HTTP Server

From Sharpfin
Jump to navigation Jump to search

HTTP Server

The HTTP Server is installed using an application called 'busybox', which has been renamed to 'sharpfin' and installed alongside the radio's own busybox program. This same executable program provides the telnet server so that you can login.

The HTTP server is installed at the same time as the login server using the patchfile which is found on the Enabling Login page.

Sharpfin-radio.jpg

Configuring

The HTTP server files are installed onto the debug partition, and can be found in /opt/webserver. The http config file is found in /opt/etc/httpd.conf

The HTTP server (and telnet server) automatically starts when the radio is booted. As they both use the same executable program, they are extremely efficient in their memory usage.

If you have previously installed the ssh server, it is recommended that you start using the telnet mechanism to login to you radio due to these efficiencies. Furthermore, it is important to ensure enough memory remains for the Reciva application. At its worst, it takes 90% of the memory. ssh takes 9% and the httpd/telnetd combination takes 2-4%.

We recommend uninstalling the ssh server before applying the sharpfin patch.

We also recommend uninstalling the sharpfin patch before upgrading the reciva application firmware (from Reciva).'

Features

The HTTP server provides the following menu features:

Radio Menu

  • Admin Menu - Admin Pages
  • Sharpfin Home - Link to this Wiki

Power

  • Reboot - Reboot the Radio

Admin Menu

  • Admin Menu - Admin Pages
  • Sharpfin Home - Link to this Wiki

Info

  • File Explorer - Browse the filesystem
  • Installed Apps - See what packages are installed
  • Radio Info - Various bits of radio info, including processes and memory usage

Install

  • Change Firmware - Very Advanced: Read Changing Firmware first
  • Debug Application - Download and run an application in /tmp
  • Install Addon - Install / upgrade a sharpfin package

Tools

  • Feedback - Provide us with vital feedback
  • Run Program - Run any unix command from the webserver, e.g. 'ls'

Expanding / Updating

The HTTP Server installs all files in /opt/webserver.

Radio Menu

The Radio Menu is intended for radio 'user' type features, such as station selection, favorites programming, alarm setting etc ...

The default /index.html file shows the 'Radio' menu, which is a two-frame page. The left frame being the menu, and the right being called 'right'.

The menu itself is a cgi script '/cgi-bin/radiomenu.cgi'. This script looks for files called 'radio_Section_Menu_Entry_Name.cgi', and populates the menu in the sections defined in the filenames. If you wish to add your own cgi-bin scripts, they are automatically added to the menu.

Admin Menu

The other menu is the Admin menu, and contains diagnosting and development menus, and is found at /adminindex.html. The left frame again is the menu, and the right is again called 'right'.

Like the radio menu, the admin menu is called '/cgi-bin/adminmenu.cgi' and looks for files called 'admin_Section_Menu_Entry_Name.cgi'

Useful Stuff

A useful script is also placed in the cgi-bin directory. The 'getarg' script parses any parameters from a HTTP GET operation, searching for a specific tag, and returns to stdout the contents, for example:

The url:

http://radio/admin/cgi-bin/admin_Info_Show_Status.cgi?function=player&when=today

Is parsed in a script file as follows:

FUNCTION="`/opt/webserver/cgi-bin/getarg function`"
WHEN="`/opt/webserver/cgi-bin/getarg when`"