Home/Support/Support Forum/XBee3 Micropython uploaded: when run in REPL mode... good results. when in API mode.. see weird symbols.

XBee3 Micropython uploaded: when run in REPL mode... good results. when in API mode.. see weird symbols.

0 votes
XBee3 Micropython uploaded: when run in REPL mode... good results. when in API mode.. see weird symbols in the REPL console:

PS = 1 so it autoruns at start-up.

when in AP=4 (REPL mode) and reset the device (MicroPython is already flashed on the device)
I see the usual beginning statements:

"Parsing /flash/main.py...
Compiling /flash/main.py...
Running bytecode...
Sending data to COORD
Data sent successfully"

then I switch to AP = 1 (API mode)

when I reset the device I see weird symbols in the REPL console (I know REPL console shouldn't be a thing in API mode but am just curious as to what the symbols are)

when I reset the device.. instead of the usual I put in quotes above.. in that's place I see

~ハu
the two line things in between the u and ~ don't look like that (just looks like that after I copy and paste). instead those two line things look like a weird square with some markings. almost resebels a tiny page or something.

anyways, if anyone understands why these hieroglyphs appear.. share the knowledge :)


thanks
asked Aug 6, 2020 in MicroPython by edunn106 New to the Community (25 points)

Please log in or register to answer this question.

2 Answers

+1 vote
The symbols are the ASCII values of what would be in Hex.
answered Aug 6, 2020 by mvut Veteran of the Digi Community (14,297 points)
To be specific, what you are seeing is the terminal trying to make a printable (visible) representation of the API frame data. For example, ~ is ASCII code 0x7E (the API frame delimiter).

If you paste something like 7e00028a0175 into a tool such as https://www.rapidtables.com/convert/number/hex-to-ascii.html you can see what we mean.
+1 vote
API mode encapsulates data into "frames" that start with a delimiter (~) and two-byte length, followed by a one-byte frame type and data that you parse based on the frame type value. The last byte is a checksum to validate the frame contents.

If you don't have a host processor connected to the serial port parsing that data, you shouldn't be running in API mode.

If you run in ATAP=0 mode, a remote node can send data so that just the payload comes out the serial port. In the documentation, that's referred to as "transparent serial".
answered Aug 7, 2020 by TomCollins Veteran of the Digi Community (2,106 points)
...