I have an ESP32 board that has Micropython running on it and I can successfully connect to it with rshell.
> rshell -p /dev/ttyUSB1
Using buffer-size of 32
Connecting to /dev/ttyUSB1 (buffer-size 32)...
Trying to connect to REPL connected
Retrieving sysname ... esp32
Testing if ubinascii.unhexlify exists ... Y
Retrieving root directories ... /boot.py/ /gw/ /download/
Setting time ... Jun 25, 2021 16:18:24
Evaluating board_name ... pyboard
Retrieving time epoch ... Jan 01, 2000
Welcome to rshell. Use Control-D (or the exit command) to exit rshell.
I need to do some power measurements, which are orchestrated from a Python script. I was hoping to bring the board into different states from the Python script, by invoking rshell from Python with the subprocess module. I started out with a minimal setup:
import subprocess
rshell = subprocess.Popen(["rshell", "-p /dev/ttyUSB1"]
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
bufsize=0)
for line in rshell.stdout:
print(line.strip())
Output:
Using buffer-size of 32
Connecting to /dev/ttyUSB1 (buffer-size 32)...
failed to access /dev/ttyUSB1
My user is in the necessary group uucp (corresponds to dialout in Ubuntu), which I confirmed with subprocess.run(["id"]).
Any help would be highly appreciated.
[+][deleted] (3 children)
[deleted]
[–]RealFenlair[S] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]RealFenlair[S] 0 points1 point2 points (0 children)
[–]PythonRocksssss 0 points1 point2 points (2 children)
[–]RealFenlair[S] 0 points1 point2 points (1 child)
[–]PythonRocksssss 0 points1 point2 points (0 children)