How to determine MicroPython mode on reconnect

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
HermannSW
Posts: 197
Joined: Wed Nov 01, 2017 7:46 am
Contact:

How to determine MicroPython mode on reconnect

Post by HermannSW » Mon Oct 01, 2018 12:01 pm

MicroPython prompt on reconnect is always ">>> ", regardless of real mode at that time (raw/normal/paste):
https://github.com/micropython/micropython/issues/4196

I found a workaround to deal with that, after entering password I inject "CTRL-C CTRL-B":
https://github.com/Hermann-SW/webrepl#webrepl-shell

After injection MicroPython mode will be "normal", regardless of initial mode:
GraphvizFidlle link
Image

Is there any API call that can determine the initial MicroPython mode besides issuing eg. just "Enter" and wait for 2nd prompt that is correct?
Pico-W Access Point static file webserver:
https://github.com/Hermann-SW/pico-w

Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454

webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell

Post Reply