mpremote mount fails reading binary file
Checks
-
I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.
-
I've searched for existing issues matching this bug, and didn't find any.
Port, board and/or hardware
RP2, Pyboard 1.1
MicroPython version
MicroPython v1.22.0 on 2023-12-27; Raspberry Pi Pico with RP2040
Reproduction
Create a file rats15.py on the PC:
import os
fn = "delete_me"
with open(fn, "wb") as f:
f.write(b"hello\n\xde\xad\xbe\xef")
with open(fn, "rb") as f:
print(f.readline())
print(f.read(4))
os.unlink(fn)
Run mpremote
$ mpremote mount .
At the REPL issue
import rats15
Expected behaviour
>>> import rats15
b'hello\n'
b'\xde\xad\xbe\xef'
>>>
This occurs if the script is run under CPython, under the Unix build, or if run locally on a MP target.
Observed behaviour
When run as described above via mpremote mount .:
MicroPython v1.22.2 on 2024-02-22; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>> import rats15
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "rats15.py", line 7, in <module>
File "<stdin>", line 147, in readline
TypeError: unsupported types for __add__: 'str', 'bytes'
>>>
Additional Information
mpremote is V1.22.0. The fault occurs on readline(). It originally became evident accessing a pgm graphics file which contains four lines of \n terminated ASCII text followed by binary data
SAMD51 on Wio Terminal : No file transfer/write + _boot.py error for firmware v1.21 & v1.22 (working on v1.20) -> Was Wio Terminal hardware issue
Checks
-
I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.
-
I've searched for existing issues matching this bug, and didn't find any.
Port, board and/or hardware
SAMD51 : Wio Terminal (SeeedStudio)
MicroPython version
MicroPython v1.22.2 on 2024-02-22; Wio Terminal D51R with SAMD51P19A
Also MicroPython v1.21 for same plateform
Reproduction
Make Soft Reboot show the error
MicroPython v1.22.2 on 2024-02-22; Wio Terminal D51R with SAMD51P19A
MPY: soft reboot
Traceback (most recent call last):
File "_boot.py", line 14, in <module>
OSError: 28
Making a file copy with mpremote fs cp ... or with Thonny IDE fails with an error message
Expected behaviour
Being able to copy files to the MicroPython file system.
Observed behaviour
Error message related to file handling
$ mpremote fs cp readme.md :readme.md
cp readme.md :readme.md
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV
Additional Information
Works on MicroPython v1.20 for Wio Terminal
Fails on MicroPython v1.21 for Wio Terminal
Fails on MicroPython v1.22 for Wio Terminal