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 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

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 :slight_smile:


The symbols are the ASCII values of what would be in Hex.

1 Like

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.

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”.

1 Like