Sunday, April 23, 2017

Preparing for exercise with NZ Red Cross

For our DFAT Pacific Pilot in Vanuatu, I am getting ready to fly out to New Zealand for a training exercise with NZ Red Cross's IT & Telecommunications Emergency Response Unit (IT&T ERU), with whom we have previously tested the Serval Mesh and earlier prototypes of the Mesh Extenders.

This time, the plan is for me to build up a fly-away kit containing Mesh Extenders, solar panels, batteries and all the necessary cables and bits and pieces for a complete functioning system.

The fun is that we don't yet have all the parts on hand, and there is still quite a bit of work to do.  So so far, the box only has me in it:





By the end of the day, it should instead have all the prototype hardware inside ready to fly out to NZ early tomorrow morning.  It is has occurred to me that this means that this Anzac Day I will be flying to a joint Australian / NZ exercise designed to protect human life.  Perhaps not on the same level as those who served in war, but it certainly reminds me of their service.

Between now and then, aside from all the paper-work, I need to:

1. Assemble 8 Mesh Extender prototypes;

2. Build 8 power/radio ID cables;

3. Program those cables;

4. Build the final firmware image to be used for the exercise and install them in the prototypes;

5. Install and prepare the microSD cards in them all;

6. Test that they work.

7. Figure out the correct way to carry LiFePO4 cells with me to NZ.

So, I'd better get to it!

Tuesday, March 28, 2017

Teaching the RFD900 about uboot, so that it doesn't interrupt the Mesh Extender boot process

The Serval Mesh Extenders logically consist of a CPU with a serial port, and an RFD900 radio.  Our RFD900 firmware provides a regular heart-beat.

This all means that the RFD900 radio, as soon as it powers on, begins sending heart-beat messages.

This ordinarily wouldn't be a problem, except that the CPU modules we are using have only one serial port, so the serial boot loader is listening on the serial port when the system first powers up, and whenever it resets.

This means that if uboot sees a heartbeat, it will interpret it as the user wishing to interrupt the boot process to interact with the boot loader.  Following Murphey's Law, this is assured to happen on every boot.

We can't get rid of uboot, as it is important to have a way to reflash the devices (especially while we are still developing the software for them).

The remaining solution is to teach the RFD900 to notice when uboot is active.

In theory, this would just take a simple little finite state machine to notice the uboot banner, and then make sure it doesn't send any characters for a while, to allow uboot to boot normally.

There are, however, two complications.

1. We have to stay silent for long enough that we don't interfere with OpenWRT's fail-safe boot mode, which just means staying silent for longer.

and

2. The RFD900 is set to 230400bps for talking to LBARD, while uboot uses the serial port at 115200.

It is this last problem that makes life more interesting, because we can't just watch for the characters of the uboot banner. Instead, we need to look for a character sequence at 230400bps that is what you would see if you send the uboot banner at 115200bps.

As uboot is working at 1/2 the baud rate that the RFD900 is using, every serial bit received from uboot will be interpreted as two bits. Thus each uboot serial character should be able to be reliably received as two characters by the RFD900. We're lucky it isn't the other way around, as then the bits would be only half as wide, and there would be some uncertainty about how the bits would be read.

In the process, I also had to clean up a few other spots where our RFD900 firmware was causing other characters to be emitted immediately on power-up.

So after a few frustrating hours of debugging the finer points, I can now reliably boot a uboot-based system with an RFD900 running our packet radio firmware permanently attached to the serial port.




Wednesday, March 15, 2017

The custom IP67 power cables have arrived!

So, just over ten days ago I wrote that a Chinese manufacturer said that they could manufacture and ship the cables we want within ten days, and that I would order some.  Today they arrived!  Some fun unpacking photos:











First up, I must congratulate the Chinese manufacturer for being able to manufacture and ship our order so quickly.  They really were a pleasure to work with, including when we had a minor problem with the shipping (which wasn't their fault).

Also, as the photos hopefully show, the cables are very solidly built, with much thicker wire than the little ones we were contemplating using previously.  They will be able to easily support large panels and batteries, with charge currents being limited only by the battery charge controller inside the Mesh Extender. The cables simply give the strong impression that they will do the job well, which we will test over coming months.

The only complication we encountered, was that they didn't have stock of the white cable material, so we had to opt for the black PVC cable, which will slightly increase heat loading of the Mesh Extenders.  But given the time frames that we are working to at the moment, we needed to simply be sure that we would have the cables we need, so that we can get the cable head moulding tools made and cables assembled in time.  Critical paths are everything when building hardware!

Sunday, March 5, 2017

Sourcing cables directly from a Chinese manufacturer

I'm still working on the power/radio-regulatory cable for the Mesh Extenders.  Fortunately, this process is drawing towards its natural ending.

My current challenge is to find suitable UV-stable and IP65 or better rated cables.

We have already found some on banggood.com, but they leads are only ~20cm long. I'd much prefer leads approximately 0.5m - 1m long, so that there is ample length for attaching solar panels and battery packs, and general ease of connection.

A bit of hunting on http://alibaba.com yielded an enquiry from Bett Electronic Co. LTD in Shenzhen.

They have exactly the kind of thing we are looking for, and nicely, their cables are thicker (18-AWG instead of 22-AWG and 24-AWG) than the ones we found on BangGood, which means lower resistance.  A further bonus, is that they can manufacture in white, which will reduce heat loading a touch. Their cables are also IP67 certified.  Also very nice.  Here are the pictures that they sent of a sample:




Also, as the manufacturer, their prices are quite good.  Given that we are looking for cables that are 87cm long on average (compared with 20cm), and with the heavier-duty wiring, it is pleasing that the price is only about 50% higher.  They can also manufacture and ship quite quickly, apparently being able to get 100 units to us within about 10 days, including shipping by DHL.

So the only complication is that they don't have any certification of UV performance that I could use to easily determine whether they would be suitable.  However, Leah was very helpful and patient in answering my many, many questions.

What I now know is that the white cables are EPDM with added Titanium Oxide, which should have excellent UV and weathering properties.  The connectors themselves are PVC, without any special UV stabilising material.  However, according to this document, the main problem with PVC under UV, is that it will discolour (not a problem), and will have reduced impact resistance (only a minor problem).

Otherwise, the only minor issue, is that I can't figure out if the PVC is Lead-free or not. However, given the small mass of the connectors, this is not an immediate concern.  Nonetheless, I would love to be able to be sure that there was no Lead in the PVC.

So it looks like we have a good solution, and I think I will place the order with Bett Electronic in the next day or so.

Wednesday, March 1, 2017

Reading and writing the I2C EEPROM connected to an RFD900

As previously described, for the new Mesh Extender we have an I2C EEPROM for encoding regulatory information, e.g., radio permitted frequency and TX power.

Basically, I am building the tools that we will need to program Mesh Extender cables as we build them, and also in the field, to reprogram them as required.

Over the past couple of weeks I have worked on the code for the RFD900+ firmware to be able to read and write the I2C EEPROM, and then to modify our flash900 utility to be able to flash not just an RFD900 radio, but also an I2C EEPROM connected via an RFD900 radio.

I've had it mostly working for a while now, but there have been strange problems with accessing certain parts of the EEPROM, and weird intermittent write problems affecting the whole EEPROM. I tried swapping EEPROMs, to confirm that it wasn't a faulty part.

I spoke to the engineering workshop folks here, who suggested that I might need external pull-up resisters to terminate the I2C bus, which fortunately turned out not to be the case, as this simplifies the cable and PCB design process (one of them would have required some extra resisters).

They also had a nice little logic analyser that could understand I2C.  That proved to be super-helpful.  It took me less than an hour to see that the problem was when back-to-back page reads were occurring and the last bit of the last byte read was a zero.  Basically I was failing to implement the NACK required at the end of a multi-byte read sequence.  

I fixed this by inserting a dummy read with NACK, like this:

$ git show 490025c33a3e821aab05055d627d192bb0d186fc               
commit 490025c33a3e821aab05055d627d192bb0d186fc                   
Author: gardners <paul@servalproject.org>                         
Date:   Thu Mar 2 14:02:22 2017 +1030                             
                                                                  
    properly terminate sequential read operations                 
                                                                  
diff --git a/Firmware/radio/i2c.c b/Firmware/radio/i2c.c          
index 76fe0be..6e9d68f 100644                                     
--- a/Firmware/radio/i2c.c                                        
+++ b/Firmware/radio/i2c.c                                        
@@ -183,6 +183,9 @@ char _eeprom_read_page(unsigned short address)
     }                                                            
   }                                                              
                                                                  
+  // Terminate the sequential read                               
+  i2c_rx(0);                                                     
+                                                                 
   i2c_stop();                                                    
                                                                  
   return 0;                                                      

With that in place, I could suddenly reliably access the whole EEPROM.  In fact, the correct data was always written there, it was just that I couldn't read it.

Following that, I spent a bit of time optimising the EEPROM read and write speed, and also the speed of the flash-rfd900 utility, both for flashing the radio and flashing the EEPROM.

It is now possible to flash an RFD900 radio in about 23 seconds, even when using a USB serial adapter with 16ms latency.  This is a huge improvement on the ~100 - 150 seconds it took previously.

Flashing the I2C EEPROM takes just under 20 seconds, including reading the entire EEPROM once before hand, and once after, to verify that all bytes have been correctly written.

Now I just need to tweak the format of the data that I store in the EEPROM, so that it contains all the information that I need, principally the list of countries a particular cable is suitable for, and increasing the resolution of the frequency parameter from MHz to KHz.

Monday, February 27, 2017

Attaching Serial Numbers

Today I have been researching options for permanently marking Mesh Extenders with serial numbers on the housing, cables and PCBs.  This is complicated by the tropical-maritime operating environment, and that the housings are to be made of poly-carbonate.

Poly-carbonate can't be safely laser-cut or laser-etched, because it gives off toxic and corrosive chlorine gas.

Tropical-maritime environments eat glue for breakfast, and abound in UV radiation to degrade everything.

So far, the best option I have found is to use a laser-etchable UV laminates, e.g.:

https://www.trotec-materials.com/laser-materials/trolase-metallic-plus/lmt-314-203-br-stainl-steel-black-0-8mm.html

With an appropriate glue.

They do supply them with either 3M 467MP adhesive tape, which claims to be good for polycarbonate, and tolerates high heat etc, or a similar TESA adhesive.

Otherwise, you can get the laminates with no adhesive, and then apply your own, such as Dymax 3025 or 3099, which seem like they should be stronger than the 3M or TESA options.

The laminates themselves are quite cheap, less than AU$20 for 30x60cm. Assuming 4x5cm labels, this gives a material cost of only about AU$0.25 per label (plus glue) -- much less than the cost of the housing.  We will likely need one 4x5cm label and two 2x5cm labels, so that we can have safety labels on the insides, incase the one on the outside falls off some how.

For the PCB, we can just have a silk-screen white panel to write the serial number and manufacture date on using a permanent marker, so no great problems there.

For the D-SUB 25-pin cables, we are looking at a nice solution to get those professionally manufactured with a low-pressure over-mould process, for about $14 per cable, plus parts.  I need to have a chat to those folks to see what our options are there for imprinting them with serial numbers during production, or failing that, whether we can laser-etch or otherwise mark those.


Tuesday, February 21, 2017

SPI microSD card on Atheros 9k

For the new Mesh Extenders, we want to use a microSD card for bulk storage, instead of a USB memory stick.  This is in part because USB draws a lot of power just to run the bus (about 10% - 20% of the total power consumption of a Mesh Extender), but also because we have had a lot of reliability problems with USB memory sticks in Mesh Extender prototypes. Basically, they don't like being shut down suddenly.

Our preferred solution was to add a microSD slot to the Ath9k modules we are using (the Core Domino).  However, we could not find any good sources on how to do this. First, we tried using the bit-bashing driver, which we did get working, however it was horribly slow (about 10KB/sec), and would routinely freeze or reset the Ath9k (possibly due to watchdog timeouts?).

The Atheros 9k does have an SPI interface which is compatible with microSD cards, however, after searching for people having used it, I couldn't find anything sensible.  The main problem is that the 16MB FLASH that boots the Mesh Extender is also attached to the SPI bus, and so there is a need to arbitrate between that, and our microSD card.

After I had given up hope and was trying to make the bit-bash driver work, I accidentally found a page that described exactly what I wanted to do, and had some simple patches for OpenWRT CC to implement it.  You just had to assign a GPIO to be the chip-select for the microSD slot, and all would be well.  Unfortunately I had no spare GPIOs.

What I did have, however, was the chip-select line for the 16MB FLASH.  Since I had only two devices, I suspected that I could just invert that signal, and feed it as the chip-select to the microSD slot.  As hoped, this worked just fine.

The total changes were very small:

https://github.com/servalproject/openwrt/commit/1cfb77ccaf4fd6a5ef345ba599534a5ae26114df
https://github.com/servalproject/openwrt/commit/3133e6ed935bc4d7705f72e639519e39cafa711d
https://github.com/servalproject/openwrt/commit/034daf1f4c63c90b079e40da3f8529288ddc1a79

Note that while I didn't have a spare GPIO, this approach still requires that you assign some GPIO to be the chip-select line. I chose a GPIO that was not exposed on the board I was using.  For many low-cost wireless routers, like the TP-LINK WR703N and friends, there are plenty of such blind GPIOs to choose from.  Indeed, this microSD hack should be fairly easily adaptable to the 703N, MR3020, MR3040 and many other cheap Atheros 9331 (or similar Atheros parts) wireless routers, such as the very nice GL-AR150 and related family.

Update: I have spoken to the nice people who make the GL-AR150 and related devices, and they are taking a look at this for evaluation.

Mesh Extender EEPROM-equiped cable work

One of the novel features of the new Mesh Extender, is that the national radio regulatory parameters will not be stored in the main unit, but rather in the power cable, as I have described previously.

This means that we can, the theory at least, have bunches of Mesh Extenders pre-positioned regionally (or even globally), without having to configure them for each country in which they will be used. Instead, we just need to have batches of country-specific power cables for them, or similarly, program sets of power cables for them, and then send those to the relevant country/countries.

It also means that we can deal with unfortunate regulations that require firmware be locked in some countries, by having the firmware lock encoded on the power cable as well.

To implement all this, we are using 2KB I2C EEPROMs, so that we can have quite a bit of information stored, and also re-program the cables from one country to another when the need arises.

We want the RFD900/RFD868 radio to read this information directly when they power up, so that they can set their radio frequency and TX power levels appropriately.  This means it makes sense to have the RFD radio talk directly to the I2C EEPROM, rather than via the Ath9k CPU.  A second reason for doing it this way is that we don't have enough GPIOs left on the Ath9k module we are using.

All this means that I needed to implement an I2C library in the RFD900 firmware, and as mentioned in the previous post, implement the SHA-3 hash function, so that we can validate that the parameters are intact, and have not been corrupted by problems with the I2C EEPROM.

I found some nice reference information about I2C, and apart from some challenges at getting the timing and protocol right, it only took a few days work to get to the point where I can now reliably and quickly read and write the EEPROM.  This meant spending a lot of time staring at oscilloscope displays like this one.




For development, I wired up a little board with one of the EEPROMs to an RFD900, to simulate the wiring for the cable.



One nice little trick that we do to save power consumption, is that the EEPROM is powered directly from one of the GPIOs on the RFD900.  If we turn that GPIO off, then the EEPROM is physically switched off, saving a (very) little bit of power.

For the actual cables, we have the pinout planned such that the EEPROM can be soldered directly onto the relevant pins of the D-SUB 25 connector, to simplify assembly and avoid the cost of a little PCB, something like this:



Bending the pins the right amount was a bit more work than hoped, but with practice (or a little jig) could be done quite quickly. This is mainly because the chip is quite a bit fatter than the pitch between the rows of pins.  The pins are the same pitch as the pins within a row on the connector, however, so that aspect is fine.

This theme of simplifying assembly is, I am finding, a recurring one as I plan how to make something that can actually be manufactured, even in modest quantities.  All manual steps need to minimised so far as possible.  This means actually trying to do things, rather than just designing them.  So half way through writing this post, I wandered downstairs and tried to solder one of these cables together. I succeeded eventually, more or less, but in the process realised that to just fit the chip onto the back of the D-SUB connector, two pins needed to be swapped around.  For now, I have soldered it up with the temporary fix, until we can get this pin change made on the next revision of PCBs (which fortunately haven't been fabricated yet). You can see the resulting mess here:




Here is the whole thing with the nice $1.35 a piece IP65-rated connectors I found recently:


Apart from the pinout problem, it wasn't too hard to assemble, really, so I am encouraged that this could still work.  I won't stop thinking about how I can further optimise the process, however.

What I haven't covered above is how I am going to protect the cable head, so that it is sealed etc.  For that, I have been talking to the plastics manufacturing people who are helping us with the injection-moulded housing design.  They have suggested we could fairly cheaply produce a tool for low-pressure plastic encapsulation of the cable, similar to what is used to produce serial and printer cable ends.  Because it is low pressure, it is possible to use aluminium for the tool, rather than the hard tool steel that is required for the injection-moulded housing.  Because aluminium is so much softer, it is quicker (and thus cheaper) to machine.

8-bit implementation of SHA3

We have need of a hash function in the Mesh Extender for the RFD900 radio to verify that the radio regulatory parameters it is loading from the serial EEPROM in the power cable have not been corrupted.

Taking a look at the current major families of hash functions, SHA-1, 2 and 3, it looks like SHA-3 is the best.  This is not just because it is the newest (incorporating the latest advances in cryptography against known attacks, compared with SHA-1, which is showing signs of vulnerability), but because it is also relatively computationally efficient (compared with SHA-2, for example), and friendly for running on simple hardware.

I found a nice public domain implementation of SHA-3, and tried to pull that into the RFD900 firmware.  However, it upset the compiler in a variety of ways.  In short, the SDCC compiler really doesn't like 64-bit data types, and does horribly inefficient (and incorrect) things with them.

Result: I have worked through the implementation converting it to a byte-oriented implementation of the full SHA-3 hash.  It correctly calculates the hashes of various test-vectors I have fed it.  What is nice, is that the implementation is now quite a bit shorter and simpler, because I have removed some optimisations for 64-bit machines from the code.  You can see the code here:

https://github.com/gardners/SiK/blob/MeshExtender2.0/Firmware/radio/sha3.c
https://github.com/gardners/SiK/blob/MeshExtender2.0/Firmware/radio/sha3.h

For very short input texts, I can calculate a SHA-3 hash in under a second, which isn't too bad, given the little 8051 CPU on the RFD900 board.

Thursday, February 2, 2017

Potential Mesh Extender Use-Cases: Farms

I was talking with a colleague about our plans for the Mesh Extender in farming, and realised that I couldn't find anything written down about our thoughts in this space, so I am going to fix that right now.

While we had been thinking about it for a while, the need for something to improve the productivity and competitiveness of family farms in remote locations here in Australia was really bought home to us by Craig from the Evening Star Caravan Park in Charleville, Outback Queensland.

Craig pointed out the cycle of decline in many remote towns caused by the shift from family ownership of farms to corporatised farming.  Basically, family farms mean that there is an extra family in a community, with kids who need schooling, and more warm bodies who need health and other services.

Corporate farming tends to use less people, in order to maximise economic efficiencies. Unfortunately, this means that a town often loses a family or two in the process. Then there are less kids at the school, so the school might lose a teacher (and the teachers family).  Then the hospital (if they are lucky enough to have one) loses a nurse (and the nurses family), because the population has reduced, and so on.  At the same time, there are now less mouths to buy food from the local supermarket and stores, so they reduce the hours of their workers, which further reduces the money that they have to spend in the community and so on.  Basically, the loss of farming families causes a continual erosion of the viability of these communities.

However, it isn't easy to run a family farm, when faced by the economies of scale and other efficiencies that corporate farming is often able to harness, including the use of information technology to remotely manage their properties, which are often very large -- upto 10s of thousands of square kilometres (although in the past the largest such operation exceeded a staggering 220,000 square kilometres -- or about the size of the entire UK).

Basically, it is much cheaper, and therefore profitable, if you are able to manage your property from a network operations centre or station homestead, instead of having to drive potentially hundreds of kilometres over rough station tracks.  However, the communications solutions currently on offer to do this are either two simplistic, e.g., analog water tank level sensors, or are so complex as to require dedicated personnel, and are simply not maintainable by the family farmers, many of whom are in their 60s and 70s.  Also, the systems are simply too expensive.

The simplicity designed into Serval from the beginning has the potential to change this, by making it possible to create remote monitoring and control networks that do not require any cellular coverage (about 2/3 of Australia has absolutely no cellular coverage at all), or incur the running costs associated with it.  This is part of why we designed Mesh Extenders with "Internet of Things" like inputs and outputs -- although of course we don't need internet access, so it is really more "Mesh of Things" (MoT).  We have already prototyped a simple MeshMS control interface to support this, so that a farmer could just subscribe or unsubscribe to alerts from a sensor by sending a text message to the sensor.  Also, they would be able to do this from anywhere on their properties, instead of being tied down to a centralised control interface.  This last point is not to be underestimated in its impact.

That is, we think we can make something which is 10x cheaper than many of the existing solutions, and 100x simpler -- and that wouldn't need farmers to pay for expensive consultants to fly and drive in from big cities -- they could progressively deploy and maintain it themselves.

Of course, it isn't just Outback Australia that could benefit. Anywhere where the capital expense, availability (or affordability) of communications, or the lack of remote control and monitoring impairs the productivity of farms.

Basically, we hope that our humanitarian technology will be helpful in more than just one situation.  In return, it might just help to create additional markets that can help us to reduce the cost of Mesh Extenders for all users.

Monday, January 30, 2017

Looking for ideas for cable and connector parts

I'm currently looking at what to use to build the power cables for the Mesh Extenders.

As previously posted, one end has a D-SUB 25 socket.  The other end needs to have connectors for:

a solar panel and battery (4 pins),
USB socket (to allow charging of phones from Mesh Extender, where power budget allows),
12/24v automotive power

and it also needs to have a little serial EPROM in the cable, so that the cable can tell the Mesh Extender which radio regulatory region it is in.

All of this needs to be fairly weather proof, so that it can ideally last for at least a year in tropical maritime or outback conditions.

It also needs to be as cheap as possible.

I'm looking for ideas for all parts of the cable, to make the cables as fast and cheap to build as possible, while maintaining adequate performance.

My current thinking is leaning towards:

Using half of a http://au.element14.com/videk/1125/lead-rs232-25w-d-skt-skt-5m/dp/1525869 for the D-SUB 25 end, then putting some currently unknown small sealed junction box on the end of that, and having the solar/battery, USB and automotive power plugs (not all may be fitted on all cables) come out the other end of the junction box.  

Those D-SUB connectors have the problem that they are not UV stabilised or IP rated, however.  Are there good simple coatings (like would spraying them with Armor-all be enough) for UV protection?  Would the connector, sitting inside a lip at at the bottom of the Mesh Extender exclude dust and water adequeately (we can at least test that once we have complete hardware units on hand)? Or does anyone know an affordable source of similar cables that are UV stabilised, and ideally, IP66 or similar rated?

For the solar/battery connector, perhaps something like http://www.banggood.com/10Pairs-DC-MaleFemale-4PIN-24AWG-Waterproof-IP65-PVC-LED-Connectors-p-1073265.html?rmmds=buy, which are outrageously cheap, and already come with tails fitted, so soldering them up on a tiny PCB in a junction box would be easy.  They claim to be UV resistant and IP65 rated, although I must confess I have some suspicions given their very low cost.

I currently have no decent leads on a small junction box that can take a fat cable in one end, and some skinny ones out the other, sealing everything in the middle. Something like the things that Telstra use to join phone cables in pits would be a potential solution (not Scotch-locs, but the bigger things).  But I don't know where to source those from (yet).

Friday, January 27, 2017

Mesh Extender 2.0 Exterior and Interior drawings

Just a quick post with some images that have been generated so far during the design process, to give some idea of how the thing will fit together.  The exact dimensions and details are likely to have changed before we produce physical units, but give a clear idea on the concept.

First, from the front:

 Here  you can see the three antenna mounts: 2 for the UHF packet radio, and 1 for the WiFi. The other two bumps are screw bosses, so that you can make your own shade for hot locations to help keep the innards below 70C.  We have included this, because the thermal budget is just not quite there  for full-sun tropical locations, while sticking to only passive cooling, and with everything in an environmentally sealed case (which also traps heat).  Adding some shade fixes this problem.

We are not at this stage designing a shade, as we figure that they can be easily made by users from whatever they have laying around, for example, an old plastic bucket, waxed cardboard box, or even a drink can split open.

From behind:


The main thing to see here is the curved back to make it easier to strap to a tree or pole, and the ribbing to help provide at least a little air-flow between the unit and whatever it is attached to.


From below:
Here you can see the D-SUB 15 utility/IoT and D-SUB 25 power/radio connectors.  Also, below those you can see a couple of round markings which are drill guides in case you want to get ethernet out.  In their default state, they have gortex moisture seals to allow the unit to maintain equal pressure with the outside, without filling with condensation.

The inside of the top:


Here the main feature to see is the notch and paddle to help hold the PCB firmly in place, to minimise the effects of vibration, e.g., if a unit is mounted on a vehicle.

The PCB itself will sit inside, with fly-leads to the antennae, as shown in the remaining images.  Returning to the thermal properties, the main means for heat to exit from the unit is conductance through the antennae connectors.  Not ideal, but when you are making a sealed unit that you don't want to cost thousands of dollars per piece, your options can be rather limited.







Wednesday, January 18, 2017

Testing Mesh Extender 2.0 Build Process with Farouk from INRIA

This week Farouk from INRIA in Lille, France has been visiting, as we discuss the potential for collaboration.  It looks like what we are doing with Serval and the Mesh Extenders at the moment will be a good fit for the needs of a project that they have at the moment.  As a result, we have spent a couple of days making sure that Farouk can replicate our build process, which also gives us confidence for others building firmware images as well, and transferring as much of the necessary know-how as possible before he heads back to France, and then in a just a couple more days, that I head back to Australia.

In this process, we are also trying to document all of the outstanding software and hardware issues for the Mesh Extenders at http://github.com/servalproject/openwrt, so that we can better coordinate our activities, and also hopefully make it easier for others to contribute or replicate our work.

Tuesday, January 17, 2017

Testing the Super-Capacitor

We have included a 1F 5.5V super-capacitor on the new Mesh Extender board.

The idea of this is so that when power is lost, the unit has a couple of seconds to stop writing to the microSD card, and perhaps tidy things up to ensure a clean boot next time.

However, we haven't managed to get it to work properly yet.

The boards have a 20 Ohm resister in-line with the super-cap, so that there is no unmanaged in-rush current when charging the capacitor from empty.

The capacitor takes a few minutes to fully charge to about 4.8V (5V - the voltage of the zener diode that forms part of the power loss detection circuit).

At this point, it should be possible to then remove the power source, and have the unit operate powered solely by the super-capacitor, until its voltage level drops below about 3.3V.

GPIO24 is the line that reads our input-power-available signal (effectively the input power before passing through a zener diode, after which it charges both the super-capacitor, as well as powering the rest of the board.  To test the system, I configured that GPIO line for input, and had a little shell script that sits in a loop reading from it.

root@OpenWrt:/# cd /sys/class/gpio
root@OpenWrt:/sys/class/gpio# echo 24 > export
root@OpenWrt:/sys/class/gpio# cd gpio24
root@OpenWrt:/sys/devices/virtual/gpio/gpio24# while [ true ]; do cat value; don

e
1
1
1
1
1
...

It reports 1 when there is an input power supply (other than USB, which is another little problem we need to solve), and 0 when there is no input power supply, but is running on the super-capacitor.  At least that is the theory.

However, with the 20 Ohm resister, the voltage on the low-side is only about 2.2V, much too low to be useful.  Thus I tried putting a 10 Ohm resister in parallel, dropping the combined resistance to about 6.7 Ohms.  That still wasn't enough.

Then I tried bridging the resister by using a multi-meter in current measuring mode after having already charged the capacitor.  This gives effectively 0 Ohms, and provides an upper bound of what is possible with this super-capacitor.  With that configuration, things were more promising, as I saw u-boot try to boot, but as can be seen, as soon as it tried using the DDR RAM, it would reset, as presumably the DDR RAM draws too much power for the super-cap to sustain the supply above 3.3V:

1
1
1
1
1


*********************************************
*        U-Boot 1.1.4  (Jun  6 2015)        *
*********************************************

AP121 (AR9331) U-Boot for DOMINO v1

DRAM:   

*********************************************
*        U-Boot 1.1.4  (Jun  6 2015)        *
*********************************************

AP121 (AR9331) U-Boot for DOMINO v1

DRAM:

*********************************************
*        U-Boot 1.1.4  (Jun  6 2015)        *
*********************************************

AP121 (AR9331) U-Boot for DOMINO v1

D?

*********************************************
*        U-Boot 1.1.4  (Jun  6 2015)        *
*********************************************

AP121 (AR9331) U-Boot for DOMINO v1


*********************************************
*        U-Boot 1.1.4  (Jun  6 2015)        *
*********************************************

AP121 (AR9331) U-Boot for DOMINO v1
?

*********************************************
*        U-Boot 1.1.4  (Jun  6 2015)        *
*********************************************

AP121 (AR9331) U-Boot for DOMINO v1

?

As can be seen above, there is no line with 0, before it hits the u-boot reboot loop, indicating that the board does not operate on the super-capacitor,  even for just a few milliseconds.

We'll have to think of an appropriate solution to this problem, but first we need to understand the situation more completely.  

Is the capacitor unable to provide enough current for the DDR RAM?

Is the capacitor too small?

Also, only one of three super-capacitors seemed to work.  The other two might have been damaged at some point in the process, but having 2/3 faulty makes me think that we shouldn't be relying on them.

Monday, January 16, 2017

Mesh Extender 2.0 second revision prototype boards

The second revision of the Mesh Extender 2.0 (ME2.0) PCBs have arrived.  These were manufactured at almost miraculous speed by RF Design ahead of the Christmas break.  They contain fixes for three of the main problems we encountered with the first revision, fixing problems with both the ethernet and serial level-converter interfaces, as well as the bootstrap pull-up and pull-down on the Domino Core Atheros 9k module.  Here is the new PCBs:

Ethernet - both ethernet ports now work nicely.  One is capable of giga-bit, but sometimes it only connects at 100mbit/sec.  We need to understand what is going on there.


Serial port - the serial port now works without problem, since we have switched to a well-known MAXIM part, instead of the TI level converter, that although in principle capable of level-converting serial lines, turns out to be much too glitchy in our situation.  Other people have had similar problems.

The pull-up registers are now correctly set, although we did still have a problem with one of them apparently not being pulled up hard enough, so we have had to install a single resister to ensure that the Ath9k knows to boot from the 16MB flash, instead of from its internal ROM.  This resister can be seen in the photo below:


We now also have both D-SUB connectors on the same side of the PCB, but having double checked with the 3D-printed case prototype, they are both on the wrong side now, so we will have to fix that in the next revision:


We are currently working on building firmware images for this board, so that we can test other functions, which I'll report on in a separate post.

OpenWRT doesn't see packages from custom feed

Just a quick post to document a problem we encountered with adding a feed to an OpenWRT build process for the Serval Mesh Extender, and how we fixed it.

We followed the process in https://wiki.openwrt.org/doc/devel/feeds to add a new feed, by:

1. Modifying feeds.conf (copying feeds.conf.default, if required)
2. Running ./scripts/feeds update customfeed, with customfeed replaced with the name of the new feed.
3. Running ./scripts/feeds install -p customfeed,  again with customfeed replaced by the name of the new feed.

However, when we did this, and then ran make menuconfig, our new packages were nowhere to be seen.

We solved this by running the following additional command:

./scripts/feeds install -a customfeed