New version of rshell with better startup for ESP8266 and ESP32
New version of rshell with better startup for ESP8266 and ESP32
I just release version 0.0.21 of rshell.
It turns out that some ESP8266 and EPS32 boards reset when you open the serial port, and the verbage printed out at startup was confusing rshell trying to get a REPL prompt.
rshell now send a Control-C followed by RETURN several times while waiting for the >>> from MicroPython to show up.
None of my boards reset when opening the serial port, so I simulated it by tweaking the RTS and DTR lines immediately after opening the serial port.
I'd love for somebody who previously had issues; typically hanging at the 'Testing if ubinascii.unhexlify exists ...' would test this version.
Some people worked around this by adding a delay in pyboard.py.
Thanks
It turns out that some ESP8266 and EPS32 boards reset when you open the serial port, and the verbage printed out at startup was confusing rshell trying to get a REPL prompt.
rshell now send a Control-C followed by RETURN several times while waiting for the >>> from MicroPython to show up.
None of my boards reset when opening the serial port, so I simulated it by tweaking the RTS and DTR lines immediately after opening the serial port.
I'd love for somebody who previously had issues; typically hanging at the 'Testing if ubinascii.unhexlify exists ...' would test this version.
Some people worked around this by adding a delay in pyboard.py.
Thanks
Re: New version of rshell with better startup for ESP8266 and ESP32
My suspicion is that some serial drivers send the reset on connect, as it only seems to affect some OS. Linux is unaffected by this behaviour. Mac OS is affected by the behaviour. Can't remember for Windows.
It's a real pain since if there is a main.py I am used to interactively killing the micropython script to make e.g. ampy put work (which relies on a responsive console to do file upload). Unfortunately ampy put then makes a connection, which restarts the board, which triggers main.py and makes the console unresponsive again.
If rshell is intelligently handling this, I'll probably switch vanguard put to use rshell instead...
https://github.com/vgkits/vanguard-cli/ ... __.py#L210
I already wrap rshell elsewhere and it's a dependency already so people don't have to install it.
It's a real pain since if there is a main.py I am used to interactively killing the micropython script to make e.g. ampy put work (which relies on a responsive console to do file upload). Unfortunately ampy put then makes a connection, which restarts the board, which triggers main.py and makes the console unresponsive again.
If rshell is intelligently handling this, I'll probably switch vanguard put to use rshell instead...
https://github.com/vgkits/vanguard-cli/ ... __.py#L210
I already wrap rshell elsewhere and it's a dependency already so people don't have to install it.
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: New version of rshell with better startup for ESP8266 and ESP32
For me the OS didn't make a difference and it seems to be hardware dependent. The one esp32 "doit esp32 devkit" does reset on connect, the other devices I have don't.
However the latest version fixes the problem and works great.
However the latest version fixes the problem and works great.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: New version of rshell with better startup for ESP8266 and ESP32
This is a big improvement. There is still a minor issue with ESP32 if you exit rshell and then attempt to reconnect: it either fails to connect or hangs trying to do so. I'm using an Espressif ESP32-DEVKITC with ESP-WROOM-32.
The workround is simple: press the reset button before attempting to reconnect.
I use the following to connect to ESPx
The workround is simple: press the reset button before attempting to reconnect.
Code: Select all
$ rsusb
Using buffer-size of 30
Connecting to /dev/ttyUSB0 (buffer-size 30)...
Trying to connect to REPL ....................Unable to connect to REPL
Welcome to rshell. Use Control-D (or the exit command) to exit rshell.
No MicroPython boards connected - use the connect command to add one
Code: Select all
alias rsusb='rshell -p /dev/ttyUSB0 --editor nano --buffer-size=30 -a'
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: New version of rshell with better startup for ESP8266 and ESP32
Thank you ! WAW!!
Great tool that opens the gate from IDE editing to esp flash.
I wil try this path
windows + NETBEANS editing esp32/ directory on remote (raspberry-pi + esp32 on /dev/ttyUSB0)
INCRON watching esp32/ and run push.sh
rshell -p /dev/ttyUSB0 | (wait ???) rsync esp32/ /pyboard | exit
Great tool that opens the gate from IDE editing to esp flash.
I wil try this path
windows + NETBEANS editing esp32/ directory on remote (raspberry-pi + esp32 on /dev/ttyUSB0)
INCRON watching esp32/ and run push.sh
rshell -p /dev/ttyUSB0 | (wait ???) rsync esp32/ /pyboard | exit
Re: New version of rshell with better startup for ESP8266 and ESP32
When I run rshell on my ESP32 I get:
From the docs it appears you should end up at:
When I re-install rshell it appears to be in:
Do I make a link to it or have I messed up the install?
Thanks,
Dave
Code: Select all
> rshell
Welocome to rshell. Use Control-D to exit.
/home/dave
Code: Select all
.../micropython/rshell>
Code: Select all
Requirement already satisfied: rshell in /usr/local/lib/python3.7/dist-packages (0.0.28)
Thanks,
Dave
Re: New version of rshell with better startup for ESP8266 and ESP32
Really great release! Some of my esp-32s were affected by this. I will report back once I test it out.
Thanks again.
Thanks again.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: New version of rshell with better startup for ESP8266 and ESP32
@davef There is nothing wrong with your installation: the rshell prompt shows the current directory wherever that may be.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: New version of rshell with better startup for ESP8266 and ESP32
On macOS, I think the default is to have DTR inactive until the port is opened. If that is used by the ESP, then that might explain the reset-on-open behaviour.
Re: New version of rshell with better startup for ESP8266 and ESP32
jcw,
I assume that remark is for someone else.
Peter,
This is what happens when I run rshell:
but when I do:
I get the root directory of the host computer. There is no /sd or /flash on my ESP32. The ESP32 has webrepl running and it is configured as an AP, is one of those conditions a problem?
rshell appears to find my files but I can't!
Update:
I found it in /pyboard
Thanks,
Dave
I assume that remark is for someone else.
Peter,
This is what happens when I run rshell:
Code: Select all
dave@dave-AOD255E:~$ sudo rshell -p /dev/ttyUSB0 --editor nano --buffer-size=30 -a
Using buffer-size of 30
Connecting to /dev/ttyUSB0 (buffer-size 30)...
Trying to connect to REPL connected
Testing if ubinascii.unhexlify exists ... Y
Retrieving root directories ... /batt_voltage_values/ /boot.py/ /datalog.csv/ /myLogger.py/ /umail.py/ /webrepl_cfg.py/
Setting time ... Aug 20, 2020 10:43:07
Evaluating board_name ... pyboard
Retrieving time epoch ... Jan 01, 2000
Welcome to rshell. Use Control-D (or the exit command) to exit rshell.
/home/dave>
Code: Select all
ls -l /
rshell appears to find my files but I can't!
Update:
I found it in /pyboard
Thanks,
Dave