Progress has not been quick on the build as, although it was quick to get it initially working, it has been more difficult to get it to the point where it is becoming stable enough to support unattended operation.
Typically it would run for a few hours or even a day and then stop updating the web database. There was no clear reason for it stopping and it often appeared to be running ok based on the local display I had attached.
However over the weeks I have found (and cured)
1. Power issues. The SIM900 GSM card will suddenly spike at close to 2 Amps current during operations. This is because some actions require it to up the GSM transmit power (such as when changing or connecting to a cell). This spike on the low voltage, low current processor based Arduino board would cause it to crash
2. GSM library issues. When compiling the Arduino code you have to include libraries that drive the GSM card. Lots of libraries exist but many have flaws in them. It took me a while to work this out as it is difficult with many of them to actually see the command interaction going on with the GSM card. Once I managed to get a trace working I could see that the libraries could not cope with all the different states of the GSM connection. If the states went in a nice linear fashion then it was ok i.e enable GSM login, login to GSM, open connection instance, transmit on connection instance, close connection instance. However if a failure occured such as when getting to the transmit data stage the connection (which was previously set up ok) had dropped then it could not go back in the linear flow to re-establish the connection. Therefore I needed to create a mini-state engine in the code to deal with the different states. Not being a natural programmer this has taken me some time!
3. Processor memory. I started of with an Arduino UNO which only has a small amount of memory (2k SRAM). Whilst this is more than suitable for fairly sophisticated code, my code has a lot of strings in it (the modem AT commands) and strings are greedy on memory. There are coding ways around this (using Flash memory for strings) but eventually I added on an ATmega2560 piggy back board to change the CPU and give me 8k of SRAM.
So it is now on "soak test" to see how long it runs.
