Hi,
I'm just wondering if there are any methods/projects that would allow me to send files and commands to the PyBoard. I would like to work in a directory on my computer (so I can use git) but not manually copy and paste the files to the pyboard every time. I imagine one command that:
git add .
Pushes the files from local to pyboard
Restarts the pyboard (ctrl+d)
starts displaying the output of the pyboard
I'd write the script myself but I'm scared of changing the write permissions of my /dev/ttyACM0 file as I don't have any experience doing this type of stuff.
If there is an existing/similar method, could someone please point me in that direction. I fear I lack the jargon to google the correct question.
Thanks,
Kip
Push files from local to PyBoard
Re: Push files from local to PyBoard
I mostly use the pyboard.py tool that is part of the MicroPython repo (which is great for testing short scripts because it never writes them to the filesystem at all), but I think what you probably want is https://github.com/dhylands/rshell/blob ... README.rst
Re: Push files from local to PyBoard
You may also be interested in the following tool: https://github.com/micropython/micropython/pull/3034
Re: Push files from local to PyBoard
Great, that's just what I needed!
If anyone is interested, I did the following to get what I wanted:
1. Install rshell
2. Create a custom command by making a upyrun file in /usr/bin/
3. Add the following commands to the upyrun file:
I import main to get the main.py file running on the pyboard
Change /sd to /flash if you are not using an sd card
4. make command file executable
5. run the command in the directory that your files are kept on your machine and that are to be reproduced on the pyboard.
This is great because the files are ready to be used straight away unlike when you are editing the files directly from the PyBoard as it can take some time for the files to update after saving.
FYI: to stop code running on the pyboard use ctrl+c and to exit the repl use ctrl+x
If anyone is interested, I did the following to get what I wanted:
1. Install rshell
Code: Select all
sudo pip3 install rshell
Code: Select all
sudo nano /usr/bin/upyrun
Code: Select all
git add .
rshell cp *.py /sd
rshell repl pyboard import main
Change /sd to /flash if you are not using an sd card
4. make command file executable
Code: Select all
sudo chmod +x /usr/bin/upyrun
5. run the command in the directory that your files are kept on your machine and that are to be reproduced on the pyboard.
Code: Select all
sudo upyrun
FYI: to stop code running on the pyboard use ctrl+c and to exit the repl use ctrl+x