how to read/write files without ampy

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
kbb732
Posts: 3
Joined: Wed Jul 29, 2020 6:43 pm

how to read/write files without ampy

Post by kbb732 » Wed Jul 29, 2020 6:50 pm

hallo
i'm new in micropython but, i can program in python
i want to put files into fs esp32 but only i see the tool ampy
but... this not run for me
there's another tool for this??

thank you.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: how to read/write files without ampy

Post by Roberthh » Wed Jul 29, 2020 6:59 pm

You can use pyboard.py from this place: https://github.com/micropython/micropyt ... ster/tools
or rshell: https://github.com/dhylands/rshell
or any of the IDE's that exists, like thonny, if you search in the forum for IDE.

kbb732
Posts: 3
Joined: Wed Jul 29, 2020 6:43 pm

Re: how to read/write files without ampy

Post by kbb732 » Wed Jul 29, 2020 8:02 pm

ok, thank you i will prove rshell, pyboard no run in my pc.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: how to read/write files without ampy

Post by Roberthh » Wed Jul 29, 2020 8:19 pm

pyboard.py is a pure python script. It should run with python3. What's the error message?
Edit: You migth have to install pyserial:

pip install pyserial

kbb732
Posts: 3
Joined: Wed Jul 29, 2020 6:43 pm

Re: how to read/write files without ampy

Post by kbb732 » Wed Jul 29, 2020 8:55 pm

Gaming-3:~/Descargas/micropython-1.12/tools$ python3 pyboard.py --device /dev/ttyUSB0 ls
^CTraceback (most recent call last):
File "pyboard.py", line 600, in <module>
main()
File "pyboard.py", line 540, in main
pyb.enter_raw_repl()
File "pyboard.py", line 299, in enter_raw_repl
data = self.read_until(1, b'raw REPL; CTRL-B to exit\r\n>')
File "pyboard.py", line 275, in read_until
new_data = self.serial.read(1)
File "/home/adrian/.local/lib/python3.6/site-packages/serial/serialposix.py", line 483, in read
ready, _, _ = select.select([self.fd, self.pipe_abort_read_r], [], [], timeout.time_left())


don't show me the directories, reject any command and timeout

i did prove thonny and connect to the esp32, i can get files from esp32 but... i dont understand how to upload

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: how to read/write files without ampy

Post by jimmo » Thu Jul 30, 2020 12:01 am

Just to be sure -- if you run

Code: Select all

miniterm.py /dev/ttyUSB0 115200
(which you should have if you've installed pyserial)

then you're able to connect to the REPL?

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: how to read/write files without ampy

Post by Roberthh » Thu Jul 30, 2020 5:33 am

Does it worl if ouy run pyboard.py or minnterm as sudo? If yes, you have to set the access rights. What is the result of:

ls -l /dev/ttyUSB0

and which Linux version are you using?

dcarson1661
Posts: 3
Joined: Thu Jul 30, 2020 3:54 pm

Re: how to read/write files without ampy

Post by dcarson1661 » Thu Jul 30, 2020 4:47 pm

Check out uPyCraft! There is a nice tutorial you can find here: https://randomnerdtutorials.com/install ... tructions/

Post Reply