Closed dannystaple closed 8 months ago
Removing #32 - we can do this with the NiMH AA's for now.
Note - I couldn't see an mpremote apt package, so pip install will work. User is probably good enough.
Mpremote is installed, but the Pi cannot find the Yukon when plugged in via USB.
danny@big-ole-yellow:~ $ mpremote devs
/dev/ttyAMA0 None 0000:0000 None None
I've verified I can reach it with MP remote from the MAC using a USB C->C cable. However, from the Pi 3A it must be a USB A->C cable.
Lsusb to list usb devices:
danny@big-ole-yellow:~ $ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Hypotheses:
Grabbed a standard Pico on a USB-micro, and checked that mpremote ls
works from my laptop. I've plugged into the Raspberry Pi, and this works first time. I am highly suspecting that none of those USB-A->C cables are good.
Made that work with the yukon with a known good USB micro cable and USB micro to C adaptor. Rubbish cables. A new tester is on the way for that.
With debug, looks like this:
--> Beginning operation run...
--> Starting operation: Install mpremote
[pyinfra.api.operations] Starting operation {'Install mpremote'} on big-ole-yellow.local
[big-ole-yellow.local] No changes
--> Starting operation: Copy test file
[pyinfra.api.operations] Starting operation {'Copy test file'} on big-ole-yellow.local
[pyinfra.connectors.ssh] Attempting upload of /Users/danielstaple/git_work/orionrobots/piwars_2024_disasterzone/robot/services/pimoroni_yukon/rp2040/test_flash_leds.py to mpremote/main.py
[pyinfra.connectors.ssh] Running command on big-ole-yellow.local: (pty=None) sh -c '/home/danny/.local/bin/mpremote cp mpremote/main.py :main.py'
[pyinfra.connectors.ssh] Waiting for exit status...
[pyinfra.connectors.ssh] Command exit status: 0
[big-ole-yellow.local] Success
--> Starting operation: Reset the Yukon
[pyinfra.api.operations] Starting operation {'Reset the Yukon'} on big-ole-yellow.local
[pyinfra.connectors.ssh] Running command on big-ole-yellow.local: (pty=None) sh -c '/home/danny/.local/bin/mpremote reset'
[pyinfra.connectors.ssh] Waiting for exit status...
[pyinfra.connectors.ssh] Command exit status: 0
[big-ole-yellow.local] Success
--> Results:
Groups: robots / inventory
[big-ole-yellow.local] Changed: 2 No change: 1 Errors: 0
I was able to do the full trip deploy, make changes, and deploy again. There's an issue if the file has the same size (which results in no change), which can be addressed to complete this.
We can get the no change condition to work right now, using sha1 digests of the files:
--> Beginning operation run...
--> Starting operation: Install mpremote
[big-ole-yellow.local] No changes
--> Starting operation: Copy test file
[big-ole-yellow.local] No changes
--> Results:
Groups: inventory / robots
[big-ole-yellow.local] Changed: 0 No change: 2 Errors: 0
Make a simple test, pre-empting the Yukon service to deploy code to it. This route will be desktop-via pyinfra->Raspberry PI-via mpremote->Yukon.
Pyinfra will drive MPRemote to deploy code to the Yukon.
Definition of Ready
Definition of done