A long time ago, I was asked by a consultant friend of mine to have a think about being able to drop portable wireless internet repeaters. The brief was that first responders could drop a bunch of wireless mesh routers over the area so that computers could be used and contact base. At the time the emergency department decided that it would be a luxury and unnecessary so I didn't get to build a prototype. However after numerous occasions of finding myself in a field, without internet access I though to revive the project in a limited way. At least I'd get always-on wifi in the car .. right? |
Portable Hotspot
So far...
Okay, I've picked this project up again - yay! Working so far:
What's not working:
What's left to do:
|
Huawei E355 USB MIFI Dongle
So, we have already determined we need usb-modeswitch (and usb-modeswich-data) to kick the dongle out of its silly install mode (12d1:14fe) and to present the actual network interface it provides (12d1:1c1e). Seems that when it *did* work in a VM it worked with CDC_NCM, and a 2.6.x kernel .... newer 3.x kernels seem to be a little stroppier about unrecognised CDCs. More research required. *sigh* |
Setting up automounting on the Raspberry PI
So the non-optimised debian setup hasn't been working for me, so I'm using the raspbian distro now. Just add a line with udisks-glue into /etc/rc.local just before the "exit 0" line Then edit /etc/udisks-glue.conf to look (something like) this: --- Start File --- filter disks { optical = false partition_table = false usage = filesystem } match disks { automount = true automount_options = { sync, noatime, "dmask=0", "fmask=0" } } filter optical { optical = true usage = filesystem } match optical { automount = true automount_options = { ro, "mode=0444", "dmode=0555" } } --- End File --- Notes:
|
Plan 3.1415926535897932384626433832795028841971693993751058209...
Yes, the next bit of kit to try is the Raspberry PI I'm trying the "Softfloat" version of the Raspberry PI based Debian install. Currently I've installed usbmount (to mount the SD card when it appears on the usb bus) and usb-switcher to punt it into 3G mode. So, it currently mounts, but that's about it. I can't seem to find the "cdc_ncm" but it according to /proc/config.gz it's compiled in statically ... More voodoo than what currently know about at the moment. The last linux kernel I compiled was a 2.4.xx ages ago. Oh, yes - a shout out to pi-suppliers ... I managed to lose my element 14 unit, no problem I thought RS Components told me a few weeks ago that I'll have one in ten weeks. The lovely chaps at Cool Components said they had some in stock, with immediate delivery. It angered me that a so called primary supplier of the PI couldn't get their act together and supply one as quick as element 14 (the other primary supplier on launch day) and they were both (pre)ordered at the same time. I know that was very naughty of me, as I was only supposed to order the one - but I very rarely buy components in "ones" as I usually need them right away, so I usually buy in twos or threes. So, as Cool Components were so nice to reply to my rant on twitter I ordered from them as I wanted a couple of cases too. NEXT DAY DELIVERY - BEFORE 11AM I was a very happy geek. And the cases they sell are cool too :) So now to read up on how to persuade the kernel to sort itself out and load the cdc_ncm driver! Oh, and I'll post more pictures in a later post. |
Plan B - MK802
So I tried plan b earlier in the week If you follow the movements of tiny computing hardware, an embedded linux afficionado, or are just an Android fanboy you'll have heard of the "Android Powered Mini CPU for just $ 65" - the Rikomagic MK 802. Well apparently it can run Linux, and there's a number of Ubuntu-based distributions for them. However it's all a bit rubbish - the Mali X drivers corrupt the displays on mine and they seem to rapidly overheat. Now I don't know if it's just my kit, wonky PSUs or whatever, all I know is that they don't appear to boot very well at all and I need reliability. This frustrated me no end. But I had a feeling that they would draw too much current anyway. Now where did I put the next candidate? |
OpenWRT (failed) recipe
Here's the recipe for the (failed) Open WRT project. Here for posterity. ===== start ===== (turn wifi off, set ip address to 192.168.1.2) telnet to 192.168.1.1 uci set network.lan.ipaddr=192.168.128.1 uci commit reboot (swap ip address to 192.168.128.2, enable proxy on 8888) telnet to 192.168.128.1 echo 'option http_proxy http://192.168.128.2:8888/' >> /etc/opkg.conf opkg update opkg install kmod-usb-storage block-mount usb-modeswitch-data kmod-scsi-generic kmod-fs-ext4 edit /etc/config/fstab (file contents) config global automount option from_fstab 1 option anon_mount 1 config global autoswap option from_fstab 1 option anon_swap 0 config swap option device /dev/sda1 option enabled 0
config mount option target /mnt/sda2 option device /dev/sda2 option fstype ext4 option options rw,sync option enabled 1 option enabled_fsck 0
config mount option target /mnt/sda3 option device /dev/sda3 option fstype ext4 option options rw,sync option enabled 1 option enabled_fsck 0
(end file contents) df -h Filesystem Size Used Available Use% Mounted on . . . /dev/mtdblock3 1.4M 796.0K 612.0K 57% /overlay overlayfs:/overlay 1.4M 796.0K 612.0K 57% / reboot. (check that all is okay i.e. /mnt/sda2 /mnt/sda3 exists, then copy /overlay) add to the sda2 config mount section of /etc/config/fstab option is_rootfs 1 change in the config swap section option enabled 0 to option enabled 1 tar -C /overlay -cvf - . | tar -C /mnt/sda2 -xf - reboot (hopefully this will have got swap on the usb stick, and /overlay working) opkg update opkg install luci /etc/init.d/uhttpd enable /etc/init.d/uhttpd start (configuration now managed by luci…) (but first we need to load the ether-cdc things) (reboot … woot lucy is running1) opkg update opkg install kmod-usb-net-cdc-ether reboot opkg update opkg install udev usbutils kmod-usb-net-rndis /// /// missing: rndis_wlan,rndis_host,cdc_ether,cdc_ncm ===== end ===== |
Step two. Configure Router
So why do we want to duplicate the functionality of the E355? Well, it's seems to be limited to five devices, as I mentioned in an earlier post that I have massive problems with that, I don't want to have to juggle tech to some arbitrary limit. Also, I'd like to support more services at some point (media streaming perhaps) Like all the 3G dongles I've seen recently, they initially show up as CD-Roms then the "drivers" switch them over to being the actual device. In this case an Micro SD Card reader and a USB CDC device, in this case a USB ethernet port. Initially I configured the WR703N as being a Wifi repeater, and that appeared to work. Alas the WR703N has a tiny tiny amount of internal flash, and it's easily filled up. So some devious things need to be done. So, what we need to do is boot, twiddle the 3G modem so the SD card shows up, switch over to *that* and bring up the other services. The initial packages I installed (to the best of my memory, as I was doing this late at night) were:
Of course the (32Gb) SD card was partitioned and formatted by a prior fdisk installation thus:
Well after bricking router "B", I plugged the dongle into a Ubuntu virtual machine, alas OpenWRT doesn't have "rndis_wlan, rndis_host, cdc_ether, cdc_ncm" which is required ... okay it has cdc_ether but none of the other modules - so development has stalled for now. |
Step One ... Gather the Equipment
The A10HZ from Maplin, a 5Ah 12v battery pack. This has 2x6v batteries internally, and a 200W inverter, two accessory sockets, and two 12v terminal posts. It has a usb power socket and a light too, but the usb socket is tied to the inverter being on and the light is incredibly weedy, so we're ignoring them for now. I now have two of these, both bought when Maplin have had sales on. Not worth £50, in my opinion but for less than £30 they're a must-have. Since most low power gadgets have USB power. 1-2A USB accessory gadgets like this ought to work just fine, some of them fit flush into the sockets too! I forget what mine are spec'd at but they all look pretty much the same as this. Seriously, you've never seen one? Look at the image to the right! I quite like the ones that have an LED because you know that they're allegedly working, as car lighter sockets tend to arc a bit and corrode. Expansys had the Huawei E355 on sale recently (around £60, cheaper on Amazon, ouch) so I grabbed one of those. These are quite fancy devices, as they have an external antenna socket, and a Micro SD (often named Trans-Flash, or TF) card slot, as well as functioning as dongles as well as a wifi router. Alas it only allows FIVE devices to connect. Frankly this bothers me, and it's a standard thing across the industry of MiFi devices, who thought that five (FIVE!!!) devices were enough? I usually have at least that many devices on my person if I pick up my laptop bag. Still, it doesn't need a computer to operate. So I tested it on a road trip to Scotland plugged in the boot of the car in an accessory socket. It worked flawlessly - Nuff said. A disassembled one and a write up of it can be found here. Deal Extreme were selling TP-Link WR703Ns at some point, but I can't find them on the site now :-(. You can still pick them up from pretty much anywhere though (like Amazon). These things are for the Chinese market (DX being a cheap and cheerful chinese exporter) and often marketed as "3G routers" - however you need a 3G dongle! They're supported by OpenWRT and quite hackable. I've played with the two I have (Imaginatively named A and B) quite extensively. The supplied firmware happily uploaded the OpenWRT images. And that's all we need apart from miscellaneous stuff like proper antennas and a nice box to put the tech in. |