Home/Support/Support Forum/OTA Update of Python Code

OTA Update of Python Code

+1 vote
Using Xbee3 Cellular Modem.

Is it possible to update python code over the air? Is this something Digi Remote Manager can handle?


P.S. The "Upload Python Files" option is not available under the "More" menu for the device.
asked Sep 26, 2018 in XBee Cellular by skeller New to the Community (1 point)
recategorized Oct 11, 2018 by skeller

Please log in or register to answer this question.

1 Answer

0 votes
This is scheduled for an upcoming release of the XBee Cellular firmware.

Edit: This feature (transfer files to device via Remote Manager) is in the current XBee/XBee3 Cellular firmware releases.
answered Oct 27, 2018 by TomCollins Veteran of the Digi Community (1,718 points)
edited Jul 16, 2019 by TomCollins
Is there any timeline for that upcoming release?
When can we expect this to happen? I do not want to go through the Digi Remote manager server.
The feature exists in Digi Remote Manager.  You could use the urequests module to download content to the file system from a web server if you're looking for a way to download code over-the-air.
Is there any proper implementation of this ?
Given that the device can only run main.py or main.mpy file located in the flash.
Is there a sample code where a file was successfully downloaded using urequests ?
For a simple sample code like the following:

import urequests

url = 'https://www.python.org/static/opengraph-icon-200x200.png'
# download the url contents in binary format
r = urequests.get(url)

# open method to open a file on your system and write the contents
with open("python1.png", "wb") as code:

I am getting:

TypeError: function takes 2 positional arguments but 4 were given
It sounds like you aren't using Digi's version of urequests.  Try uploading this one to your device -- your test code worked for me.  https://github.com/digidotcom/xbee-micropython/tree/master/lib/urequests
Thanks a lot for your kind reply. I wasted a day on this :(
Sorry to hear that.  :-(

Please take a look at the PyCharm plugin (described in the README from that GitHub project) for developing code on the XBee3 products.  The GitHub project includes libraries ported to the version of MicroPython on XBee modules.  In this case, the TLS/SSL interface is slightly different than other MicroPython products.