I want to compile my code into Digi XBee Cellular 3G Global Embedded Modem Flash memory

I have a problem compiling any code using Micropython from XCTU to Xbee Cellular 3G Global embedded. This is the error “OSError [Errno 7019] ENODEV”… I cannot do nothing… :S Please helpme to compile correctly. I’m following the steps of the User Manuals(The error was produce in the step 5):

  1. Access the MicroPython environment.

  2. Copy the code you want to paste into the XBee device. For example:
    print(“Hello world”)

  3. Press Ctrl+F.
    MicroPython v1.9.3-999-g00000000 on 2018-01-01; XBee Module with EFX32
    Type “help()” for more information.
    >>>
    flash compile mode; Ctrl-C to cancel, Ctrl-D to finish
    1^^^

  4. At the MicroPython 1^^^ prompt, right-click and select the Paste option.
    MicroPython v1.9.3-999-g00000000 on 2018-01-01; XBee Module with EFX32
    Type “help()” for more information.
    >>>
    flash compile mode; Ctrl-C to cancel, Ctrl-D to finish
    1^^^ print(“Hello world”)

  5. Press Ctrl+D to finish. The code is compiled and stored in flash memory.
    Compiling 123 bytes of code…
    Used 0/150 QSTR entries.
    Compiled 123 bytes of code to 188/7544 bytes of flash.
    Automatically run this code at startup [Y/n]?

  6. You can choose whether to have the code stored in the flash memory automatically run the next time the XBee device is started. Press Enter to leave the setting unchanged (the default value shown as uppercase).
    Y: Press Y to automatically run the code stored in flash memory upon startup. This sets the PS command to 1. Note that this example only works on startup if you have a terminal open on that serial port and the AP command is set to 4.
    N: Press N to ensure that the code stored in flash memory is not run the next time the XBee device is started. This sets the PS command to 0.

The ENODEV error is because you have not formatted the XBee’s filesystem yet. I believe you can do this using the XCTU filesystem manager. If not, you can do it by entering command mode (+++) and sending the command ATFS FORMAT CONFIRM.

1 Like

Yes, and from MicroPython you can also “import os” and “os.format()” to format the file system. This is a change from how earlier releases stored code.

Thanks a lot!!

You might have an indentation error. Try to trap your errors with this type of code. Then the code will continue and you can debug.

try:	your code...

    	xyz = i2c.readfrom(addr, 6)
    	
    	Tempr = (xyz[0] * 16 + xyz[1])/100
    	print (Tempr , "C")


except Exception as err:
    	print("num " , err)