Open jedie opened 6 years ago
When exactly do you get the error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV
? Just waiting in the REPL, or executing some command?
e.g.: sending a file with thonny results in:
>>> %upload main.py /main.py
Traceback (most recent call last):
File "/home/jens/repos/thonny-Env/src/thonny/thonny/plugins/micropython/__init__.py", line 860, in _check_and_upload
self._upload(source, target)
File "/home/jens/repos/thonny-Env/src/thonny/thonny/plugins/micropython/__init__.py", line 867, in _upload
self._upload_via_serial(source, target)
File "/home/jens/repos/thonny-Env/src/thonny/thonny/plugins/micropython/__init__.py", line 878, in _upload_via_serial
self._execute_and_expect_empty_response("__upf = open(%r, 'wb')" % target)
File "/home/jens/repos/thonny-Env/src/thonny/thonny/plugins/micropython/__init__.py", line 503, in _execute_and_expect_empty_response
assert len(err) == 0, "Error was " + repr(err)
AssertionError: Error was bytearray(b'Traceback (most recent call last):\r\n File "<stdin>", line 1, in <module>\r\nOSError: [Errno 19] ENODEV\r\n')
>>>
But something like this works:
>>> import os
>>> os.listdir()
['boot.py']
>>> open("boot.py", "r").read()
"# This file is executed on every boot (including wake-boot from deepsleep)\nimport sys\nsys.path[1] = '/flash/lib'\n"
>>> open("main.py", "w").write("#test")
5
>>> open("main.py", "r").read()
'#test'
I also try to send files via rshell doesn't work:
+ rshell -p /dev/ttyUSB0 rsync -v . /pyboard
Connecting to /dev/ttyUSB0 ...
Adding /pyboard/crossbar_demo.py
timed out or error in transfer to remote
If i add --debug i can see that the timeout appears in:
----- About to send 2174 bytes of code to the pyboard -----
def recv_file_from_host(src_file, dst_filename, filesize, dst_mode='wb'):
...
How can I better find out where the problem appears?
Sorry, I've never used thonny, rshell was reported to work, but I'm not using it. I can only recommend to use FTPServer for file transfer.
Great idea. I will test it. But it would be interesting what happens in thonny. I have use ist with baseline micropython
EDIT: I also report it here: https://bitbucket.org/plas/thonny/issues/540/upload-doesnt-work-with-lobo-micropython
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV
Comes from: open("/foo_bar.py", "wb")
It will work, if i change the file path from '/foo_bar.py' to 'foo_bar.py'
The root of the internal FS is /flash/
.
So you have either to use the full path "/flash/foo_bar.py"
or the relative to your current directory "/foo_bar.py"
.
OK... Then this can be closed... But: Is it possible to change the OSError: [Errno 19] ENODEV
message to something more appropriate? e.g.: OSError: [Errno 19] Target not writable!
ENODEV
is a standard error code (OS error) which means "No such device" and will be issued if some requested device (which may be file, but also something else) cannot be accessed.
It would be impractical to generate more descriptive messages for all possible cases.
Ah ok! Good to know...
But can be ENODEV
renamed to No such device
?
I have a ODROID-GO and whant to use microPython...
Specs from https://github.com/hardkernel/ODROID-GO-MicroPython :
So i guess esp32_psram_all is the best choice?!?
I made this:
MicroPython_ESP32_psRAM_LoBo/MicroPython_BUILD/firmware/esp32_psram_all$ ../flash.sh
And the REPL works. But i get errors like:
The boot output is: