Auto Updater
mctrivia
Posts: 3,772
Well I was wondering if anyone wanted to collaborate on an auto update object for the propeller?
What is required.
1) SpinStudio Nic adapter and internet access.
2) Server that can store most up to date eeprom data.(done)
http://prop.aigamez.net/index.html to create account and upload eeproms
http://prop.aigamez.net/download.php?u=xx,p=xx,x=xx,l=xx,c=xx,v=xx
u,p,c are provided by my server.
v is version number
l is page length in 32byte blocks
x is page number
page contents will be # followed by the file contents or ####No Such File,####Current,####End,####Invalid Entry I think they are obvious what they are for.
3) Spin code to download the code in blocks write it to the eeprom here is a start:
What is required.
1) SpinStudio Nic adapter and internet access.
2) Server that can store most up to date eeprom data.(done)
http://prop.aigamez.net/index.html to create account and upload eeproms
http://prop.aigamez.net/download.php?u=xx,p=xx,x=xx,l=xx,c=xx,v=xx
u,p,c are provided by my server.
v is version number
l is page length in 32byte blocks
x is page number
page contents will be # followed by the file contents or ####No Such File,####Current,####End,####Invalid Entry I think they are obvious what they are for.
3) Spin code to download the code in blocks write it to the eeprom here is a start:
Con 'server defined constants au_u=? 'user number will be same for all your products au_p=? 'product number can be any 32 bit number au_v=? 'version number keep increasing it au_c=? 'anti leach code Con pageLength=32 'size of download buffer area in bytes/32 VAR byte buffer[noparse][[/noparse]pageLength*32] PUB copyBlock(ubBlockNumber) | x repeat from 0 to pageLength-1 i2c.WritePage(i2c#BootPin, i2c#EEPROM, ubBlockNumber*pageLength*32+x*32, @buffer+x*32, 32) startTime := cnt ' prepare to check for a timeout repeat while i2c.WriteWait(i2c#BootPin, i2c#EEPROM, ubBlockNumber*pageLength*32+x*32) if cnt - startTime > clkfreq / 10 abort ' waited more than a 1/10 second for the write to finish
Comments