I recently purchased an BestBuy Insignia Infocast 8" device. It is essentially an 800Mhz big screen Chumby running linux 2.6 with some BestBuy customizations. The Insignia team did not include a web server and the simplest way to fix that is to use the lighthttp server from the blog mentioned above.
Installing and Configuring
The basic steps for installation are:
- Turn on SSH in the Info cast. Touch the Insignia logo in the upper right corner. This should make the About Device panel appear. Then touch the Pi symbol in the upper right corner. Enable sshd by touching the SSHD button. The daemon starts immediately. The machine's IP address appears in the panel. You will need that to ssh into the box.
- SSH into the device from your PC. Windows users can use putty which is freely available on the internet. Linux users probably already have it installed. The root user id has no ssh password so linux users will login with ssh root@<chumby_ip_address>
- You can enable sshd across reboots by creating /psp/start_sshd with the command
but remember that you the default sshd has no password.
- cd into /mnt/storage.
- Download the pre-built version of light httpd. Find the URL in the blog mentioned above and enter wget <the_.tar.gz file path> in the ssh window. I normally create a software or downloads directory to keep stuff organized.
- Unzip the package with gunzip <the_.tar.gz file name> and then untar the .tar file while in the /mnt/storage directory.
- You can delete the .tar file because it is no longer needed.
- The directory /mnt/storage/psp/rfs1 does not exist in the default Infocast installation so create that directory using mkdir.
- Copy /mnt/storage/lighty/startup.sh to /mnt/storage/psp/rfs1/userhook1. Note that the userhook1 filename does not have any file extension.
- Edit /mnt/storage/lighty/lighthttpd.conf
- Change the server.errorlog and accesslog.filename to fit your needs. I changed mine to
# server.errorlog = "/mnt/storage/logs/lighthttpd.error.log"Start the web server and verify it's running
# accesslog.filename = "/mnt/storage/logs/lighttpd.access.log"
server.errorlog = "/tmp/lighthttpd.error.log"
accesslog.filename = "/dev/null"
- Type /mnt/storage/psp/rfs1/userhook1 to start the server.
- You should be able to verify the process is running with the ps -ef command.
- You can then hit the web server with your browser http://<chumby_ip_address> and see the welcome screen.
One of the nifty things about running a web server is that you can cause it to run programs on the device just by requesting the URL of a program tied to the web server. Everything written to standard-out is returned to the web browser.
The lighty/lighttpd.conf file contains mappings to support Bourne Shell and Perl scripts. It assumes that any file ending in .sh is a shell script and any file ending in .pl is a Perl script.
cgi.assign = ( ".sh" => "/bin/sh", ".pl" => "/mnt/storage/usr/bin/perl", ".cgi" => "/psp/usr/bin/perl" )The Infocast 8" comes with a couple shell scripts that were intended for the standard Chumby web server that are easily adapted to lighthttpd (with a simple rename). They have .sh on the end so we'll fix that when we copy them into the lighty cgi-bin directory.
alias.url = ( "/cgi-bin/" => "/mnt/storage/lighty/cgi-bin/", "/images/" => "/mnt/storage/images/" )
- cp /www/cgi-bin/memstats /mnt/storage/lighty/cgi-bin/memstats.sh
- cp /www/cgi-bin/wifi /mnt/storage/lighty/cgi-bin/wifi.sh
#!/bin/shI installed it in /mnt/storage/lighty/cgi-bin/top.sh and run it with http://<ip_address>/cgi-bin/top.sh
echo "Content-type: text/html"
echo "<title>Chumby Top Processes</title>"
echo "<meta http-equiv=\"Refresh\" content=\"5\";>"
echo "<h4>Top Processes (refreshes every 5 seconds) </h4>"
The referenced blog article describes how to build lighthttpd from scratch. You might want to do a custom build if you need additional modules.