Painless geany editing of SD files for PYBv1.1

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
mplichota
Posts: 1
Joined: Tue Dec 04, 2018 3:53 pm

Painless geany editing of SD files for PYBv1.1

Post by mplichota » Tue Dec 04, 2018 4:23 pm

My host is a Raspberry Pi running raspian. I keep master copies of the code destined for the target in ~/uPy.

The script to run the console interface is in ~/bin/uPcomm:
[code]
#!/bin/sh
# connect to uPy board
screen /dev/ttyACM0
[/code]

The script to edit the local copy of 1 file and copy it to the target is in ~/bin/uPcomm:
[code]
#!/bin/sh
# edit and sync 1 source file for the uPy board
# the uPy board (PYBv1.1) SD card must be mounted
uPYBOARD_MNT=/media/pi/F980-F79B # Rasperry Pi mount point
cd ~/uPy
geany $1 # edit, save, close window, quit
xmessage -nearmouse "Quit any running uPy board program, then soft reset the uPy board by sending a Ctrl-d" 2> /dev/null
cp $1 $uPYBOARD_MNT
sync -d $uPYBOARD_MNT/$1
[/code]

My policy is to always have a uSD device inserted on the target, so I have not tested this using the on-chip /flash directory.

Post Reply