Skip to content
Lieven Hollevoet edited this page Sep 22, 2014 · 1 revision

__MisterPlug - MisterHouse on a Plug Computer__

The Sheeva Plug Computer is produced by Global Industries in the USA and available from NewIt in the UK. There are a few different versions of the Plug available, with various versions of Linux loaded. The Plugs have limited I/O (USB and Ethernet) as they are mostly intended as small servers or embedded systems. The key interest for home control is the low power, just 5W which is a big saving relative even to a mini ITX. Also the small size can easily hide in any corner. You do need another PC to interface to the Plug but most people have a laptop or desktop computer to access the Internet anyway.

Initial access is via the Ethernet interface, via ssh, or via the serial console (the Guru Plug doesn't come with a serial console). You will need a terminal emulator like 'putty' on your PC. You should then load 'Webmin' to your Plug to provide a secure web interface (https) on your PC (needs java support on Browser). Webmin is very easy to install and instructions can be on the forum (Webmin or MH forums? - njc). Webmin uses Perl and sets up a secure server. Someone might workout how to use this instead of the MH server (?). Apache is also easy download and install.

The Plug computer might seem like it can't do everything that a full fledged laptop or desktop computer can. To expand the I/O capabilities of the USB, add a powered USB hub. This should allow you to handle more USB devices. Since we're beginning to see various I/O device that use Ethernet, the Plug is not as limited as its small size might suggest. Since there is no screen access to the Plug will be limited to the USB Serial console, the web interface or network access via telnet or SSH. Many folks successfully run MisterHouse (MH) on old under powered throw away computers (300MHz or even 133MHz Pentiums), but use a lot more electricity doing it!

Loading MH

This is a sort of description of how I loaded MH on the most basic Plug. It is quite easy despite never having used Linux before. I was helped and reassured by the instructions already on the MH Wiki, see configuration then Ubuntu. It is even easier than that as everything is built-in (e.g. Linux and 'webmin') when downloaded and are fully operational - no geeky stuff to do.

Another method of install can be found here: MH on a Plug Computer

You won't need to worry about converting the .h files (if you don't understand that you didn't read the links first, did you?) as the Plug Ubuntu is a newer version and configured already. I didn't download gd but did get the other bits if I could find them in CPAN. DB_file didn't work as it seemed to need to be compiled in C perhaps.

MH is very cluttered with about 15Meg of non essentials so I downloaded a new instance (it is now recommended to use the GitHub version) onto my win2k machine and stripped out all the /bin except //mh//, //mh.ini//, and //print_socket_fork.pl// which MH needs. In the code directories I removed all the code except //mh_control.pl// It won't start if no code files exist. I will add code files one at a time and test them. Also stripped out all the windows only stuff and from the web directory, the ia1-ia4 &ia6, and mh1-4. The lib directories starting winxx are not necessary.

I ran this on Win2k to prove it then transfered it by usb stick. This is not clever as many filenames are lower case, which Windows doesn't mind but Unix does. However going through it all does teach you a bit about what's in there.

In Data directory I had to add suitable directories with //code_select.txt// and //code_select_test.txt// modified to suit my reduced code base (just comment out the unused code with #) and included //photo_index.text// and sample photos which are non fatal errors, and //remarks/110tags.txt// in order to get the tag on the front webpage. I think I got a non fatal error because disabled_commands is missing.

Then in the //bin// directory, edit the //mh.private.ini// file (if you do not have a //mh.private.ini// just copy the //mh.ini// to //mh.private.ini//), set XPL = 1 & XAP = 1, set Telnet to blank, server_mhsend_port to blank, and gd = 0. You can turn them on when you do start using them.

Change photo_index and html_alias_photos to point to appropriate data directories. Disable TK in //mh.private.ini// but remove the TK code files as there is no display for it to run on.

I have pointed data_dir to ///var/run/Misterdata// which is a ramdisk with the usual data directories below it. It might need an empty file named mh_temp.saved_states to start, I can't remember.

It might be easier to unpack the tar file in situ and then prune it. But don't try it uncorrected or you will be overwhelmed by errors I expect. If you are new to it First try MH on a plain Windows PC to understand it. There are lots of code modules enabled as downloaded that cause piles of messages that must put off a lot of newcomers.

MH creates lots of logs which can be disabled after debugging but the potential flash killer is the 60 second mh_temp.saved_states. I think a daily backup and save on shutdown is the answer with a reload on startup. This is why the data dir needs to be pointed to ram not left in the main body of code. It is possible that a SD card could cope with the constant rewrites.

You probably want to set up a non-root user called eg 'mh' to run things. Linux guides will tell you how. Then make your data files read/write by the user as follows:

  • log in as user mh using putty
  • su root (enter root password when asked)
  • chown -hR mh:mh /var/run/Misterdata
  • su mh (to get back to user)
Now to run it
  • cd Misterplug/mh/bin
  • perl mh ( and off it goes - if you get errors it is probably easier to debug on your windows version )
You can now get to it from your PC browser with http://192.168.x.y:8080 I found it faster than my laptop of PC and had it serving pages to both, PC and MID (mobile Internet device). I stop it with 'control C' but there might be a better way.

The Linux most basic version handles flash sticks but needs the appropriate drivers to handle usb to serial converters. To get the appropriate drivers first figure out what version of Linux you are running (//uname -r//) then visit the Sheeva Kernel Directory (opens in a new window). The most common serial adapters are the PL2303 and the FTDI.

I haven't tried sound yet but apparently it can be done with a USB sound card. The same goes for a video display, keyboard and mouse. Each device will need the appropriate driver for the device used.

Clone this wiki locally