S&B Volcano vaporizer remote control with Pi Pico W
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

flash.sh 424B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. set -euo pipefail
  3. SERIAL=/dev/serial/by-id/usb-xythobuz_VolcanoRC_*
  4. DISK=/dev/disk/by-label/RPI-RP2
  5. MOUNT=/mnt/tmp
  6. if [ ! -e $DISK ]
  7. then
  8. echo Resetting Raspberry Pi Pico
  9. echo -n -e "\\x18" > $SERIAL
  10. fi
  11. echo -n Waiting for disk to appear
  12. until [ -e $DISK ]
  13. do
  14. echo -n .
  15. sleep 1
  16. done
  17. echo
  18. echo Mounting bootloader disk
  19. sudo mount $DISK $MOUNT
  20. echo Copying binary
  21. sudo cp $1 $MOUNT
  22. echo Done