Friday, August 15, 2014

Pure C firmware loader for RFD900 Radios

We are using the RFD900 radios in the Mesh Extenders, as described in previous posts.

The normal route for programming these is to use a python script or mono based GUI that comes with the SiK firmware.  However, for auto-updates on the Mesh Extender we need to run the update process from on the Mesh Extender itself.

It is possible to install python on the little OpenWRT boxes we use for the Mesh Extenders, however it isn't ideal on several fronts.

First, it is way bigger than the entire rest of the mesh extender distribution, and seriously bloats the upgrade bundles if we want them to be all-inclusive.

Second, for reasons I don't entirely understand, it isn't possible to run the python script headless in an /etc/rc.d script, which is basically a show stopper.

Third, the python firmware loader doesn't check if the firmware is already the same as what is on the radio.  This means that the flash would get worn out a little with each Mesh Extender software update, even if it doesn't change the radio firmware.

Fourth, you have to specify the baudrate of the radio.  It would be much nicer and safer to have it auto-detect.

Our solution is to write our own compact RFD900 firmware loader in pure C that addresses all these problems.

I have just finished the first working version, which can be downloaded from https://github.com/servalproject/flash-rfd900.

It probably has some bugs, and might brick your RFD900 (although it might also help un brick it, too ;)

It is very easy to build and use:

To compile, just type make.  It is bland enough that it should work on most UNIX-like systems.  That said, I have only tested it on my Mac.

To run, you need to tell it the firmware file (in intelhex format) and serial port, e.g.:

flash900 radio~rfd900a.ihx /dev/cu.usbserial-A901G64G

When running, it will display something like:

Read 1760 IHEX records from firmware file
Trying to get command mode...
Checking if stuck in bootloader
Trying to switch to AT command mode
Switching to boot loader...
Got OK at 115200
Board id = $43, freq = $91
Erased parameters.
Checking if the radio already has this version of firmware...

Firmware differs: erasing and flashing...
Erasing flash.
Flash erased, now writing new firmware.
Range $f7fe - $f7ff

The Range line shows the memory range currently being verified/written, so you know how far along it is.  The flash gets verified as it is written, and the program will exit with an error if verification fails after writing.

If you want to force it to flash the radio even if the firmware is the same, add "force" to the end of the command line:

flash900 radio~rfd900a.ihx /dev/cu.usbserial-A901G64G force

While this little program is far from perfect, hopefully it will be of use to some people out there.

Thursday, August 7, 2014

Getting ready for National Science Week again

Australian National Science Week is coming up fast, and similar to last year, my family and I will visit some remote schools to encourage young people to think positively about science, and maybe consider including it in their future study and employment aspirations.

This year we will be visiting Hawker and Leigh Creek Area Schools, and the students from Marree Aboriginal School will make the (relatively) short trip down from Marree to Leigh Creek.

Apart from our existing love for this area, I purposely make my National Science Week plans to remote areas because they tend to miss out on a lot of the opportunities available in the cities and regional centres.  This is the tyranny of distance and isolation at work, which is also one of our prime motivators with the Serval Project.

It is pleasing that the South Australian Science Week Community Grants scheme has generously supported my efforts in this way for the past several years.  If you are a scientist, science teacher or communicator in South Australia and would like to contribute something to the festivities of Science Week in future years, they are a good port of call.

But back to National Science Week present...

I try to include something a bit different each time where the general public can get involved in some way.  This year that is establishing a permanent wireless communications link between the Arkaroola Village and the Arkaroola Homestead area where the Arkaroola Wilderness Sanctuary plans to setup a research facility, which are several kilometres apart, and separated by some spectacular and rugged hills and ridges, some of which looks just like this:



Here you can see the wireless communications gear we will be using that arrived this morning from the nice people at CityTechnology:


In the future, this will allow for high-bandwidth real-time communications to support future research activities in the sanctuary.  But right now, it is a great chance to join us at Arkaroola to be part of the team who are setting up and testing this facility, and explore parts of the sanctuary that are not normally easily accessed.  Arkaroola will be providing us with transport to the ridges and locations where we need to setup the links.

So if you would like a bit of an outback adventure with some science content, hop over to the information page on the National Science Week website and register your interest.  Of course you don't have to just join in with us, you can enjoy many of the other great things that Arkaroola has to offer, including fantastic astronomy, scenic flights over what Hans Heysen described as "the bones of the earth laid bare", and much more.  You will also be close to some of the world's oldest fossils of complex life.

Monday, August 4, 2014

Problems with SanDisk Cruzer Fit flash drives

For the Mesh Extender we need physically very small USB memory sticks for the Rhizome data store.

We have had problems with these in the past: some Verbatim ones wouldn't mount reliably at boot.

So we switched to the SANDisk Cruzer Fit.

However, those drives are not without their own problems.

In fact, they have a really nasty habit of going permanently read-only under certain circumstances.  This is fairly well documented on the internet, and SanDisk have known about the problem for at least a couple of years, e.g.:

http://forums.sandisk.com/t5/All-SanDisk-USB-Flash-Drives/Sandisk-cruzer-16GB-became-read-only/td-p/255218/page/2

http://www.bleepingcomputer.com/forums/t/483270/sandisk-cruzer-usb-thumb-drive-8gb-write-protected/

https://discussions.apple.com/message/19239201

It turns out that one of those circumstances is when installing a Mesh Extender upgrade bundle.

We have had two more fail within the space of an hour today, in addition to others that have failed in the past.

We have contacted SANDisk to ask if they have fixed the root problem in their later drives, and are awaiting a response.  We have also got in touch with them to see about getting replacement drives.  We have offered to show them our use case that triggers the units to go read-only. Right now they signs aren't good that that they will sort things out, or even honour their statutory obligations, but we will keep you posted.

In the meantime, until SanDisk asserts and we can verify that the problem with these drives has been corrected, we strongly recommend against buying any SANDisk USB memory sticks.

Monday, July 21, 2014

Design files for free and open-source collapsable communications tower

After rather a long time, we finally have the design files for the communications tower online at:

https://github.com/servalproject/foss-comms-tower

We also have a paper that we will present at the IEEE Global Humanitarian Technology Conference in San Jose in October 2014.

Once the conference has been held, we will post a link to an open-access copy of the paper.  However, you can already get more detail from the thesis of Greg, the lead student on the project.  His thesis is included as a PDF in the GitHub repository mentioned above.

Wednesday, June 4, 2014

Serval Rugged Battery Pack

One of the tasks we have been funding from our crowd funding campaign last year is the design of a rugged battery pack that can run from a solar panel, car battery, hand crank or other various power sources.  This is desired to run Serval Mesh Extenders and other wireless nodes in the field.  Musti has been doing the work on this, putting in much more effort and time than we have paid, and has made some really great progress as the image and video below show.


Image (C) Musti, CC-BY-NC-SA from https://github.com/servalproject/ServalRuggedBatteryPack



The unit should be able to run a Mesh Extender for 2 - 4 days when the design is complete.

As with all we do, the entire design is open-source.  The source code is available at https://github.com/servalproject/ServalRuggedBatteryPack, along with some more pictures of the device in action.



Wednesday, May 28, 2014

Tunnelling IP traffic over the Serval Overlay Mesh

We have been asked a number of times over the past few years if it is possible to carry IP traffic over a Serval Mesh network.  

Our answer has always been along the lines of "yes, you could in principle tunnel it, but we haven't added support for it, and we have other tasks higher on our priority list."  Thanks to a research agreement with the New America Foundation's Commotion Wireless project, and a lot of excellent work by Jeremy, this has now changed.  

We are now able to tunnel IP traffic over the newly implemented Mesh Streaming Protocol (MSP).  MSP is kind of like TCP for Serval Mesh, in that it provides reliable in-order delivery of a data stream.  It isn't exactly like TCP, however.  For example, we intend to add a kind of hybrid mode where it tries to reliably deliver traffic, but is okay with missing the occasional packet if it will delay the whole stream too much.  That sort of feature is good for streaming live audio, for example.

To tunnel IP traffic over a mesh we need more than just MSP, we need some sort of port-forwarding between IP and MSP, in other words a protocol converter.  We also need a proxy server, and ideally, some sort of access control mechanism to decide who can use the service.  It would also be great to have an automatic service discovery mechanism.

Jeremy has implemented all of these things, as can be seen in the video below.


Talking about the access control, one of the nice things about the Serval overlay mesh protocols is that node addresses are public keys.  This means that you can reliably limit services to a particular node, just by filtering on network address, because no one can spoof the network address of any other party.

Another happy side effect is that all traffic over the tunnel is automatically end-to-end encrypted.  As can be seen in the video, there is nothing the user needs to do in order to get the encryption.


Friday, May 23, 2014

Stopping Samsung Galaxy S2 data partition filling up

We have a number of Galaxy S2's that we use for Serval.  Some of those we keep "stock", so no root or anything fancy, for testing Serval Mesh on. The one of those I use as my day-to-day phone has recently been filling up the internal storage so that I couldn't install even small apps, even though I had very little installed on the phone.

After a bit of digging around, I discovered that this can be fixed by dialling *#9900# and then choosing the option to delete logcat.  Suddenly my phone was back to having 1.6GB of free space on the internal storage :)

Hopefully this will help others who encounter the same problem.