How do you disable control characters from unintentionally calling certain REPL commands?

Hello all, I’m stumped on how one would keep the REPL on an XBee3 LTE-M modem from unintentionally going into “Paste” mode or other mode when receiving raw data via the UART. I’m reading in data from the UART using “stdin_data =” but the trouble I’m having is that I have a lot of data with control characters. For example a line ending of 0x0d resets the REPL. How can you avoid this? I see there is a raw REPL mode but again a control character received of 0x0b would knock it out of this mode.


Try using the Micro Python UART instead of the REBL interface for your data going in and out of the XBee. That should take care of the issue.

Digi Support

1 Like

Can you elaborate on what you mean? Technically I am using the primary UART with the sys.stdin command in Micropython. Are you saying use the secondary UART? If so my hardware is tied to the primary unfortunately. Not sure I follow what you’re suggesting.

Yes, that is what I am referring to. The secondary UART is designed for sending data to the Micro Python interface when it is enabled where by the primary uart is the REBL interface only.

Thanks for the reply mvut. I have a follow-up question related to this, can the secondary UART be used for API mode w/o escapes or is that only possible on the primary UART?

The primary UART will not function with API frames when you are in Micro Python mode so I don’t see how that would have worked.

As for the Python serial port, I don’t know as I have never tested that.