pyboard tool error

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
manos
Posts: 27
Joined: Mon Sep 28, 2020 9:03 am

pyboard tool error

Post by manos » Tue Nov 10, 2020 9:24 pm

Hey,

it seems like I can't access the files stored in flash of my xbee 3, using the pyboard tool.
Although, I can use a command like this:
pyboard --device /dev/ttyUSB0 -b 9600 -c 'print(1+1)'
(which means that the pyboard tool is communicating with micropython's repl in my xbee), the following doesn't work:
pyboard --device /dev/ttyUSB0 -b 9600 -f ls
with the following error:
pyboard: error: unrecognized arguments: -f
which I am pretty sure that f flag is the correct one for filesystem operations...

Any help is welcomed!

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

Re: pyboard tool error

Post by Roberthh » Wed Nov 11, 2020 7:07 am

It looks like you are using an old version of pyboard.py. I am using the new mpr.py tool, based on pyboard.py with the XBEE 3 and it is working very well. For mpr.py you have to update pyboard.py too.
mpr.py: https://github.com/micropython/micropyt ... 6375/files
pyboard.py: https://github.com/micropython/micropyt ... pyboard.py

manos
Posts: 27
Joined: Mon Sep 28, 2020 9:03 am

Re: pyboard tool error

Post by manos » Wed Nov 11, 2020 8:54 am

Hi,

I am having some trouble in installing mpr.
My attempt is:
python3 -m pip install mpr
(in xubuntu)
and I get:
Collecting mpr
Could not find a version that satisfies the requirement mpr (from versions: )
No matching distribution found for mpr

Do you have any thoughts?
Thanks for your patience and help!

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

Re: pyboard tool error

Post by jimmo » Wed Nov 11, 2020 9:33 am

manos wrote:
Wed Nov 11, 2020 8:54 am
python3 -m pip install mpr
mpr isn't a pypi package, so you won't be able to install it with pip.

It's still in development, and the PR hasn't been merged yet. As roberthh said, it's available at the in-progress PR here: https://github.com/micropython/micropyt ... 6375/files

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

Re: pyboard tool error

Post by Roberthh » Wed Nov 11, 2020 12:42 pm

You can just download or paste the files from the links I gave. It is just the two files which you need.

manos
Posts: 27
Joined: Mon Sep 28, 2020 9:03 am

Re: pyboard tool error

Post by manos » Wed Nov 11, 2020 2:09 pm

Thank you both for your replies!

Just because I am a noob.
Do I download them somewhere specific?
Then, do I import it or call it somehow through pyboard?

Thanks in advance

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

Re: pyboard tool error

Post by Roberthh » Wed Nov 11, 2020 3:17 pm

You can paste/copy the files from the mentioned links into a text editor and store them as pyboard.py and mpr.py in the same directory. Then you can alwas start them with

python3 mpr.py argument(s)
or
python3 pyboard.py argument(s)

On Windows, it may be just python. On Linux/Mac, if you have set the executable flag, you can also start it with:

./mpr.py argument(s)
or
./pyboard.py argumet(s)

manos
Posts: 27
Joined: Mon Sep 28, 2020 9:03 am

Re: pyboard tool error

Post by manos » Thu Nov 12, 2020 8:41 am

Thanks for the clarification!

Pyboard seems to work fine!
Mpr gives me some trouble time (i.e when I try to connect to the REPL, it just returns:
Connected to MicroPython at /dev/ttyUSB0
Use Ctrl-] to exit this shell
but gives no prompt and it seems that no matter what I type, I cannot make it show me a prompt or what I type or execute a command.

Anyway, I guess I will have to experiment a little bit (maybe try specify the baud rate).
Thank you for your help

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

Re: pyboard tool error

Post by Roberthh » Thu Nov 12, 2020 9:20 am

If you look into the PR at https://github.com/micropython/micropython/pull/6375, there are some examples of using it.

Post Reply