Field firmware update via GSM

This forum is for posts that might be considered off-topic but that may be useful or interesting to members. Examples include posts about electronics or programming in general, other microcontrollers or interesting devices, useful websites, etc.
Post Reply
sturgessb
Posts: 287
Joined: 25 April 2008, 6:34 AM
Location: Norwich, UK

Field firmware update via GSM

Post by sturgessb »

Hello all

Does anyone have experience with downloading applications to zx in the field via a remote connection?

I have a zx hooked up to ublox g100 gsm and have established 2way data connection. Is it possible to update the firmware on the zx via this connection if needed?

Cheers

Ben
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

Post by GTBecker »

Wireless application download, yes; see ZXCmdMode.
Tom
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

As Tom suggests, it should be the same as any other wireless communication channel. Almost certainly, you'll have to use the "ATN character" method of getting the ZBasic device into command mode (or use ZXCmdMode() as Tom suggested). Once the device is in command mode, the rest of the downloading procedure is the same as if DTR were used. One issue that might arise is if there are long delays in the command/response interaction between the downloader (IDE or otherwise) and the device.
- Don Kinzer
stevech
Posts: 715
Joined: 22 February 2006, 20:56 PM

Post by stevech »

Here's how I do it...
Field device sends heartbeat via Internet to server. Server must respond. Hearbeat is an application IP packet sent via TCP or UDP.
To do an update, the server intentionally stops responding to heartbeats. After a while, the field device says - no heartbeats, so I'll reboot myself. During the reboot, it asks the server if there's a new version of firmware available. If so, that gets downloaded and installed.

This is to avoid having the field device accept an inward TCP connection or port-forwarded UDP, due to firewall rules at field sites. No inward connections permitted. And in LTE, some carriers (like Verizon) are double-NATing now so you can't run a server accepting connections in the field - field device must initiate all connections (and I use passive mode FTP to cope with that). The double-NAt winds up with a net 10 address on the client side. No public IP. Unless you pay $$$ for a static public IP.

Though I do this via a field device with an Ethernet NIC (WizNet 812), one could do the same idea using a serial-to-ethernet black box and go into the microprocessor via serial. But the serial to ethernet box has the same firewall issues - and cellular double-NAT issue.

Too much to detail here, I also devised a way to do the firmware download and update even though the device's RAM is not large enough to store the new version of firmware. I did an update in place scheme, writing the flash on the fly, using a variation on a bootloader. Includes error recovery scheme in case firmware update aborted early.

Been running this for most of a year at about 100 sites. Some use cellular data (EV-DO and IP), and some use a wired connection.
sturgessb
Posts: 287
Joined: 25 April 2008, 6:34 AM
Location: Norwich, UK

Post by sturgessb »

Thanks guys!
Post Reply