From 67fba166813c9226908694d779d21571bf00e744 Mon Sep 17 00:00:00 2001 From: docgalaxyblock Date: Thu, 14 Sep 2023 14:33:51 +0200 Subject: [PATCH] add: implement OpenMowerOS-Tools --- .../root/home/pi/fetch_and_upload_firmware.sh | 19 ------------------- .../filesystem/root/home/pi/start_openocd.sh | 9 --------- .../root/home/pi/start_ros-debug_bash.sh | 5 ----- .../filesystem/root/home/pi/start_ros_bash.sh | 5 ----- .../root/home/pi/upload_firmware.sh | 10 ---------- src/modules/openmower/start_chroot_script | 4 +++- 6 files changed, 3 insertions(+), 49 deletions(-) delete mode 100644 src/modules/openmower/filesystem/root/home/pi/fetch_and_upload_firmware.sh delete mode 100644 src/modules/openmower/filesystem/root/home/pi/start_openocd.sh delete mode 100644 src/modules/openmower/filesystem/root/home/pi/start_ros-debug_bash.sh delete mode 100644 src/modules/openmower/filesystem/root/home/pi/start_ros_bash.sh delete mode 100644 src/modules/openmower/filesystem/root/home/pi/upload_firmware.sh diff --git a/src/modules/openmower/filesystem/root/home/pi/fetch_and_upload_firmware.sh b/src/modules/openmower/filesystem/root/home/pi/fetch_and_upload_firmware.sh deleted file mode 100644 index f126aef..0000000 --- a/src/modules/openmower/filesystem/root/home/pi/fetch_and_upload_firmware.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -source /boot/openmower/mower_config - -# remove old firmware -rm -rf firmware_download -mkdir firmware_download -cd firmware_download - -# Download the latest firmware -echo "Fetching Firmware" -wget https://github.com/ClemensElflein/OpenMower/releases/download/latest/firmware.zip - -unzip firmware.zip - -cd .. - -echo "Flashing Firmware: ./firmware_download/firmware/$OM_HARDWARE_VERSION/firmware.elf" -sudo ./upload_firmware.sh ./firmware_download/firmware/$OM_HARDWARE_VERSION/firmware.elf diff --git a/src/modules/openmower/filesystem/root/home/pi/start_openocd.sh b/src/modules/openmower/filesystem/root/home/pi/start_openocd.sh deleted file mode 100644 index f5697e1..0000000 --- a/src/modules/openmower/filesystem/root/home/pi/start_openocd.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# This script starts OpenOCD on the pi and allows external connections. -# This way you can use VS code to remotely debug the Pico code. - -echo "10" > /sys/class/gpio/export -echo "out" > /sys/class/gpio/gpio10/direction -echo "1" > /sys/class/gpio/gpio10/value -openocd -f interface/raspberrypi-swd.cfg -f target/rp2040.cfg -c "bindto 0.0.0.0" diff --git a/src/modules/openmower/filesystem/root/home/pi/start_ros-debug_bash.sh b/src/modules/openmower/filesystem/root/home/pi/start_ros-debug_bash.sh deleted file mode 100644 index 8d93ffc..0000000 --- a/src/modules/openmower/filesystem/root/home/pi/start_ros-debug_bash.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# Starts a bash in the docker container. -# Use this for ROS specific commands (e.g. rostopic echo) - -sudo podman exec -it openmower-debug /openmower_entrypoint.sh /bin/bash diff --git a/src/modules/openmower/filesystem/root/home/pi/start_ros_bash.sh b/src/modules/openmower/filesystem/root/home/pi/start_ros_bash.sh deleted file mode 100644 index 1cb5ae6..0000000 --- a/src/modules/openmower/filesystem/root/home/pi/start_ros_bash.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# Starts a bash in the docker container. -# Use this for ROS specific commands (e.g. rostopic echo) - -sudo podman exec -it openmower /openmower_entrypoint.sh /bin/bash diff --git a/src/modules/openmower/filesystem/root/home/pi/upload_firmware.sh b/src/modules/openmower/filesystem/root/home/pi/upload_firmware.sh deleted file mode 100644 index 73635ac..0000000 --- a/src/modules/openmower/filesystem/root/home/pi/upload_firmware.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# This script uploads new firmware to the Pico. -# You need to provide the .elf file, not the .uf2 -# run as root! - -echo "10" > /sys/class/gpio/export -echo "out" > /sys/class/gpio/gpio10/direction -echo "1" > /sys/class/gpio/gpio10/value -openocd -f interface/raspberrypi-swd.cfg -f target/rp2040.cfg -c "program $1 verify reset exit" diff --git a/src/modules/openmower/start_chroot_script b/src/modules/openmower/start_chroot_script index 318d1e3..7a610e2 100644 --- a/src/modules/openmower/start_chroot_script +++ b/src/modules/openmower/start_chroot_script @@ -15,8 +15,10 @@ install_cleanup_trap echo_green "Copying files to root filesystem and applying permissions..." unpack /filesystem/root / + +echo_green "Cloning OpenMowerOS-Tools..." +git clone https://github.com/ClemensElflein/OMIAUH /home/pi/openmoweros-tools chown -R pi:pi /home/pi -chmod +x /home/pi/*.sh cp /etc/comitup.conf.example /boot/openmower/comitup-default-example.txt cp /boot/openmower/hotspot.txt /boot/openmower/hotspot-example.txt