-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32 "Could not enter raw repl" #27
Comments
Are you disconnecting picocom before trying to use rshell? If not - that's part of the problem. You can't have 2 programs both trying to use the same usb-serial port. If you try, one program will get some of the characters and the other program will get some of the characters. |
@dhylands Nope. I don't use picocom and rshell together. It's either I am at picocom terminal or trying ampy / rshell after I have exited out picocom. The usb cable is connected directly to the MacBook's USB port. I am not using any usb hub. So Macbook has two USB ports. The other one is using a USB hub so I can use other devices, ie iphone, hard drives etc. |
Seems like this issue still persists... Will try to upgrade to the latest MicroPython, but this is what i get on a brand new wemos esp32 Lolin32 lite dev board, after freshly installing rshell:
|
Thanks for the report. I never appreciated all the crap being sent back
during boot up.
I noticed this:
OSError: [Errno 2] ENOENT
Which is probably coming from your boot.py. I suspect that you'll need to
fix that first before rshell will work properly.
Once you've got that dealt with you may also need to add the -a option in
order to transfer files.
On Mon, Feb 26, 2018 at 1:46 AM Nicholas Mistry ***@***.***> wrote:
Seems like this issue still persists... Will try to upgrade to the latest
MicroPython, but this is what i get on a brand new wemos esp32 Lolin32 lite
dev board, after freshly installing rshell:
`(uPython) ➜ ~ rshell -b 115200 -d --buffer-size=30 -p
/dev/tty.wchusbserial1420
Debug = True
Port = /dev/tty.wchusbserial1420
Baud = 115200
User = micro
Password = python
Wait = 0
nocolor = 0
binary = 0
Timing = 0
Quiet = 0
Buffer_size = 30
Cmd = []
Connecting to /dev/tty.wchusbserial1420 ...
----- About to send 286 bytes of code to the pyboard -----
def test_buffer():
"""Checks the micropython firmware to see if sys.stdin.buffer exists."""
import sys
try:
_ = sys.stdin.buffer
return True
except:
return False
output = test_buffer()
if output is None:
print("None")
else:
print(output)
------------------------------
b'\xd9:\xc2A0\x8c\xdcE\xc9v\xba\xc2A0I\xfdd.\x97\x82\xc2\xc1\xb0i\xcd\xc1_\xe4\xae\x97\x82\xc2\xc10,\xa8\xd6E\xc9v\xba\xc2A0i\xc1_\xa4\xae\x97\x82\xc2\xc10\r\xa1\xeb\x8b\x95:\xc4R\x8a\t\x1a\xb1\xbdc\xeb"\xa5v'fH\xec+\xd1:\xc2\xcdf\xe6\x16\x821bb\x95\xb9i\xb4C!\xeb\x85d\xba\xc2\xcd\xe6\x96A0L,\x89\x95n\xbaS\x9a2\x8d!\xeb\x85\xd1:\xc2\xd10\xb0\x13\x820bb\x95\xb9:\xb0C!\xeb\x85d\xba\xc2Q\xb0\xba\xc20\xb0b\xa2\x95\xf9:L\xca9\xb2C\xa1\x96\x8b\xc9\xe5
\xc2\xd10\xb0\x13YcSH\xf8\x1b[0;32mI (349) cpu_start: Pro cpu
up.\x1b[0m\r\n\x1b[0;32mI (349) cpu_start: Single core
mode\x1b[0m\r\n\x1b[0;32mI (350) heap_init: Initializing. RAM available for
dynamic allocation:\x1b[0m\r\n\x1b[0;32mI (353) heap_init: At 3FFAE6E0 len
00001920 (6 KiB): DRAM\x1b[0m\r\n\x1b[0;32mI (359) heap_init: At 3FFD4D08
len 0000B2F8 (44 KiB): DRAM\x1b[0m\r\n\x1b[0;32mI (366) heap_init: At
3FFE0440 len 00003BC0 (14 KiB): D/IRAM\x1b[0m\r\n\x1b[0;32mI (372)
heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM\x1b[0m\r\n\x1b[0;32mI
(378) heap_init: At 4008FB00 len 00010500 (65 KiB):
IRAM\x1b[0m\r\n\x1b[0;32mI (384) cpu_start: Pro cpu start user
code\x1b[0m\r\n\x1b[0;32mI (178) cpu_start: Starting scheduler on PRO
CPU.\x1b[0m\r\nOSError: [Errno 2] ENOENT\r\nMicroPython
v1.9.2-283-gdba3796e on 2017-10-27; ESP32 module with ESP32\r\nType
"help()" for more information.\r\n>>> '
Traceback (most recent call last):
File
"/Users/nmistry/.virtualenvs/uPython/lib/python3.6/site-packages/rshell/main.py",
line 1185, in connect
ip_address = socket.gethostbyname(port)
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/nmistry/.virtualenvs/uPython/bin/rshell", line 11, in
sys.exit(main())
File
"/Users/nmistry/.virtualenvs/uPython/lib/python3.6/site-packages/rshell/command_line.py",
line 4, in main
rshell.main.main()
File
"/Users/nmistry/.virtualenvs/uPython/lib/python3.6/site-packages/rshell/main.py",
line 2658, in main
real_main()
File
"/Users/nmistry/.virtualenvs/uPython/lib/python3.6/site-packages/rshell/main.py",
line 2620, in real_main
connect(args.port, baud=args.baud, wait=args.wait, user=args.user,
password=args.password)
File
"/Users/nmistry/.virtualenvs/uPython/lib/python3.6/site-packages/rshell/main.py",
line 1191, in connect
connect_serial(port, baud=baud, wait=wait)
File
"/Users/nmistry/.virtualenvs/uPython/lib/python3.6/site-packages/rshell/main.py",
line 1215, in connect_serial
dev = DeviceSerial(port, baud, wait)
File
"/Users/nmistry/.virtualenvs/uPython/lib/python3.6/site-packages/rshell/main.py",
line 1436, in *init*
Device.*init*(self, pyb)
File
"/Users/nmistry/.virtualenvs/uPython/lib/python3.6/site-packages/rshell/main.py",
line 1262, in *init*
self.has_buffer = self.remote_eval(test_buffer)
File
"/Users/nmistry/.virtualenvs/uPython/lib/python3.6/site-packages/rshell/main.py",
line 1353, in remote_eval
return eval(self.remote(func, *args, **kwargs))
File
"/Users/nmistry/.virtualenvs/uPython/lib/python3.6/site-packages/rshell/main.py",
line 1331, in remote
self.pyb.enter_raw_repl()
File
"/Users/nmistry/.virtualenvs/uPython/lib/python3.6/site-packages/rshell/pyboard.py",
line 187, in enter_raw_repl
raise PyboardError('could not enter raw repl')
rshell.pyboard.PyboardError: could not enter raw repl
(uPython) ➜ ~`
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAHyDNC2cFfMvz7ufkX5MyJ8MSi_wFyNks5tYlM4gaJpZM4OCq4b>
.
--
Dave Hylands
Peachland, BC, Canada
http://www.davehylands.com
|
I'm having the same issue as the OP: a brand new Wemos D1 Mini flashed with MicroPython 1.9.3 shows the same garbage before getting to the REPL (via plain ol'
As discussed, this causes
@dhylands, re: your comment about this being an issue in
Not sure what to fix (or whether anything can be "fixed" at this level)? |
I think that the error is this one:
You need to resolve that before rshell will connect. This is most likely due to a missing main.py (just a guess - I don't have an ESP32) |
I experienced this problem connecting to a Wemos D1 Mini Lite from a Macintosh. Adding a short delay in the enter_raw_repl() function in pyboard.py, as described at https://forum.micropython.org/viewtopic.php?t=3217#p19117 seems to fix the problem. |
The only thing that worked for me was changing the file "pyboard.py" in Python_path / Lib / site-packages / It worked for me in Windows10 with a wemos_oled_18650_battery board I am sorry for my bad english |
Are you talking about ampy or rshell? Your comment mentions editing an ampy file. |
My apologies, I mixed the themes. I have the same problem: "Could not enter raw repl" but when I use ampy from cmd on Windows. Anyway, I suppose that in the case of rshell, in the case of using python3 there is also an "egg" package with a "pyboard.py" file to edit, or it will be free in the "site-packages" folder, such as in python2 |
This works! I have the same issue with using ampy with my NodeMCU ESP8266, got the "could not enter raw repl" error on all my windows 10 machines at work. It works fine on OSX. But adding this line made it work! Thanks Sansanito!! |
I like rshell very much. but i meet the issue with ESP32- WROOM-32. I must hardware reset the ESP32 each time before want connect to ESP32 ,otherwise,would display "could not enter raw repl" . but for ESP8266, It's ok. sorry for my poor english. |
simplified to below code can reset ESP board when connecting, and no need hardware reset when reconnecting to ESP board on ESP8266 and ESP32 board. |
On my system runs: On my system rshell also works very unreliable. After I put a simple blink Test on the board
Steps to reproduce the problem:
After that if i erase the flash and flash the micropython firmware again everything works as expected until i uploaded At the same time
|
Fixes issue dhylands#27, see discussion there.
I had the same problem. When looking into it I found that the ili9341 driver I use does not deinit cleanly, which causes the following behaviour on Ctrl-D (soft reset):
The problem is that rshell, via pyboard, does the following when it goes to the raw REPL mode:
Apparently this soft-reset maintains the raw REPL status and does not revert to friendly REPL. But since my ESP32 crashes on the soft reset because the ili9341 driver doesn't cleanly unload, it doesn't get a raw REPL when it expects one. You'll notice the second time it looks for the raw REPL thing, it looks without the The soft reset is probably to unload anything that might be hogging memory. One might argue that this is a broken state on the board and that therefore rshell doesn't need to work, but this will lock out everyone that gets their board in a state where the soft-reset does not happen cleanly, although they have a perfectly working raw REPL. So I built a command line option |
If you want to try if
|
This is actually an issue and a response I posted on the ampy project. See ESP8266 Micropython "Could not enter raw repl" #19
I am creating this issue because it's exactly the same with rshell. This is for reference and workaround purposes.
I had been trying to solve the same problem with my ESP32 for two days now (I think I got the same issue on ESP8266 01 but I probably gave up). But then out of the blue I was able to make it work today.
So when I plugin the board on my Macbook 2013, that's when I get this unable to enter REPL issue. But as soon as I plug it in on my Raspberry Pi, I am able to run the same rshell commands without issues!
My immediate solution is:
Some interesting observations:
The text was updated successfully, but these errors were encountered: