Installing PlugPBX on the Dreamplug
30 Jan 2012
Now that we've successfully connected to our Dreamplug we need to take a step back and load some software on it before we connect again. The Dreamplug can boot from SD card and that is what we want to do here, and the easiest way to do this is to load a disk image onto our SD card before putting it into the Dreamplug.
The PlugPBX project provides a card image that already has the Debian operating system on it as well as Asterisk, FreePBX and some other useful tools. However, the current version of PlugPBX is quite old so our process is to install it as-is then update both the operating system and telephony software.
To install PlugPBX as-is:
- Unplug your Dreamplug from power and remove the SD card if there is one in it, otherwise get a blank 4GB or more SD card
- Download betaimageDec22-dhcpfixed4G.img.bz2 from http://downloads.plugpbx.org/
- Extract the disk image (.img) file
- Use Roadkil's Disk Image tool to image the file onto your SD card as explained in the PlugPBX documentation (I found I needed to right-click and 'Run as administrator' to install Roadkil)
- I've got a 8GB SD card and the PlugPBX image is designed for 4GB so I changed the main partition on the image to fill the rest of the card. I couldn't find a free Windows partition manager that could handle ext2 but gparted provides a bootable CD that will give you the ability. (You'll only need to do this step if you're using an 8GB SD card.)
- Download Ext2fsd which will allow you to see the ext2 SD card partitions on your windows machine - you need to assign drive letters to two main card partitions and then the files will appear in Windows file manager
- Download uImage_220.127.116.11, dreamplug_debian_v0.2.zip.001 and dreamplug_debian_v0.2.zip.002 from the Globalscale website
- Rename uImage_18.104.22.168 to simply uImage and copy it over the uImage file in the root of the first partition on the disk
- The zip.001 and zip.002 files are two parts of a single zip file. To unzip these on windows you simply right-click and unzip the first file and it will extract the second automatically into the one folder
- Find the subfolders extracted at /lib/modules and copy both of these into on the second disk partition into /lib/modules there (leave the existing folder in there as well)
- Edit /etc/fstab and change the UUIDs (the long hash-looking strings) back to real devices (use /dev/sdb1 for boot and /dev/sdb2 for root)
Booting to the SD Card
- Some of the Dreamplugs you buy will come set up to boot to SD card already. But mine didn't.
- To make your Dreamplug boot from SD card:
- Put the SD card back into the Dreamplug
- Start putty to connect to your device (see previous post)
- Power up the Dreamplug and interrupt the boot sequence (you only get 3 seconds to press a key)
- Enter the following commands to tell Dreamplug to boot into PlugPBX on the SD Card:
setenv x_bootargs_root root=/dev/sdb2 rootdelay=15
setenv x_bootcmd_kernel fatload usb 0 0x6400000 uImage
To update the software to the latest versions we need to first update the operating system:
- Run apt-get update
- This takes a long time, over half an hour
- Press enter at various points when it asks you about restarting services or existing configuration files - this uses the default selection which worked for me
- You'll see loads of 'locale' errors and later on 'missing LSB' errors , these don't seem to matter
- After the update is complete change /usr/sbin/safe_asterisk line 15 which reads ASTPIDFILE=/var/run/asterisk.pid - change this to be : ASTPIDFILE=/var/run/asterisk/asterisk.pid
- Type 'reboot' to reboot the Dreamplug
- The server should now start as normal
- Log in using 'root' and 'password'
- Type 'ifconfig' and look for the line near the top that says 'inet addr' followed by an IP address. Your Dreamplug PlugPBX web interface will be visible in your browser at this IP, giving you access to FreePBX, Munin, Webmin and some other tools
To update Asterisk and FreePBX we use the web interface:
- Visit the IP you found above in your browser
- Click the 'FreePBX Adminstration' link to open the admin interface
- Click the 'Tools' tab in the sidebar then 'Module admin'
- Click the link that says 'Check for module updates online'
- Click '2.6 Upgrade tool' and and check 'Download and install' then click the 'Process' button top right
- Once downloaded close the popup then click the orange 'Apply changes' button that appears at the top of the page
- Click the new '2.6 Upgrade' option in the sidebar and follow the instructions,
- Update the FreePBX framework module to the latest version
- Then click 'upgrade all' and confirm, then wait while they all download and install
- Once finished close the popup then click the orange 'Apply changes' button that appears at the top of the page
- Repeat the upgrade process until you are at the latest version
Make a backup, then continue
Now is not the time to let all the hours spent upgrading count for naught. Take a backup of your SD card by slipping it back into your PC card reader and using Roadkil's Disk Image to take an image of it.
Then it's time to set up your PBX using the FreePBX web interface, the same as it would be if FreePBX were running on any other server. I found it confusing at first but once familiar with the interface it allows a lot of functionality and I was able to set up my small office with 5 phones to work quite successfully. There's plenty of information at http://www.freepbx.org/
Let me know how you go!