PY (MicroPython Command)
This command applies to the XBee Cellular Modem.
Interact with the XBee Cellular Modem using MicroPython. PY is a command with sub-commands. These sub-commands are arguments to PY.
Note You can use the PY command options to control MicroPython from Digi Remote Manager. Refer to the Digi MicroPython Programming Guide.
PYB (Bundled Code Report)
You can store compiled code in flash using the os.bundle() function in the MicroPython REPL; refer to the Digi MicroPython Programming Guide. The PYB sub-command reports details of the bundled code. In Command mode, it returns two lines of text, for example:
bytecode: 619 bytes (hash=0x0900DBCE)
bundled: 2017-05-09T15:49:44
The messages are:
- bytecode: The size of bytecode stored in flash and its 32-bit hash. A size of 0 indicates that there is no stored code.
- bundled: A compilation timestamp. A timestamp of 2000-01-01T00:00:00 indicates that the clock was not set during compilation.
In API mode, PYB returns three 32-bit big-endian values:
- bytecode size
- bytecode hash
- timestamp as seconds since 2000-01-01T00:00:00
PYE (Erase Bundled Code)
PYE interrupts any running code, erases any bundled code and then does a soft-reboot on the MicroPython subsystem.
PYR (Soft Reset)
PYR performs a MicroPython soft reset which stops any currently executing code. If Python Startup is enabled (PS1) then the stored Python code is run.
PYV (Version Report)
Report the MicroPython version.
PY^ (Interrupt Program)
Sends KeyboardInterrupt to MicroPython. This is useful if there is a runaway MicroPython program and you have filled the stdin buffer. You can enter Command mode (+++) and send ATPY^ to interrupt the program.
Default
N/A