Autoupdate by Netburner itself

Discussion to talk about software related topics only.
Post Reply
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Autoupdate by Netburner itself

Post by v8dave »

Hi all,

I like the idea of the autoupdate feature but as my hardware is going to be connected by GPRS and not the Ethernet connection, it is not possible to use the standard auto update feature as the device's IP address is not visible on the GPRS network, well, not without a dedicated setup with the GSM operator to give a static IP address.

Even after dialing up and connecting and getting the IP, this IP is hidden behind the GSM network NAS sp not visible to the outside world.

Is it possible to get the Netburner to check an FTP site for current software and then download this and repogramme itself? What I would like to do is put a special file on the server that the device downloads, checks if there is a new version for itselt and then it downloads this new version and installs it and reboots. Is this possible?

Cheers,
Dave...
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Re: Autoupdate by Netburner itself

Post by v8dave »

I think I may have found a solution. There is a sample in the examples that allows to download from an FTP server.!!

Going to try and get this to work.

Cheers,
Dave...

EDITED... MMmmmm. Not quite what I was looking for but it may give me clues on how to do this. This is actually an FTP server on the Netburner and not opening an FTP connection to an external server.
User avatar
Chris Ruff
Posts: 222
Joined: Thu Apr 24, 2008 4:09 pm
Location: topsail island, nc
Contact:

Re: Autoupdate by Netburner itself

Post by Chris Ruff »

This can be done.

You need to have a daemon running on the distant server that your NB module logs into. The version check takes place via your code (you have your own code on both ends). The file transfer takes place via TCP. You don't have to (and I wouldn't want to) use FTP at all.

The trick, however, is how to get from the file you just transferred int RAM to upgrade the module and then reboot. You will need to follow the code in autoupdate to see how to do this.

and remember, any error in your code could render the module sitting in the monitor at your customer's site. very embarassing.

Chris
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand
warsky
Posts: 1
Joined: Thu May 13, 2010 9:58 am

Re: Autoupdate by Netburner itself

Post by warsky »

Our NetBurner DAQConnect library along with a special form of the DAQConnect service can do this for you with a minimal amount of effort on your part. You post versions of your software on the DAQConnect server, specifying version numbers, and then you can either trigger all your deployed units to upgrade, trigger single units, or allow your customers to trigger the upgrade when they are ready. We keep historical images for you so you can revert back if necessary. This is done from the web and in a way that does not require static IPs. You'd have to write about 3 lines of code. We do all the hard work for you!

You could also take advantage of DAQConnect's other features, including the ability to do remote configuration over the web, and the ability to remotely monitor data coming from the device.

Please email me at:

m at daqconnect.com
or phone: 541-646-7077

if you'd like to discuss this further.
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Re: Autoupdate by Netburner itself

Post by v8dave »

Thanks Chris,

I also came across code that can update the module via the SD card, which I have built into my hardware. I can download the file and write this to the SD card and then use the code to programme the unit. This has checksum tests and will fail if there is any errors.

I like your idea of running a Daemon on the server handling the requests instead of FTP etc. I'll look into this but it does mean doing a little more work and coding for that too.

Any upgrade over the air could potentially render the unit as a brick so I would build in various features to prevent this as much as possible. Having the ability to upgrade it over the air though is a real bonus for adding new features (which would be tested thoroughly first) or fixing any bugs. It won't be done unless the operator has set the unit up to do this via the control panel setting in my software so they have control over this feature.

Having spent the last month developing with the Netburner I must say I am pretty well impresed with it. The speed is so much better than the old Rabbit based system that I design prior to this unit (which I have managed to port a lot of the core over from). I am also considering doing a redesign of another project over to Netburner and porting the code to it.

Thanks for your comments.
Dave...
khoney
Posts: 125
Joined: Fri Sep 11, 2009 12:43 pm

Re: Autoupdate by Netburner itself

Post by khoney »

v8dave - Could you share with us where you located this code? I'd like to do something similar myself, i.e. send a client an SD card with a firmware update.
User avatar
lgitlitz
Posts: 331
Joined: Wed Apr 23, 2008 11:43 am
Location: San Diego, CA
Contact:

Re: Autoupdate by Netburner itself

Post by lgitlitz »

Example to update from the EFFS( SD, CF, RAM-drive):
C:\nburn\examples\EFFS\EFFS-AppUpdate
Example to update from FTP:
C:\nburn\examples\FTP\FTPD_AppUpdate

Also look at the steam update header:
C:\nburn\include\StreamUpdate.h
This header provides functions that allow you to read or write the contents of User and Application flash to any file descriptor. There are descriptions for each function in the header.

int SendUserFlashToStreamAsBinary( int fd );
int SendUserFlashToStreamAsS19( int fd );
int ReadS19UserFlashFromStream( int fd );
int ReadBinaryUserFlashFromStream( int fd );
int ReadS19ApplicationCodeFromStream( int fd );
int SendApplicationCodeAsS19( int fd );
int ReadBinaryApplicationCodeFromStream(int fd );
Post Reply