GM862 write to memory

Hi guys,

I have 18 GM862 devices out in the wild but I have recently come up with an issue. I had to change something in the code on the device, which meant I had to bring in all 18 vehicles and plug the modules into the laptop individually.

I was wondering if anyone knows if it is possible to use the python interpreter to write to the internal storage? The same place the files go when you send them over with RSTerm/Hyperterm. If it is possible, then I can have some intermediary code which will check for updates and download them from the web server, write them to memory and then run that code/module. It would save me a great deal of time, especially as I am about to put another 20 out there.

Regards

Tomas

Yes it is possible to access the memory, here is a little bit of code I use to update the device’s code:

######################################
#save the data in a file named fileToExec 
def saveFile(data,fileToExec):
        if ((data != "") and (data != -1)):
                f = open(fileToExec,'wb')
                f.write(data)
                f.close()
                return 1
        else:
                return -1

You then reboot the module with this command:

MDM.send('AT#REBOOT\r',0)

And your module should start running your new code

remember variables can only be 16k bytes long, so you can’t update a file bigger than 16k[/code]

Thanks, that is a great help. I dont think my code will get larger than 16k but if it does I can split it up into modules and have some main class import them, or im sure there will be a way to segment the file, write 16k to memory and then load up another 16k to append to it afterward.

This is going to be a massive help to me.