From f0879346d238cdddf50c5ee93776e37c78eab7e5 Mon Sep 17 00:00:00 2001 From: mklomp Date: Tue, 6 Dec 2022 12:11:34 +0100 Subject: [PATCH 001/353] Disabled ROS installation --- install_mirte.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_mirte.sh b/install_mirte.sh index e1ee3c0..29c5eb5 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -54,8 +54,8 @@ cd $MIRTE_SRC_DIR/mirte-install-scripts ./install_jupyter_ros.sh # Install Mirte ROS packages -cd $MIRTE_SRC_DIR/mirte-install-scripts -./install_ROS.sh +#cd $MIRTE_SRC_DIR/mirte-install-scripts +#./install_ROS.sh # Install numpy pip3 install numpy From 135a763a093ea7695cc81eb1948957d18c6caa46 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Mon, 13 Mar 2023 19:16:07 +0000 Subject: [PATCH 002/353] Temp diables installing netplaio due to crash --- network_install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/network_install.sh b/network_install.sh index e8b5f1d..474ff6c 100755 --- a/network_install.sh +++ b/network_install.sh @@ -8,11 +8,11 @@ systemctl disable hostapd sed -i 's/#DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf # Install netplan (not installed on armbian) and networmanager (not installed by Raspberry) -sudo apt install -y netplan.io +#sudo apt install -y netplan.io sudo apt install -y network-manager -sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/50-cloud-init.yaml /etc/netplan/ -sudo netplan apply -sudo apt purge -y ifupdown +#sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/50-cloud-init.yaml /etc/netplan/ +#sudo netplan apply +#sudo apt purge -y ifupdown # Fix for bug in systemd-resolved # (https://askubuntu.com/questions/973017/wrong-nameserver-set-by-resolvconf-and-networkmanager) From c84669a94da8f28a66c05da5cec6f5e0d2d492aa Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Mon, 20 Mar 2023 12:53:03 +0000 Subject: [PATCH 003/353] Added ROS2 installer --- install_ROS2.sh | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 install_ROS2.sh diff --git a/install_ROS2.sh b/install_ROS2.sh new file mode 100755 index 0000000..ffd9c7f --- /dev/null +++ b/install_ROS2.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +#TODO: get this as a parameter +MIRTE_SRC_DIR=/usr/local/src/mirte + +# Install ROS Noetic +sudo apt install software-properties-common -y +sudo add-apt-repository universe -y +sudo apt update && sudo apt install curl -y +sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null +sudo apt update +sudo apt upgrade -y +sudo apt install ros-humble-ros-base +sudo apt install ros-humble-xacro +sudo apt install ros-dev-tools +grep -qxF "source /opt/ros/humble/setup.bash" /home/mirte/.bashrc || echo "source /opt/ros/humble/setup.bash" >> /home/mirte/.bashrc +source /opt/ros/humble/setup.bash +sudo rosdep init +rosdep update + +# Install computer vision libraries +#TODO: make dependecies of ROS package +sudo apt install -y python3-pip python3-wheel python3-setuptools python3-opencv libzbar0 +sudo pip3 install pyzbar + +# Move custom settings to writabel filesystem +#cp $MIRTE_SRC_DIR/mirte-ros-packages/mirte_telemetrix/config/mirte_user_settings.yaml /home/mirte/.user_settings.yaml +#rm $MIRTE_SRC_DIR/mirte-ros-packages/mirte_telemetrix/config/mirte_user_settings.yaml +#ln -s /home/mirte/.user_settings.yaml $MIRTE_SRC_DIR/mirte-ros-packages/config/mirte_user_settings.yaml + +# Install Mirte ROS package +mkdir -p /home/mirte/mirte_ws/src +cd /home/mirte/mirte_ws/src +ln -s $MIRTE_SRC_DIR/mirte-ros-packages . +cd .. +rosdep install -y --from-paths src/ --ignore-src --rosdistro humble +colcon build +grep -qxF "source /home/mirte/mirte_ws/install/setup.bash" /home/mirte/.bashrc || echo "source /home/mirte/mirte_ws/install/setup.bash" >> /home/mirte/.bashrc +source /home/mirte/mirte_ws/install/setup.bash + +# install missing python dependencies rosbridge +#sudo apt install -y libffi-dev libjpeg-dev zlib1g-dev +#sudo pip3 install twisted pyOpenSSL autobahn tornado pymongo + +# Add systemd service to start ROS nodes +sudo rm /lib/systemd/system/mirte-ros.service +sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-ros.service /lib/systemd/system/ + +sudo systemctl daemon-reload +sudo systemctl stop mirte-ros || /bin/true +sudo systemctl start mirte-ros +sudo systemctl enable mirte-ros + +sudo usermod -a -G video mirte +sudo adduser mirte dialout +python3 -m pip install telemetrix-rpi-pico + +# Install OLED dependencies (adafruit dependecies often break, so explicityle set to versions) +sudo apt install -y python3-bitstring libfreetype6-dev libjpeg-dev zlib1g-dev fonts-dejavu +sudo pip3 install adafruit-circuitpython-busdevice==5.1.1 adafruit-circuitpython-framebuf==1.4.9 adafruit-circuitpython-typing==1.7.0 Adafruit-PlatformDetect==3.22.1 +sudo pip3 install pillow adafruit-circuitpython-ssd1306==2.12.1 From 1e166146d1d043abee920e16844264a177094f3a Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Tue, 8 Aug 2023 12:03:51 +0200 Subject: [PATCH 004/353] Changed ROS2 installaion to remove apt-key --- download_repos.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/download_repos.sh b/download_repos.sh index 302a7cb..8a95276 100755 --- a/download_repos.sh +++ b/download_repos.sh @@ -1,8 +1,8 @@ #!/bin/bash # Install vcstool -sudo sh -c 'echo "deb http://ftp.tudelft.nl/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' -curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add - +sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null sudo apt-get update sudo apt-get install -y python3-vcstool From f303cda509dff1afc4d909299f2be60fd8c8887c Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Tue, 8 Aug 2023 12:15:59 +0200 Subject: [PATCH 005/353] UPdating python3.8 to default 3.10 --- install_mirte.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install_mirte.sh b/install_mirte.sh index 29c5eb5..c5b23b0 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -18,8 +18,8 @@ cp download_repos.sh $MIRTE_SRC_DIR cd $MIRTE_SRC_DIR ./download_repos.sh -# Install dependecnies to be able to run python3.8 -sudo apt install -y python3.8 python3-pip python3-setuptools +# Install dependencies to be able to run python3 (3.10 default) +sudo apt install -y python3 python3-pip python3-setuptools # Set piwheels as pip repo sudo bash -c "echo '[global]' > /etc/pip.conf" @@ -68,7 +68,7 @@ fi # Install Mirte documentation cd $MIRTE_SRC_DIR/mirte-documentation -sudo apt install -y python3.8-venv libenchant-dev +sudo apt install -y python3-venv libenchant-dev python3 -m venv docs-env source docs-env/bin/activate pip install docutils==0.16.0 sphinx-tabs==3.2.0 #TODO: use files to freeze versions From 34503ff31cea51b8e766b2cd331f8ba63bb94722 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 31 Oct 2023 17:19:31 +0100 Subject: [PATCH 006/353] Start install vscode --- install_vscode.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 install_vscode.sh diff --git a/install_vscode.sh b/install_vscode.sh new file mode 100644 index 0000000..767a77d --- /dev/null +++ b/install_vscode.sh @@ -0,0 +1,23 @@ +#!/bin/bash +MIRTE_SRC_DIR=/usr/local/src/mirte + +cd $MIRTE_SRC_DIR +mkdir vscode +cd vscode +wget https://gist.githubusercontent.com/b01/0a16b6645ab7921b0910603dfb85e4fb/raw/ea48d972a176b90b3956de59eb7a43da9be86ec5/download-vs-code-server.sh +chmod +x download-vs-code-server.sh +sudo -u mirte $MIRTE_SRC_DIR/vscode/download-vs-code-server.sh + +# For the website: +Wget -O vscode_cli.tar.gz https://az764295.vo.msecnd.net/stable/f1b07bd25dfad64b0167beb15359ae573aecd2cc/vscode_cli_alpine_arm64_cli.tar.gz +Tar -xvf vscode_cli.tar.gz +./code update + +./code serve-web --port 8005 --host 0.0.0.0 --without-connection-token --accept-server-license-terms & +code_pid=$! +until [ "$(wget -qO- http://localhost:8005/ | wc --bytes )" -gt "1000" ]; do + sleep 5 +done +kill $code_pid + +# TODO: add system to start it! \ No newline at end of file From e68bb52a4197d4a2f967282680b3f897ce604479 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 1 Nov 2023 16:05:03 +0100 Subject: [PATCH 007/353] Add base_url to jupyter launch script to fix ip:80/jupyter/ --- nginx.conf | 2 +- services/mirte-jupyter.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index ca6877b..19e1c2d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -34,7 +34,7 @@ http { # Jupyter Notebook location /jupyter/ { - proxy_pass http://localhost:8888/; + proxy_pass http://localhost:8888/jupyter/; } # Wifi Connect diff --git a/services/mirte-jupyter.service b/services/mirte-jupyter.service index 2bbeb28..743102f 100644 --- a/services/mirte-jupyter.service +++ b/services/mirte-jupyter.service @@ -6,7 +6,7 @@ After=network-online.target [Service] User=mirte -ExecStart=/bin/bash -c "source /opt/ros/noetic/setup.bash && source /home/mirte/mirte_ws/devel/setup.bash && cd /home/mirte/jupyter-ros/notebooks && source /home/mirte/jupyter/bin/activate && jupyter nbextension enable --py --sys-prefix jupyros && jupyter notebook --ip='0.0.0.0' --NotebookApp.token='' --NotebookApp.password=''" +ExecStart=/bin/bash -c "source /opt/ros/noetic/setup.bash && source /home/mirte/mirte_ws/devel/setup.bash && cd /home/mirte/jupyter-ros/notebooks && source /home/mirte/jupyter/bin/activate && jupyter nbextension enable --py --sys-prefix jupyros && jupyter notebook --ip='0.0.0.0' --NotebookApp.token='' --NotebookApp.password='' --NotebookApp.base_url='/jupyter/'" [Install] WantedBy=multi-user.target From fd093e630bef15cb906599ad56b427f576dcf7d6 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 1 Nov 2023 16:33:45 +0100 Subject: [PATCH 008/353] Fix ros-video subfolder proxy --- nginx.conf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 19e1c2d..b6bb132 100644 --- a/nginx.conf +++ b/nginx.conf @@ -29,7 +29,11 @@ http { # The ROS video server location /ros-video/ { - proxy_pass http://localhost:8181/; + proxy_pass http://localhost:8181/; + sub_filter "/snapshot" "/ros-video/snapshot"; # convert all /snapshot... texts(url) to /ros-video/snapshot... + sub_filter "/stream" "/ros-video/stream"; # convert /stream... urls to /ros-video/stream... Used for the stream_viewer page and actual stream. + sub_filter_once off; + sub_filter_types "*"; } # Jupyter Notebook From 9559a3a2c30ebaffc5f96ab55324029d4f979e71 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Fri, 3 Nov 2023 12:52:14 +0100 Subject: [PATCH 009/353] change nginx install to 'default' method --- install_web.sh | 3 +- nginx.conf | 89 +++++++++++++++++++++----------------------------- 2 files changed, 39 insertions(+), 53 deletions(-) diff --git a/install_web.sh b/install_web.sh index dbfb07c..fc75fef 100755 --- a/install_web.sh +++ b/install_web.sh @@ -34,7 +34,8 @@ sudo apt install -y strace # Install nginx (as reverse proxy to all services) sudo apt install -y nginx -sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/nginx.conf /etc/nginx/ +sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/nginx.conf /etc/nginx/sites-available/mirte.conf +sudo ln /etc/nginx/sites-available/mirte.conf /etc/nginx/sites-enabled/ # Add systemd service sudo rm /lib/systemd/system/mirte-web-interface.service diff --git a/nginx.conf b/nginx.conf index b6bb132..406add1 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,26 +1,13 @@ -user www-data; -worker_processes auto; -pid /run/nginx.pid; -include /etc/nginx/modules-enabled/*.conf; - -events { - worker_connections 768; - # multi_accept on; -} - -http { +server { - - server { - - gzip_min_length 1000; - gzip_buffers 4 8k; - gzip_http_version 1.0; - gzip_disable "msie6"; - gzip_types text/plain text/css application/javascript; - gzip_vary on; - gzip on; - gzip_proxied any; + gzip_min_length 1000; + gzip_buffers 4 8k; + gzip_http_version 1.0; + gzip_disable "msie6"; + gzip_types text/plain text/css application/javascript; + gzip_vary on; + gzip on; + gzip_proxied any; # The NodeJs (Vue) webserver location / { @@ -38,66 +25,64 @@ http { # Jupyter Notebook location /jupyter/ { - proxy_pass http://localhost:8888/jupyter/; + proxy_pass http://localhost:8888/jupyter/; } # Wifi Connect location /wifi-connect/ { - # Wifi connect does not map to localhost - proxy_pass http://192.168.42.1:8080/; + # Wifi connect does not map to localhost + proxy_pass http://192.168.42.1:8080/; } # Sphinx RTD Docs location /docs/ { - include /etc/nginx/mime.types; + include /etc/nginx/mime.types; alias /usr/local/src/mirte/mirte-documentation/_build/html/; } # ROS bridge websocket location /ws/ros { proxy_pass http://localhost:9090; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $http_host; - proxy_read_timeout 86400s; - proxy_send_timeout 86400s; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $http_host; + proxy_read_timeout 86400s; + proxy_send_timeout 86400s; } # Shell websocket location /ws/shell { proxy_pass http://localhost:3000/shell; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $http_host; - proxy_read_timeout 86400s; - proxy_send_timeout 86400s; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $http_host; + proxy_read_timeout 86400s; + proxy_send_timeout 86400s; } # Linetrace location /ws/linetrace { proxy_pass http://localhost:8001; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $http_host; - proxy_read_timeout 86400s; - proxy_send_timeout 86400s; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $http_host; + proxy_read_timeout 86400s; + proxy_send_timeout 86400s; } # mDNS client discovery location /ws/clients { proxy_pass http://localhost:4567; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $http_host; - proxy_read_timeout 86400s; - proxy_send_timeout 86400s; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $http_host; + proxy_read_timeout 86400s; + proxy_send_timeout 86400s; } - } - } From a340a263e602ebd53299e30a1e10c6a0cc4e2476 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Fri, 3 Nov 2023 17:46:47 +0100 Subject: [PATCH 010/353] start pam module --- pam/readme.md | 18 ++++++++++++++++++ pam/storepassword.c | 22 ++++++++++++++++++++++ pam/warn.c | 25 +++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 pam/readme.md create mode 100644 pam/storepassword.c create mode 100644 pam/warn.c diff --git a/pam/readme.md b/pam/readme.md new file mode 100644 index 0000000..07feaee --- /dev/null +++ b/pam/readme.md @@ -0,0 +1,18 @@ +# password module +requires +sudo apt-get install libpam0g-dev + + +mkdir /lib/security +gcc -fPIC -fno-stack-protector -c storepassword.c && ld -x --shared -o /lib/security/storepassword.so storepassword.o +gcc -fPIC -fno-stack-protector -c warn.c && ld -x --shared -o /lib/security/warn.so warn.o + +/etc/pam.d/common-password: +password required /lib/security/storepassword.so + +/etc/pam.d/passwd: +password required /lib/security/warn.so + +before @include + + diff --git a/pam/storepassword.c b/pam/storepassword.c new file mode 100644 index 0000000..9286061 --- /dev/null +++ b/pam/storepassword.c @@ -0,0 +1,22 @@ +#define PAM_SM_PASSWORD 1 +#include +#include +#include +#include +#include +#include + +PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, + int argc, const char **argv) +{ + if (flags == PAM_PRELIM_CHECK) + { + printf("Your password will be stored in plaintext, so don't make it your cats name! The web-login and the Mirte-hotspot will get the same password."); + return PAM_SUCCESS; + } + char *pwd; + + int r = pam_get_item(pamh, PAM_AUTHTOK, (const void **)&pwd); + printf("Your new password is \"%s\". Very nice!\n", pwd); + return PAM_SUCCESS; +} diff --git a/pam/warn.c b/pam/warn.c new file mode 100644 index 0000000..fe58165 --- /dev/null +++ b/pam/warn.c @@ -0,0 +1,25 @@ +#define PAM_SM_PASSWORD 1 +#include +#include +#include +#include +#include + +/* + This module will warn users when changing their password that it is stored in plaintext + Compile with + gcc -fPIC -fno-stack-protector -c warn.c && ld -x --shared -o /lib/security/warn.so warn.o + and add + password required /lib/security/warn.so + before the "@include common-password" line in /etc/pam.d/passwd to let it run before the passwd system. +*/ +PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, + int argc, const char **argv) +{ + if (flags == PAM_PRELIM_CHECK) { + printf("Your password will be stored in plaintext, so don't make it your super secret password!\nThe web-login and the Mirte-hotspot will get the same password.\n"); + return PAM_SUCCESS; + } + + return PAM_SUCCESS; +} From c2fb7f56e58081011793884a185b79c346d23545 Mon Sep 17 00:00:00 2001 From: "Arend-Jan(Mirte-42F850)" Date: Mon, 6 Nov 2023 09:55:08 +0000 Subject: [PATCH 011/353] Add cmake build and install --- pam/.gitignore | 1 + pam/CMakeLists.txt | 82 +++++++++++++++++++++++++++++++++ pam/cmake/modules/FindPAM.cmake | 76 ++++++++++++++++++++++++++++++ pam/storepassword.c | 3 +- 4 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 pam/.gitignore create mode 100644 pam/CMakeLists.txt create mode 100644 pam/cmake/modules/FindPAM.cmake diff --git a/pam/.gitignore b/pam/.gitignore new file mode 100644 index 0000000..d163863 --- /dev/null +++ b/pam/.gitignore @@ -0,0 +1 @@ +build/ \ No newline at end of file diff --git a/pam/CMakeLists.txt b/pam/CMakeLists.txt new file mode 100644 index 0000000..4f657db --- /dev/null +++ b/pam/CMakeLists.txt @@ -0,0 +1,82 @@ +cmake_minimum_required(VERSION 3.10) +project(mirteam) + +#set(CMAKE_CXX_STANDARD 11) +#set(CMAKE_CXX_STANDARD_REQUIRED ON) +#set(CMAKE_CXX_EXTENSIONS OFF) + +# Notify CMake that we have module files to find packages/libs. +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") + +find_package(PAM REQUIRED) + +# Check if we found PAM. +if (NOT PAM_FOUND) + message(FATAL_ERROR "PAM library was not found.") +endif () + +# Source configuration. +include_directories( + ${PAM_INCLUDE_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} +) + +set(EXECUTABLE_NAME "pamdule") + +# Add sources to this project's executable. +# add_executable(${EXECUTABLE_NAME} + +# "storepassword.c" +# ) +# add_library(${PROJECT_NAME} SHARED ${SOURCES} ${PAM_LIBRARIES}) + +# # Install library +# install(TARGETS ${PROJECT_NAME} DESTINATION lib/${PROJECT_NAME}) + +# add_library(${EXECUTABLE_NAME}, "storepassword.c") +# target_link_libraries(${EXECUTABLE_NAME} + +# ) +set(modules warn storepassword) + +foreach(module ${modules}) + + set(WARN_FILE ${module}.so) + # gcc -fPIC -fno-stack-protector -c warn.c && ld -x --shared -o /lib/security/warn.so warn.o + set(WARN_CMD "gcc" "-fPIC" "-fno-stack-protector" "-c" ../${module}.c) + set(WARN_LD_CMD "ld" "-x" "--shared" "-o" ${module}.so ${module}.o) + # set(KBUILD_CMD $(MAKE) -C ${PAM_INCLUDE_DIR} modules M=${CMAKE_CURRENT_BINARY_DIR} src=${CMAKE_CURRENT_SOURCE_DIR}) + + # Generate the Kbuild file through cmake. + # FILE(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/Kbuild "obj-m := warn.so") + + add_custom_command(OUTPUT ${WARN_FILE} + COMMAND ${WARN_CMD} + COMMAND ${WARN_LD_CMD} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${module}.c VERBATIM) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${module}.so + DESTINATION /lib/security/) + + add_custom_target(mirteam_${module} ALL DEPENDS ${WARN_FILE}) +endforeach(module ${modules}) + +# set(WARN_FILE warn.so) +# # gcc -fPIC -fno-stack-protector -c warn.c && ld -x --shared -o /lib/security/warn.so warn.o +# set(WARN_CMD "gcc" "-fPIC" "-fno-stack-protector" "-c" "../warn.c") +# set(WARN_LD_CMD "ld" "-x" "--shared" "-o" "/lib/security/warn.so" "warn.o") +# # set(KBUILD_CMD $(MAKE) -C ${PAM_INCLUDE_DIR} modules M=${CMAKE_CURRENT_BINARY_DIR} src=${CMAKE_CURRENT_SOURCE_DIR}) + +# # Generate the Kbuild file through cmake. +# # FILE(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/Kbuild "obj-m := warn.so") + +# add_custom_command(OUTPUT ${WARN_FILE} +# COMMAND ${WARN_CMD} +# COMMAND ${WARN_LD_CMD} +# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +# DEPENDS warn.c VERBATIM) + +# add_custom_target(mirteam ALL DEPENDS ${WARN_FILE}) +# Parse c files +add_library(dummy_target warn.c) diff --git a/pam/cmake/modules/FindPAM.cmake b/pam/cmake/modules/FindPAM.cmake new file mode 100644 index 0000000..4c8db27 --- /dev/null +++ b/pam/cmake/modules/FindPAM.cmake @@ -0,0 +1,76 @@ +# - Try to find the PAM libraries +# Once done this will define +# +# PAM_FOUND - system has pam +# PAM_INCLUDE_DIR - the pam include directory +# PAM_LIBRARIES - libpam library +# +# SPDX-License-Identifier: BSD-3-Clause +# Copied from https://github.com/KDE/kwallet-pam/blob/master/cmake/modules/FindPAM.cmake +if (PAM_INCLUDE_DIR AND PAM_LIBRARY) + # Already in cache, be silent + set(PAM_FIND_QUIETLY TRUE) +endif (PAM_INCLUDE_DIR AND PAM_LIBRARY) + +find_path(PAM_INCLUDE_DIR NAMES security/pam_appl.h pam/pam_appl.h) +find_library(PAM_LIBRARY pam) +find_library(DL_LIBRARY dl) + +if (PAM_INCLUDE_DIR AND PAM_LIBRARY) + set(PAM_FOUND TRUE) + if (DL_LIBRARY) + set(PAM_LIBRARIES ${PAM_LIBRARY} ${DL_LIBRARY}) + else (DL_LIBRARY) + set(PAM_LIBRARIES ${PAM_LIBRARY}) + endif (DL_LIBRARY) + + if (EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h) + # darwin claims to be something special + set(HAVE_PAM_PAM_APPL_H 1) + endif (EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h) + + if (NOT DEFINED PAM_MESSAGE_CONST) + include(CheckCXXSourceCompiles) + # XXX does this work with plain c? + check_cxx_source_compiles(" +#if ${HAVE_PAM_PAM_APPL_H}+0 +# include +#else +# include +#endif + +static int PAM_conv( + int num_msg, + const struct pam_message **msg, /* this is the culprit */ + struct pam_response **resp, + void *ctx) +{ + return 0; +} + +int main(void) +{ + struct pam_conv PAM_conversation = { + &PAM_conv, /* this bombs out if the above does not match */ + 0 + }; + + return 0; +} +" PAM_MESSAGE_CONST) + endif (NOT DEFINED PAM_MESSAGE_CONST) + set(PAM_MESSAGE_CONST ${PAM_MESSAGE_CONST} CACHE BOOL "PAM expects a conversation function with const pam_message") + +endif (PAM_INCLUDE_DIR AND PAM_LIBRARY) + +if (PAM_FOUND) + if (NOT PAM_FIND_QUIETLY) + message(STATUS "Found PAM: ${PAM_LIBRARIES}") + endif (NOT PAM_FIND_QUIETLY) +else (PAM_FOUND) + if (PAM_FIND_REQUIRED) + message(FATAL_ERROR "PAM was not found") + endif(PAM_FIND_REQUIRED) +endif (PAM_FOUND) + +mark_as_advanced(PAM_INCLUDE_DIR PAM_LIBRARY DL_LIBRARY PAM_MESSAGE_CONST) \ No newline at end of file diff --git a/pam/storepassword.c b/pam/storepassword.c index 9286061..dfd9ad1 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -11,12 +11,11 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, { if (flags == PAM_PRELIM_CHECK) { - printf("Your password will be stored in plaintext, so don't make it your cats name! The web-login and the Mirte-hotspot will get the same password."); return PAM_SUCCESS; } char *pwd; int r = pam_get_item(pamh, PAM_AUTHTOK, (const void **)&pwd); - printf("Your new password is \"%s\". Very nice!\n", pwd); + printf("Your new password is \"%s\". Very nice!\nThe password will be updated for the webpages. The wifi password will be updated at next boot!\n", pwd); return PAM_SUCCESS; } From b3f1b2e68292475c1db303ab3c49b2089d837dba Mon Sep 17 00:00:00 2001 From: "Arend-Jan(Mirte-42F850)" Date: Mon, 6 Nov 2023 10:30:53 +0000 Subject: [PATCH 012/353] cleanup cmake --- pam/CMakeLists.txt | 51 +++------------------------------------------ pam/storepassword.c | 3 ++- pam/warn.c | 17 ++++++++------- 3 files changed, 14 insertions(+), 57 deletions(-) diff --git a/pam/CMakeLists.txt b/pam/CMakeLists.txt index 4f657db..550f37f 100644 --- a/pam/CMakeLists.txt +++ b/pam/CMakeLists.txt @@ -1,43 +1,21 @@ cmake_minimum_required(VERSION 3.10) -project(mirteam) +project(mirte_pam) -#set(CMAKE_CXX_STANDARD 11) -#set(CMAKE_CXX_STANDARD_REQUIRED ON) -#set(CMAKE_CXX_EXTENSIONS OFF) - -# Notify CMake that we have module files to find packages/libs. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") find_package(PAM REQUIRED) # Check if we found PAM. if (NOT PAM_FOUND) - message(FATAL_ERROR "PAM library was not found.") + message(FATAL_ERROR "PAM library was not found. Install: sudo apt-get install libpam0g-dev") endif () -# Source configuration. include_directories( ${PAM_INCLUDE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) -set(EXECUTABLE_NAME "pamdule") - -# Add sources to this project's executable. -# add_executable(${EXECUTABLE_NAME} - -# "storepassword.c" -# ) -# add_library(${PROJECT_NAME} SHARED ${SOURCES} ${PAM_LIBRARIES}) - -# # Install library -# install(TARGETS ${PROJECT_NAME} DESTINATION lib/${PROJECT_NAME}) - -# add_library(${EXECUTABLE_NAME}, "storepassword.c") -# target_link_libraries(${EXECUTABLE_NAME} - -# ) set(modules warn storepassword) foreach(module ${modules}) @@ -46,10 +24,6 @@ foreach(module ${modules}) # gcc -fPIC -fno-stack-protector -c warn.c && ld -x --shared -o /lib/security/warn.so warn.o set(WARN_CMD "gcc" "-fPIC" "-fno-stack-protector" "-c" ../${module}.c) set(WARN_LD_CMD "ld" "-x" "--shared" "-o" ${module}.so ${module}.o) - # set(KBUILD_CMD $(MAKE) -C ${PAM_INCLUDE_DIR} modules M=${CMAKE_CURRENT_BINARY_DIR} src=${CMAKE_CURRENT_SOURCE_DIR}) - - # Generate the Kbuild file through cmake. - # FILE(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/Kbuild "obj-m := warn.so") add_custom_command(OUTPUT ${WARN_FILE} COMMAND ${WARN_CMD} @@ -59,24 +33,5 @@ foreach(module ${modules}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${module}.so DESTINATION /lib/security/) - add_custom_target(mirteam_${module} ALL DEPENDS ${WARN_FILE}) + add_custom_target(mirte_pam_${module} ALL DEPENDS ${WARN_FILE}) endforeach(module ${modules}) - -# set(WARN_FILE warn.so) -# # gcc -fPIC -fno-stack-protector -c warn.c && ld -x --shared -o /lib/security/warn.so warn.o -# set(WARN_CMD "gcc" "-fPIC" "-fno-stack-protector" "-c" "../warn.c") -# set(WARN_LD_CMD "ld" "-x" "--shared" "-o" "/lib/security/warn.so" "warn.o") -# # set(KBUILD_CMD $(MAKE) -C ${PAM_INCLUDE_DIR} modules M=${CMAKE_CURRENT_BINARY_DIR} src=${CMAKE_CURRENT_SOURCE_DIR}) - -# # Generate the Kbuild file through cmake. -# # FILE(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/Kbuild "obj-m := warn.so") - -# add_custom_command(OUTPUT ${WARN_FILE} -# COMMAND ${WARN_CMD} -# COMMAND ${WARN_LD_CMD} -# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -# DEPENDS warn.c VERBATIM) - -# add_custom_target(mirteam ALL DEPENDS ${WARN_FILE}) -# Parse c files -add_library(dummy_target warn.c) diff --git a/pam/storepassword.c b/pam/storepassword.c index dfd9ad1..a193a76 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -9,6 +9,7 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv) { + if (flags == PAM_PRELIM_CHECK) { return PAM_SUCCESS; @@ -16,6 +17,6 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, char *pwd; int r = pam_get_item(pamh, PAM_AUTHTOK, (const void **)&pwd); - printf("Your new password is \"%s\". Very nice!\nThe password will be updated for the webpages. The wifi password will be updated at next boot!\n", pwd); + printf("Your new password is \"%s\". Very nice, very secure!!\nThe password will be updated for the webpages. The wifi password will be updated at next boot!\n", pwd); return PAM_SUCCESS; } diff --git a/pam/warn.c b/pam/warn.c index fe58165..b014ebc 100644 --- a/pam/warn.c +++ b/pam/warn.c @@ -7,19 +7,20 @@ /* This module will warn users when changing their password that it is stored in plaintext - Compile with + Compile with gcc -fPIC -fno-stack-protector -c warn.c && ld -x --shared -o /lib/security/warn.so warn.o - and add + and add password required /lib/security/warn.so before the "@include common-password" line in /etc/pam.d/passwd to let it run before the passwd system. */ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv) { - if (flags == PAM_PRELIM_CHECK) { - printf("Your password will be stored in plaintext, so don't make it your super secret password!\nThe web-login and the Mirte-hotspot will get the same password.\n"); - return PAM_SUCCESS; - } - + if (flags == PAM_PRELIM_CHECK) + { + printf("Your password will be stored in plaintext, so don't make it your super secret password!\nThe web-login and the Mirte-hotspot will get the same password.\n"); + return PAM_SUCCESS; + } + return PAM_SUCCESS; -} +} \ No newline at end of file From 7fbe8ff3ad84e3226836f07cb0704c27515403a3 Mon Sep 17 00:00:00 2001 From: "Arend-Jan(Mirte-42F850)" Date: Mon, 6 Nov 2023 13:13:44 +0000 Subject: [PATCH 013/353] Add json parsing and updating --- pam/.gitignore | 3 ++- pam/CMakeLists.txt | 36 ++++++++++++++++++++++-------------- pam/mirte_pam.h | 30 ++++++++++++++++++++++++++++++ pam/storepassword.c | 36 +++++++++++++++++++++++++++--------- pam/test.c | 7 +++++++ pam/warn.c | 9 ++------- 6 files changed, 90 insertions(+), 31 deletions(-) create mode 100644 pam/mirte_pam.h create mode 100644 pam/test.c diff --git a/pam/.gitignore b/pam/.gitignore index d163863..02ad755 100644 --- a/pam/.gitignore +++ b/pam/.gitignore @@ -1 +1,2 @@ -build/ \ No newline at end of file +build/ +build2/ \ No newline at end of file diff --git a/pam/CMakeLists.txt b/pam/CMakeLists.txt index 550f37f..fa45501 100644 --- a/pam/CMakeLists.txt +++ b/pam/CMakeLists.txt @@ -19,19 +19,27 @@ include_directories( set(modules warn storepassword) foreach(module ${modules}) - - set(WARN_FILE ${module}.so) - # gcc -fPIC -fno-stack-protector -c warn.c && ld -x --shared -o /lib/security/warn.so warn.o - set(WARN_CMD "gcc" "-fPIC" "-fno-stack-protector" "-c" ../${module}.c) - set(WARN_LD_CMD "ld" "-x" "--shared" "-o" ${module}.so ${module}.o) - - add_custom_command(OUTPUT ${WARN_FILE} - COMMAND ${WARN_CMD} - COMMAND ${WARN_LD_CMD} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${module}.c VERBATIM) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${module}.so - DESTINATION /lib/security/) + add_library(mirte_pam_${module} SHARED ${module}.c) - add_custom_target(mirte_pam_${module} ALL DEPENDS ${WARN_FILE}) + find_package(json-c CONFIG) + target_link_libraries(mirte_pam_${module} PRIVATE json-c::json-c) + + install(TARGETS mirte_pam_${module} DESTINATION /lib/security/) + endforeach(module ${modules}) + +add_executable(myprogram test.c storepassword.c) +target_link_libraries(myprogram PRIVATE json-c::json-c) + +# cmake_minimum_required(VERSION 2.4.0) + +# project(mycustomlib) + +# # Find source files +# file(GLOB SOURCES warn.c) + + +# # Create shared library +# add_library(${PROJECT_NAME} SHARED ${SOURCES}) + +# Install library diff --git a/pam/mirte_pam.h b/pam/mirte_pam.h new file mode 100644 index 0000000..7358382 --- /dev/null +++ b/pam/mirte_pam.h @@ -0,0 +1,30 @@ +#pragma once +#include +#include +#include +#include +#include +#include +#include +#define RED "\x1B[31m" +#define GRN "\x1B[32m" +#define YEL "\x1B[33m" +#define BLU "\x1B[34m" +#define MAG "\x1B[35m" +#define CYN "\x1B[36m" +#define WHT "\x1B[37m" +#define RESET "\x1B[0m" + +#define filename "/root/filename.txt" +void savePassword(char *, char *); +void openPassword(); +#ifdef PAM_MOCK +int pam_get_item(void *p, int i, const void **pwd) +{ + return 0; +} +#else +#include +#include +#endif +void makeFileWithout(int); \ No newline at end of file diff --git a/pam/storepassword.c b/pam/storepassword.c index a193a76..9063a6d 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -1,11 +1,5 @@ #define PAM_SM_PASSWORD 1 -#include -#include -#include -#include -#include -#include - +#include "mirte_pam.h" PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv) { @@ -15,8 +9,32 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, return PAM_SUCCESS; } char *pwd; - + char *user; int r = pam_get_item(pamh, PAM_AUTHTOK, (const void **)&pwd); - printf("Your new password is \"%s\". Very nice, very secure!!\nThe password will be updated for the webpages. The wifi password will be updated at next boot!\n", pwd); + pam_get_item(pamh, PAM_USER, (const void **)&user); + printf(GRN "Mirte:\t"RESET"The new password for \"%s\" is \"%s\". Very nice, very secure!!\n"GRN "Mirte:\t"RESET"The password will be updated for the webpages.\n"GRN "Mirte:\t"RESET"The Wi-Fi password will be updated at next boot!\n", user, pwd); + savePassword(user, pwd); return PAM_SUCCESS; } + +void savePassword(char *username, char *passwd) +{ + json_object *root = json_object_from_file("/root/contact.json"); + if (!root) + return; + + json_object *user = json_object_object_get(root, username); + if (!user) + { + user = json_object_new_object(); + json_object_object_add(root, username, json_object_new_string(passwd)); + } + else + { + json_object_set_string(user, passwd); + } + // json_object_set_string(user, passwd); + // printf("The jso321n file:\n\n%s\n", json_object_to_json_string_ext(root, JSON_C_TO_STRING_PRETTY)); + json_object_to_file_ext(filename, root, JSON_C_TO_STRING_PRETTY); + json_object_put(root); +} \ No newline at end of file diff --git a/pam/test.c b/pam/test.c new file mode 100644 index 0000000..183510e --- /dev/null +++ b/pam/test.c @@ -0,0 +1,7 @@ +#define PAM_MOCK +#include "mirte_pam.h" + +int main() { + // will just update the file + savePassword("asdf","ww"); +} \ No newline at end of file diff --git a/pam/warn.c b/pam/warn.c index b014ebc..017563d 100644 --- a/pam/warn.c +++ b/pam/warn.c @@ -1,10 +1,5 @@ #define PAM_SM_PASSWORD 1 -#include -#include -#include -#include -#include - +#include "mirte_pam.h" /* This module will warn users when changing their password that it is stored in plaintext Compile with @@ -18,7 +13,7 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, { if (flags == PAM_PRELIM_CHECK) { - printf("Your password will be stored in plaintext, so don't make it your super secret password!\nThe web-login and the Mirte-hotspot will get the same password.\n"); + printf(GRN "Mirte:\t"RESET"Your password will be stored in plaintext, so don't make it your super secret password!\n"GRN "Mirte:\t"RESET"The web-login and the Mirte-hotspot will get the same password.\n"); return PAM_SUCCESS; } From 51f91baa7ed6eb217ee48fd9750293e0a263f555 Mon Sep 17 00:00:00 2001 From: "Arend-Jan(Mirte-42F850)" Date: Mon, 6 Nov 2023 14:15:18 +0000 Subject: [PATCH 014/353] Improve installation pam and docs --- pam/.gitignore | 4 +++- pam/CMakeLists.txt | 32 ++++++++++++++++++-------------- pam/install_json.sh | 11 +++++++++++ pam/install_module.sh | 15 +++++++++++++++ pam/mirte_pam.h | 22 ++++++++++------------ pam/readme.md | 31 +++++++++++++++++++------------ pam/storepassword.c | 19 ++++++++++--------- 7 files changed, 86 insertions(+), 48 deletions(-) create mode 100755 pam/install_json.sh create mode 100755 pam/install_module.sh diff --git a/pam/.gitignore b/pam/.gitignore index 02ad755..dcfccc2 100644 --- a/pam/.gitignore +++ b/pam/.gitignore @@ -1,2 +1,4 @@ build/ -build2/ \ No newline at end of file +build2/ +/build** +json-c/ \ No newline at end of file diff --git a/pam/CMakeLists.txt b/pam/CMakeLists.txt index fa45501..0e19b82 100644 --- a/pam/CMakeLists.txt +++ b/pam/CMakeLists.txt @@ -15,13 +15,29 @@ include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) +find_package(json-c) +if(NOT json-fc_FOUND) + message("Json-c not found, installing it for you!") + execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/install_json.sh) + message("Done installing json-c") + + find_package(json-c) + if(NOT json-c_FOUND) + message(FATAL_ERROR "Tried installing json-c, still not found") + endif() +endif() +# get_cmake_property(_variableNames VARIABLES) +# list (SORT _variableNames) +# foreach (_variableName ${_variableNames}) +# message(STATUS "${_variableName}=${${_variableName}}") +# endforeach() set(modules warn storepassword) foreach(module ${modules}) add_library(mirte_pam_${module} SHARED ${module}.c) - find_package(json-c CONFIG) + # find_package(json-c CONFIG) target_link_libraries(mirte_pam_${module} PRIVATE json-c::json-c) install(TARGETS mirte_pam_${module} DESTINATION /lib/security/) @@ -30,16 +46,4 @@ endforeach(module ${modules}) add_executable(myprogram test.c storepassword.c) target_link_libraries(myprogram PRIVATE json-c::json-c) - -# cmake_minimum_required(VERSION 2.4.0) - -# project(mycustomlib) - -# # Find source files -# file(GLOB SOURCES warn.c) - - -# # Create shared library -# add_library(${PROJECT_NAME} SHARED ${SOURCES}) - -# Install library +install(CODE "execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/install_module.sh)") \ No newline at end of file diff --git a/pam/install_json.sh b/pam/install_json.sh new file mode 100755 index 0000000..c2d3802 --- /dev/null +++ b/pam/install_json.sh @@ -0,0 +1,11 @@ +#!/bin/bash +git clone https://github.com/json-c/json-c.git -b json-c-0.17 +cd json-c +mkdir build +cd build +cmake -DCMAKE_BUILD_TYPE=Release .. +make +make install # requires sudo privileges +cd ../../ +rm -rf json-c +ldconfig \ No newline at end of file diff --git a/pam/install_module.sh b/pam/install_module.sh new file mode 100755 index 0000000..70e9e45 --- /dev/null +++ b/pam/install_module.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +#check if already added to these settings and put it in the correct place if not yet +echo "installing mirte pam modules when needed" +if ! grep -q libmirte_pam_warn "/etc/pam.d/passwd"; then + sed -i '/@include common-password/i \ +password required /lib/security/libmirte_pam_warn.so' /etc/pam.d/passwd + echo "added warning module to /etc/pam.d/passwd" +fi + + +if ! grep -q libmirte_pam_storepassword "/etc/pam.d/passwd"; then + printf "\npassword required /lib/security/libmirte_pam_storepassword.so\n" >> /etc/pam.d/passwd + echo "added password storing to /etc/pam.d/passwd" +fi \ No newline at end of file diff --git a/pam/mirte_pam.h b/pam/mirte_pam.h index 7358382..a79535d 100644 --- a/pam/mirte_pam.h +++ b/pam/mirte_pam.h @@ -5,6 +5,15 @@ #include #include #include +#ifdef PAM_MOCK +int pam_get_item(void *p, int i, const void **pwd) +{ + return 0; +} +#else +#include +#include +#endif #include #define RED "\x1B[31m" #define GRN "\x1B[32m" @@ -15,16 +24,5 @@ #define WHT "\x1B[37m" #define RESET "\x1B[0m" -#define filename "/root/filename.txt" +#define filename "/root/userss.json" void savePassword(char *, char *); -void openPassword(); -#ifdef PAM_MOCK -int pam_get_item(void *p, int i, const void **pwd) -{ - return 0; -} -#else -#include -#include -#endif -void makeFileWithout(int); \ No newline at end of file diff --git a/pam/readme.md b/pam/readme.md index 07feaee..916421d 100644 --- a/pam/readme.md +++ b/pam/readme.md @@ -2,17 +2,24 @@ requires sudo apt-get install libpam0g-dev +# Build +```sh +mkdir build +cd build +cmake -DCMAKE_BUILD_TYPE=Release .. +make +make install # requires sudo privileges +``` -mkdir /lib/security -gcc -fPIC -fno-stack-protector -c storepassword.c && ld -x --shared -o /lib/security/storepassword.so storepassword.o -gcc -fPIC -fno-stack-protector -c warn.c && ld -x --shared -o /lib/security/warn.so warn.o - -/etc/pam.d/common-password: -password required /lib/security/storepassword.so - -/etc/pam.d/passwd: -password required /lib/security/warn.so - -before @include - +This will build the Mirte pam modules(warning and storepassword), install them to `/lib/security/limbirte_pam_xxx.so` and add the required lines to `/etc/pam.d/passwd`. +# passwd +The resulting `/etc/pam.d/passwd` should look like: +``` +# +# The PAM configuration file for the Shadow `passwd' service +# +password required /lib/security/libmirte_pam_warn.so +@include common-password +password required /lib/security/libmirte_pam_storepassword.so +``` diff --git a/pam/storepassword.c b/pam/storepassword.c index 9063a6d..42e40b9 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -12,29 +12,30 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, char *user; int r = pam_get_item(pamh, PAM_AUTHTOK, (const void **)&pwd); pam_get_item(pamh, PAM_USER, (const void **)&user); - printf(GRN "Mirte:\t"RESET"The new password for \"%s\" is \"%s\". Very nice, very secure!!\n"GRN "Mirte:\t"RESET"The password will be updated for the webpages.\n"GRN "Mirte:\t"RESET"The Wi-Fi password will be updated at next boot!\n", user, pwd); + printf(GRN "Mirte:\t" RESET "The new password for \"%s\" is \"%s\". Very nice, very secure!!\n" GRN "Mirte:\t" RESET "The password will be updated for the webpages.\n" GRN "Mirte:\t" RESET "The Wi-Fi password will be updated at next boot!\n", user, pwd); savePassword(user, pwd); return PAM_SUCCESS; } void savePassword(char *username, char *passwd) { - json_object *root = json_object_from_file("/root/contact.json"); + json_object *root = json_object_from_file(filename); if (!root) - return; + { + // file did not exist or some other error, just remake it. + root = json_object_new_object(); + } json_object *user = json_object_object_get(root, username); - if (!user) + if (user) { - user = json_object_new_object(); - json_object_object_add(root, username, json_object_new_string(passwd)); + json_object_set_string(user, passwd); } else { - json_object_set_string(user, passwd); + // user does not exist yet, so add it to the file. + json_object_object_add(root, username, json_object_new_string(passwd)); } - // json_object_set_string(user, passwd); - // printf("The jso321n file:\n\n%s\n", json_object_to_json_string_ext(root, JSON_C_TO_STRING_PRETTY)); json_object_to_file_ext(filename, root, JSON_C_TO_STRING_PRETTY); json_object_put(root); } \ No newline at end of file From 5d3f3d6183c29cac13a5aaaf880b9e7357c8e502 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 6 Nov 2023 16:21:16 +0100 Subject: [PATCH 015/353] Add pam to install script + improve readme --- create_user.sh | 2 +- install_pam.sh | 9 +++++++++ pam/CMakeLists.txt | 2 +- pam/image.png | Bin 0 -> 31162 bytes pam/install_json.sh | 8 ++++---- pam/install_module.sh | 11 +++++------ pam/mirte_pam.h | 3 ++- pam/readme.md | 19 +++++++++++++++++-- 8 files changed, 39 insertions(+), 15 deletions(-) create mode 100755 install_pam.sh create mode 100644 pam/image.png diff --git a/create_user.sh b/create_user.sh index f6a28fc..2106e6e 100755 --- a/create_user.sh +++ b/create_user.sh @@ -2,7 +2,7 @@ set -e MIRTE_SRC_DIR=/usr/local/src/mirte - +sudo ./install_pam.sh # setup pam before changing the password for the mirte user. # Add mirte user with sudo rights #TODO: user without homedir (create homedir for user) sudo useradd -m -G sudo,audio -s /bin/bash mirte diff --git a/install_pam.sh b/install_pam.sh new file mode 100755 index 0000000..447eff3 --- /dev/null +++ b/install_pam.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cd pam || exit +sudo apt-get install libpam0g-dev +mkdir build +cd build || exit 1 +cmake -DCMAKE_BUILD_TYPE=Release .. # will install json-c when not yet installed +make +make install # requires sudo privileges diff --git a/pam/CMakeLists.txt b/pam/CMakeLists.txt index 0e19b82..b0f7deb 100644 --- a/pam/CMakeLists.txt +++ b/pam/CMakeLists.txt @@ -3,7 +3,7 @@ project(mirte_pam) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") -find_package(PAM REQUIRED) +find_package(PAM) # Check if we found PAM. if (NOT PAM_FOUND) diff --git a/pam/image.png b/pam/image.png new file mode 100644 index 0000000000000000000000000000000000000000..d7cf1af62adf1bb987df129af7f01cadb848b2de GIT binary patch literal 31162 zcmd3OXFQx++i!|6q6Z<-Lr93u=p(u$N^C+TYVh3;Gr}c73?+R< zy5a*B*1GmfUH3{&e>}jo1itH=V{d1U#ypMz_@L#HVMhA<)4&I^l8Jx5O~!ra?}wxX z1}U1J4G{>$*P9<*AQXQ+4a6W#-Shx4IZ%}pKam=IQsgzGu8l2V{V-K|@P&Gj4m833ZOUvS;= zAk1k~p>|(2_Iyb9BIe@zb}(n1DIv9>UNUUA9TEI{HPXOsY={fEwNgUj4SfRrR8>87 zYDk>Zvz;|s_kz1^@e1tJC_j5C-hIPm9d!|3nr<2-7cH_by-ehaass92JaSbekq&+D z$8$8Gy|mvPycCaETD2B&;uWbA(qHl@??k6UPHh$7kV*3f;MOMZ$FD}RePLEih;u(X z)MOt=msu1n5m?piw0LKO(!Mo{o~@UHIlAyTYhK=CCa$+<>``$3t~7xZsgHZCnw8-$ zebzwWb}TT0Jk}P9P|h~f`u0vHM)3C?&mnkD#b>&Gv@-qbeT^#7UVRuHe{CYaKzHYT zER#=5+kV!HiP!|){ZhGR5!2DSd{<|K+6BNErrge8eC0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+zkX*ETCCk>UrJr*WbDFzMj%} za<~Jm2JO7(nh8ggh*HE=mGGB~jm1`xv%J47xe(5Xjrbx#;?P1Q+2_}2W`50ks{p+= zk?gUY$Br&)JY<7XzB|AIlmdv7NkB^GMuE!u{PGe42*KG>YTP1R;;GcrpJYkop~P@q zwc|Qj{UR&}W_A2fyV;3e0@1PB#33R>Sx0R42<*}gGgP6XdfELt)f+S9^!_3%;V(&*~0`Vx&UEu#OSp-WK)vJ->&=Uu2MbFRon!-8T-LzeD5Y^V zo>lkM<-<%pZVDATSi5acilvqd=k(gx^NtifQ!3qQgw>HdV4H7zzee;{bro4zbTSF3 z%#fT{ZZ|7gg(0{?vz1WfD-`V%7K%-zKReU7RyB6u!gb+sNZjI*a28AF{*=ku@hG(F^*T? z*ZC#qUjM1+Fv1!c+ZlA9E%d@eH>*wmMUJ?`pDc7Nt|c(+vo>)gBh3NbS@al}WA0EH zN_(#H8Ul4g&}Hpuk#69dd)i3z*MKp@2U64(OMkt;TO_O%L%g*?SB5*YtUJlR;gK_s zX}plh%Xo5NSja@}b)47@7TK__(S)Uj&<-u=aghn-M z8eyx+v9KQvtHLScfn{26csWH=czCOMZE1BhUpq@h=^Rf_9wlWcr6iwyGA^H-2}Eez zu$r#z2w~psi~bQzp~neK8r(0X=UzuX#ADEhQvU@LR`YG*ryn49Z%GxD^ECl!0tl`= z{5Lhp(IVIUsE4+G3?V*oncnLfy_G9n*P_T~swIS)eAlC{PCFKZ8MwK0;M;ic<+yb! z{fXJJ`v|r5(*faq&U^1`nNf^XaLSvM+sl{sy z8c$HRN}!VOf+jP-@YHpT-ubf%SKxcCXYOBzd|0PS-#-cKE!uyfF8> /etc/pam.d/passwd - echo "added password storing to /etc/pam.d/passwd" -fi \ No newline at end of file + printf "\npassword required /lib/security/libmirte_pam_storepassword.so\n" >>/etc/pam.d/passwd + echo "added password storing to /etc/pam.d/passwd" +fi diff --git a/pam/mirte_pam.h b/pam/mirte_pam.h index a79535d..8d60206 100644 --- a/pam/mirte_pam.h +++ b/pam/mirte_pam.h @@ -24,5 +24,6 @@ int pam_get_item(void *p, int i, const void **pwd) #define WHT "\x1B[37m" #define RESET "\x1B[0m" -#define filename "/root/userss.json" +// TODO: better location to be useful for other systems +#define filename "/root/users.json" void savePassword(char *, char *); diff --git a/pam/readme.md b/pam/readme.md index 916421d..1da7931 100644 --- a/pam/readme.md +++ b/pam/readme.md @@ -1,8 +1,21 @@ # password module -requires -sudo apt-get install libpam0g-dev + +This system will show some info to the user when changing passwords and stores the new password in `/root/users.json`. The warnings are hooked in to `passwd` by using pam modules. + +Output: + +![passwd with mirte pam](image.png) + + # Build +Building PAM modules requires `libpam0g-dev`: + +```sh +sudo apt-get install libpam0g-dev +``` + +Building the Mirte PAM system: ```sh mkdir build cd build @@ -23,3 +36,5 @@ password required /lib/security/libmirte_pam_warn.so @include common-password password required /lib/security/libmirte_pam_storepassword.so ``` + +The `warn` module is started before the actual passwd system, so the output will be before the passwd output. The storepassword is after it to catch the plaintext password. \ No newline at end of file From d1be0873c0a2d127c308f174800e3a8357b5c253 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 7 Nov 2023 14:03:48 +0100 Subject: [PATCH 016/353] Create login page --- login/index.html | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 login/index.html diff --git a/login/index.html b/login/index.html new file mode 100644 index 0000000..dfffd25 --- /dev/null +++ b/login/index.html @@ -0,0 +1,39 @@ + + + + + + + Mirte login + + + + + + +
+ + + +
+ + + + + \ No newline at end of file From e24e73fab99fc0a8b1aba9041a5fd386f67f06ce Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 7 Nov 2023 14:09:51 +0100 Subject: [PATCH 017/353] Add login system to nginx --- nginx.conf | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/nginx.conf b/nginx.conf index 406add1..b09eec2 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,3 +1,30 @@ + +# check the password against the mirte user password. +# Requires nginx reload on password change! +map $arg_password $accepted { + default 0; + "supersecurepassword" 1; # dev password, remove when it's working great + include /root/file.conf; # store password over there in format: "password" 1; +} + +# check that the client is 'internal' or external to require login or not. +map $remote_addr $internal { + hostnames; # enables .* in ips + default 0; + # 192.168.2.* 1; + 192.168.43.* 1; + 192.168.42.* 1; + 192.168.137.* 1; +} + +# combine the two checks into a single check +map $accepted$internal $requireLogin { + 00 1; # not logged in, external + 01 0; # not logged in and internal + 10 0; # logged in and external + 11 0; # logged in and internal +} + server { gzip_min_length 1000; @@ -11,11 +38,17 @@ server { # The NodeJs (Vue) webserver location / { + if ($requireLogin = 1) { + return 302 /login/?target=$request_uri; # temporary redirect + } proxy_pass http://localhost:3000/; } # The ROS video server location /ros-video/ { + if ($requireLogin = 1) { + return 302 /login/?target=$request_uri; # temporary redirect + } proxy_pass http://localhost:8181/; sub_filter "/snapshot" "/ros-video/snapshot"; # convert all /snapshot... texts(url) to /ros-video/snapshot... sub_filter "/stream" "/ros-video/stream"; # convert /stream... urls to /ros-video/stream... Used for the stream_viewer page and actual stream. @@ -25,23 +58,34 @@ server { # Jupyter Notebook location /jupyter/ { + if ($requireLogin = 1) { + return 302 /login/?target=$request_uri; # temporary redirect + } proxy_pass http://localhost:8888/jupyter/; } # Wifi Connect location /wifi-connect/ { + if ($requireLogin = 1) { + return 302 /login/?target=$request_uri; # temporary redirect + } # Wifi connect does not map to localhost proxy_pass http://192.168.42.1:8080/; } # Sphinx RTD Docs location /docs/ { + # TODO: do we need login for this? + # TODO: docs compilation is broken? include /etc/nginx/mime.types; alias /usr/local/src/mirte/mirte-documentation/_build/html/; } # ROS bridge websocket location /ws/ros { + if ($requireLogin = 1) { + return 302 /login/?target=$request_uri; # temporary redirect + } proxy_pass http://localhost:9090; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -53,6 +97,9 @@ server { # Shell websocket location /ws/shell { + if ($requireLogin = 1) { + return 302 /login/?target=$request_uri; # temporary redirect + } proxy_pass http://localhost:3000/shell; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -64,6 +111,9 @@ server { # Linetrace location /ws/linetrace { + if ($requireLogin = 1) { + return 302 /login/?target=$request_uri; # temporary redirect + } proxy_pass http://localhost:8001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -75,6 +125,9 @@ server { # mDNS client discovery location /ws/clients { + if ($requireLogin = 1) { + return 302 /login/?target=$request_uri; # temporary redirect + } proxy_pass http://localhost:4567; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -84,5 +137,24 @@ server { proxy_send_timeout 86400s; } + # Login system: + # Show the login page when not logged in and required to login, otherwise redirect somewhere else + + location /login/ { + if ($arg_target = '') { + set $arg_target '/'; + } + if ($requireLogin = 0) { + return 302 $arg_target; # temporary redirect to the target url parameter + } + alias /usr/local/src/mirte/mirte-install-scripts/login/; + } + + location /logout/ { + # remove the password cookie(expire/set to empty) and redirect to main site. Might redirect the client back to /login/ + add_header Set-Cookie "password=empty; path=/; Domain=$host; expires=Thu, 01 Jan 1970 00:00:00 GMT;" always; + return 302 /; + } + } From 7a32d11bb9aaa92c1c43ab99c6aae1a2582eaf6a Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 7 Nov 2023 16:33:58 +0100 Subject: [PATCH 018/353] Add vscode terms system --- nginx.conf | 45 +++++++++++++++++++++++++++++++++++++++++++++ vscode/index.html | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 vscode/index.html diff --git a/nginx.conf b/nginx.conf index b09eec2..9b83bc4 100644 --- a/nginx.conf +++ b/nginx.conf @@ -156,5 +156,50 @@ server { return 302 /; } + # VSCode system: + # /code/ will redirect(when logged in) to :8000 as vscode won't work nicely in a folder + # Before using it, the terms must be accepted, otherwise nginx will redirect the client to /code/accept/ + # + location /code/ { + if ($requireLogin = 1) { + return 302 /login/?target=$request_uri; # temporary redirect + } + return 302 http://$host:8000/; # that is defined lower + } + location /code/accept/ { + if ($requireLogin = 1) { + return 302 /login/?target=$request_uri; # temporary redirect + } + alias /www/vscode/; + } + } +# VSCode server: +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} +map $cookie_codeAccepted $requireAccept { + default 1; + accept 0; +} +server { + listen *:8000; # vscode does not work in a folder + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header X-Forwarded-Host $http_host; + proxy_read_timeout 86400s; + proxy_send_timeout 86400s; + location / { + if ($requireLogin = 1) { + return 302 http://$host/login/?target=/code/; # temporary redirect, /code/ will redirect back to :8000/ + } + if ($requireAccept = 1) { + return 302 http://$host/code/accept/; + } + proxy_pass http://127.0.0.1:9000/; + } +} \ No newline at end of file diff --git a/vscode/index.html b/vscode/index.html new file mode 100644 index 0000000..e9d2e04 --- /dev/null +++ b/vscode/index.html @@ -0,0 +1,39 @@ + + + + + + + Visual Studio Code Accept License terms + + + + + +

Accept Visual Studio Code license terms:

+
+
+    
+
+ + + +
+ + + + \ No newline at end of file From 4f297033a63a988e5f29dbd92c6a710e148b9aeb Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 7 Nov 2023 17:07:19 +0100 Subject: [PATCH 019/353] Fix vscode starting and license terms --- install_vscode.sh | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/install_vscode.sh b/install_vscode.sh index 767a77d..4e71b08 100644 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -1,23 +1,31 @@ #!/bin/bash MIRTE_SRC_DIR=/usr/local/src/mirte -cd $MIRTE_SRC_DIR +cd $MIRTE_SRC_DIR || exit mkdir vscode -cd vscode +cd vscode || exit wget https://gist.githubusercontent.com/b01/0a16b6645ab7921b0910603dfb85e4fb/raw/ea48d972a176b90b3956de59eb7a43da9be86ec5/download-vs-code-server.sh chmod +x download-vs-code-server.sh sudo -u mirte $MIRTE_SRC_DIR/vscode/download-vs-code-server.sh # For the website: -Wget -O vscode_cli.tar.gz https://az764295.vo.msecnd.net/stable/f1b07bd25dfad64b0167beb15359ae573aecd2cc/vscode_cli_alpine_arm64_cli.tar.gz -Tar -xvf vscode_cli.tar.gz -./code update +wget -O vscode_cli.tar.gz https://az764295.vo.msecnd.net/stable/f1b07bd25dfad64b0167beb15359ae573aecd2cc/vscode_cli_alpine_arm64_cli.tar.gz +tar -xvf vscode_cli.tar.gz +./code update # update the server -./code serve-web --port 8005 --host 0.0.0.0 --without-connection-token --accept-server-license-terms & +# first load it will trigger a download of the actual server. The Mirtes don't have networking, so download it during sd generation +./code serve-web --port 9000 --host 0.0.0.0 --without-connection-token --accept-server-license-terms & code_pid=$! -until [ "$(wget -qO- http://localhost:8005/ | wc --bytes )" -gt "1000" ]; do - sleep 5 +until [ "$(wget -qO- http://localhost:9000/ | wc --bytes)" -gt "1000" ]; do + sleep 5 done + +# Add the license terms after in the vscode/index.html file that the users must accept before using it. +# rerun vscode with the same port to let it stop immediately, but it will show the license terms +sudo sed -i '/^<\!--TERMS-->$/r'<(~/code serve-web --port 9000 --host 0.0.0.0 | grep -v error) $MIRTE_SRC_DIR/mirte-install-scripts/vscode/index.html + +# Stop the server started earlier kill $code_pid -# TODO: add system to start it! \ No newline at end of file +sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-vscode.service /lib/systemd/system/ +sudo systemctl enable mirte-vscode From 5cf5b7b843471c473b4c8a98de39dde60b639a13 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 Nov 2023 10:03:26 +0100 Subject: [PATCH 020/353] Add vscode service --- services/mirte-vscode.service | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 services/mirte-vscode.service diff --git a/services/mirte-vscode.service b/services/mirte-vscode.service new file mode 100644 index 0000000..7dbedf8 --- /dev/null +++ b/services/mirte-vscode.service @@ -0,0 +1,12 @@ +[Unit] +Description=Mirte VScode +After=network.target +After=ssh.service +After=network-online.target + +[Service] +User=mirte +ExecStart=/bin/bash -c "/home/mirte/code serve-web --without-connection-token --host 127.0.0.1 --port 9000" +# Nginx will protect it by requiring a password and requiring accepting the license. +[Install] +WantedBy=multi-user.target From 8e8a0dd85d3c17c1ed7d78691040108cba17342f Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 Nov 2023 10:30:00 +0100 Subject: [PATCH 021/353] mv sites + add list page --- install_vscode.sh | 2 +- nginx.conf | 8 +++- sites/list/index.html | 63 +++++++++++++++++++++++++++++ {login => sites/login}/index.html | 0 {vscode => sites/vscode}/index.html | 0 5 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 sites/list/index.html rename {login => sites/login}/index.html (100%) rename {vscode => sites/vscode}/index.html (100%) diff --git a/install_vscode.sh b/install_vscode.sh index 4e71b08..901a1b9 100644 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -22,7 +22,7 @@ done # Add the license terms after in the vscode/index.html file that the users must accept before using it. # rerun vscode with the same port to let it stop immediately, but it will show the license terms -sudo sed -i '/^<\!--TERMS-->$/r'<(~/code serve-web --port 9000 --host 0.0.0.0 | grep -v error) $MIRTE_SRC_DIR/mirte-install-scripts/vscode/index.html +sudo sed -i '/^<\!--TERMS-->$/r'<(~/code serve-web --port 9000 --host 0.0.0.0 | grep -v error) $MIRTE_SRC_DIR/mirte-install-scripts/sites/vscode/index.html # Stop the server started earlier kill $code_pid diff --git a/nginx.conf b/nginx.conf index 9b83bc4..97bb572 100644 --- a/nginx.conf +++ b/nginx.conf @@ -137,6 +137,10 @@ server { proxy_send_timeout 86400s; } + # show the available pages + location /list/ { + alias /usr/local/src/mirte/mirte-install-scripts/sites/list/; + } # Login system: # Show the login page when not logged in and required to login, otherwise redirect somewhere else @@ -147,7 +151,7 @@ server { if ($requireLogin = 0) { return 302 $arg_target; # temporary redirect to the target url parameter } - alias /usr/local/src/mirte/mirte-install-scripts/login/; + alias /usr/local/src/mirte/mirte-install-scripts/sites/login/; } location /logout/ { @@ -170,7 +174,7 @@ server { if ($requireLogin = 1) { return 302 /login/?target=$request_uri; # temporary redirect } - alias /www/vscode/; + alias /usr/local/src/mirte/mirte-install-scripts/sites/vscode/; } } diff --git a/sites/list/index.html b/sites/list/index.html new file mode 100644 index 0000000..e0f8c44 --- /dev/null +++ b/sites/list/index.html @@ -0,0 +1,63 @@ + + + + + + + Index + + + + + + + + + + \ No newline at end of file diff --git a/login/index.html b/sites/login/index.html similarity index 100% rename from login/index.html rename to sites/login/index.html diff --git a/vscode/index.html b/sites/vscode/index.html similarity index 100% rename from vscode/index.html rename to sites/vscode/index.html From b1202d5c32ad7255f1c2a4d987cd62dbb7efb3a4 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 Nov 2023 11:40:15 +0100 Subject: [PATCH 022/353] Add password change system nginx --- config/web/newpasswd | 1 + config/web/password_map.conf | 1 + install_web.sh | 2 ++ nginx.conf | 24 +++++++++++++- pam/password_manager/manager.py | 0 sites/login/newpassword/index.html | 53 ++++++++++++++++++++++++++++++ 6 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 config/web/newpasswd create mode 100644 config/web/password_map.conf create mode 100644 pam/password_manager/manager.py create mode 100644 sites/login/newpassword/index.html diff --git a/config/web/newpasswd b/config/web/newpasswd new file mode 100644 index 0000000..a0557d9 --- /dev/null +++ b/config/web/newpasswd @@ -0,0 +1 @@ +# will be updated by nginx and is listened to by the python password system! \ No newline at end of file diff --git a/config/web/password_map.conf b/config/web/password_map.conf new file mode 100644 index 0000000..ebb27b6 --- /dev/null +++ b/config/web/password_map.conf @@ -0,0 +1 @@ +"mirte_mirte" 1; \ No newline at end of file diff --git a/install_web.sh b/install_web.sh index fc75fef..856a6c0 100755 --- a/install_web.sh +++ b/install_web.sh @@ -36,6 +36,8 @@ sudo apt install -y strace sudo apt install -y nginx sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/nginx.conf /etc/nginx/sites-available/mirte.conf sudo ln /etc/nginx/sites-available/mirte.conf /etc/nginx/sites-enabled/ +# give nginx access to that folder to put a new password in: +sudo chown www-data:www-data -R /usr/local/src/mirte/mirte-install-scripts/config/web # Add systemd service sudo rm /lib/systemd/system/mirte-web-interface.service diff --git a/nginx.conf b/nginx.conf index 97bb572..f27e009 100644 --- a/nginx.conf +++ b/nginx.conf @@ -4,7 +4,7 @@ map $arg_password $accepted { default 0; "supersecurepassword" 1; # dev password, remove when it's working great - include /root/file.conf; # store password over there in format: "password" 1; + include /usr/local/src/mirte/mirte-install-scripts/config/web/password_map.conf; # store password over there in format: "password" 1; } # check that the client is 'internal' or external to require login or not. @@ -159,6 +159,28 @@ server { add_header Set-Cookie "password=empty; path=/; Domain=$host; expires=Thu, 01 Jan 1970 00:00:00 GMT;" always; return 302 /; } + location /login/changepassword/ { + if ($requireLogin = 1) { + return 302 $arg_target; # temporary redirect + } + alias /usr/local/src/mirte/mirte-install-scripts/sites/login/changepassword/; + } + location "/login/newpasswd" { + # PUT request from the /login/changepassword/ page, can only be updated. File is listened to by python password system. + if ($requireLogin = 1) { + return 302 /login/; + } + # if not PUT request, block it! + if ( $request_method !~ ^(PUT)$ ) { + return 405; + } + alias /usr/local/src/mirte/mirte-install-scripts/config/web/newpasswd; + client_body_temp_path /tmp/upl_tmp; + dav_methods PUT; + create_full_put_path on; + dav_access all:rw; + fastcgi_store off; + } # VSCode system: # /code/ will redirect(when logged in) to :8000 as vscode won't work nicely in a folder diff --git a/pam/password_manager/manager.py b/pam/password_manager/manager.py new file mode 100644 index 0000000..e69de29 diff --git a/sites/login/newpassword/index.html b/sites/login/newpassword/index.html new file mode 100644 index 0000000..ba848d7 --- /dev/null +++ b/sites/login/newpassword/index.html @@ -0,0 +1,53 @@ + + + + + + + Mirte new password + + + + + +

Create new password:

+
+ + + +
+ + + + \ No newline at end of file From d96c45fb4d4d707e318d11f734323b137ef3eccb Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 Nov 2023 12:07:37 +0100 Subject: [PATCH 023/353] Fix install missing cmake --- create_user.sh | 4 +++- install_pam.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/create_user.sh b/create_user.sh index 2106e6e..ad04945 100755 --- a/create_user.sh +++ b/create_user.sh @@ -2,12 +2,14 @@ set -e MIRTE_SRC_DIR=/usr/local/src/mirte -sudo ./install_pam.sh # setup pam before changing the password for the mirte user. # Add mirte user with sudo rights #TODO: user without homedir (create homedir for user) sudo useradd -m -G sudo,audio -s /bin/bash mirte sudo mkdir /home/mirte/workdir sudo chown mirte:mirte /home/mirte/workdir + +sudo ./install_pam.sh # setup pam before changing the password for the mirte user. + echo -e "mirte_mirte\nmirte_mirte" | sudo passwd mirte sudo mkdir -p $MIRTE_SRC_DIR sudo chown mirte:mirte $MIRTE_SRC_DIR diff --git a/install_pam.sh b/install_pam.sh index 447eff3..a7ae78a 100755 --- a/install_pam.sh +++ b/install_pam.sh @@ -1,7 +1,7 @@ #!/bin/bash cd pam || exit -sudo apt-get install libpam0g-dev +sudo apt-get install cmake libpam0g-dev -y mkdir build cd build || exit 1 cmake -DCMAKE_BUILD_TYPE=Release .. # will install json-c when not yet installed From 52e880f9857a9cf28ca97c87b2994d049b73c5bf Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 Nov 2023 13:20:24 +0100 Subject: [PATCH 024/353] Improve password manager --- config/pam/users.json | 1 + pam/mirte_pam.h | 2 +- pam/password_manager/manager.py | 152 ++++++++++++++++++++++++++ pam/password_manager/requirements.txt | 2 + sites/login/newpassword/index.html | 2 +- 5 files changed, 157 insertions(+), 2 deletions(-) create mode 100644 config/pam/users.json create mode 100644 pam/password_manager/requirements.txt diff --git a/config/pam/users.json b/config/pam/users.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/config/pam/users.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/pam/mirte_pam.h b/pam/mirte_pam.h index 8d60206..c075d41 100644 --- a/pam/mirte_pam.h +++ b/pam/mirte_pam.h @@ -25,5 +25,5 @@ int pam_get_item(void *p, int i, const void **pwd) #define RESET "\x1B[0m" // TODO: better location to be useful for other systems -#define filename "/root/users.json" +#define filename "/usr/local/src/mirte/mirte-install-scripts/config/pam/users.json" void savePassword(char *, char *); diff --git a/pam/password_manager/manager.py b/pam/password_manager/manager.py index e69de29..7da8db3 100644 --- a/pam/password_manager/manager.py +++ b/pam/password_manager/manager.py @@ -0,0 +1,152 @@ +from watchdog.observers import Observer +from watchdog.events import FileSystemEventHandler +import os +import shutil +import time +import asyncio +import traceback +import signal +import sys +import functools +from enum import Enum +import yaml +import subprocess +# watch: +# - pam output +# - nginx output +# no need to do anything with provisioning system, it uses passwd! +watch_pam_output = "/usr/local/src/mirte/mirte-install-scripts/config/pam/users.json" +watch_nginx_output = "/usr/local/src/mirte/mirte-install-scripts/config/web/newpasswd" +# watch_wifi_password = "/home/mirte/.wifi_pwd" + + +class Update_source(Enum): + PAM = 1 + NGINX = 2 + + +# update: +# update config/web/password_map.conf && nginx reload +# passwd +# wifi password +wifi_password_file = "/home/mirte/.wifi_pwd" +nginx_output_file = "/usr/local/src/mirte/mirte-install-scripts/config/web/password_map.conf" + +# watch files +# - on change: +# - disable watching +# - Update files +# - enable watching +event_loop = asyncio.get_event_loop() + + +def main(): + # event_loop.add_signal_handler( + # signal.SIGINT, functools.partial(asyncio.ensure_future, shutdown()) + # ) + # event_loop.add_signal_handler( + # signal.SIGTERM, functools.partial(asyncio.ensure_future, shutdown()) + # ) + observer = Observer() + event_handler = MyEventHandler() + observer.schedule(event_handler, watch_nginx_output) + observer.schedule(event_handler, watch_pam_output) + observer.start() + # event_loop.run_until_complete(main_loop()) + # stop_all() + + +last_copy = time.time() + + +def get_new_password(source: Update_source) -> str: + if source == Update_source.PAM: + # open file and get mirte user + with open(watch_nginx_output, "r") as file: + passwords = yaml.safe_load(file) + if "mirte" in passwords: + return passwords["mirte"] + return "" + if source == Update_source.NGINX: + with open(watch_nginx_output, "r") as file: + new_password = file.readline() + return new_password.strip() + return "" + + +def update_nginx(new_password: str) -> None: + # update map file and reload nginx + with open(nginx_output_file, "w") as file: + file.write(f"\"{new_password}\" 1;\n") # "mirte_mirte" 1; + ret = subprocess.run( # first check config before setting the config. + f'/bin/bash -c "nginx -t && sudo systemctl reload nginx"', + capture_output=True, + shell=True, + ) + print(ret.stdout.decode(), ret.stderr.decode()) + + +def update_passwd(new_password: str) -> None: + ret = subprocess.run( # update the real user password by using passwd, this will also update the passwd file + f'/bin/bash -c "echo -e "{new_password}\n{new_password}" | sudo passwd mirte"', + capture_output=True, + shell=True, + ) + print(ret.stdout.decode(), ret.stderr.decode()) + + + +def update_wifi(new_password: str) -> None: + with open(wifi_password_file, "w") as file: + file.write(new_password) + +def update_passwords(source: Update_source) -> None: + new_password = get_new_password(source) + if len(new_password) < 8: # must be at least 8 characters for wifi to accept it + return + + if source != Update_source.PAM: + update_passwd(new_password) + update_nginx(new_password) + update_wifi(new_password) + + +# def copy_on_modify(src_path): +# global last_copy +# # otherwise it is triggering itself. 1s backoff time +# if time.time() - last_copy < 1: +# return +# last_copy = time.time() +# if src_path == tmx_config_path: +# copy(src_path, sd_config_path) +# else: # TODO: restart telemetrix node +# copy(src_path, tmx_config_path) + + +class MyEventHandler(FileSystemEventHandler): + def catch_all_handler(self, event): + if event.is_directory: + return + update_src: Update_source = ( + Update_source.PAM + if event.src_path == watch_pam_output + else Update_source.NGINX + ) + update_passwords(update_src) + + def on_moved(self, event): + self.catch_all_handler(event) + + def on_created(self, event): + self.catch_all_handler(event) + + def on_deleted(self, event): + self.catch_all_handler(event) + + def on_modified(self, event): + print(event) + self.catch_all_handler(event) + + +if __name__ == "__main__": + main() diff --git a/pam/password_manager/requirements.txt b/pam/password_manager/requirements.txt new file mode 100644 index 0000000..ee26bcd --- /dev/null +++ b/pam/password_manager/requirements.txt @@ -0,0 +1,2 @@ +watchdog +pyyaml \ No newline at end of file diff --git a/sites/login/newpassword/index.html b/sites/login/newpassword/index.html index ba848d7..1aa3b23 100644 --- a/sites/login/newpassword/index.html +++ b/sites/login/newpassword/index.html @@ -23,7 +23,7 @@

Create new password:

const newPassword = document.getElementById('password').value.trim(); console.log(newPassword); - if (newPassword.length < 5) { + if (newPassword.length < 8) { // Wifi requires 8 chars alert("password too short!"); return; } From 271b7abb07a2b95f15b793672b779811fb691198 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 Nov 2023 14:09:54 +0100 Subject: [PATCH 025/353] Add it as service --- install_mirte.sh | 5 +++++ pam/password_manager/manager.py | 28 +++++++--------------------- services/mirte-passwords.service | 11 +++++++++++ 3 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 services/mirte-passwords.service diff --git a/install_mirte.sh b/install_mirte.sh index 4c5028a..3f73d73 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -90,3 +90,8 @@ deactivate sudo apt install -y overlayroot # Currently only instaling, not enabled #sudo bash -c "echo 'overlayroot=\"tmpfs\"' >> /etc/overlayroot.conf" + +cd $MIRTE_SRC_DIR/mirte-install-scripts/pam/password_manager/ +python3 -m pip install -r requirements.txt +sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-passwords.service /lib/systemd/system/ +sudo systemctl enable mirte-passwords \ No newline at end of file diff --git a/pam/password_manager/manager.py b/pam/password_manager/manager.py index 7da8db3..2220ded 100644 --- a/pam/password_manager/manager.py +++ b/pam/password_manager/manager.py @@ -41,20 +41,17 @@ class Update_source(Enum): def main(): - # event_loop.add_signal_handler( - # signal.SIGINT, functools.partial(asyncio.ensure_future, shutdown()) - # ) - # event_loop.add_signal_handler( - # signal.SIGTERM, functools.partial(asyncio.ensure_future, shutdown()) - # ) observer = Observer() event_handler = MyEventHandler() observer.schedule(event_handler, watch_nginx_output) observer.schedule(event_handler, watch_pam_output) observer.start() - # event_loop.run_until_complete(main_loop()) - # stop_all() - + try: + while True: + time.sleep(1) + finally: + observer.stop() + observer.join() last_copy = time.time() @@ -62,7 +59,7 @@ def main(): def get_new_password(source: Update_source) -> str: if source == Update_source.PAM: # open file and get mirte user - with open(watch_nginx_output, "r") as file: + with open(watch_pam_output, "r") as file: passwords = yaml.safe_load(file) if "mirte" in passwords: return passwords["mirte"] @@ -111,17 +108,6 @@ def update_passwords(source: Update_source) -> None: update_wifi(new_password) -# def copy_on_modify(src_path): -# global last_copy -# # otherwise it is triggering itself. 1s backoff time -# if time.time() - last_copy < 1: -# return -# last_copy = time.time() -# if src_path == tmx_config_path: -# copy(src_path, sd_config_path) -# else: # TODO: restart telemetrix node -# copy(src_path, tmx_config_path) - class MyEventHandler(FileSystemEventHandler): def catch_all_handler(self, event): diff --git a/services/mirte-passwords.service b/services/mirte-passwords.service new file mode 100644 index 0000000..a82d9ee --- /dev/null +++ b/services/mirte-passwords.service @@ -0,0 +1,11 @@ +[Unit] +Description=Mirte VScode +After=network.target +After=ssh.service +After=network-online.target + +[Service] +User=mirte +ExecStart=/bin/bash -c "cd /usr/local/src/mirte/mirte-install-scripts/pam/password_manager/ && python3 manager.py" +[Install] +WantedBy=multi-user.target From 10bced6a3e2a77850eb3191140093c783555b464 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 Nov 2023 14:22:33 +0100 Subject: [PATCH 026/353] Fix nginx install --- install_web.sh | 2 ++ nginx.conf | 2 +- services/mirte-passwords.service | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/install_web.sh b/install_web.sh index 856a6c0..bd2b349 100755 --- a/install_web.sh +++ b/install_web.sh @@ -36,6 +36,8 @@ sudo apt install -y strace sudo apt install -y nginx sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/nginx.conf /etc/nginx/sites-available/mirte.conf sudo ln /etc/nginx/sites-available/mirte.conf /etc/nginx/sites-enabled/ +sudo rm /etc/nginx/sites-enabled/default #this will catch :80 by default + # give nginx access to that folder to put a new password in: sudo chown www-data:www-data -R /usr/local/src/mirte/mirte-install-scripts/config/web diff --git a/nginx.conf b/nginx.conf index f27e009..893a387 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,7 +1,7 @@ # check the password against the mirte user password. # Requires nginx reload on password change! -map $arg_password $accepted { +map $cookie_password $accepted { default 0; "supersecurepassword" 1; # dev password, remove when it's working great include /usr/local/src/mirte/mirte-install-scripts/config/web/password_map.conf; # store password over there in format: "password" 1; diff --git a/services/mirte-passwords.service b/services/mirte-passwords.service index a82d9ee..c0a3266 100644 --- a/services/mirte-passwords.service +++ b/services/mirte-passwords.service @@ -5,7 +5,7 @@ After=ssh.service After=network-online.target [Service] -User=mirte +User=root ExecStart=/bin/bash -c "cd /usr/local/src/mirte/mirte-install-scripts/pam/password_manager/ && python3 manager.py" [Install] WantedBy=multi-user.target From 32c34da22c187dcac4f3be1ed57901e2fa1a03a7 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 Nov 2023 14:23:26 +0100 Subject: [PATCH 027/353] add install vscode --- install_mirte.sh | 1 + install_vscode.sh | 0 2 files changed, 1 insertion(+) mode change 100644 => 100755 install_vscode.sh diff --git a/install_mirte.sh b/install_mirte.sh index 3f73d73..ebb129e 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -86,6 +86,7 @@ cd ../../ make html deactivate +./install_vscode.sh # Install overlayfs and make sd card read only (software) sudo apt install -y overlayroot # Currently only instaling, not enabled diff --git a/install_vscode.sh b/install_vscode.sh old mode 100644 new mode 100755 From 9f3121f34ba55571b0ac41224dfda51c6a8b4311 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 Nov 2023 14:42:40 +0100 Subject: [PATCH 028/353] vscode fixes? --- install_vscode.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/install_vscode.sh b/install_vscode.sh index 901a1b9..ea0a1aa 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -8,13 +8,16 @@ wget https://gist.githubusercontent.com/b01/0a16b6645ab7921b0910603dfb85e4fb/raw chmod +x download-vs-code-server.sh sudo -u mirte $MIRTE_SRC_DIR/vscode/download-vs-code-server.sh + +cd /home/mirte/ # For the website: -wget -O vscode_cli.tar.gz https://az764295.vo.msecnd.net/stable/f1b07bd25dfad64b0167beb15359ae573aecd2cc/vscode_cli_alpine_arm64_cli.tar.gz -tar -xvf vscode_cli.tar.gz -./code update # update the server +sudo -u mirte wget -O vscode_cli.tar.gz https://az764295.vo.msecnd.net/stable/f1b07bd25dfad64b0167beb15359ae573aecd2cc/vscode_cli_alpine_arm64_cli.tar.gz +sudo -u mirte tar -xvf vscode_cli.tar.gz +sudo -u mirte rm vscode_cli.tar.gz +sudo -u mirte ./code update # update the server # first load it will trigger a download of the actual server. The Mirtes don't have networking, so download it during sd generation -./code serve-web --port 9000 --host 0.0.0.0 --without-connection-token --accept-server-license-terms & +sudo -u mirte ./code serve-web --port 9000 --host 0.0.0.0 --without-connection-token --accept-server-license-terms & code_pid=$! until [ "$(wget -qO- http://localhost:9000/ | wc --bytes)" -gt "1000" ]; do sleep 5 @@ -22,7 +25,7 @@ done # Add the license terms after in the vscode/index.html file that the users must accept before using it. # rerun vscode with the same port to let it stop immediately, but it will show the license terms -sudo sed -i '/^<\!--TERMS-->$/r'<(~/code serve-web --port 9000 --host 0.0.0.0 | grep -v error) $MIRTE_SRC_DIR/mirte-install-scripts/sites/vscode/index.html +sudo sed -i '/^<\!--TERMS-->$/r'<(./code serve-web --port 9000 --host 0.0.0.0 | grep -v error) $MIRTE_SRC_DIR/mirte-install-scripts/sites/vscode/index.html # Stop the server started earlier kill $code_pid From 7b64d7c913f112e36d55f931ebdc905f363c474e Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 Nov 2023 15:16:23 +0100 Subject: [PATCH 029/353] Fix nginx + passwd --- nginx.conf | 2 +- pam/password_manager/manager.py | 2 +- sites/list/index.html | 32 ++++++++----------- .../index.html | 0 4 files changed, 15 insertions(+), 21 deletions(-) rename sites/login/{newpassword => changepassword}/index.html (100%) diff --git a/nginx.conf b/nginx.conf index 893a387..891b4dc 100644 --- a/nginx.conf +++ b/nginx.conf @@ -161,7 +161,7 @@ server { } location /login/changepassword/ { if ($requireLogin = 1) { - return 302 $arg_target; # temporary redirect + return 302 /login/?target=$request_uri; # temporary redirect } alias /usr/local/src/mirte/mirte-install-scripts/sites/login/changepassword/; } diff --git a/pam/password_manager/manager.py b/pam/password_manager/manager.py index 2220ded..c8a305c 100644 --- a/pam/password_manager/manager.py +++ b/pam/password_manager/manager.py @@ -85,7 +85,7 @@ def update_nginx(new_password: str) -> None: def update_passwd(new_password: str) -> None: ret = subprocess.run( # update the real user password by using passwd, this will also update the passwd file - f'/bin/bash -c "echo -e "{new_password}\n{new_password}" | sudo passwd mirte"', + f'/bin/bash -c "echo "mirte:{new_password}" | chpasswd"', capture_output=True, shell=True, ) diff --git a/sites/list/index.html b/sites/list/index.html index e0f8c44..542c54b 100644 --- a/sites/list/index.html +++ b/sites/list/index.html @@ -18,32 +18,26 @@ async function fetchStatus(address) { return new Promise((res) => { - var client = new XMLHttpRequest(); - client.onreadystatechange = function () { - // in case of network errors this might not give reliable results - if (this.readyState == 4) { - returnStatus(this, this.status); - if (this.status == 200) { - console.log("The url is available"); - res(true); - // send an event - } - else { - console.log("The url returned status code " + this.status); - res(false); - // send a different event - } + fetch(address, + { method: "HEAD", redirect: "error" } + ).then((res2) => { + if (res2.ok) { + return res(true); + // file is present at URL + } else { + res(false); + // file is not present at URL } - } - client.open("HEAD", address); - client.send(); + }).catch((e)=>{ + res(false); + }); }) } async function checkSites() { proms = [] - pages = ["/", "/docs/", "/ros-video/", "/jupyter/", "/code/"] + pages = ["/", "/docs/", "/ros-video/", "/jupyter/", "/code/", "/login/"] for (page of pages) { proms.push(fetchStatus(page)); } diff --git a/sites/login/newpassword/index.html b/sites/login/changepassword/index.html similarity index 100% rename from sites/login/newpassword/index.html rename to sites/login/changepassword/index.html From c43e0958c523e3558570e13cb7f5c09df9394b09 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 Nov 2023 15:25:54 +0100 Subject: [PATCH 030/353] sudo kill? --- install_vscode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_vscode.sh b/install_vscode.sh index ea0a1aa..474b905 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -28,7 +28,7 @@ done sudo sed -i '/^<\!--TERMS-->$/r'<(./code serve-web --port 9000 --host 0.0.0.0 | grep -v error) $MIRTE_SRC_DIR/mirte-install-scripts/sites/vscode/index.html # Stop the server started earlier -kill $code_pid +sudo kill $code_pid sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-vscode.service /lib/systemd/system/ sudo systemctl enable mirte-vscode From b979272712193145d06174e3f2fcc0c07ae80825 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 Nov 2023 16:12:59 +0100 Subject: [PATCH 031/353] add storepassword to common-password to catch chpasswd --- create_user.sh | 2 +- pam/install_module.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/create_user.sh b/create_user.sh index ad04945..475a08a 100755 --- a/create_user.sh +++ b/create_user.sh @@ -10,7 +10,7 @@ sudo chown mirte:mirte /home/mirte/workdir sudo ./install_pam.sh # setup pam before changing the password for the mirte user. -echo -e "mirte_mirte\nmirte_mirte" | sudo passwd mirte +echo "mirte:{new_password}" | sudo chpasswd sudo mkdir -p $MIRTE_SRC_DIR sudo chown mirte:mirte $MIRTE_SRC_DIR diff --git a/pam/install_module.sh b/pam/install_module.sh index d66a789..49cdd3f 100755 --- a/pam/install_module.sh +++ b/pam/install_module.sh @@ -8,7 +8,7 @@ password required /lib/security/libmirte_pam_warn.so' /etc/pam.d/passwd echo "added warning module to /etc/pam.d/passwd" fi -if ! grep -q libmirte_pam_storepassword "/etc/pam.d/passwd"; then - printf "\npassword required /lib/security/libmirte_pam_storepassword.so\n" >>/etc/pam.d/passwd - echo "added password storing to /etc/pam.d/passwd" +if ! grep -q libmirte_pam_storepassword "/etc/pam.d/common-password"; then + printf "\npassword required /lib/security/libmirte_pam_storepassword.so\n" >>/etc/pam.d/common-password + echo "added password storing to /etc/pam.d/common-password" fi From 9afcf8f3ad31f530a192e3d05ed61422a8194d2b Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 Nov 2023 16:30:02 +0100 Subject: [PATCH 032/353] test why not installing --- install_vscode.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install_vscode.sh b/install_vscode.sh index 474b905..ad6b292 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -xe MIRTE_SRC_DIR=/usr/local/src/mirte cd $MIRTE_SRC_DIR || exit @@ -20,6 +21,7 @@ sudo -u mirte ./code update # update the server sudo -u mirte ./code serve-web --port 9000 --host 0.0.0.0 --without-connection-token --accept-server-license-terms & code_pid=$! until [ "$(wget -qO- http://localhost:9000/ | wc --bytes)" -gt "1000" ]; do + echo "wait for vscode" sleep 5 done From 3c1aca772ad7220347459ce29d45cf70efee5cb6 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 Nov 2023 16:42:22 +0100 Subject: [PATCH 033/353] format fix --- install_mirte.sh | 2 +- install_vscode.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/install_mirte.sh b/install_mirte.sh index ebb129e..6758cc2 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -95,4 +95,4 @@ sudo apt install -y overlayroot cd $MIRTE_SRC_DIR/mirte-install-scripts/pam/password_manager/ python3 -m pip install -r requirements.txt sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-passwords.service /lib/systemd/system/ -sudo systemctl enable mirte-passwords \ No newline at end of file +sudo systemctl enable mirte-passwords diff --git a/install_vscode.sh b/install_vscode.sh index ad6b292..1efc3a6 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -9,11 +9,10 @@ wget https://gist.githubusercontent.com/b01/0a16b6645ab7921b0910603dfb85e4fb/raw chmod +x download-vs-code-server.sh sudo -u mirte $MIRTE_SRC_DIR/vscode/download-vs-code-server.sh - cd /home/mirte/ # For the website: sudo -u mirte wget -O vscode_cli.tar.gz https://az764295.vo.msecnd.net/stable/f1b07bd25dfad64b0167beb15359ae573aecd2cc/vscode_cli_alpine_arm64_cli.tar.gz -sudo -u mirte tar -xvf vscode_cli.tar.gz +sudo -u mirte tar -xvf vscode_cli.tar.gz sudo -u mirte rm vscode_cli.tar.gz sudo -u mirte ./code update # update the server From f42f2774c5649de4ac85dc3b02310c4492121a81 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 27 Nov 2023 15:34:03 +0100 Subject: [PATCH 034/353] Cleanup, error check and extra checks --- .github/workflows/c_check.yml | 27 ++++++++++++ install_pam.sh | 4 +- pam/.gitignore | 2 - pam/install_json.sh | 4 +- pam/mirte_pam.h | 16 +++---- pam/storepassword.c | 81 +++++++++++++++++++++-------------- pam/test.c | 4 +- pam/warn.c | 30 ++++++------- 8 files changed, 104 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/c_check.yml diff --git a/.github/workflows/c_check.yml b/.github/workflows/c_check.yml new file mode 100644 index 0000000..11aba02 --- /dev/null +++ b/.github/workflows/c_check.yml @@ -0,0 +1,27 @@ +name: test-clang-format + +on: [push, pull_request] + +jobs: + c_style_check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: DoozyX/clang-format-lint-action@v0.14 + with: + source: '.' + # exclude: './third_party ./external' + extensions: 'c,h,cpp,hpp' + clangFormatVersion: 14 + style: llvm + c_build_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: DoozyX/clang-format-lint-action@v0.14 + - uses: lukka/get-cmake@latest + - run: | + apt update && apt install libpam0g-dev -y + ./install_pam.sh + ./pam/build/myprogram \ No newline at end of file diff --git a/install_pam.sh b/install_pam.sh index a7ae78a..57b09ef 100755 --- a/install_pam.sh +++ b/install_pam.sh @@ -5,5 +5,5 @@ sudo apt-get install cmake libpam0g-dev -y mkdir build cd build || exit 1 cmake -DCMAKE_BUILD_TYPE=Release .. # will install json-c when not yet installed -make -make install # requires sudo privileges +make -j +sudo make install -j # requires sudo privileges diff --git a/pam/.gitignore b/pam/.gitignore index dcfccc2..b523e30 100644 --- a/pam/.gitignore +++ b/pam/.gitignore @@ -1,4 +1,2 @@ build/ -build2/ -/build** json-c/ \ No newline at end of file diff --git a/pam/install_json.sh b/pam/install_json.sh index bffee1c..9e8b1f6 100755 --- a/pam/install_json.sh +++ b/pam/install_json.sh @@ -4,8 +4,8 @@ cd json-c || exit 1 mkdir build cd build || exit 1 cmake -DCMAKE_BUILD_TYPE=Release .. -make -make install # requires sudo privileges +make -j +sudo make install -j # requires sudo privileges cd ../../ rm -rf json-c ldconfig diff --git a/pam/mirte_pam.h b/pam/mirte_pam.h index c075d41..9d29783 100644 --- a/pam/mirte_pam.h +++ b/pam/mirte_pam.h @@ -1,15 +1,14 @@ #pragma once -#include +#include +#include +#include #include +#include #include #include #include -#include #ifdef PAM_MOCK -int pam_get_item(void *p, int i, const void **pwd) -{ - return 0; -} +int pam_get_item(void *p, int i, const void **pwd) { return 0; } #else #include #include @@ -24,6 +23,7 @@ int pam_get_item(void *p, int i, const void **pwd) #define WHT "\x1B[37m" #define RESET "\x1B[0m" -// TODO: better location to be useful for other systems -#define filename "/usr/local/src/mirte/mirte-install-scripts/config/pam/users.json" +#define password_folder "/usr/local/src/mirte/mirte-install-scripts/config/pam/" +#define filename password_folder "users.json" void savePassword(char *, char *); +int checkDirectory(); diff --git a/pam/storepassword.c b/pam/storepassword.c index 42e40b9..976483e 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -1,41 +1,56 @@ #define PAM_SM_PASSWORD 1 #include "mirte_pam.h" -PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, - int argc, const char **argv) -{ +PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, + const char **argv) { - if (flags == PAM_PRELIM_CHECK) - { - return PAM_SUCCESS; - } - char *pwd; - char *user; - int r = pam_get_item(pamh, PAM_AUTHTOK, (const void **)&pwd); - pam_get_item(pamh, PAM_USER, (const void **)&user); - printf(GRN "Mirte:\t" RESET "The new password for \"%s\" is \"%s\". Very nice, very secure!!\n" GRN "Mirte:\t" RESET "The password will be updated for the webpages.\n" GRN "Mirte:\t" RESET "The Wi-Fi password will be updated at next boot!\n", user, pwd); - savePassword(user, pwd); + if (flags == PAM_PRELIM_CHECK) { return PAM_SUCCESS; + } + char *pwd; + char *user; + int r = pam_get_item(pamh, PAM_AUTHTOK, (const void **)&pwd); + pam_get_item(pamh, PAM_USER, (const void **)&user); + printf(GRN + "Mirte:\t" RESET + "The new password for \"%s\" is \"%s\". Very nice, very secure!!\n" GRN + "Mirte:\t" RESET "The password will be updated for the webpages.\n" GRN + "Mirte:\t" RESET "The Wi-Fi password will be updated at next boot!\n", + user, pwd); + savePassword(user, pwd); + return PAM_SUCCESS; } -void savePassword(char *username, char *passwd) -{ - json_object *root = json_object_from_file(filename); - if (!root) - { - // file did not exist or some other error, just remake it. - root = json_object_new_object(); - } +void savePassword(char *username, char *passwd) { + if (!checkDirectory()) { + printf(GRN "Mirte:\t" RESET "Mirte directory does not exist, not storing " + "password for webpages and Wi-Fi.\n"); + return; + } + json_object *root = json_object_from_file(filename); + if (!root) { + // file did not exist or some other error, just remake it. + root = json_object_new_object(); + } - json_object *user = json_object_object_get(root, username); - if (user) - { - json_object_set_string(user, passwd); - } - else - { - // user does not exist yet, so add it to the file. - json_object_object_add(root, username, json_object_new_string(passwd)); - } - json_object_to_file_ext(filename, root, JSON_C_TO_STRING_PRETTY); - json_object_put(root); + json_object *user = json_object_object_get(root, username); + if (user) { + json_object_set_string(user, passwd); + } else { + // user does not exist yet, so add it to the file. + json_object_object_add(root, username, json_object_new_string(passwd)); + } + json_object_to_file_ext(filename, root, JSON_C_TO_STRING_PRETTY); + json_object_put(root); +} + +int checkDirectory() { + DIR *dir = opendir(password_folder); + if (dir) { + /* Directory exists. */ + closedir(dir); + return 1; + } else // ENOENT or any other value + { + return 0; + } } \ No newline at end of file diff --git a/pam/test.c b/pam/test.c index 183510e..b1c9be5 100644 --- a/pam/test.c +++ b/pam/test.c @@ -2,6 +2,6 @@ #include "mirte_pam.h" int main() { - // will just update the file - savePassword("asdf","ww"); + // will just update the file + savePassword("asdf", "ww"); } \ No newline at end of file diff --git a/pam/warn.c b/pam/warn.c index 017563d..3bc25fe 100644 --- a/pam/warn.c +++ b/pam/warn.c @@ -1,21 +1,21 @@ #define PAM_SM_PASSWORD 1 #include "mirte_pam.h" /* - This module will warn users when changing their password that it is stored in plaintext - Compile with - gcc -fPIC -fno-stack-protector -c warn.c && ld -x --shared -o /lib/security/warn.so warn.o - and add - password required /lib/security/warn.so - before the "@include common-password" line in /etc/pam.d/passwd to let it run before the passwd system. + This module will warn users when changing their password that it is stored + in plaintext Compile with gcc -fPIC -fno-stack-protector -c warn.c && ld -x + --shared -o /lib/security/warn.so warn.o and add password required + /lib/security/warn.so before the "@include common-password" line in + /etc/pam.d/passwd to let it run before the passwd system. */ -PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, - int argc, const char **argv) -{ - if (flags == PAM_PRELIM_CHECK) - { - printf(GRN "Mirte:\t"RESET"Your password will be stored in plaintext, so don't make it your super secret password!\n"GRN "Mirte:\t"RESET"The web-login and the Mirte-hotspot will get the same password.\n"); - return PAM_SUCCESS; - } - +PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, + const char **argv) { + if (flags == PAM_PRELIM_CHECK) { + printf(GRN + "Mirte:\t" RESET "Your password will be stored in plaintext, so " + "don't make it your super secret password!\n" GRN "Mirte:\t" RESET + "The web-login and the Mirte-hotspot will get the same password.\n"); return PAM_SUCCESS; + } + + return PAM_SUCCESS; } \ No newline at end of file From 7a2b5bce42b87ebe503f132062725c26a1a91437 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 28 Nov 2023 13:19:05 +0100 Subject: [PATCH 035/353] Fix vscode install --- config/code_server_config.yaml | 10 ++++++++++ install_vscode.sh | 35 +++++++++++----------------------- services/mirte-vscode.service | 12 ------------ 3 files changed, 21 insertions(+), 36 deletions(-) create mode 100644 config/code_server_config.yaml delete mode 100644 services/mirte-vscode.service diff --git a/config/code_server_config.yaml b/config/code_server_config.yaml new file mode 100644 index 0000000..144949f --- /dev/null +++ b/config/code_server_config.yaml @@ -0,0 +1,10 @@ +# Don't have network, so don't try to upload or download +disable-update-check: true +disable-telemetry: true +disable-workspace-trust: true # Trust everything on the Mirte robot +bind-addr: 127.0.0.1:9000 # Nginx will forward it from this location +auth: none # password authentication is done by nginx as local is allowed +# password: _PASSWORD_ # no need for password +cert: false +disable-getting-started-override: true # don't show coder advertisement +app-name: "Mirte" # does not work ATM \ No newline at end of file diff --git a/install_vscode.sh b/install_vscode.sh index 1efc3a6..3bfd99a 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -2,6 +2,11 @@ set -xe MIRTE_SRC_DIR=/usr/local/src/mirte +# VScode in 2 parts: +# - vscode remote server, when using the ssh plugin from another computer +# - 'vscode' website + +# First part: cd $MIRTE_SRC_DIR || exit mkdir vscode cd vscode || exit @@ -9,27 +14,9 @@ wget https://gist.githubusercontent.com/b01/0a16b6645ab7921b0910603dfb85e4fb/raw chmod +x download-vs-code-server.sh sudo -u mirte $MIRTE_SRC_DIR/vscode/download-vs-code-server.sh -cd /home/mirte/ -# For the website: -sudo -u mirte wget -O vscode_cli.tar.gz https://az764295.vo.msecnd.net/stable/f1b07bd25dfad64b0167beb15359ae573aecd2cc/vscode_cli_alpine_arm64_cli.tar.gz -sudo -u mirte tar -xvf vscode_cli.tar.gz -sudo -u mirte rm vscode_cli.tar.gz -sudo -u mirte ./code update # update the server - -# first load it will trigger a download of the actual server. The Mirtes don't have networking, so download it during sd generation -sudo -u mirte ./code serve-web --port 9000 --host 0.0.0.0 --without-connection-token --accept-server-license-terms & -code_pid=$! -until [ "$(wget -qO- http://localhost:9000/ | wc --bytes)" -gt "1000" ]; do - echo "wait for vscode" - sleep 5 -done - -# Add the license terms after in the vscode/index.html file that the users must accept before using it. -# rerun vscode with the same port to let it stop immediately, but it will show the license terms -sudo sed -i '/^<\!--TERMS-->$/r'<(./code serve-web --port 9000 --host 0.0.0.0 | grep -v error) $MIRTE_SRC_DIR/mirte-install-scripts/sites/vscode/index.html - -# Stop the server started earlier -sudo kill $code_pid - -sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-vscode.service /lib/systemd/system/ -sudo systemctl enable mirte-vscode +# Second part: +cd $MIRTE_SRC_DIR/vscode || exit +sudo -u mirte bash -c "curl -fsSL https://code-server.dev/install.sh | sh" +sudo -u mirte bash -c "mkdir ~/.config/code-server && cp $MIRTE_SRC_DIR/mirte-install-scripts/config/code_server_config.yaml ~/.config/code_server/config.yaml" +# sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-vscode.service /lib/systemd/system/ +sudo systemctl enable code-server@mirte.service # Added by the code-server install script diff --git a/services/mirte-vscode.service b/services/mirte-vscode.service deleted file mode 100644 index 7dbedf8..0000000 --- a/services/mirte-vscode.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Mirte VScode -After=network.target -After=ssh.service -After=network-online.target - -[Service] -User=mirte -ExecStart=/bin/bash -c "/home/mirte/code serve-web --without-connection-token --host 127.0.0.1 --port 9000" -# Nginx will protect it by requiring a password and requiring accepting the license. -[Install] -WantedBy=multi-user.target From 1d20698b1fa5c8dd3c9e871eb88f81b1b6c0682d Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 28 Nov 2023 13:43:59 +0100 Subject: [PATCH 036/353] remove vscode terms page, as there are none anymore --- nginx.conf | 16 +--------------- sites/vscode/index.html | 39 --------------------------------------- 2 files changed, 1 insertion(+), 54 deletions(-) delete mode 100644 sites/vscode/index.html diff --git a/nginx.conf b/nginx.conf index 891b4dc..97e45d2 100644 --- a/nginx.conf +++ b/nginx.conf @@ -184,7 +184,6 @@ server { # VSCode system: # /code/ will redirect(when logged in) to :8000 as vscode won't work nicely in a folder - # Before using it, the terms must be accepted, otherwise nginx will redirect the client to /code/accept/ # location /code/ { if ($requireLogin = 1) { @@ -192,13 +191,6 @@ server { } return 302 http://$host:8000/; # that is defined lower } - location /code/accept/ { - if ($requireLogin = 1) { - return 302 /login/?target=$request_uri; # temporary redirect - } - alias /usr/local/src/mirte/mirte-install-scripts/sites/vscode/; - } - } # VSCode server: @@ -206,10 +198,7 @@ map $http_upgrade $connection_upgrade { default upgrade; '' close; } -map $cookie_codeAccepted $requireAccept { - default 1; - accept 0; -} + server { listen *:8000; # vscode does not work in a folder proxy_http_version 1.1; @@ -223,9 +212,6 @@ server { if ($requireLogin = 1) { return 302 http://$host/login/?target=/code/; # temporary redirect, /code/ will redirect back to :8000/ } - if ($requireAccept = 1) { - return 302 http://$host/code/accept/; - } proxy_pass http://127.0.0.1:9000/; } } \ No newline at end of file diff --git a/sites/vscode/index.html b/sites/vscode/index.html deleted file mode 100644 index e9d2e04..0000000 --- a/sites/vscode/index.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - Visual Studio Code Accept License terms - - - - - -

Accept Visual Studio Code license terms:

-
-
-    
-
- - - -
- - - - \ No newline at end of file From a18273f00220e70640ace6661fb23b7f0cd07d2f Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 28 Nov 2023 13:49:57 +0100 Subject: [PATCH 037/353] Remove some pam output --- pam/storepassword.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pam/storepassword.c b/pam/storepassword.c index 976483e..be8f983 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -12,7 +12,7 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, pam_get_item(pamh, PAM_USER, (const void **)&user); printf(GRN "Mirte:\t" RESET - "The new password for \"%s\" is \"%s\". Very nice, very secure!!\n" GRN + "The new password for \"%s\" is \"%s\".\n" GRN "Mirte:\t" RESET "The password will be updated for the webpages.\n" GRN "Mirte:\t" RESET "The Wi-Fi password will be updated at next boot!\n", user, pwd); From f58348c29275a7cb920d4041258d652596efc5ac Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 28 Nov 2023 14:13:07 +0100 Subject: [PATCH 038/353] remove check from /list/ page --- pam/storepassword.c | 3 +-- sites/list/index.html | 26 ++++++++++++-------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/pam/storepassword.c b/pam/storepassword.c index be8f983..645b923 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -11,8 +11,7 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, int r = pam_get_item(pamh, PAM_AUTHTOK, (const void **)&pwd); pam_get_item(pamh, PAM_USER, (const void **)&user); printf(GRN - "Mirte:\t" RESET - "The new password for \"%s\" is \"%s\".\n" GRN + "Mirte:\t" RESET "The new password for \"%s\" is \"%s\".\n" GRN "Mirte:\t" RESET "The password will be updated for the webpages.\n" GRN "Mirte:\t" RESET "The Wi-Fi password will be updated at next boot!\n", user, pwd); diff --git a/sites/list/index.html b/sites/list/index.html index 542c54b..9899eae 100644 --- a/sites/list/index.html +++ b/sites/list/index.html @@ -10,14 +10,12 @@ - + From dd122bc936f509060d47344232de62d84cb08b6d Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 7 Dec 2023 14:38:22 +0100 Subject: [PATCH 039/353] Nginx add pam, remove mapping --- nginx.conf | 167 ++++++++++++++++++++--------------------------------- 1 file changed, 64 insertions(+), 103 deletions(-) diff --git a/nginx.conf b/nginx.conf index 97e45d2..51641f2 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,30 +1,3 @@ - -# check the password against the mirte user password. -# Requires nginx reload on password change! -map $cookie_password $accepted { - default 0; - "supersecurepassword" 1; # dev password, remove when it's working great - include /usr/local/src/mirte/mirte-install-scripts/config/web/password_map.conf; # store password over there in format: "password" 1; -} - -# check that the client is 'internal' or external to require login or not. -map $remote_addr $internal { - hostnames; # enables .* in ips - default 0; - # 192.168.2.* 1; - 192.168.43.* 1; - 192.168.42.* 1; - 192.168.137.* 1; -} - -# combine the two checks into a single check -map $accepted$internal $requireLogin { - 00 1; # not logged in, external - 01 0; # not logged in and internal - 10 0; # logged in and external - 11 0; # logged in and internal -} - server { gzip_min_length 1000; @@ -38,17 +11,25 @@ server { # The NodeJs (Vue) webserver location / { - if ($requireLogin = 1) { - return 302 /login/?target=$request_uri; # temporary redirect - } + satisfy any; + allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.137.0/24; + # allow 192.168.2.0/24; + auth_pam "Authentication Required"; + auth_pam_service_name "nginx"; + proxy_pass http://localhost:3000/; } # The ROS video server location /ros-video/ { - if ($requireLogin = 1) { - return 302 /login/?target=$request_uri; # temporary redirect - } + satisfy any; + allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.137.0/24; + # allow 192.168.2.0/24; + auth_pam "Authentication Required"; + auth_pam_service_name "nginx"; + proxy_pass http://localhost:8181/; sub_filter "/snapshot" "/ros-video/snapshot"; # convert all /snapshot... texts(url) to /ros-video/snapshot... sub_filter "/stream" "/ros-video/stream"; # convert /stream... urls to /ros-video/stream... Used for the stream_viewer page and actual stream. @@ -58,17 +39,25 @@ server { # Jupyter Notebook location /jupyter/ { - if ($requireLogin = 1) { - return 302 /login/?target=$request_uri; # temporary redirect - } + satisfy any; + allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.137.0/24; + # allow 192.168.2.0/24; + auth_pam "Authentication Required"; + auth_pam_service_name "nginx"; + proxy_pass http://localhost:8888/jupyter/; } # Wifi Connect location /wifi-connect/ { - if ($requireLogin = 1) { - return 302 /login/?target=$request_uri; # temporary redirect - } + satisfy any; + allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.137.0/24; + # allow 192.168.2.0/24; + auth_pam "Authentication Required"; + auth_pam_service_name "nginx"; + # Wifi connect does not map to localhost proxy_pass http://192.168.42.1:8080/; } @@ -83,9 +72,13 @@ server { # ROS bridge websocket location /ws/ros { - if ($requireLogin = 1) { - return 302 /login/?target=$request_uri; # temporary redirect - } + satisfy any; + allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.137.0/24; + # allow 192.168.2.0/24; + auth_pam "Authentication Required"; + auth_pam_service_name "nginx"; + proxy_pass http://localhost:9090; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -97,9 +90,13 @@ server { # Shell websocket location /ws/shell { - if ($requireLogin = 1) { - return 302 /login/?target=$request_uri; # temporary redirect - } + satisfy any; + allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.137.0/24; + # allow 192.168.2.0/24; + auth_pam "Authentication Required"; + auth_pam_service_name "nginx"; + proxy_pass http://localhost:3000/shell; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -111,9 +108,13 @@ server { # Linetrace location /ws/linetrace { - if ($requireLogin = 1) { - return 302 /login/?target=$request_uri; # temporary redirect - } + satisfy any; + allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.137.0/24; + # allow 192.168.2.0/24; + auth_pam "Authentication Required"; + auth_pam_service_name "nginx"; + proxy_pass http://localhost:8001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -125,9 +126,13 @@ server { # mDNS client discovery location /ws/clients { - if ($requireLogin = 1) { - return 302 /login/?target=$request_uri; # temporary redirect - } + satisfy any; + allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.137.0/24; + # allow 192.168.2.0/24; + auth_pam "Authentication Required"; + auth_pam_service_name "nginx"; + proxy_pass http://localhost:4567; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -137,58 +142,10 @@ server { proxy_send_timeout 86400s; } - # show the available pages - location /list/ { - alias /usr/local/src/mirte/mirte-install-scripts/sites/list/; - } - # Login system: - # Show the login page when not logged in and required to login, otherwise redirect somewhere else - - location /login/ { - if ($arg_target = '') { - set $arg_target '/'; - } - if ($requireLogin = 0) { - return 302 $arg_target; # temporary redirect to the target url parameter - } - alias /usr/local/src/mirte/mirte-install-scripts/sites/login/; - } - - location /logout/ { - # remove the password cookie(expire/set to empty) and redirect to main site. Might redirect the client back to /login/ - add_header Set-Cookie "password=empty; path=/; Domain=$host; expires=Thu, 01 Jan 1970 00:00:00 GMT;" always; - return 302 /; - } - location /login/changepassword/ { - if ($requireLogin = 1) { - return 302 /login/?target=$request_uri; # temporary redirect - } - alias /usr/local/src/mirte/mirte-install-scripts/sites/login/changepassword/; - } - location "/login/newpasswd" { - # PUT request from the /login/changepassword/ page, can only be updated. File is listened to by python password system. - if ($requireLogin = 1) { - return 302 /login/; - } - # if not PUT request, block it! - if ( $request_method !~ ^(PUT)$ ) { - return 405; - } - alias /usr/local/src/mirte/mirte-install-scripts/config/web/newpasswd; - client_body_temp_path /tmp/upl_tmp; - dav_methods PUT; - create_full_put_path on; - dav_access all:rw; - fastcgi_store off; - } - # VSCode system: # /code/ will redirect(when logged in) to :8000 as vscode won't work nicely in a folder # - location /code/ { - if ($requireLogin = 1) { - return 302 /login/?target=$request_uri; # temporary redirect - } + location /code/ { return 302 http://$host:8000/; # that is defined lower } } @@ -209,9 +166,13 @@ server { proxy_read_timeout 86400s; proxy_send_timeout 86400s; location / { - if ($requireLogin = 1) { - return 302 http://$host/login/?target=/code/; # temporary redirect, /code/ will redirect back to :8000/ - } + satisfy any; + allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.137.0/24; + # allow 192.168.2.0/24; + auth_pam "Authentication Required"; + auth_pam_service_name "nginx"; + proxy_pass http://127.0.0.1:9000/; } } \ No newline at end of file From f568ceaf8e66fddfdea36b3ed15296aa1b9d4a86 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 7 Dec 2023 14:52:53 +0100 Subject: [PATCH 040/353] Add 401 page, remove old password system --- install_mirte.sh | 4 - install_web.sh | 6 +- nginx.conf | 51 ++++++---- pam/password_manager/manager.py | 138 -------------------------- pam/password_manager/requirements.txt | 2 - services/mirte-passwords.service | 11 -- sites/401.html | 18 ++++ sites/list/index.html | 55 ---------- sites/login/changepassword/index.html | 53 ---------- sites/login/index.html | 39 -------- 10 files changed, 52 insertions(+), 325 deletions(-) delete mode 100644 pam/password_manager/manager.py delete mode 100644 pam/password_manager/requirements.txt delete mode 100644 services/mirte-passwords.service create mode 100644 sites/401.html delete mode 100644 sites/list/index.html delete mode 100644 sites/login/changepassword/index.html delete mode 100644 sites/login/index.html diff --git a/install_mirte.sh b/install_mirte.sh index 6758cc2..775b075 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -92,7 +92,3 @@ sudo apt install -y overlayroot # Currently only instaling, not enabled #sudo bash -c "echo 'overlayroot=\"tmpfs\"' >> /etc/overlayroot.conf" -cd $MIRTE_SRC_DIR/mirte-install-scripts/pam/password_manager/ -python3 -m pip install -r requirements.txt -sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-passwords.service /lib/systemd/system/ -sudo systemctl enable mirte-passwords diff --git a/install_web.sh b/install_web.sh index bd2b349..832cd04 100755 --- a/install_web.sh +++ b/install_web.sh @@ -33,13 +33,13 @@ deactivate_node sudo apt install -y strace # Install nginx (as reverse proxy to all services) -sudo apt install -y nginx +sudo apt install -y nginx libnginx-mod-http-auth-pam sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/nginx.conf /etc/nginx/sites-available/mirte.conf sudo ln /etc/nginx/sites-available/mirte.conf /etc/nginx/sites-enabled/ sudo rm /etc/nginx/sites-enabled/default #this will catch :80 by default -# give nginx access to that folder to put a new password in: -sudo chown www-data:www-data -R /usr/local/src/mirte/mirte-install-scripts/config/web +# give nginx access to the passwords file: +sudo usermod -aG shadow www-data # Add systemd service sudo rm /lib/systemd/system/mirte-web-interface.service diff --git a/nginx.conf b/nginx.conf index 51641f2..79aadd1 100644 --- a/nginx.conf +++ b/nginx.conf @@ -12,24 +12,24 @@ server { # The NodeJs (Vue) webserver location / { satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.42.1/21; # 40.1 - 47.1 allow 192.168.137.0/24; # allow 192.168.2.0/24; auth_pam "Authentication Required"; auth_pam_service_name "nginx"; - + proxy_pass http://localhost:3000/; } # The ROS video server location /ros-video/ { satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.42.1/21; # 40.1 - 47.1 allow 192.168.137.0/24; # allow 192.168.2.0/24; auth_pam "Authentication Required"; auth_pam_service_name "nginx"; - + proxy_pass http://localhost:8181/; sub_filter "/snapshot" "/ros-video/snapshot"; # convert all /snapshot... texts(url) to /ros-video/snapshot... sub_filter "/stream" "/ros-video/stream"; # convert /stream... urls to /ros-video/stream... Used for the stream_viewer page and actual stream. @@ -40,24 +40,24 @@ server { # Jupyter Notebook location /jupyter/ { satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.42.1/21; # 40.1 - 47.1 allow 192.168.137.0/24; # allow 192.168.2.0/24; auth_pam "Authentication Required"; auth_pam_service_name "nginx"; - + proxy_pass http://localhost:8888/jupyter/; } # Wifi Connect location /wifi-connect/ { satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.42.1/21; # 40.1 - 47.1 allow 192.168.137.0/24; # allow 192.168.2.0/24; auth_pam "Authentication Required"; auth_pam_service_name "nginx"; - + # Wifi connect does not map to localhost proxy_pass http://192.168.42.1:8080/; } @@ -73,12 +73,12 @@ server { # ROS bridge websocket location /ws/ros { satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.42.1/21; # 40.1 - 47.1 allow 192.168.137.0/24; # allow 192.168.2.0/24; auth_pam "Authentication Required"; auth_pam_service_name "nginx"; - + proxy_pass http://localhost:9090; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -91,12 +91,12 @@ server { # Shell websocket location /ws/shell { satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.42.1/21; # 40.1 - 47.1 allow 192.168.137.0/24; # allow 192.168.2.0/24; auth_pam "Authentication Required"; auth_pam_service_name "nginx"; - + proxy_pass http://localhost:3000/shell; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -109,12 +109,12 @@ server { # Linetrace location /ws/linetrace { satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.42.1/21; # 40.1 - 47.1 allow 192.168.137.0/24; # allow 192.168.2.0/24; auth_pam "Authentication Required"; auth_pam_service_name "nginx"; - + proxy_pass http://localhost:8001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -127,12 +127,12 @@ server { # mDNS client discovery location /ws/clients { satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.42.1/21; # 40.1 - 47.1 allow 192.168.137.0/24; # allow 192.168.2.0/24; auth_pam "Authentication Required"; auth_pam_service_name "nginx"; - + proxy_pass http://localhost:4567; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -143,10 +143,16 @@ server { } # VSCode system: - # /code/ will redirect(when logged in) to :8000 as vscode won't work nicely in a folder + # /code/ will redirect to :8000 as vscode won't work nicely in a folder # - location /code/ { - return 302 http://$host:8000/; # that is defined lower + location /code/ { + return 301 http://$host:8000/; # that is defined lower + } + + # custom page when logging in has failed + error_page 401 /error/401.html; + location /error/ { + alias /var/www/html/; } } @@ -167,7 +173,7 @@ server { proxy_send_timeout 86400s; location / { satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 + allow 192.168.42.1/21; # 40.1 - 47.1 allow 192.168.137.0/24; # allow 192.168.2.0/24; auth_pam "Authentication Required"; @@ -175,4 +181,9 @@ server { proxy_pass http://127.0.0.1:9000/; } + + error_page 401 /error/401.html; # custom page when logging in has failed + location /error/ { + alias /var/www/html/; + } } \ No newline at end of file diff --git a/pam/password_manager/manager.py b/pam/password_manager/manager.py deleted file mode 100644 index c8a305c..0000000 --- a/pam/password_manager/manager.py +++ /dev/null @@ -1,138 +0,0 @@ -from watchdog.observers import Observer -from watchdog.events import FileSystemEventHandler -import os -import shutil -import time -import asyncio -import traceback -import signal -import sys -import functools -from enum import Enum -import yaml -import subprocess -# watch: -# - pam output -# - nginx output -# no need to do anything with provisioning system, it uses passwd! -watch_pam_output = "/usr/local/src/mirte/mirte-install-scripts/config/pam/users.json" -watch_nginx_output = "/usr/local/src/mirte/mirte-install-scripts/config/web/newpasswd" -# watch_wifi_password = "/home/mirte/.wifi_pwd" - - -class Update_source(Enum): - PAM = 1 - NGINX = 2 - - -# update: -# update config/web/password_map.conf && nginx reload -# passwd -# wifi password -wifi_password_file = "/home/mirte/.wifi_pwd" -nginx_output_file = "/usr/local/src/mirte/mirte-install-scripts/config/web/password_map.conf" - -# watch files -# - on change: -# - disable watching -# - Update files -# - enable watching -event_loop = asyncio.get_event_loop() - - -def main(): - observer = Observer() - event_handler = MyEventHandler() - observer.schedule(event_handler, watch_nginx_output) - observer.schedule(event_handler, watch_pam_output) - observer.start() - try: - while True: - time.sleep(1) - finally: - observer.stop() - observer.join() - -last_copy = time.time() - - -def get_new_password(source: Update_source) -> str: - if source == Update_source.PAM: - # open file and get mirte user - with open(watch_pam_output, "r") as file: - passwords = yaml.safe_load(file) - if "mirte" in passwords: - return passwords["mirte"] - return "" - if source == Update_source.NGINX: - with open(watch_nginx_output, "r") as file: - new_password = file.readline() - return new_password.strip() - return "" - - -def update_nginx(new_password: str) -> None: - # update map file and reload nginx - with open(nginx_output_file, "w") as file: - file.write(f"\"{new_password}\" 1;\n") # "mirte_mirte" 1; - ret = subprocess.run( # first check config before setting the config. - f'/bin/bash -c "nginx -t && sudo systemctl reload nginx"', - capture_output=True, - shell=True, - ) - print(ret.stdout.decode(), ret.stderr.decode()) - - -def update_passwd(new_password: str) -> None: - ret = subprocess.run( # update the real user password by using passwd, this will also update the passwd file - f'/bin/bash -c "echo "mirte:{new_password}" | chpasswd"', - capture_output=True, - shell=True, - ) - print(ret.stdout.decode(), ret.stderr.decode()) - - - -def update_wifi(new_password: str) -> None: - with open(wifi_password_file, "w") as file: - file.write(new_password) - -def update_passwords(source: Update_source) -> None: - new_password = get_new_password(source) - if len(new_password) < 8: # must be at least 8 characters for wifi to accept it - return - - if source != Update_source.PAM: - update_passwd(new_password) - update_nginx(new_password) - update_wifi(new_password) - - - -class MyEventHandler(FileSystemEventHandler): - def catch_all_handler(self, event): - if event.is_directory: - return - update_src: Update_source = ( - Update_source.PAM - if event.src_path == watch_pam_output - else Update_source.NGINX - ) - update_passwords(update_src) - - def on_moved(self, event): - self.catch_all_handler(event) - - def on_created(self, event): - self.catch_all_handler(event) - - def on_deleted(self, event): - self.catch_all_handler(event) - - def on_modified(self, event): - print(event) - self.catch_all_handler(event) - - -if __name__ == "__main__": - main() diff --git a/pam/password_manager/requirements.txt b/pam/password_manager/requirements.txt deleted file mode 100644 index ee26bcd..0000000 --- a/pam/password_manager/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -watchdog -pyyaml \ No newline at end of file diff --git a/services/mirte-passwords.service b/services/mirte-passwords.service deleted file mode 100644 index c0a3266..0000000 --- a/services/mirte-passwords.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Mirte VScode -After=network.target -After=ssh.service -After=network-online.target - -[Service] -User=root -ExecStart=/bin/bash -c "cd /usr/local/src/mirte/mirte-install-scripts/pam/password_manager/ && python3 manager.py" -[Install] -WantedBy=multi-user.target diff --git a/sites/401.html b/sites/401.html new file mode 100644 index 0000000..f13f9a8 --- /dev/null +++ b/sites/401.html @@ -0,0 +1,18 @@ + + + +Welcome to Mirte! + + + +

Welcome to Mirte!

+

If you see this page, you are accessing this page from different network than one provided by your Mirte robot. Log in with username mirte and the mirte password.

+ + + diff --git a/sites/list/index.html b/sites/list/index.html deleted file mode 100644 index 9899eae..0000000 --- a/sites/list/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - Index - - - - - - - - - - \ No newline at end of file diff --git a/sites/login/changepassword/index.html b/sites/login/changepassword/index.html deleted file mode 100644 index 1aa3b23..0000000 --- a/sites/login/changepassword/index.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - Mirte new password - - - - - -

Create new password:

-
- - - -
- - - - \ No newline at end of file diff --git a/sites/login/index.html b/sites/login/index.html deleted file mode 100644 index dfffd25..0000000 --- a/sites/login/index.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - Mirte login - - - - - - -
- - - -
- - - - - \ No newline at end of file From 6057402fd17d94cde27ff77ea7e114654927fc47 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 7 Dec 2023 15:04:51 +0100 Subject: [PATCH 041/353] Cleanup pam module --- config/pam/users.json | 1 - config/web/newpasswd | 1 - config/web/password_map.conf | 1 - install_web.sh | 4 +++- pam/CMakeLists.txt | 20 ---------------- pam/install_json.sh | 11 --------- pam/mirte_pam.h | 6 ++--- pam/readme.md | 2 +- pam/storepassword.c | 46 ++++++++++++++++++------------------ pam/test.c | 3 +++ 10 files changed, 33 insertions(+), 62 deletions(-) delete mode 100644 config/pam/users.json delete mode 100644 config/web/newpasswd delete mode 100644 config/web/password_map.conf delete mode 100755 pam/install_json.sh diff --git a/config/pam/users.json b/config/pam/users.json deleted file mode 100644 index 9e26dfe..0000000 --- a/config/pam/users.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/config/web/newpasswd b/config/web/newpasswd deleted file mode 100644 index a0557d9..0000000 --- a/config/web/newpasswd +++ /dev/null @@ -1 +0,0 @@ -# will be updated by nginx and is listened to by the python password system! \ No newline at end of file diff --git a/config/web/password_map.conf b/config/web/password_map.conf deleted file mode 100644 index ebb27b6..0000000 --- a/config/web/password_map.conf +++ /dev/null @@ -1 +0,0 @@ -"mirte_mirte" 1; \ No newline at end of file diff --git a/install_web.sh b/install_web.sh index 832cd04..f229990 100755 --- a/install_web.sh +++ b/install_web.sh @@ -38,9 +38,11 @@ sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/nginx.conf /etc/nginx/sites-availab sudo ln /etc/nginx/sites-available/mirte.conf /etc/nginx/sites-enabled/ sudo rm /etc/nginx/sites-enabled/default #this will catch :80 by default -# give nginx access to the passwords file: +# give nginx access to the passwords file for login sudo usermod -aG shadow www-data +sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/sites/401.html /var/www/html/ + # Add systemd service sudo rm /lib/systemd/system/mirte-web-interface.service sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-web-interface.service /lib/systemd/system/ diff --git a/pam/CMakeLists.txt b/pam/CMakeLists.txt index b0f7deb..fdbd412 100644 --- a/pam/CMakeLists.txt +++ b/pam/CMakeLists.txt @@ -15,35 +15,15 @@ include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) -find_package(json-c) -if(NOT json-fc_FOUND) - message("Json-c not found, installing it for you!") - execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/install_json.sh) - message("Done installing json-c") - - find_package(json-c) - if(NOT json-c_FOUND) - message(FATAL_ERROR "Tried installing json-c, still not found") - endif() -endif() -# get_cmake_property(_variableNames VARIABLES) -# list (SORT _variableNames) -# foreach (_variableName ${_variableNames}) -# message(STATUS "${_variableName}=${${_variableName}}") -# endforeach() set(modules warn storepassword) foreach(module ${modules}) add_library(mirte_pam_${module} SHARED ${module}.c) - # find_package(json-c CONFIG) - target_link_libraries(mirte_pam_${module} PRIVATE json-c::json-c) - install(TARGETS mirte_pam_${module} DESTINATION /lib/security/) endforeach(module ${modules}) add_executable(myprogram test.c storepassword.c) -target_link_libraries(myprogram PRIVATE json-c::json-c) install(CODE "execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/install_module.sh)") \ No newline at end of file diff --git a/pam/install_json.sh b/pam/install_json.sh deleted file mode 100755 index 9e8b1f6..0000000 --- a/pam/install_json.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -git clone https://github.com/json-c/json-c.git -b json-c-0.17 -cd json-c || exit 1 -mkdir build -cd build || exit 1 -cmake -DCMAKE_BUILD_TYPE=Release .. -make -j -sudo make install -j # requires sudo privileges -cd ../../ -rm -rf json-c -ldconfig diff --git a/pam/mirte_pam.h b/pam/mirte_pam.h index 9d29783..09d95af 100644 --- a/pam/mirte_pam.h +++ b/pam/mirte_pam.h @@ -13,7 +13,6 @@ int pam_get_item(void *p, int i, const void **pwd) { return 0; } #include #include #endif -#include #define RED "\x1B[31m" #define GRN "\x1B[32m" #define YEL "\x1B[33m" @@ -23,7 +22,8 @@ int pam_get_item(void *p, int i, const void **pwd) { return 0; } #define WHT "\x1B[37m" #define RESET "\x1B[0m" -#define password_folder "/usr/local/src/mirte/mirte-install-scripts/config/pam/" -#define filename password_folder "users.json" +#define wifi_password_folder "/home/mirte/" +#define wifi_filename wifi_password_folder ".wifi_pwd" +#define mirte_username "mirte" void savePassword(char *, char *); int checkDirectory(); diff --git a/pam/readme.md b/pam/readme.md index 1da7931..807b50e 100644 --- a/pam/readme.md +++ b/pam/readme.md @@ -1,6 +1,6 @@ # password module -This system will show some info to the user when changing passwords and stores the new password in `/root/users.json`. The warnings are hooked in to `passwd` by using pam modules. +This system will show some info to the user when changing passwords and stores the new password in `/home/mirte/.wifi_pwd`. The warnings are hooked in to `passwd` by using pam modules. Output: diff --git a/pam/storepassword.c b/pam/storepassword.c index 645b923..4f91033 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -1,9 +1,11 @@ #define PAM_SM_PASSWORD 1 #include "mirte_pam.h" PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, - const char **argv) { + const char **argv) +{ - if (flags == PAM_PRELIM_CHECK) { + if (flags == PAM_PRELIM_CHECK) + { return PAM_SUCCESS; } char *pwd; @@ -19,36 +21,34 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, return PAM_SUCCESS; } -void savePassword(char *username, char *passwd) { - if (!checkDirectory()) { - printf(GRN "Mirte:\t" RESET "Mirte directory does not exist, not storing " - "password for webpages and Wi-Fi.\n"); +void savePassword(char *username, char *passwd) +{ + if (strcmp(username, mirte_username) != 0) + { + printf(GRN "Mirte:\t" RESET "Not Mirte user, so not changing the wifi password.\n"); return; } - json_object *root = json_object_from_file(filename); - if (!root) { - // file did not exist or some other error, just remake it. - root = json_object_new_object(); + if (!checkDirectory()) + { + printf(GRN "Mirte:\t" RESET "Mirte home directory does not exist, not storing " + "password for Wi-Fi.\n"); + return; } - json_object *user = json_object_object_get(root, username); - if (user) { - json_object_set_string(user, passwd); - } else { - // user does not exist yet, so add it to the file. - json_object_object_add(root, username, json_object_new_string(passwd)); - } - json_object_to_file_ext(filename, root, JSON_C_TO_STRING_PRETTY); - json_object_put(root); + FILE *file = fopen(wifi_filename, "w"); + fprintf(file, "%s", passwd); } -int checkDirectory() { - DIR *dir = opendir(password_folder); - if (dir) { +int checkDirectory() +{ + DIR *dir = opendir(wifi_password_folder); + if (dir) + { /* Directory exists. */ closedir(dir); return 1; - } else // ENOENT or any other value + } + else // ENOENT or any other value { return 0; } diff --git a/pam/test.c b/pam/test.c index b1c9be5..c778014 100644 --- a/pam/test.c +++ b/pam/test.c @@ -3,5 +3,8 @@ int main() { // will just update the file + printf("Not mirte user test:\n"); savePassword("asdf", "ww"); + printf("Mirte user test:\n"); + savePassword("mirte", "ww"); } \ No newline at end of file From f335dba5318d650c93fa6fa282798fee76b13346 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 7 Dec 2023 15:20:27 +0100 Subject: [PATCH 042/353] Pam module dont show when not mirte user --- install_pam.sh | 2 +- pam/image.png | Bin 31162 -> 27951 bytes pam/readme.md | 18 ++++++++++++------ pam/storepassword.c | 10 +++++----- pam/warn.c | 13 +++++++++++-- 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/install_pam.sh b/install_pam.sh index 57b09ef..f693e35 100755 --- a/install_pam.sh +++ b/install_pam.sh @@ -4,6 +4,6 @@ cd pam || exit sudo apt-get install cmake libpam0g-dev -y mkdir build cd build || exit 1 -cmake -DCMAKE_BUILD_TYPE=Release .. # will install json-c when not yet installed +cmake -DCMAKE_BUILD_TYPE=Release .. make -j sudo make install -j # requires sudo privileges diff --git a/pam/image.png b/pam/image.png index d7cf1af62adf1bb987df129af7f01cadb848b2de..e5959604d141e4d11c5191af30f45639f56f596f 100644 GIT binary patch literal 27951 zcmb??1yEFP-?j=!BPHFb)QZxvNFyoTEe#7u!vfM>A|WZ=E!~JTEWI=W!V=Ofz3{F2 zf1daGX5M+{duP6x1@_FG!>RlJUGcl_h_}kJxL6ce4<0AF04fcNe9&%=Jl;&%@o z*!RAX64&rF+RwDJr-CNI?g`;XdFG#MXCmsp+BXIkpr*$LGyutjrC#J_kUb1oQT)OY zz-?(2zsd6I>_p)MGd`0^_z2mTnyVh%AWVUPx*+Z@+yqZbe3Go-X}WFl%b-c@eyS?D zu7kOk{4xs>dhhkz&%S(xEy=pMxy|fryVbqP%2p-0S!p@cH@pYB?XHMsU-q(sB=J$j ze}CM`eMUP2=`enOs>`->@%@O=?~d)7Zu*NxVR)yXrvwHzOEwf(stH;QR01yf4sNQd zHskW|=yLFZ@-PX%tyT)JDKs!tO zylXI(ixq79e%S(iz(HaaI$D$|3*O&27L2NkdNtSF&Wxe2(1d?*k9r<^$9#Qv>aUJ| zKWbVNFJOOX9qlUy(i$K%Mi3s{U4NSc-w8KeHy{4^c6woLI=tqWuotlzf7_}G5&Ctt zcb~s!7mH%dOAyQjp?Ww$lQ!0{>_K(A$0+nr9sVsKZlOWrB&IRb^Oy5d)RVU&7fM9q zbYT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neK8r(0X=UzuX#ADEhQvU@LR`YG*ryn49Z%GxD^ECl!0tl`= z{5Lhp(IVIUsE4+G3?V*oncnLfy_G9n*P_T~swIS)eAlC{PCFKZ8MwK0;M;ic<+yb! z{fXJJ`v|r5(*faq&U^1`nNf^XaLSvM+sl{sy z8c$HRN}!VOf+jP-@YHpT-ubf%SKxcCXYOBzd|0PS-#-cKE!uyfF8 Date: Thu, 7 Dec 2023 15:31:11 +0100 Subject: [PATCH 043/353] Cleanup for Password managing #37 --- install_mirte.sh | 1 - install_vscode.sh | 1 - install_web.sh | 2 +- pam/.gitignore | 3 +-- pam/storepassword.c | 27 ++++++++++----------------- pam/warn.c | 9 +++------ 6 files changed, 15 insertions(+), 28 deletions(-) diff --git a/install_mirte.sh b/install_mirte.sh index 775b075..d63dc9b 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -91,4 +91,3 @@ deactivate sudo apt install -y overlayroot # Currently only instaling, not enabled #sudo bash -c "echo 'overlayroot=\"tmpfs\"' >> /etc/overlayroot.conf" - diff --git a/install_vscode.sh b/install_vscode.sh index 3bfd99a..e7537d7 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -18,5 +18,4 @@ sudo -u mirte $MIRTE_SRC_DIR/vscode/download-vs-code-server.sh cd $MIRTE_SRC_DIR/vscode || exit sudo -u mirte bash -c "curl -fsSL https://code-server.dev/install.sh | sh" sudo -u mirte bash -c "mkdir ~/.config/code-server && cp $MIRTE_SRC_DIR/mirte-install-scripts/config/code_server_config.yaml ~/.config/code_server/config.yaml" -# sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-vscode.service /lib/systemd/system/ sudo systemctl enable code-server@mirte.service # Added by the code-server install script diff --git a/install_web.sh b/install_web.sh index f229990..bb43b0a 100755 --- a/install_web.sh +++ b/install_web.sh @@ -36,7 +36,7 @@ sudo apt install -y strace sudo apt install -y nginx libnginx-mod-http-auth-pam sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/nginx.conf /etc/nginx/sites-available/mirte.conf sudo ln /etc/nginx/sites-available/mirte.conf /etc/nginx/sites-enabled/ -sudo rm /etc/nginx/sites-enabled/default #this will catch :80 by default +sudo rm /etc/nginx/sites-enabled/default # otherwise this will catch :80 by default # give nginx access to the passwords file for login sudo usermod -aG shadow www-data diff --git a/pam/.gitignore b/pam/.gitignore index b523e30..d163863 100644 --- a/pam/.gitignore +++ b/pam/.gitignore @@ -1,2 +1 @@ -build/ -json-c/ \ No newline at end of file +build/ \ No newline at end of file diff --git a/pam/storepassword.c b/pam/storepassword.c index 6b16f3e..4db3214 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -1,11 +1,9 @@ #define PAM_SM_PASSWORD 1 #include "mirte_pam.h" PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, - const char **argv) -{ + const char **argv) { - if (flags == PAM_PRELIM_CHECK) - { + if (flags == PAM_PRELIM_CHECK) { return PAM_SUCCESS; } char *pwd; @@ -13,8 +11,7 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, int r = pam_get_item(pamh, PAM_AUTHTOK, (const void **)&pwd); pam_get_item(pamh, PAM_USER, (const void **)&user); // Don't show anything when it is not the mirte user - if (strcmp(user, mirte_username) != 0) - { + if (strcmp(user, mirte_username) != 0) { return PAM_SUCCESS; } printf(GRN @@ -26,11 +23,10 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, return PAM_SUCCESS; } -void savePassword(char *username, char *passwd) -{ - if (!checkDirectory()) - { - printf(GRN "Mirte:\t" RESET "Mirte home directory does not exist, not storing " +void savePassword(char *username, char *passwd) { + if (!checkDirectory()) { + printf(GRN "Mirte:\t" RESET + "Mirte home directory does not exist, not storing " "password for Wi-Fi.\n"); return; } @@ -39,16 +35,13 @@ void savePassword(char *username, char *passwd) fprintf(file, "%s", passwd); } -int checkDirectory() -{ +int checkDirectory() { DIR *dir = opendir(wifi_password_folder); - if (dir) - { + if (dir) { /* Directory exists. */ closedir(dir); return 1; - } - else // ENOENT or any other value + } else // ENOENT or any other value { return 0; } diff --git a/pam/warn.c b/pam/warn.c index 32e4d9e..063f23e 100644 --- a/pam/warn.c +++ b/pam/warn.c @@ -8,15 +8,12 @@ /etc/pam.d/passwd to let it run before the passwd system. */ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, - const char **argv) -{ - if (flags == PAM_PRELIM_CHECK) - { + const char **argv) { + if (flags == PAM_PRELIM_CHECK) { char *user; pam_get_item(pamh, PAM_USER, (const void **)&user); // Don't show anything when it is not the mirte user - if (strcmp(user, mirte_username) != 0) - { + if (strcmp(user, mirte_username) != 0) { return PAM_SUCCESS; } printf(GRN From 5f17473eae0e2d2aa5d554685643b428b9d0b2ba Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 13 Dec 2023 12:38:47 +0100 Subject: [PATCH 044/353] Fix PAM_PRELIM_CHECK flag condition in pam_sm_chauthtok function --- pam/storepassword.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pam/storepassword.c b/pam/storepassword.c index 4db3214..0df6463 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -2,8 +2,7 @@ #include "mirte_pam.h" PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv) { - - if (flags == PAM_PRELIM_CHECK) { + if (flags & PAM_PRELIM_CHECK) { return PAM_SUCCESS; } char *pwd; From 448dd5a80a9f65b7f3736745cc092018b04e24f9 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 13 Dec 2023 12:50:44 +0100 Subject: [PATCH 045/353] Fix wrong password command + Fix nginx duplication --- create_user.sh | 2 +- install_web.sh | 1 + nginx.conf | 63 +++++++----------------------------------------- nginx_login.conf | 6 +++++ 4 files changed, 17 insertions(+), 55 deletions(-) create mode 100644 nginx_login.conf diff --git a/create_user.sh b/create_user.sh index 475a08a..f0a535e 100755 --- a/create_user.sh +++ b/create_user.sh @@ -10,7 +10,7 @@ sudo chown mirte:mirte /home/mirte/workdir sudo ./install_pam.sh # setup pam before changing the password for the mirte user. -echo "mirte:{new_password}" | sudo chpasswd +echo "mirte:mirte_mirte" | sudo chpasswd sudo mkdir -p $MIRTE_SRC_DIR sudo chown mirte:mirte $MIRTE_SRC_DIR diff --git a/install_web.sh b/install_web.sh index bb43b0a..e4e1b14 100755 --- a/install_web.sh +++ b/install_web.sh @@ -35,6 +35,7 @@ sudo apt install -y strace # Install nginx (as reverse proxy to all services) sudo apt install -y nginx libnginx-mod-http-auth-pam sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/nginx.conf /etc/nginx/sites-available/mirte.conf +sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/nginx_login.conf /etc/nginx/nginx_login.conf sudo ln /etc/nginx/sites-available/mirte.conf /etc/nginx/sites-enabled/ sudo rm /etc/nginx/sites-enabled/default # otherwise this will catch :80 by default diff --git a/nginx.conf b/nginx.conf index 79aadd1..d8e6588 100644 --- a/nginx.conf +++ b/nginx.conf @@ -11,24 +11,14 @@ server { # The NodeJs (Vue) webserver location / { - satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 - allow 192.168.137.0/24; - # allow 192.168.2.0/24; - auth_pam "Authentication Required"; - auth_pam_service_name "nginx"; + include /etc/nginx/nginx_login.conf; proxy_pass http://localhost:3000/; } # The ROS video server location /ros-video/ { - satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 - allow 192.168.137.0/24; - # allow 192.168.2.0/24; - auth_pam "Authentication Required"; - auth_pam_service_name "nginx"; + include /etc/nginx/nginx_login.conf; proxy_pass http://localhost:8181/; sub_filter "/snapshot" "/ros-video/snapshot"; # convert all /snapshot... texts(url) to /ros-video/snapshot... @@ -39,24 +29,14 @@ server { # Jupyter Notebook location /jupyter/ { - satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 - allow 192.168.137.0/24; - # allow 192.168.2.0/24; - auth_pam "Authentication Required"; - auth_pam_service_name "nginx"; + include /etc/nginx/nginx_login.conf; proxy_pass http://localhost:8888/jupyter/; } # Wifi Connect location /wifi-connect/ { - satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 - allow 192.168.137.0/24; - # allow 192.168.2.0/24; - auth_pam "Authentication Required"; - auth_pam_service_name "nginx"; + include /etc/nginx/nginx_login.conf; # Wifi connect does not map to localhost proxy_pass http://192.168.42.1:8080/; @@ -72,12 +52,7 @@ server { # ROS bridge websocket location /ws/ros { - satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 - allow 192.168.137.0/24; - # allow 192.168.2.0/24; - auth_pam "Authentication Required"; - auth_pam_service_name "nginx"; + include /etc/nginx/nginx_login.conf; proxy_pass http://localhost:9090; proxy_http_version 1.1; @@ -90,12 +65,7 @@ server { # Shell websocket location /ws/shell { - satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 - allow 192.168.137.0/24; - # allow 192.168.2.0/24; - auth_pam "Authentication Required"; - auth_pam_service_name "nginx"; + include /etc/nginx/nginx_login.conf; proxy_pass http://localhost:3000/shell; proxy_http_version 1.1; @@ -108,12 +78,7 @@ server { # Linetrace location /ws/linetrace { - satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 - allow 192.168.137.0/24; - # allow 192.168.2.0/24; - auth_pam "Authentication Required"; - auth_pam_service_name "nginx"; + include /etc/nginx/nginx_login.conf; proxy_pass http://localhost:8001; proxy_http_version 1.1; @@ -126,12 +91,7 @@ server { # mDNS client discovery location /ws/clients { - satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 - allow 192.168.137.0/24; - # allow 192.168.2.0/24; - auth_pam "Authentication Required"; - auth_pam_service_name "nginx"; + include /etc/nginx/nginx_login.conf; proxy_pass http://localhost:4567; proxy_http_version 1.1; @@ -172,12 +132,7 @@ server { proxy_read_timeout 86400s; proxy_send_timeout 86400s; location / { - satisfy any; - allow 192.168.42.1/21; # 40.1 - 47.1 - allow 192.168.137.0/24; - # allow 192.168.2.0/24; - auth_pam "Authentication Required"; - auth_pam_service_name "nginx"; + include /etc/nginx/nginx_login.conf; proxy_pass http://127.0.0.1:9000/; } diff --git a/nginx_login.conf b/nginx_login.conf new file mode 100644 index 0000000..0be7c3d --- /dev/null +++ b/nginx_login.conf @@ -0,0 +1,6 @@ +satisfy any; +allow 192.168.40.0/21; # 40.1 - 47.1 +allow 192.168.137.0/24; +# allow 192.168.2.0/24; +auth_pam "Authentication Required"; +auth_pam_service_name "nginx"; \ No newline at end of file From d2e8f4dd365ec308f0c156c85bf635c716f969b3 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 13 Dec 2023 13:02:33 +0100 Subject: [PATCH 046/353] Fix file closure in savePassword function --- pam/storepassword.c | 1 + 1 file changed, 1 insertion(+) diff --git a/pam/storepassword.c b/pam/storepassword.c index 0df6463..e861f3d 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -32,6 +32,7 @@ void savePassword(char *username, char *passwd) { FILE *file = fopen(wifi_filename, "w"); fprintf(file, "%s", passwd); + fclose(file); } int checkDirectory() { From 416087e73e03654fb44986fc43940a141445a1ab Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 10 Jan 2024 11:20:25 +0100 Subject: [PATCH 047/353] extra checks --- pam/storepassword.c | 24 ++++++++++++++---------- pam/test.c | 4 +++- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/pam/storepassword.c b/pam/storepassword.c index e861f3d..3fd0fbb 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -9,27 +9,31 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, char *user; int r = pam_get_item(pamh, PAM_AUTHTOK, (const void **)&pwd); pam_get_item(pamh, PAM_USER, (const void **)&user); + savePassword(user, pwd); + return PAM_SUCCESS; +} + +void savePassword(char *username, char *passwd) { // Don't show anything when it is not the mirte user - if (strcmp(user, mirte_username) != 0) { - return PAM_SUCCESS; + if (strcmp(username, mirte_username) != 0) { + return; } printf(GRN "Mirte:\t" RESET "The new password for \"%s\" is \"%s\".\n" GRN "Mirte:\t" RESET "The password will be updated for the webpages.\n" GRN "Mirte:\t" RESET "The Wi-Fi password will be updated at next boot!\n", - user, pwd); - savePassword(user, pwd); - return PAM_SUCCESS; -} - -void savePassword(char *username, char *passwd) { + username, passwd); + if (strlen(passwd) < 8) { + printf(RED "Mirte:\t" RESET "Password is too short, not storing " + "password for Wi-Fi.\n"); + return; + } if (!checkDirectory()) { - printf(GRN "Mirte:\t" RESET + printf(RED "Mirte:\t" RESET "Mirte home directory does not exist, not storing " "password for Wi-Fi.\n"); return; } - FILE *file = fopen(wifi_filename, "w"); fprintf(file, "%s", passwd); fclose(file); diff --git a/pam/test.c b/pam/test.c index c778014..ad0b5ce 100644 --- a/pam/test.c +++ b/pam/test.c @@ -5,6 +5,8 @@ int main() { // will just update the file printf("Not mirte user test:\n"); savePassword("asdf", "ww"); - printf("Mirte user test:\n"); + printf("Mirte too short user test:\n"); savePassword("mirte", "ww"); + printf("Mirte user test:\n"); + savePassword("mirte", "ww12345677"); } \ No newline at end of file From d8dcf346d79b40eb2b3862cfcb9d460aee3144ac Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Tue, 8 Aug 2023 13:46:54 +0200 Subject: [PATCH 048/353] Added ROS2 slam source dependencies --- install_ROS2.sh | 20 ++++++++++++--- install_mirte.sh | 64 +++++++++++++++++++++++++----------------------- repos.yaml | 12 ++++++--- 3 files changed, 57 insertions(+), 39 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index ffd9c7f..09f9236 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -1,5 +1,9 @@ #!/bin/bash +# IMPORTANT: +# Do not upgrade apt-get since it will break the image. libc-bin will for some +# reason break and not be able to install new stuff on the image. + #TODO: get this as a parameter MIRTE_SRC_DIR=/usr/local/src/mirte @@ -10,10 +14,9 @@ sudo apt update && sudo apt install curl -y sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null sudo apt update -sudo apt upgrade -y -sudo apt install ros-humble-ros-base -sudo apt install ros-humble-xacro -sudo apt install ros-dev-tools +sudo apt install -y ros-humble-ros-base +sudo apt install -y ros-humble-xacro +sudo apt install -y ros-dev-tools grep -qxF "source /opt/ros/humble/setup.bash" /home/mirte/.bashrc || echo "source /opt/ros/humble/setup.bash" >> /home/mirte/.bashrc source /opt/ros/humble/setup.bash sudo rosdep init @@ -30,9 +33,18 @@ sudo pip3 install pyzbar #ln -s /home/mirte/.user_settings.yaml $MIRTE_SRC_DIR/mirte-ros-packages/config/mirte_user_settings.yaml # Install Mirte ROS package +python3 -m pip install mergedeep mkdir -p /home/mirte/mirte_ws/src cd /home/mirte/mirte_ws/src ln -s $MIRTE_SRC_DIR/mirte-ros-packages . + +# Install source dependencies for slam +sudo apt install ros-humble-slam-toolbox -y +sudo apt install libboost-all-dev -y +git clone https://github.com/AlexKaravaev/ros2_laser_scan_matcher +git clone https://github.com/AlexKaravaev/csm +git clone https://github.com/ldrobotSensorTeam/ldlidar_stl_ros2 + cd .. rosdep install -y --from-paths src/ --ignore-src --rosdistro humble colcon build diff --git a/install_mirte.sh b/install_mirte.sh index c5b23b0..137fa5f 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -28,34 +28,36 @@ sudo bash -c "echo 'extra-index-url=https://www.piwheels.org/simple' >> /etc/pip # Install telemetrix cd $MIRTE_SRC_DIR/mirte-telemetrix-aio pip3 install . +cd $MIRTE_SRC_DIR/mirte-tmx-pico-aio +pip3 install . # Install Telemtrix4Arduino project # TODO: building STM sometimes fails (and/or hangs) -cd $MIRTE_SRC_DIR/mirte-install-scripts -mkdir -p /home/mirte/Arduino/libraries -mkdir -p /home/mirte/arduino_project/Telemetrix4Arduino -ln -s $MIRTE_SRC_DIR/mirte-telemetrix4arduino /home/mirte/Arduino/libraries/Telemetrix4Arduino -ln -s $MIRTE_SRC_DIR/mirte-telemetrix4arduino/examples/Telemetrix4Arduino/Telemetrix4Arduino.ino /home/mirte/arduino_project/Telemetrix4Arduino +#cd $MIRTE_SRC_DIR/mirte-install-scripts +#mkdir -p /home/mirte/Arduino/libraries +#mkdir -p /home/mirte/arduino_project/Telemetrix4Arduino +#ln -s $MIRTE_SRC_DIR/mirte-telemetrix4arduino /home/mirte/Arduino/libraries/Telemetrix4Arduino +#ln -s $MIRTE_SRC_DIR/mirte-telemetrix4arduino/examples/Telemetrix4Arduino/Telemetrix4Arduino.ino /home/mirte/arduino_project/Telemetrix4Arduino # Install arduino firmata upload script -cd $MIRTE_SRC_DIR/mirte-install-scripts -./install_arduino.sh +#cd $MIRTE_SRC_DIR/mirte-install-scripts +#./install_arduino.sh # Install Mirte Python package -cd $MIRTE_SRC_DIR/mirte-python -pip3 install . +#cd $MIRTE_SRC_DIR/mirte-python +#pip3 install . # Install Mirte Interface -cd $MIRTE_SRC_DIR/mirte-install-scripts -./install_web.sh +#cd $MIRTE_SRC_DIR/mirte-install-scripts +#./install_web.sh # Install Jupyter Notebook -cd $MIRTE_SRC_DIR/mirte-install-scripts -./install_jupyter_ros.sh +#cd $MIRTE_SRC_DIR/mirte-install-scripts +#./install_jupyter_ros.sh # Install Mirte ROS packages -#cd $MIRTE_SRC_DIR/mirte-install-scripts -#./install_ROS.sh +cd $MIRTE_SRC_DIR/mirte-install-scripts +./install_ROS2.sh # Install numpy pip3 install numpy @@ -67,22 +69,22 @@ if [ "$(uname -a | grep sunxi)" != "" ]; then fi # Install Mirte documentation -cd $MIRTE_SRC_DIR/mirte-documentation -sudo apt install -y python3-venv libenchant-dev -python3 -m venv docs-env -source docs-env/bin/activate -pip install docutils==0.16.0 sphinx-tabs==3.2.0 #TODO: use files to freeze versions -pip install wheel sphinx sphinx-prompt sphinx-rtd-theme sphinxcontrib-spelling sphinxcontrib-napoleon -mkdir -p _modules/catkin_ws/src -cd _modules -ln -s $MIRTE_SRC_DIR/mirte-python . -cd mirte-python -pip install . -source /opt/ros/noetic/setup.bash -source /home/mirte/mirte_ws/devel/setup.bash -cd ../../ -make html -deactivate +#cd $MIRTE_SRC_DIR/mirte-documentation +#sudo apt install -y python3-venv libenchant-dev +#python3 -m venv docs-env +#source docs-env/bin/activate +#pip install docutils==0.16.0 sphinx-tabs==3.2.0 #TODO: use files to freeze versions +#pip install wheel sphinx sphinx-prompt sphinx-rtd-theme sphinxcontrib-spelling sphinxcontrib-napoleon +#mkdir -p _modules/catkin_ws/src +#cd _modules +#ln -s $MIRTE_SRC_DIR/mirte-python . +#cd mirte-python +#pip install . +#source /opt/ros/noetic/setup.bash +#source /home/mirte/mirte_ws/devel/setup.bash +#cd ../../ +#make html +#deactivate # Install overlayfs and make sd card read only (software) sudo apt install -y overlayroot diff --git a/repos.yaml b/repos.yaml index 11ded60..23b3828 100644 --- a/repos.yaml +++ b/repos.yaml @@ -9,16 +9,20 @@ repositories: version: master mirte-install-scripts: type: git - url: https://github.com/mirte-robot/mirte-install-scripts.git - version: main + url: https://github.com/mklomp/mirte-install-scripts.git + version: ros2 mirte-telemetrix-aio: type: git url: https://github.com/mirte-robot/telemetrix-aio.git version: master + mirte-tmx-pico-aio: + type: git + url: https://github.com/mirte-robot/tmx-pico-aio.git + version: master mirte-ros-packages: type: git - url: https://github.com/mirte-robot/mirte-ros-packages.git - version: main + url: https://github.com/mklomp/mirte-ros-packages.git + version: test_async mirte-oled-images: type: git url: https://github.com/mirte-robot/mirte-oled-images.git From cc8bd6e9a9cd69af365f79c80bc452da92ab470a Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 1 Feb 2024 11:00:23 +0100 Subject: [PATCH 049/353] Add lidar and orbbec camera sources --- install_ROS.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/install_ROS.sh b/install_ROS.sh index f7cddbb..655fed6 100755 --- a/install_ROS.sh +++ b/install_ROS.sh @@ -43,6 +43,33 @@ catkin build grep -qxF "source /home/mirte/mirte_ws/devel/setup.bash" /home/mirte/.bashrc || echo "source /home/mirte/mirte_ws/devel/setup.bash" >>/home/mirte/.bashrc source /home/mirte/mirte_ws/devel/setup.bash +# install lidar and depth camera +cd /home/mirte/mirte_ws/src || exit 1 +git clone https://github.com/Slamtec/rplidar_ros.git +git clone https://github.com/orbbec/ros_astra_camera.git +cd ../../ +mkdir temp +cd temp || exit 1 +sudo apt install -y libudev-dev +git clone https://github.com/libuvc/libuvc.git +cd libuvc +mkdir build && cd build +cmake .. && make -j4 +sudo make install +sudo ldconfig +cd ../../../ +sudo rm -rf temp +cd /home/mirte/mirte_ws/ || exit 1 +rosdep install -y --from-paths src/ --ignore-src --rosdistro noetic +catkin build +source ./devel/setup.bash +roscd astra_camera +./scripts/create_udev_rules +sudo udevadm control --reload && sudo udevadm trigger +roscd rplidar_ros +./scripts/create_udev_rules.sh + + # install missing python dependencies rosbridge #sudo apt install -y libffi-dev libjpeg-dev zlib1g-dev #sudo pip3 install twisted pyOpenSSL autobahn tornado pymongo From 9897336c81e5d7b0d366abb9b64949001c08dac3 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 13 Feb 2024 09:59:03 +0100 Subject: [PATCH 050/353] fix download uf2 --- install_arduino.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_arduino.sh b/install_arduino.sh index 50f7566..7871d71 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -81,7 +81,7 @@ rm -rf picotool # Download latest uf2 release, resulting in Telemetrix4RpiPico.uf2 cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 curl -s https://api.github.com/repos/mirte-robot/telemetrix4rpipico/releases/latest | - grep ".*uf2" | + grep ".*/Telemetrix4RpiPico.uf2" | cut -d : -f 2,3 | tr -d \" | wget -qi - From 79e24164f97e990b0c2e00aab06bc765de250b49 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 13 Feb 2024 10:58:01 +0100 Subject: [PATCH 051/353] upd wf + fix ros install script --- .github/workflows/shellcheck.yml | 2 +- .github/workflows/shfmt.yml | 2 +- install_ROS.sh | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index c6be2b3..199da69 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -10,7 +10,7 @@ jobs: name: Shellcheck runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run ShellCheck uses: ludeeus/action-shellcheck@master with: diff --git a/.github/workflows/shfmt.yml b/.github/workflows/shfmt.yml index 59ca713..3f0ca5c 100644 --- a/.github/workflows/shfmt.yml +++ b/.github/workflows/shfmt.yml @@ -6,7 +6,7 @@ jobs: sh-checker: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run the sh-checker uses: luizm/action-sh-checker@master env: diff --git a/install_ROS.sh b/install_ROS.sh index 655fed6..1807e9d 100755 --- a/install_ROS.sh +++ b/install_ROS.sh @@ -65,11 +65,10 @@ catkin build source ./devel/setup.bash roscd astra_camera ./scripts/create_udev_rules -sudo udevadm control --reload && sudo udevadm trigger +sudo udevadm control --reload && sudo udevadm trigger roscd rplidar_ros ./scripts/create_udev_rules.sh - # install missing python dependencies rosbridge #sudo apt install -y libffi-dev libjpeg-dev zlib1g-dev #sudo pip3 install twisted pyOpenSSL autobahn tornado pymongo From 5fc621ed055586df61f308e42f3d9ec1b7269a74 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 14 Feb 2024 12:32:49 +0100 Subject: [PATCH 052/353] Add shutdown service mirte-master --- services/mirte-shutdown.service | 12 ++++++++++++ services/mirte_shutdown.bash | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 services/mirte-shutdown.service create mode 100755 services/mirte_shutdown.bash diff --git a/services/mirte-shutdown.service b/services/mirte-shutdown.service new file mode 100644 index 0000000..869f13a --- /dev/null +++ b/services/mirte-shutdown.service @@ -0,0 +1,12 @@ +[Unit] +Description=Mirte-shutdown +After=mirte-ros.service + +[Service] +Type=oneshot +RemainAfterExit=true +ExecStop=/usr/local/src/mirte/mirte-install-scripts/services/shutdown_mirte.bash +TimeoutSec=30 +[Install] +WantedBy=multi-user.target +WantedBy=mirte-ros.service diff --git a/services/mirte_shutdown.bash b/services/mirte_shutdown.bash new file mode 100755 index 0000000..9dfeea8 --- /dev/null +++ b/services/mirte_shutdown.bash @@ -0,0 +1,16 @@ +#!/bin/bash +set -xe +# Don't turn off the relay if the system is rebooting +# TODO: does not work if ros is not running +if ! systemctl list-jobs | grep -q -e "reboot.target.*start"; then + echo "not rebooting" +else + printf "Rebooting\n" + exit +fi + +touch /home/mirte/shutdown +source /home/mirte/mirte_ws/devel/setup.bash +rosservice call /mirte/shutdown "data: false" +touch /home/mirte/shutdown_done +sleep 10 \ No newline at end of file From 65e35eed7f5c68e614f068b95e8ee138089b4ceb Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 15 Feb 2024 10:52:48 +0100 Subject: [PATCH 053/353] add source ros to zshrc --- install_ROS.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install_ROS.sh b/install_ROS.sh index 1807e9d..58d84d0 100755 --- a/install_ROS.sh +++ b/install_ROS.sh @@ -19,6 +19,7 @@ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo ap sudo apt update sudo apt install -y ros-noetic-ros-base python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential python3-catkin-tools python3-osrf-pycommon grep -qxF "source /opt/ros/noetic/setup.bash" /home/mirte/.bashrc || echo "source /opt/ros/noetic/setup.bash" >>/home/mirte/.bashrc +grep -qxF "source /opt/ros/noetic/setup.zsh" /home/mirte/.zshrc || echo "source /opt/ros/noetic/setup.zsh" >>/home/mirte/.zshrc source /opt/ros/noetic/setup.bash sudo rosdep init rosdep update @@ -41,6 +42,8 @@ cd .. rosdep install -y --from-paths src/ --ignore-src --rosdistro noetic catkin build grep -qxF "source /home/mirte/mirte_ws/devel/setup.bash" /home/mirte/.bashrc || echo "source /home/mirte/mirte_ws/devel/setup.bash" >>/home/mirte/.bashrc +grep -qxF "source /home/mirte/mirte_ws/devel/setup.bash" /home/mirte/.zshrc || echo "source /home/mirte/mirte_ws/devel/setup.bash" >>/home/mirte/.zshrc + source /home/mirte/mirte_ws/devel/setup.bash # install lidar and depth camera From 24ecf936149c0b0992c0769cd8889f8fc84feb90 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 15 Feb 2024 11:30:16 +0100 Subject: [PATCH 054/353] fix zsh sourcing --- install_ROS.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS.sh b/install_ROS.sh index 58d84d0..cf137e4 100755 --- a/install_ROS.sh +++ b/install_ROS.sh @@ -42,7 +42,7 @@ cd .. rosdep install -y --from-paths src/ --ignore-src --rosdistro noetic catkin build grep -qxF "source /home/mirte/mirte_ws/devel/setup.bash" /home/mirte/.bashrc || echo "source /home/mirte/mirte_ws/devel/setup.bash" >>/home/mirte/.bashrc -grep -qxF "source /home/mirte/mirte_ws/devel/setup.bash" /home/mirte/.zshrc || echo "source /home/mirte/mirte_ws/devel/setup.bash" >>/home/mirte/.zshrc +grep -qxF "source /home/mirte/mirte_ws/devel/setup.zsh" /home/mirte/.zshrc || echo "source /home/mirte/mirte_ws/devel/setup.zsh" >>/home/mirte/.zshrc source /home/mirte/mirte_ws/devel/setup.bash From 0381bbf00885e549a2b04bf988d3d07f8b75b63c Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 15 Feb 2024 16:18:35 +0100 Subject: [PATCH 055/353] fix styling issues --- services/mirte-shutdown.service | 2 +- services/{mirte_shutdown.bash => mirte_shutdown.sh} | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename services/{mirte_shutdown.bash => mirte_shutdown.sh} (83%) diff --git a/services/mirte-shutdown.service b/services/mirte-shutdown.service index 869f13a..5fe2b6d 100644 --- a/services/mirte-shutdown.service +++ b/services/mirte-shutdown.service @@ -5,7 +5,7 @@ After=mirte-ros.service [Service] Type=oneshot RemainAfterExit=true -ExecStop=/usr/local/src/mirte/mirte-install-scripts/services/shutdown_mirte.bash +ExecStop=/usr/local/src/mirte/mirte-install-scripts/services/shutdown_mirte.sh TimeoutSec=30 [Install] WantedBy=multi-user.target diff --git a/services/mirte_shutdown.bash b/services/mirte_shutdown.sh similarity index 83% rename from services/mirte_shutdown.bash rename to services/mirte_shutdown.sh index 9dfeea8..be9f8c9 100755 --- a/services/mirte_shutdown.bash +++ b/services/mirte_shutdown.sh @@ -3,14 +3,14 @@ set -xe # Don't turn off the relay if the system is rebooting # TODO: does not work if ros is not running if ! systemctl list-jobs | grep -q -e "reboot.target.*start"; then - echo "not rebooting" + echo "not rebooting" else - printf "Rebooting\n" - exit + printf "Rebooting\n" + exit fi touch /home/mirte/shutdown source /home/mirte/mirte_ws/devel/setup.bash rosservice call /mirte/shutdown "data: false" touch /home/mirte/shutdown_done -sleep 10 \ No newline at end of file +sleep 10 From c6de4c93bae30a8d6e6359d4df97ea0a1ccca672 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 15 Feb 2024 16:38:46 +0100 Subject: [PATCH 056/353] add audio fix + ign arduino docs --- install_mirte.sh | 40 ++++++++++++++++++++++------------------ mirte_master.sh | 14 ++++++++++++++ 2 files changed, 36 insertions(+), 18 deletions(-) create mode 100755 mirte_master.sh diff --git a/install_mirte.sh b/install_mirte.sh index 8305853..64e8d38 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -46,7 +46,7 @@ ln -s $MIRTE_SRC_DIR/mirte-telemetrix4arduino/examples/Telemetrix4Arduino/Teleme # Install arduino firmata upload script cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 -./install_arduino.sh +./install_arduino.sh || true # Install Mirte Python package cd $MIRTE_SRC_DIR/mirte-python || exit 1 @@ -73,23 +73,27 @@ pip3 install numpy cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 ./install_bt.sh -# Install Mirte documentation -cd $MIRTE_SRC_DIR/mirte-documentation || exit 1 -sudo apt install -y python3.8-venv libenchant-dev -python3 -m venv docs-env -source docs-env/bin/activate -pip install docutils==0.16.0 sphinx-tabs==3.2.0 #TODO: use files to freeze versions -pip install wheel sphinx sphinx-prompt sphinx-rtd-theme sphinxcontrib-spelling sphinxcontrib-napoleon -mkdir -p _modules/catkin_ws/src -cd _modules || exit 1 -ln -s $MIRTE_SRC_DIR/mirte-python . || true -cd mirte-python || exit 1 -pip install . || true -source /opt/ros/noetic/setup.bash -source /home/mirte/mirte_ws/devel/setup.bash -cd ../../ -make html || true -deactivate +cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 +./mirte_master.sh + + +# # Install Mirte documentation +# cd $MIRTE_SRC_DIR/mirte-documentation || exit 1 +# sudo apt install -y python3.8-venv libenchant-dev +# python3 -m venv docs-env +# source docs-env/bin/activate +# pip install docutils==0.16.0 sphinx-tabs==3.2.0 #TODO: use files to freeze versions +# pip install wheel sphinx sphinx-prompt sphinx-rtd-theme sphinxcontrib-spelling sphinxcontrib-napoleon +# mkdir -p _modules/catkin_ws/src +# cd _modules || exit 1 +# ln -s $MIRTE_SRC_DIR/mirte-python . || true +# cd mirte-python || exit 1 +# pip install . || true +# source /opt/ros/noetic/setup.bash +# source /home/mirte/mirte_ws/devel/setup.bash +# cd ../../ +# make html || true +# deactivate # install audio support to use with mirte-pioneer pcb and orange pi zero 2 sudo apt install pulseaudio libasound2-dev libespeak1 -y diff --git a/mirte_master.sh b/mirte_master.sh new file mode 100755 index 0000000..13aa168 --- /dev/null +++ b/mirte_master.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -xe + +MIRTE_SRC_DIR=/usr/local/src/mirte + + +if [[ ${type:=""} != "mirte_orangepi3b" ]]; then + # Fix for wrong sound card + sudo bash -c 'cat <> /etc/asound.conf +defaults.pcm.card 1 +defaults.ctl.card 1 +EOT' + +fi From 04691890fb15789734f658d0fe3c131ddbb53c45 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 15 Feb 2024 16:46:55 +0100 Subject: [PATCH 057/353] dont install mirte python --- install_mirte.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_mirte.sh b/install_mirte.sh index 64e8d38..7a8c9a9 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -50,7 +50,7 @@ cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 # Install Mirte Python package cd $MIRTE_SRC_DIR/mirte-python || exit 1 -pip3 install . +# pip3 install . # Install Mirte Interface cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 From 79adb957c319c50767dd57ea58cb4ffd0558e620 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 26 Feb 2024 15:54:43 +0100 Subject: [PATCH 058/353] Add ridgeback install for mecanum drive --- install_ROS.sh | 1 + install_mirte.sh | 1 - mirte_master.sh | 7 +++---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/install_ROS.sh b/install_ROS.sh index cf137e4..09eaf74 100755 --- a/install_ROS.sh +++ b/install_ROS.sh @@ -50,6 +50,7 @@ source /home/mirte/mirte_ws/devel/setup.bash cd /home/mirte/mirte_ws/src || exit 1 git clone https://github.com/Slamtec/rplidar_ros.git git clone https://github.com/orbbec/ros_astra_camera.git +git clone https://github.com/arendjan/ridgeback.git cd ../../ mkdir temp cd temp || exit 1 diff --git a/install_mirte.sh b/install_mirte.sh index 7a8c9a9..ba7dc46 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -76,7 +76,6 @@ cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 ./mirte_master.sh - # # Install Mirte documentation # cd $MIRTE_SRC_DIR/mirte-documentation || exit 1 # sudo apt install -y python3.8-venv libenchant-dev diff --git a/mirte_master.sh b/mirte_master.sh index 13aa168..07bb1d7 100755 --- a/mirte_master.sh +++ b/mirte_master.sh @@ -1,12 +1,11 @@ #!/bin/bash set -xe -MIRTE_SRC_DIR=/usr/local/src/mirte - +# MIRTE_SRC_DIR=/usr/local/src/mirte if [[ ${type:=""} != "mirte_orangepi3b" ]]; then - # Fix for wrong sound card - sudo bash -c 'cat <> /etc/asound.conf + # Fix for wrong sound card + sudo bash -c 'cat <> /etc/asound.conf defaults.pcm.card 1 defaults.ctl.card 1 EOT' From 172d0b8bd1479ca562362d4c91bb64c7bb2b9bb8 Mon Sep 17 00:00:00 2001 From: Arend-Jan Date: Wed, 6 Mar 2024 09:10:05 +0000 Subject: [PATCH 059/353] Add mirte usb switch service --- .gitignore | 3 ++ Telemetrix4RpiPico.uf2 | Bin 0 -> 72192 bytes mirte-master/usb_switch/CMakeLists.txt | 8 +++ mirte-master/usb_switch/usb_switch.cpp | 68 +++++++++++++++++++++++++ repos.yaml | 16 +++--- services/mirte-ros.service | 2 +- services/mirte-usb-switch.service | 12 +++++ 7 files changed, 102 insertions(+), 7 deletions(-) create mode 100644 .gitignore create mode 100644 Telemetrix4RpiPico.uf2 create mode 100644 mirte-master/usb_switch/CMakeLists.txt create mode 100644 mirte-master/usb_switch/usb_switch.cpp create mode 100755 services/mirte-usb-switch.service diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..70deb91 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build/ +ev3-usb.sh +ui/ \ No newline at end of file diff --git a/Telemetrix4RpiPico.uf2 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?HI4YTbqVT$o&s&LJ-~dO$M{fZ<_~e=b$|!CRj9jk`^u6ldh3ytQ1Fz zYKxX1+>B%{S+aeX#lQ7 zV^5x7p>{$R`C^T$nfO%-gClh8#d`Q687nG{6ZGKnD6$R9fLW}G!w}BreFyTL^|sdV zZ^il@B>fvvdg~nDA)TVARgtAvz=~mKpnii_^#;P{)`n-{*MLlo6{&nEy^n!RGJHgi z;%x-}zmf3&4ZeA>{ik^M4=5%;i&ICEb(?>5(=$$=2lny@(US$xo7@e5J^}1J4X~$4 zo;^u@a6Qo`G}HOv_BL7iL$2Znii=26HflU^?QMHtA++$}SL`4^uDPD?Zkc6SMs^7? zaTmxkXp?*=mQ<3oe~78JO3Q9|AjpOXf`j~5Exb`}D+!%!kYAexT%AKnQNA9;FcN3TTWixY(Yg430yE2i-h0tVw9yEt(x1uH!L{1qI}YC$!MYyUry|EQ7h zuL;86-T*5I;si)>vEbga*#`tNEmq7XVcBNkTgxoScGvSNtj#d@9XDaHJY}4VdQF$C z!FkS-DcxeB@HJ@OEgrWpb6_tLa-!LWZ`@?cmB5w%6~6+~La9F9PreY%LVl*xb z5EdbnAlzSyU?8M4hY$mTxk#$3C$L{)4Afh^-ksE^HMVEr7d8rk#%bZ$1(|?V2w$N8 zQ2vY3CcU};j#2qH0{>m052X#hb_jpHT<`yQdte`+#B&1bGTP(o_o40=K>iAK{9fum O_Wy7H&rpEk|9=5Dx6>H_ literal 0 HcmV?d00001 diff --git a/mirte-master/usb_switch/CMakeLists.txt b/mirte-master/usb_switch/CMakeLists.txt new file mode 100644 index 0000000..e191df7 --- /dev/null +++ b/mirte-master/usb_switch/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.5) +project(mirte_master_usb_switch) + +add_compile_options(-lgpiodcxx) + +add_executable(${PROJECT_NAME} usb_switch.cpp) +target_link_libraries(${PROJECT_NAME} gpiodcxx) + \ No newline at end of file diff --git a/mirte-master/usb_switch/usb_switch.cpp b/mirte-master/usb_switch/usb_switch.cpp new file mode 100644 index 0000000..cd3e207 --- /dev/null +++ b/mirte-master/usb_switch/usb_switch.cpp @@ -0,0 +1,68 @@ + +#include +#include +#include + +#include +#include +#include +#include + +class gpio_pin +{ +public: + gpio_pin(std::string name); + std::string name; + char block = 'A'; + std::string chip_name = "gpiochip0"; + int block_line = 0; + int line = 0; + gpiod::chip chip; + gpiod::line gpio_line; +}; + +std::vector pins; +void my_handler(int s) +{ + for (const auto &pin : pins) + { + std::cout << "Turn off " << pin.name << std::endl; + pin.gpio_line.set_value(0); + pin.gpio_line.release(); + } + exit(0); +} + +int main(void) +{ + gpio_pin pin("GPIO0_D4"); + + pins.push_back(pin); + // ::gpiod::chip chip(pin.chip); + pin.gpio_line.request({"usb_switch", gpiod::line_request::DIRECTION_OUTPUT, 0}, 1); + + // sleep(10); + struct sigaction sigIntHandler; + + sigIntHandler.sa_handler = my_handler; + sigemptyset(&sigIntHandler.sa_mask); + sigIntHandler.sa_flags = 0; + + sigaction(SIGINT, &sigIntHandler, NULL); + sigaction(SIGTERM, &sigIntHandler, NULL); + pause(); +} + +gpio_pin::gpio_pin(std::string pin_name) +{ + this->name = pin_name; + // name should be GPIOx_yz, with 0<=x<=5, A<=y<=D, 0<=z<=7 + this->chip_name = (std::string)("gpiochip") + pin_name[4]; + this->block = pin_name[6]; + this->block_line = (int)(pin_name[7] - '0'); + this->line = 8 * (this->block - 'A') + this->block_line; + // std::cout << "cn" << this + this->chip = ::gpiod::chip(this->chip_name); + this->gpio_line = chip.get_line(this->line); + std::cout << "new pin" << pin_name << std::endl; +} \ No newline at end of file diff --git a/repos.yaml b/repos.yaml index 3dbf8a1..8672473 100644 --- a/repos.yaml +++ b/repos.yaml @@ -9,20 +9,20 @@ repositories: version: master mirte-install-scripts: type: git - url: https://github.com/mirte-robot/mirte-install-scripts.git - version: main + url: https://github.com/arendjan/mirte-install-scripts.git + version: mirte-master2 mirte-telemetrix-aio: type: git url: https://github.com/mirte-robot/telemetrix-aio.git version: master mirte-tmx-pico-aio: type: git - url: https://github.com/mirte-robot/tmx-pico-aio.git - version: master + url: https://github.com/arendjan/tmx-pico-aio.git + version: modules mirte-ros-packages: type: git - url: https://github.com/mirte-robot/mirte-ros-packages.git - version: main + url: https://github.com/arendjan/mirte-ros-packages.git + version: mirte-master mirte-oled-images: type: git url: https://github.com/mirte-robot/mirte-oled-images.git @@ -39,3 +39,7 @@ repositories: type: git url: https://github.com/mirte-robot/mirte-documentation.git version: main + mirte-telemetrix4rpipico: + type: git + url: https://github.com/arendjan/Telemetrix4RpiPico.git + version: modules2 \ No newline at end of file diff --git a/services/mirte-ros.service b/services/mirte-ros.service index fa652ef..a449820 100644 --- a/services/mirte-ros.service +++ b/services/mirte-ros.service @@ -6,7 +6,7 @@ After=network-online.target [Service] User=mirte -ExecStart=/bin/bash -c "source /home/mirte/mirte_ws/devel/setup.bash && roslaunch mirte_bringup minimal.launch" +ExecStart=/bin/bash -c "source /home/mirte/mirte_ws/devel/setup.bash && roslaunch mirte_bringup minimal_master.launch" [Install] WantedBy=multi-user.target diff --git a/services/mirte-usb-switch.service b/services/mirte-usb-switch.service new file mode 100755 index 0000000..bb375f7 --- /dev/null +++ b/services/mirte-usb-switch.service @@ -0,0 +1,12 @@ +[Unit] +Description=Mirte USB switch +After=network.target +After=ssh.service +After=network-online.target + +[Service] +User=root +ExecStart=/bin/bash -c "/usr/local/src/mirte/mirte-install-scripts/mirte-master/usb_switch/build/mirte_master_usb_switch" + +[Install] +WantedBy=multi-user.target From f9035303cf28d0df6ea063acd5ee299dc73251c0 Mon Sep 17 00:00:00 2001 From: Arend-Jan Date: Wed, 6 Mar 2024 09:14:06 +0000 Subject: [PATCH 060/353] Build and start service install mirte-master --- install_mirte.sh | 2 +- install_mirte_master.sh | 24 ++++++++++++++++++++++++ mirte_master.sh | 13 ------------- 3 files changed, 25 insertions(+), 14 deletions(-) create mode 100755 install_mirte_master.sh delete mode 100755 mirte_master.sh diff --git a/install_mirte.sh b/install_mirte.sh index ba7dc46..d26304d 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -74,7 +74,7 @@ cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 ./install_bt.sh cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 -./mirte_master.sh +./install_mirte_master.sh # # Install Mirte documentation # cd $MIRTE_SRC_DIR/mirte-documentation || exit 1 diff --git a/install_mirte_master.sh b/install_mirte_master.sh new file mode 100755 index 0000000..1d5fb28 --- /dev/null +++ b/install_mirte_master.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -xe + +MIRTE_SRC_DIR=/usr/local/src/mirte + +if [[ ${type:=""} != "mirte_orangepi3b" ]]; then + # Fix for wrong sound card + sudo bash -c 'cat <> /etc/asound.conf +defaults.pcm.card 1 +defaults.ctl.card 1 +EOT' + +fi + +cd $MIRTE_SRC_DIR/mirte-install-scripts/mirte-master/usb_switch/ +mkdir build +cd build +cmake .. +make -j +sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-usb-switch.service /lib/systemd/system/ +sudo systemctl daemon-reload +sudo systemctl stop mirte-usb-switch.service || /bin/true +sudo systemctl start mirte-usb-switch.service +sudo systemctl enable mirte-usb-switch.service diff --git a/mirte_master.sh b/mirte_master.sh deleted file mode 100755 index 07bb1d7..0000000 --- a/mirte_master.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -set -xe - -# MIRTE_SRC_DIR=/usr/local/src/mirte - -if [[ ${type:=""} != "mirte_orangepi3b" ]]; then - # Fix for wrong sound card - sudo bash -c 'cat <> /etc/asound.conf -defaults.pcm.card 1 -defaults.ctl.card 1 -EOT' - -fi From 21206e171c85eb2cb115c094b41f12c219f9c5b4 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 7 Mar 2024 15:32:45 +0100 Subject: [PATCH 061/353] Cleanup usb-switch code and cmake action --- .github/workflows/c_check.yml | 14 +++- .github/workflows/cmake_check.yml | 24 +++++++ install_mirte_master.sh | 1 + mirte-master/usb_switch/CMakeLists.txt | 1 - mirte-master/usb_switch/usb_switch.cpp | 90 ++++++++++++-------------- pam/CMakeLists.txt | 24 +++---- 6 files changed, 92 insertions(+), 62 deletions(-) create mode 100644 .github/workflows/cmake_check.yml diff --git a/.github/workflows/c_check.yml b/.github/workflows/c_check.yml index 11aba02..6d43ab9 100644 --- a/.github/workflows/c_check.yml +++ b/.github/workflows/c_check.yml @@ -21,7 +21,17 @@ jobs: - uses: actions/checkout@v3 - uses: DoozyX/clang-format-lint-action@v0.14 - uses: lukka/get-cmake@latest - - run: | + - name: Build pam module + run: | apt update && apt install libpam0g-dev -y ./install_pam.sh - ./pam/build/myprogram \ No newline at end of file + ./pam/build/myprogram + - name: Build usb_switch + run: | + cd mirte-master/usb_switch/ + sudo apt install libgpiod-dev -y + mkdir build + cd build + cmake .. + make -j + \ No newline at end of file diff --git a/.github/workflows/cmake_check.yml b/.github/workflows/cmake_check.yml new file mode 100644 index 0000000..f975b1a --- /dev/null +++ b/.github/workflows/cmake_check.yml @@ -0,0 +1,24 @@ +name: CMake Format Check + +on: + [push, pull_request] + +jobs: + cmake-format-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Install cmake-format + run: pip install cmake-format + + - name: Run cmake-format check + run: cmake-format --check **/**/CMakeLists.txt + diff --git a/install_mirte_master.sh b/install_mirte_master.sh index 1d5fb28..d19e6be 100755 --- a/install_mirte_master.sh +++ b/install_mirte_master.sh @@ -13,6 +13,7 @@ EOT' fi cd $MIRTE_SRC_DIR/mirte-install-scripts/mirte-master/usb_switch/ +sudo apt install libgpiod-dev -y mkdir build cd build cmake .. diff --git a/mirte-master/usb_switch/CMakeLists.txt b/mirte-master/usb_switch/CMakeLists.txt index e191df7..52be395 100644 --- a/mirte-master/usb_switch/CMakeLists.txt +++ b/mirte-master/usb_switch/CMakeLists.txt @@ -5,4 +5,3 @@ add_compile_options(-lgpiodcxx) add_executable(${PROJECT_NAME} usb_switch.cpp) target_link_libraries(${PROJECT_NAME} gpiodcxx) - \ No newline at end of file diff --git a/mirte-master/usb_switch/usb_switch.cpp b/mirte-master/usb_switch/usb_switch.cpp index cd3e207..d0e4e01 100644 --- a/mirte-master/usb_switch/usb_switch.cpp +++ b/mirte-master/usb_switch/usb_switch.cpp @@ -3,66 +3,62 @@ #include #include -#include #include -#include +#include #include +#include -class gpio_pin -{ +class gpio_pin { public: - gpio_pin(std::string name); - std::string name; - char block = 'A'; - std::string chip_name = "gpiochip0"; - int block_line = 0; - int line = 0; - gpiod::chip chip; - gpiod::line gpio_line; + gpio_pin(std::string name); + std::string name; + char block = 'A'; + std::string chip_name = "gpiochip0"; + int block_line = 0; + int line = 0; + gpiod::chip chip; + gpiod::line gpio_line; }; std::vector pins; -void my_handler(int s) -{ - for (const auto &pin : pins) - { - std::cout << "Turn off " << pin.name << std::endl; - pin.gpio_line.set_value(0); - pin.gpio_line.release(); - } - exit(0); +void stop_handler(int s) { + for (const auto &pin : pins) { + std::cout << "Turn off " << pin.name << std::endl; + pin.gpio_line.set_value(0); + pin.gpio_line.release(); + } + exit(0); } -int main(void) -{ - gpio_pin pin("GPIO0_D4"); +int main(void) { + gpio_pin pin("GPIO0_D4"); - pins.push_back(pin); - // ::gpiod::chip chip(pin.chip); - pin.gpio_line.request({"usb_switch", gpiod::line_request::DIRECTION_OUTPUT, 0}, 1); + pins.push_back(pin); + // ::gpiod::chip chip(pin.chip); + sleep(5); + pin.gpio_line.request( + {"usb_switch", gpiod::line_request::DIRECTION_OUTPUT, 0}, 1); - // sleep(10); - struct sigaction sigIntHandler; + struct sigaction sigIntHandler; - sigIntHandler.sa_handler = my_handler; - sigemptyset(&sigIntHandler.sa_mask); - sigIntHandler.sa_flags = 0; + sigIntHandler.sa_handler = stop_handler; + sigemptyset(&sigIntHandler.sa_mask); + sigIntHandler.sa_flags = 0; - sigaction(SIGINT, &sigIntHandler, NULL); - sigaction(SIGTERM, &sigIntHandler, NULL); - pause(); + sigaction(SIGINT, &sigIntHandler, NULL); + sigaction(SIGTERM, &sigIntHandler, NULL); + pause(); } -gpio_pin::gpio_pin(std::string pin_name) -{ - this->name = pin_name; - // name should be GPIOx_yz, with 0<=x<=5, A<=y<=D, 0<=z<=7 - this->chip_name = (std::string)("gpiochip") + pin_name[4]; - this->block = pin_name[6]; - this->block_line = (int)(pin_name[7] - '0'); - this->line = 8 * (this->block - 'A') + this->block_line; - // std::cout << "cn" << this - this->chip = ::gpiod::chip(this->chip_name); - this->gpio_line = chip.get_line(this->line); - std::cout << "new pin" << pin_name << std::endl; +gpio_pin::gpio_pin(std::string pin_name) { + this->name = pin_name; + // name should be GPIOx_yz, with 0<=x<=5, A<=y<=D, 0<=z<=7 + this->chip_name = (std::string)("gpiochip") + pin_name[4]; + this->block = pin_name[6]; + this->block_line = (int)(pin_name[7] - '0'); + this->line = 8 * (this->block - 'A') + this->block_line; + // std::cout << "cn" << this + this->chip = ::gpiod::chip(this->chip_name); + this->gpio_line = chip.get_line(this->line); + std::cout << "new pin" << pin_name << std::endl; } \ No newline at end of file diff --git a/pam/CMakeLists.txt b/pam/CMakeLists.txt index fdbd412..565d6b7 100644 --- a/pam/CMakeLists.txt +++ b/pam/CMakeLists.txt @@ -6,24 +6,24 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") find_package(PAM) # Check if we found PAM. -if (NOT PAM_FOUND) - message(FATAL_ERROR "PAM library was not found. Install: sudo apt-get install libpam0g-dev") -endif () +if(NOT PAM_FOUND) + message( + FATAL_ERROR + "PAM library was not found. Install: sudo apt-get install libpam0g-dev") +endif() -include_directories( - ${PAM_INCLUDE_DIR} - ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR} -) +include_directories(${PAM_INCLUDE_DIR} ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}) set(modules warn storepassword) foreach(module ${modules}) - add_library(mirte_pam_${module} SHARED ${module}.c) - - install(TARGETS mirte_pam_${module} DESTINATION /lib/security/) + add_library(mirte_pam_${module} SHARED ${module}.c) + + install(TARGETS mirte_pam_${module} DESTINATION /lib/security/) endforeach(module ${modules}) add_executable(myprogram test.c storepassword.c) -install(CODE "execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/install_module.sh)") \ No newline at end of file +install( + CODE "execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/install_module.sh)") From 881932c99cb44653283c275fb1ac644e1d6cf616 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Fri, 8 Mar 2024 10:40:44 +0100 Subject: [PATCH 062/353] Fix hard-coded upload port --- run_arduino.sh | 72 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 29 deletions(-) diff --git a/run_arduino.sh b/run_arduino.sh index 9093a1f..25ea842 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -1,47 +1,61 @@ #!/bin/bash - #TODO: script should have format ./run.sh build|upload] mcu_type arduino_folder # with mcu_type and arduino_folder optional # Check if ROS is running ROS_RUNNING=$(ps aux | grep -c "[r]osmaster") - +COMMAND=$1 +PROJECT=$2 # Stop ROS when uploading new code -if test "$1" == "upload" && [[ $ROS_RUNNING == "1" ]]; then +if test "$COMMAND" == "upload" && [[ $ROS_RUNNING == "1" ]]; then echo "STOPPING ROS" sudo service mirte-ros stop || /bin/true fi # Different build scripts -if test "$1" == "build"; then - arduino-cli -v compile --fqbn STM32:stm32:GenF1:pnum=BLUEPILL_F103C8,upload_method=dfu2Method,xserial=generic,usb=CDCgen,xusb=FS,opt=osstd,rtlib=nano /home/mirte/arduino_project/$2 -fi -if test "$1" == "build_nano"; then - arduino-cli -v compile --fqbn arduino:avr:nano:cpu=atmega328 /home/mirte/arduino_project/$2 -fi -if test "$1" == "build_nano_old"; then - arduino-cli -v compile --fqbn arduino:avr:nano:cpu=atmega328old /home/mirte/arduino_project/$2 -fi -if test "$1" == "build_uno"; then - arduino-cli -v compile --fqbn arduino:avr:uno /home/mirte/arduino_project/$2 -fi +if test "$COMMAND" == "build"; then + arduino-cli -v compile --fqbn STM32:stm32:GenF1:pnum=BLUEPILL_F103C8,upload_method=dfu2Method,xserial=generic,usb=CDCgen,xusb=FS,opt=osstd,rtlib=nano /home/mirte/arduino_project/$PROJECT +fi +if test "$COMMAND" == "build_nano"; then + arduino-cli -v compile --fqbn arduino:avr:nano:cpu=atmega328 /home/mirte/arduino_project/$PROJECT +fi +if test "$COMMAND" == "build_nano_old"; then + arduino-cli -v compile --fqbn arduino:avr:nano:cpu=atmega328old /home/mirte/arduino_project/$PROJECT +fi +if test "$COMMAND" == "build_uno"; then + arduino-cli -v compile --fqbn arduino:avr:uno /home/mirte/arduino_project/$PROJECT +fi +upload() { + PORT=$1 + # Different upload scripts + if test "$COMMAND" == "upload" || test "$COMMAND" == "upload_stm32"; then + arduino-cli -v upload -p $PORT --fqbn STM32:stm32:GenF1:pnum=BLUEPILL_F103C8,upload_method=dfu2Method,xserial=generic,usb=CDCgen,xusb=FS,opt=osstd,rtlib=nano /home/mirte/arduino_project/$PROJECT + fi + if test "$COMMAND" == "upload_nano"; then + arduino-cli -v upload -p $PORT --fqbn arduino:avr:nano:cpu=atmega328 /home/mirte/arduino_project/$PROJECT + fi + if test "$COMMAND" == "upload_nano_old"; then + arduino-cli -v upload -p $PORT --fqbn arduino:avr:nano:cpu=atmega328old /home/mirte/arduino_project/$PROJECT + fi + if test "$COMMAND" == "upload_uno"; then + arduino-cli -v upload -p $PORT --fqbn arduino:avr:uno /home/mirte/arduino_project/$PROJECT + fi +} -# Different upload scripts -if test "$1" == "upload" || test "$1" == "upload_stm32"; then - arduino-cli -v upload -p /dev/ttyACM0 --fqbn STM32:stm32:GenF1:pnum=BLUEPILL_F103C8,upload_method=dfu2Method,xserial=generic,usb=CDCgen,xusb=FS,opt=osstd,rtlib=nano /home/mirte/arduino_project/$2 -fi -if test "$1" == "upload_nano"; then - arduino-cli -v upload -p /dev/ttyUSB0 --fqbn arduino:avr:nano:cpu=atmega328 /home/mirte/arduino_project/$2 -fi -if test "$1" == "upload_nano_old"; then - arduino-cli -v upload -p /dev/ttyUSB0 --fqbn arduino:avr:nano:cpu=atmega328old /home/mirte/arduino_project/$2 -fi -if test "$1" == "upload_uno"; then - arduino-cli -v upload -p /dev/ttyACM0 --fqbn arduino:avr:uno /home/mirte/arduino_project/$2 -fi +if [[ $COMMAND == upload* ]]; then + shopt -s nullglob + for PORT in "/dev/ttyUSB"*; do + echo "Uploading to $PORT" + upload $PORT + done + for PORT in "/dev/ttyACM"*; do + echo "Uploading to $PORT" + upload $PORT + done +fi # Start ROS again -if test "$1" == "upload" && test "$2" == "Telemetrix4Arduino" && [[ $ROS_RUNNING == "1" ]]; then +if test "$COMMAND" == "upload" && test "$PROJECT" == "Telemetrix4Arduino" && [[ $ROS_RUNNING == "1" ]]; then sudo service mirte-ros start echo "STARTING ROS" fi From d70bc3b9237246dd82dd1770baf1f750daf90817 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 11 Mar 2024 09:25:03 +0100 Subject: [PATCH 063/353] ignore apt update issues armbian for now --- install_ROS.sh | 4 ++-- install_mirte.sh | 2 +- install_web.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install_ROS.sh b/install_ROS.sh index 09eaf74..d05413a 100755 --- a/install_ROS.sh +++ b/install_ROS.sh @@ -11,12 +11,12 @@ wget https://apt.kitware.com/kitware-archive.sh chmod +x kitware-archive.sh sudo ./kitware-archive.sh rm kitware-archive.sh -sudo apt update +sudo apt update || true sudo apt install cmake -y # Install ROS Noetic sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - -sudo apt update +sudo apt update || true sudo apt install -y ros-noetic-ros-base python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential python3-catkin-tools python3-osrf-pycommon grep -qxF "source /opt/ros/noetic/setup.bash" /home/mirte/.bashrc || echo "source /opt/ros/noetic/setup.bash" >>/home/mirte/.bashrc grep -qxF "source /opt/ros/noetic/setup.zsh" /home/mirte/.zshrc || echo "source /opt/ros/noetic/setup.zsh" >>/home/mirte/.zshrc diff --git a/install_mirte.sh b/install_mirte.sh index 29bab56..f443d8b 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -9,7 +9,7 @@ Acquire::ForceIPv4 "true"; EOF # Update -sudo apt update +sudo apt update || true # Install locales sudo apt install -y locales diff --git a/install_web.sh b/install_web.sh index ae9a7cd..164be2a 100755 --- a/install_web.sh +++ b/install_web.sh @@ -3,7 +3,7 @@ set -xe MIRTE_SRC_DIR=/usr/local/src/mirte # Update -sudo apt update +sudo apt update || true # Install nodeenv sudo apt install -y python3-pip python3-setuptools python3-wheel From 22cf60843d322d991baaee53e44a91c93595bc12 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 11 Mar 2024 10:06:52 +0100 Subject: [PATCH 064/353] apt armbian issue focal try fix2 --- download_repos.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/download_repos.sh b/download_repos.sh index 1f9139e..e20043f 100755 --- a/download_repos.sh +++ b/download_repos.sh @@ -3,8 +3,8 @@ set -xe # Install vcstool sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - -sudo apt-get update -sudo apt-get install -y python3-vcstool +sudo apt update || true +sudo apt install -y python3-vcstool # Download all Mirte repositories vcs import --workers 1 Date: Mon, 11 Mar 2024 12:06:08 +0100 Subject: [PATCH 065/353] reorder astra install --- install_ROS.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/install_ROS.sh b/install_ROS.sh index d05413a..e2aa135 100755 --- a/install_ROS.sh +++ b/install_ROS.sh @@ -39,12 +39,6 @@ mkdir -p /home/mirte/mirte_ws/src cd /home/mirte/mirte_ws/src || exit 1 ln -s $MIRTE_SRC_DIR/mirte-ros-packages . cd .. -rosdep install -y --from-paths src/ --ignore-src --rosdistro noetic -catkin build -grep -qxF "source /home/mirte/mirte_ws/devel/setup.bash" /home/mirte/.bashrc || echo "source /home/mirte/mirte_ws/devel/setup.bash" >>/home/mirte/.bashrc -grep -qxF "source /home/mirte/mirte_ws/devel/setup.zsh" /home/mirte/.zshrc || echo "source /home/mirte/mirte_ws/devel/setup.zsh" >>/home/mirte/.zshrc - -source /home/mirte/mirte_ws/devel/setup.bash # install lidar and depth camera cd /home/mirte/mirte_ws/src || exit 1 @@ -73,6 +67,13 @@ sudo udevadm control --reload && sudo udevadm trigger roscd rplidar_ros ./scripts/create_udev_rules.sh +rosdep install -y --from-paths src/ --ignore-src --rosdistro noetic +catkin build +grep -qxF "source /home/mirte/mirte_ws/devel/setup.bash" /home/mirte/.bashrc || echo "source /home/mirte/mirte_ws/devel/setup.bash" >>/home/mirte/.bashrc +grep -qxF "source /home/mirte/mirte_ws/devel/setup.zsh" /home/mirte/.zshrc || echo "source /home/mirte/mirte_ws/devel/setup.zsh" >>/home/mirte/.zshrc + +source /home/mirte/mirte_ws/devel/setup.bash + # install missing python dependencies rosbridge #sudo apt install -y libffi-dev libjpeg-dev zlib1g-dev #sudo pip3 install twisted pyOpenSSL autobahn tornado pymongo From 9654d32e13271f66e276a7240aa9b8b3ece06be5 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 11 Mar 2024 13:21:20 +0100 Subject: [PATCH 066/353] fix vscode install --- install_vscode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_vscode.sh b/install_vscode.sh index e7537d7..e0a298c 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -17,5 +17,5 @@ sudo -u mirte $MIRTE_SRC_DIR/vscode/download-vs-code-server.sh # Second part: cd $MIRTE_SRC_DIR/vscode || exit sudo -u mirte bash -c "curl -fsSL https://code-server.dev/install.sh | sh" -sudo -u mirte bash -c "mkdir ~/.config/code-server && cp $MIRTE_SRC_DIR/mirte-install-scripts/config/code_server_config.yaml ~/.config/code_server/config.yaml" +sudo -u mirte bash -c "mkdir -p ~/.config/code-server && cp $MIRTE_SRC_DIR/mirte-install-scripts/config/code_server_config.yaml ~/.config/code_server/config.yaml" sudo systemctl enable code-server@mirte.service # Added by the code-server install script From ad7ae9c887d3d4da2e0de22c9faf62390baa800e Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 11 Mar 2024 14:42:34 +0100 Subject: [PATCH 067/353] ign vscode issue for now --- install_vscode.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_vscode.sh b/install_vscode.sh index e0a298c..fbde6ce 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -17,5 +17,5 @@ sudo -u mirte $MIRTE_SRC_DIR/vscode/download-vs-code-server.sh # Second part: cd $MIRTE_SRC_DIR/vscode || exit sudo -u mirte bash -c "curl -fsSL https://code-server.dev/install.sh | sh" -sudo -u mirte bash -c "mkdir -p ~/.config/code-server && cp $MIRTE_SRC_DIR/mirte-install-scripts/config/code_server_config.yaml ~/.config/code_server/config.yaml" -sudo systemctl enable code-server@mirte.service # Added by the code-server install script +sudo -u mirte bash -c "mkdir -p ~/.config/code-server && cp $MIRTE_SRC_DIR/mirte-install-scripts/config/code_server_config.yaml ~/.config/code_server/config.yaml" || true +sudo systemctl enable code-server@mirte.service || true # Added by the code-server install script From a82c32faef87c2c248da7cf3c31e41324535c300 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 11 Mar 2024 16:34:21 +0100 Subject: [PATCH 068/353] fix vscode install err --- install_vscode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_vscode.sh b/install_vscode.sh index fbde6ce..286659f 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -17,5 +17,5 @@ sudo -u mirte $MIRTE_SRC_DIR/vscode/download-vs-code-server.sh # Second part: cd $MIRTE_SRC_DIR/vscode || exit sudo -u mirte bash -c "curl -fsSL https://code-server.dev/install.sh | sh" -sudo -u mirte bash -c "mkdir -p ~/.config/code-server && cp $MIRTE_SRC_DIR/mirte-install-scripts/config/code_server_config.yaml ~/.config/code_server/config.yaml" || true +sudo -u mirte bash -c "mkdir -p ~/.config/code-server && cp $MIRTE_SRC_DIR/mirte-install-scripts/config/code_server_config.yaml ~/.config/code-server/config.yaml" || true sudo systemctl enable code-server@mirte.service || true # Added by the code-server install script From 7bffa9a0df50c02947e6526600d7bbf3441a54ce Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 11 Mar 2024 21:12:07 +0100 Subject: [PATCH 069/353] set root password --- install_mirte.sh | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/install_mirte.sh b/install_mirte.sh index f443d8b..0eea5de 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -50,7 +50,7 @@ cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 # Install Mirte Python package cd $MIRTE_SRC_DIR/mirte-python || exit 1 -# pip3 install . +pip3 install . # Install Mirte Interface cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 @@ -77,22 +77,22 @@ cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 ./install_mirte_master.sh # # Install Mirte documentation -# cd $MIRTE_SRC_DIR/mirte-documentation || exit 1 -# sudo apt install -y python3.8-venv libenchant-dev -# python3 -m venv docs-env -# source docs-env/bin/activate -# pip install docutils==0.16.0 sphinx-tabs==3.2.0 #TODO: use files to freeze versions -# pip install wheel sphinx sphinx-prompt sphinx-rtd-theme sphinxcontrib-spelling sphinxcontrib-napoleon -# mkdir -p _modules/catkin_ws/src -# cd _modules || exit 1 -# ln -s $MIRTE_SRC_DIR/mirte-python . || true -# cd mirte-python || exit 1 -# pip install . || true -# source /opt/ros/noetic/setup.bash -# source /home/mirte/mirte_ws/devel/setup.bash -# cd ../../ -# make html || true -# deactivate +cd $MIRTE_SRC_DIR/mirte-documentation || exit 1 +sudo apt install -y python3.8-venv libenchant-dev +python3 -m venv docs-env +source docs-env/bin/activate +pip install docutils==0.16.0 sphinx-tabs==3.2.0 #TODO: use files to freeze versions +pip install wheel sphinx sphinx-prompt sphinx-rtd-theme sphinxcontrib-spelling sphinxcontrib-napoleon +mkdir -p _modules/catkin_ws/src +cd _modules || exit 1 +ln -s $MIRTE_SRC_DIR/mirte-python . || true +cd mirte-python || exit 1 +pip install . || true +source /opt/ros/noetic/setup.bash +source /home/mirte/mirte_ws/devel/setup.bash +cd ../../ +make html || true +deactivate ./install_vscode.sh @@ -100,6 +100,10 @@ cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 sudo apt install pulseaudio libasound2-dev libespeak1 -y pip3 install simpleaudio pyttsx3 +# set default password for root to ... +sed -i '/^root:/d' /etc/shadow +echo 'root:$6$iPpuScKGQTiuJk9r$cBXX/s.8UBp0bvrshHRhw/tHcmU3.beHBfCyJgP8Qhjx2CEO5.dyyvKips6loYQocSTgS/qEYxPrOQd/.qVi70:19793:0:99999:7:::' | sudo tee -a /etc/shadow + # Install overlayfs and make sd card read only (software) sudo apt install -y overlayroot # Currently only instaling, not enabled From 6453af14341828f240d02da1bbd05a4ba50e5762 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 12 Mar 2024 09:12:51 +0100 Subject: [PATCH 070/353] Fix docs install vscode --- install_mirte.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install_mirte.sh b/install_mirte.sh index 0eea5de..e9ce9b8 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -94,6 +94,7 @@ cd ../../ make html || true deactivate +cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 ./install_vscode.sh # install audio support to use with mirte-pioneer pcb and orange pi zero 2 From bc6136d4101cfabac3603980e9a3b8bb0d2c72a4 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 12 Mar 2024 10:59:24 +0100 Subject: [PATCH 071/353] Fix sed /etc/shadow now allowed --- install_mirte.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_mirte.sh b/install_mirte.sh index e9ce9b8..5d8491c 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -102,7 +102,7 @@ sudo apt install pulseaudio libasound2-dev libespeak1 -y pip3 install simpleaudio pyttsx3 # set default password for root to ... -sed -i '/^root:/d' /etc/shadow +sudo sed -i '/^root:/d' /etc/shadow echo 'root:$6$iPpuScKGQTiuJk9r$cBXX/s.8UBp0bvrshHRhw/tHcmU3.beHBfCyJgP8Qhjx2CEO5.dyyvKips6loYQocSTgS/qEYxPrOQd/.qVi70:19793:0:99999:7:::' | sudo tee -a /etc/shadow # Install overlayfs and make sd card read only (software) From 597823cecb60ee2db82b8deaf9e7e9e2198385cc Mon Sep 17 00:00:00 2001 From: mklomp Date: Fri, 15 Mar 2024 12:35:58 +0100 Subject: [PATCH 072/353] Added mergedeep to dependecies --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index ffd9c7f..3afecb9 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -22,7 +22,7 @@ rosdep update # Install computer vision libraries #TODO: make dependecies of ROS package sudo apt install -y python3-pip python3-wheel python3-setuptools python3-opencv libzbar0 -sudo pip3 install pyzbar +sudo pip3 install pyzbar mergedeep # Move custom settings to writabel filesystem #cp $MIRTE_SRC_DIR/mirte-ros-packages/mirte_telemetrix/config/mirte_user_settings.yaml /home/mirte/.user_settings.yaml From dc70a5c634edeb4ccf1380eca9fe26ffc533a67d Mon Sep 17 00:00:00 2001 From: mklomp Date: Tue, 19 Mar 2024 09:48:36 +0100 Subject: [PATCH 073/353] Update ROS systemd service to start ROS2 --- services/mirte-ros.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/mirte-ros.service b/services/mirte-ros.service index fa652ef..9ee9391 100644 --- a/services/mirte-ros.service +++ b/services/mirte-ros.service @@ -6,7 +6,7 @@ After=network-online.target [Service] User=mirte -ExecStart=/bin/bash -c "source /home/mirte/mirte_ws/devel/setup.bash && roslaunch mirte_bringup minimal.launch" +ExecStart=/bin/bash -c "source /home/mirte/mirte_ws/install/setup.bash && ros2 launch mirte_bringup minimal.launch.py" [Install] WantedBy=multi-user.target From 8a075392e30d4159240650f379789b40aec015fd Mon Sep 17 00:00:00 2001 From: Arend-Jan Date: Thu, 21 Mar 2024 20:32:04 +0000 Subject: [PATCH 074/353] Fix usb switch code + remove telemetrix uf2 --- .gitignore | 4 +++- Telemetrix4RpiPico.uf2 | Bin 72192 -> 0 bytes mirte-master/usb_switch/usb_switch.cpp | 18 +++++++++--------- 3 files changed, 12 insertions(+), 10 deletions(-) delete mode 100644 Telemetrix4RpiPico.uf2 diff --git a/.gitignore b/.gitignore index 70deb91..9179412 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ build/ ev3-usb.sh -ui/ \ No newline at end of file +ui/ +mirte-master/usb_switch/usb_switch.cpp +*.uf2 diff --git a/Telemetrix4RpiPico.uf2 b/Telemetrix4RpiPico.uf2 deleted file mode 100644 index e44cc6a6c74ccc57c6c105198d29db17165ab47a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 72192 zcmd?SeS8$v^*?^^>|>tD<^h=94PkaSK%Rh*0HRTu%!EmHCqPI*Ljrb_AS}U$1*+Xh z)dkcBu`Lj^c|b+5R>ih4vV82Xq^4^75w-1Xf}c+yqKiDNAFXyPYM!&db7vA*nts0D z-+#Z?D{NkynVq?FXXd=`IrrRi&pCIEkQ;sHs`bwy29b{eVR?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}1J4X~$4 zo;^u@a6Qo`G}HOv_BL7iL$2Znii=26HflU^?QMHtA++$}SL`4^uDPD?Zkc6SMs^7? zaTmxkXp?*=mQ<3oe~78JO3Q9|AjpOXf`j~5Exb`}D+!%!kYAexT%AKnQNA9;FcN3TTWixY(Yg430yE2i-h0tVw9yEt(x1uH!L{1qI}YC$!MYyUry|EQ7h zuL;86-T*5I;si)>vEbga*#`tNEmq7XVcBNkTgxoScGvSNtj#d@9XDaHJY}4VdQF$C z!FkS-DcxeB@HJ@OEgrWpb6_tLa-!LWZ`@?cmB5w%6~6+~La9F9PreY%LVl*xb z5EdbnAlzSyU?8M4hY$mTxk#$3C$L{)4Afh^-ksE^HMVEr7d8rk#%bZ$1(|?V2w$N8 zQ2vY3CcU};j#2qH0{>m052X#hb_jpHT<`yQdte`+#B&1bGTP(o_o40=K>iAK{9fum O_Wy7H&rpEk|9=5Dx6>H_ diff --git a/mirte-master/usb_switch/usb_switch.cpp b/mirte-master/usb_switch/usb_switch.cpp index d0e4e01..8bf936b 100644 --- a/mirte-master/usb_switch/usb_switch.cpp +++ b/mirte-master/usb_switch/usb_switch.cpp @@ -31,14 +31,6 @@ void stop_handler(int s) { } int main(void) { - gpio_pin pin("GPIO0_D4"); - - pins.push_back(pin); - // ::gpiod::chip chip(pin.chip); - sleep(5); - pin.gpio_line.request( - {"usb_switch", gpiod::line_request::DIRECTION_OUTPUT, 0}, 1); - struct sigaction sigIntHandler; sigIntHandler.sa_handler = stop_handler; @@ -47,6 +39,15 @@ int main(void) { sigaction(SIGINT, &sigIntHandler, NULL); sigaction(SIGTERM, &sigIntHandler, NULL); + + gpio_pin pin("GPIO4_C3"); + + pins.push_back(pin); + pin.gpio_line.request( + {"usb_switch", gpiod::line_request::DIRECTION_OUTPUT, 0}, 0); + pin.gpio_line.set_value(0); // Force off before turning on. + sleep(1); + pin.gpio_line.set_value(1); pause(); } @@ -57,7 +58,6 @@ gpio_pin::gpio_pin(std::string pin_name) { this->block = pin_name[6]; this->block_line = (int)(pin_name[7] - '0'); this->line = 8 * (this->block - 'A') + this->block_line; - // std::cout << "cn" << this this->chip = ::gpiod::chip(this->chip_name); this->gpio_line = chip.get_line(this->line); std::cout << "new pin" << pin_name << std::endl; From fb7ebab1ba41c476f3bfb4dcc68821fdb5e7382c Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 21 Mar 2024 22:54:08 +0100 Subject: [PATCH 075/353] Add albert packages + gpiod udev rules --- install_mirte_master.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install_mirte_master.sh b/install_mirte_master.sh index d19e6be..8a02524 100755 --- a/install_mirte_master.sh +++ b/install_mirte_master.sh @@ -23,3 +23,14 @@ sudo systemctl daemon-reload sudo systemctl stop mirte-usb-switch.service || /bin/true sudo systemctl start mirte-usb-switch.service sudo systemctl enable mirte-usb-switch.service + +# create a gpio group and add mirte to it. This is needed to access the gpio ports, otherwise only sudo is allowed. +sudo groupadd gpiod +sudo usermod -a -G gpiod mirte +sudo echo '# udev rules for gpio port access through libgpiod +SUBSYSTEM=="gpio", KERNEL=="gpiochip*", GROUP="gpiod", MODE="0660"' | sudo tee /etc/udev/rules.d/60-gpiod.rules +pip install gpiod==1.5.4 # python3.8 version + +# chatgpt node stuff for @chris-pek +pip install gtts playsound openai==0.28.0 sounddevice scipy SpeechRecognition soundfile transformers datasets pyyaml pydub Elevenlabs +pip install numpy==1.23.1 # python3.8 fix From 10c7a4be5f3ee783d581e560e95fe2dc751260be Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 21 Mar 2024 23:19:39 +0100 Subject: [PATCH 076/353] fix gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9179412..d1941eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ build/ ev3-usb.sh ui/ -mirte-master/usb_switch/usb_switch.cpp *.uf2 From 87b0e8001a3c2dcb09147bfcb6e6f0fe7e1a6bc9 Mon Sep 17 00:00:00 2001 From: mklomp Date: Mon, 25 Mar 2024 10:57:44 +0100 Subject: [PATCH 077/353] Using ROS2 repos --- download_repos.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/download_repos.sh b/download_repos.sh index 302a7cb..8a95276 100755 --- a/download_repos.sh +++ b/download_repos.sh @@ -1,8 +1,8 @@ #!/bin/bash # Install vcstool -sudo sh -c 'echo "deb http://ftp.tudelft.nl/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' -curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add - +sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null sudo apt-get update sudo apt-get install -y python3-vcstool From d0669a83316974dff29aaa4f6f504587bcc89c07 Mon Sep 17 00:00:00 2001 From: mklomp Date: Mon, 25 Mar 2024 11:20:06 +0100 Subject: [PATCH 078/353] Install python3 instead of python3.8 --- install_mirte.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_mirte.sh b/install_mirte.sh index 29c5eb5..86f718b 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -18,8 +18,8 @@ cp download_repos.sh $MIRTE_SRC_DIR cd $MIRTE_SRC_DIR ./download_repos.sh -# Install dependecnies to be able to run python3.8 -sudo apt install -y python3.8 python3-pip python3-setuptools +# Install dependecnies to be able to run python3 +sudo apt install -y python3 python3-pip python3-setuptools # Set piwheels as pip repo sudo bash -c "echo '[global]' > /etc/pip.conf" From 6df236a9ca3390723543e5894ac4b0f7ef9930dc Mon Sep 17 00:00:00 2001 From: mklomp Date: Mon, 25 Mar 2024 12:28:46 +0100 Subject: [PATCH 079/353] Using python3 instead of python3.8 --- install_mirte.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_mirte.sh b/install_mirte.sh index 86f718b..86a6f6e 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -68,7 +68,7 @@ fi # Install Mirte documentation cd $MIRTE_SRC_DIR/mirte-documentation -sudo apt install -y python3.8-venv libenchant-dev +sudo apt install -y python3-venv libenchant-dev python3 -m venv docs-env source docs-env/bin/activate pip install docutils==0.16.0 sphinx-tabs==3.2.0 #TODO: use files to freeze versions From 987ca749d1d798f061576073f2fc6eee8c34de9f Mon Sep 17 00:00:00 2001 From: mklomp Date: Mon, 25 Mar 2024 13:35:16 +0100 Subject: [PATCH 080/353] Disable documentation --- install_mirte.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/install_mirte.sh b/install_mirte.sh index 86a6f6e..1fc5d09 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -67,22 +67,22 @@ if [ "$(uname -a | grep sunxi)" != "" ]; then fi # Install Mirte documentation -cd $MIRTE_SRC_DIR/mirte-documentation -sudo apt install -y python3-venv libenchant-dev -python3 -m venv docs-env -source docs-env/bin/activate -pip install docutils==0.16.0 sphinx-tabs==3.2.0 #TODO: use files to freeze versions -pip install wheel sphinx sphinx-prompt sphinx-rtd-theme sphinxcontrib-spelling sphinxcontrib-napoleon -mkdir -p _modules/catkin_ws/src -cd _modules -ln -s $MIRTE_SRC_DIR/mirte-python . -cd mirte-python -pip install . -source /opt/ros/noetic/setup.bash -source /home/mirte/mirte_ws/devel/setup.bash -cd ../../ -make html -deactivate +#cd $MIRTE_SRC_DIR/mirte-documentation +#sudo apt install -y python3-venv libenchant-dev +#python3 -m venv docs-env +#source docs-env/bin/activate +#pip install docutils==0.16.0 sphinx-tabs==3.2.0 #TODO: use files to freeze versions +#pip install wheel sphinx sphinx-prompt sphinx-rtd-theme sphinxcontrib-spelling sphinxcontrib-napoleon +#mkdir -p _modules/catkin_ws/src +#cd _modules +#ln -s $MIRTE_SRC_DIR/mirte-python . +#cd mirte-python +#pip install . +#source /opt/ros/noetic/setup.bash +#source /home/mirte/mirte_ws/devel/setup.bash +#cd ../../ +#make html +#deactivate # Install overlayfs and make sd card read only (software) sudo apt install -y overlayroot From 560e5052896313eebd2f462f28b18bf347e3d779 Mon Sep 17 00:00:00 2001 From: mklomp Date: Sat, 30 Mar 2024 21:21:20 +0100 Subject: [PATCH 081/353] Updating to latest wifi-connect --- network_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_install.sh b/network_install.sh index 474ff6c..1f314ee 100755 --- a/network_install.sh +++ b/network_install.sh @@ -23,7 +23,7 @@ sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf' # Install wifi-connect MY_ARCH=$(arch) if [[ "$MY_ARCH" == "armv7l" ]]; then MY_ARCH="rpi"; fi -wget https://github.com/balena-os/wifi-connect/releases/download/v4.4.6/wifi-connect-v4.4.6-linux-$(echo "$MY_ARCH").tar.gz +wget https://github.com/balena-os/wifi-connect/releases/download/v4.11.1/wifi-connect-v4.11.1-linux-$(echo "$MY_ARCH").zip tar -xf wifi-connect* sudo mv wifi-connect /usr/local/sbin rm wifi-connect* From 6c41575ddc94a0cbba4193f8d54b9608769c77b6 Mon Sep 17 00:00:00 2001 From: mklomp Date: Sun, 31 Mar 2024 09:41:51 +0200 Subject: [PATCH 082/353] Unzip instead of tar wifi-connect --- network_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_install.sh b/network_install.sh index 1f314ee..4a20518 100755 --- a/network_install.sh +++ b/network_install.sh @@ -24,7 +24,7 @@ sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf' MY_ARCH=$(arch) if [[ "$MY_ARCH" == "armv7l" ]]; then MY_ARCH="rpi"; fi wget https://github.com/balena-os/wifi-connect/releases/download/v4.11.1/wifi-connect-v4.11.1-linux-$(echo "$MY_ARCH").zip -tar -xf wifi-connect* +unzip wifi-connect* sudo mv wifi-connect /usr/local/sbin rm wifi-connect* From c73c9173334840cf02179e045e46380a418c5373 Mon Sep 17 00:00:00 2001 From: mklomp Date: Sun, 31 Mar 2024 19:28:23 +0200 Subject: [PATCH 083/353] Instakk ROS2 --- install_mirte.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/install_mirte.sh b/install_mirte.sh index 1fc5d09..a23c054 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -42,20 +42,20 @@ cd $MIRTE_SRC_DIR/mirte-install-scripts ./install_arduino.sh # Install Mirte Python package -cd $MIRTE_SRC_DIR/mirte-python -pip3 install . +#cd $MIRTE_SRC_DIR/mirte-python +#pip3 install . # Install Mirte Interface cd $MIRTE_SRC_DIR/mirte-install-scripts ./install_web.sh # Install Jupyter Notebook -cd $MIRTE_SRC_DIR/mirte-install-scripts -./install_jupyter_ros.sh - -# Install Mirte ROS packages #cd $MIRTE_SRC_DIR/mirte-install-scripts -#./install_ROS.sh +#./install_jupyter_ros.sh + +# Install Mirte ROS2 packages +cd $MIRTE_SRC_DIR/mirte-install-scripts +./install_ROS2.sh # Install numpy pip3 install numpy From e37b71a655638bd48f3b1d10ce67e92c14c3bc4d Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 15 Apr 2024 17:42:13 +0200 Subject: [PATCH 084/353] move to arendjan/telemetrxi4rpipico to download img --- install_arduino.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_arduino.sh b/install_arduino.sh index 7871d71..02c6bbd 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -79,8 +79,9 @@ rm -rf pico-sdk rm -rf picotool # Download latest uf2 release, resulting in Telemetrix4RpiPico.uf2 +# TODO: Downlaods from arendjan/telemetrix4rpipico, as it isn't released yet on the official repo cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 -curl -s https://api.github.com/repos/mirte-robot/telemetrix4rpipico/releases/latest | +curl -s https://api.github.com/repos/arendjan/telemetrix4rpipico/releases/latest | grep ".*/Telemetrix4RpiPico.uf2" | cut -d : -f 2,3 | tr -d \" | From 4ce3a3363436be8806178fb1bd89a1cbaca5f1ae Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 24 Apr 2024 09:34:21 +0200 Subject: [PATCH 085/353] Use telemetrix from server --- install_arduino.sh | 12 +++++++----- install_bt.sh | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/install_arduino.sh b/install_arduino.sh index 02c6bbd..0392c84 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -81,8 +81,10 @@ rm -rf picotool # Download latest uf2 release, resulting in Telemetrix4RpiPico.uf2 # TODO: Downlaods from arendjan/telemetrix4rpipico, as it isn't released yet on the official repo cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 -curl -s https://api.github.com/repos/arendjan/telemetrix4rpipico/releases/latest | - grep ".*/Telemetrix4RpiPico.uf2" | - cut -d : -f 2,3 | - tr -d \" | - wget -qi - +# curl -s https://api.github.com/repos/arendjan/telemetrix4rpipico/releases/latest | +# grep ".*/Telemetrix4RpiPico.uf2" | +# cut -d : -f 2,3 | +# tr -d \" | +# wget -qi - + +wget https://mirte.arend-jan.com/files/telemetrix/modules2/Telemetrix4RpiPico.uf2 \ No newline at end of file diff --git a/install_bt.sh b/install_bt.sh index 86dff28..f8d67b6 100755 --- a/install_bt.sh +++ b/install_bt.sh @@ -48,5 +48,5 @@ if [ "$(uname -a | grep sunxi)" != "" ]; then install_fake_bt else # Fix for ps3 controller not connecting - sudo sh -c "echo -e '#Fix for ps3 controllers not connecting\nClassicBondedOnly=false\n' >> /etc/bluetooth/input.conf" + sudo sh -c "echo '#Fix for ps3 controllers not connecting\nClassicBondedOnly=false\n' >> /etc/bluetooth/input.conf" fi From 2f1aa339332cee1530f3c66c00d27c66fef44853 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 24 Apr 2024 09:36:11 +0200 Subject: [PATCH 086/353] fix styling --- install_arduino.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_arduino.sh b/install_arduino.sh index 0392c84..23e59cd 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -87,4 +87,4 @@ cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 # tr -d \" | # wget -qi - -wget https://mirte.arend-jan.com/files/telemetrix/modules2/Telemetrix4RpiPico.uf2 \ No newline at end of file +wget https://mirte.arend-jan.com/files/telemetrix/modules2/Telemetrix4RpiPico.uf2 From 698d982f6c81c2545dc9268c38cd1209d7de92fd Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 30 Apr 2024 13:49:27 +0000 Subject: [PATCH 087/353] chmod shutdown service --- install_mirte_master.sh | 7 +++++++ services/mirte-shutdown.service | 0 2 files changed, 7 insertions(+) mode change 100644 => 100755 services/mirte-shutdown.service diff --git a/install_mirte_master.sh b/install_mirte_master.sh index 8a02524..1b56f37 100755 --- a/install_mirte_master.sh +++ b/install_mirte_master.sh @@ -24,6 +24,13 @@ sudo systemctl stop mirte-usb-switch.service || /bin/true sudo systemctl start mirte-usb-switch.service sudo systemctl enable mirte-usb-switch.service +sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-shutdown.service /lib/systemd/system/ +sudo systemctl daemon-reload +sudo systemctl stop mirte-shutdown.service || /bin/true +sudo systemctl start mirte-shutdown.service +sudo systemctl enable mirte-shutdown.service + + # create a gpio group and add mirte to it. This is needed to access the gpio ports, otherwise only sudo is allowed. sudo groupadd gpiod sudo usermod -a -G gpiod mirte diff --git a/services/mirte-shutdown.service b/services/mirte-shutdown.service old mode 100644 new mode 100755 From 7d2509fe3a078fe38b365a1da84ceac022acd927 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 30 Apr 2024 14:05:08 +0000 Subject: [PATCH 088/353] fix shutdown service --- services/mirte-shutdown.service | 2 +- services/mirte_shutdown.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/services/mirte-shutdown.service b/services/mirte-shutdown.service index 5fe2b6d..97037d6 100755 --- a/services/mirte-shutdown.service +++ b/services/mirte-shutdown.service @@ -5,7 +5,7 @@ After=mirte-ros.service [Service] Type=oneshot RemainAfterExit=true -ExecStop=/usr/local/src/mirte/mirte-install-scripts/services/shutdown_mirte.sh +ExecStop=/usr/local/src/mirte/mirte-install-scripts/services/mirte_shutdown.sh TimeoutSec=30 [Install] WantedBy=multi-user.target diff --git a/services/mirte_shutdown.sh b/services/mirte_shutdown.sh index be9f8c9..aa5722b 100755 --- a/services/mirte_shutdown.sh +++ b/services/mirte_shutdown.sh @@ -2,12 +2,12 @@ set -xe # Don't turn off the relay if the system is rebooting # TODO: does not work if ros is not running -if ! systemctl list-jobs | grep -q -e "reboot.target.*start"; then - echo "not rebooting" -else - printf "Rebooting\n" - exit -fi +# if ! systemctl list-jobs | grep -q -e "reboot.target.*start"; then +# echo "not rebooting" +# else +# printf "Rebooting\n" +# exit +# fi touch /home/mirte/shutdown source /home/mirte/mirte_ws/devel/setup.bash From a58815ea7f7599d6e01947c01a18cc5d256e5095 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 30 Apr 2024 14:26:10 +0000 Subject: [PATCH 089/353] remove touch shutdown files --- services/mirte_shutdown.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/mirte_shutdown.sh b/services/mirte_shutdown.sh index aa5722b..52ec515 100755 --- a/services/mirte_shutdown.sh +++ b/services/mirte_shutdown.sh @@ -9,8 +9,8 @@ set -xe # exit # fi -touch /home/mirte/shutdown +# touch /home/mirte/shutdown source /home/mirte/mirte_ws/devel/setup.bash rosservice call /mirte/shutdown "data: false" -touch /home/mirte/shutdown_done +# touch /home/mirte/shutdown_done sleep 10 From 90bbc70a4d7899a5b6c346492db57575217d7607 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 30 Apr 2024 16:31:24 +0200 Subject: [PATCH 090/353] style fix --- install_mirte_master.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install_mirte_master.sh b/install_mirte_master.sh index 1b56f37..5708a12 100755 --- a/install_mirte_master.sh +++ b/install_mirte_master.sh @@ -30,7 +30,6 @@ sudo systemctl stop mirte-shutdown.service || /bin/true sudo systemctl start mirte-shutdown.service sudo systemctl enable mirte-shutdown.service - # create a gpio group and add mirte to it. This is needed to access the gpio ports, otherwise only sudo is allowed. sudo groupadd gpiod sudo usermod -a -G gpiod mirte From 9c5d47dbdc8888ca717a9c04892ea0b45780a6a7 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 2 May 2024 16:27:23 +0200 Subject: [PATCH 091/353] add fix scripts for mirte-master --- fix_scripts/fix_arm.sh | 21 +++++++++++++++++++++ fix_scripts/update_tmx.sh | 10 ++++++++++ 2 files changed, 31 insertions(+) create mode 100644 fix_scripts/fix_arm.sh create mode 100644 fix_scripts/update_tmx.sh diff --git a/fix_scripts/fix_arm.sh b/fix_scripts/fix_arm.sh new file mode 100644 index 0000000..53780c3 --- /dev/null +++ b/fix_scripts/fix_arm.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -xe +mkdir ~/arm_temp +cd ~/arm_temp +sudo systemctl stop mirte-ros +wget https://mirte.arend-jan.com/files/telemetrix/modules2/Telemetrix4RpiPico.uf2 +sudo picotool load -f Telemetrix4RpiPico.uf2 +git clone -b modules https://github.com/arendjan/tmx-pico-aio.git +cd tmx-pico-aio +pip install . +pip install aioconsole +sleep 10 +python3 examples/mirte_master_set_ranges_volt.py +sleep 10 +python3 examples/mirte_master_check_home.py +sleep 10 +sudo systemctl start mirte-ros +cd ~ +rm -rf ~/arm_temp +cd ~/mirte_ws/src/mirte-ros-packages/ +git pull diff --git a/fix_scripts/update_tmx.sh b/fix_scripts/update_tmx.sh new file mode 100644 index 0000000..239bd5f --- /dev/null +++ b/fix_scripts/update_tmx.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -xe +mkdir temp_upd +cd temp_upd +wget https://mirte.arend-jan.com/files/telemetrix/modules2/Telemetrix4RpiPico.uf2 +sudo picotool load -f Telemetrix4RpiPico.uf2 +cd ../ +rm -rf temp_upd +cd ~/mirte_ws/src/mirte-ros-packages/ +git pull From 9a8a7ec4ccfe3ac58f953eb713fefe083c561a0b Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 2 May 2024 16:37:35 +0200 Subject: [PATCH 092/353] add dev tty fix arm script --- fix_scripts/fix_arm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fix_scripts/fix_arm.sh b/fix_scripts/fix_arm.sh index 53780c3..d566b78 100644 --- a/fix_scripts/fix_arm.sh +++ b/fix_scripts/fix_arm.sh @@ -12,7 +12,7 @@ pip install aioconsole sleep 10 python3 examples/mirte_master_set_ranges_volt.py sleep 10 -python3 examples/mirte_master_check_home.py +python3 examples/mirte_master_check_home.py Date: Thu, 2 May 2024 16:43:36 +0200 Subject: [PATCH 093/353] add catkin build fix arm script --- fix_scripts/fix_arm.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fix_scripts/fix_arm.sh b/fix_scripts/fix_arm.sh index d566b78..0d04b80 100644 --- a/fix_scripts/fix_arm.sh +++ b/fix_scripts/fix_arm.sh @@ -14,8 +14,10 @@ python3 examples/mirte_master_set_ranges_volt.py sleep 10 python3 examples/mirte_master_check_home.py Date: Thu, 2 May 2024 16:47:28 +0200 Subject: [PATCH 094/353] add reset offset fix arm script --- fix_scripts/fix_arm.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/fix_scripts/fix_arm.sh b/fix_scripts/fix_arm.sh index 0d04b80..be54732 100644 --- a/fix_scripts/fix_arm.sh +++ b/fix_scripts/fix_arm.sh @@ -9,6 +9,7 @@ git clone -b modules https://github.com/arendjan/tmx-pico-aio.git cd tmx-pico-aio pip install . pip install aioconsole +python3 examples/mirte_master_reset_offset.py sleep 10 python3 examples/mirte_master_set_ranges_volt.py sleep 10 From 625d30e147f99d3b26d383e72f8cf8c2af9c1ef5 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 2 May 2024 16:48:18 +0200 Subject: [PATCH 095/353] remove extra sleep fix arm script --- fix_scripts/fix_arm.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/fix_scripts/fix_arm.sh b/fix_scripts/fix_arm.sh index be54732..c0d6220 100644 --- a/fix_scripts/fix_arm.sh +++ b/fix_scripts/fix_arm.sh @@ -14,7 +14,6 @@ sleep 10 python3 examples/mirte_master_set_ranges_volt.py sleep 10 python3 examples/mirte_master_check_home.py Date: Fri, 3 May 2024 16:16:47 +0200 Subject: [PATCH 096/353] upd fix_arm --- fix_scripts/fix_arm.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fix_scripts/fix_arm.sh b/fix_scripts/fix_arm.sh index c0d6220..a7758a9 100644 --- a/fix_scripts/fix_arm.sh +++ b/fix_scripts/fix_arm.sh @@ -5,8 +5,10 @@ cd ~/arm_temp sudo systemctl stop mirte-ros wget https://mirte.arend-jan.com/files/telemetrix/modules2/Telemetrix4RpiPico.uf2 sudo picotool load -f Telemetrix4RpiPico.uf2 -git clone -b modules https://github.com/arendjan/tmx-pico-aio.git -cd tmx-pico-aio +# git clone -b modules https://github.com/arendjan/tmx-pico-aio.git +cd /usr/local/src/mirte/mirte-tmx-pico-aio +git pull +# cd tmx-pico-aio pip install . pip install aioconsole python3 examples/mirte_master_reset_offset.py From 22fc6afa832343f03ac0105bba529ccad8a46ca1 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 6 May 2024 15:21:31 +0200 Subject: [PATCH 097/353] upd fix arm --- fix_scripts/fix_arm.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/fix_scripts/fix_arm.sh b/fix_scripts/fix_arm.sh index a7758a9..a9a19df 100644 --- a/fix_scripts/fix_arm.sh +++ b/fix_scripts/fix_arm.sh @@ -1,5 +1,6 @@ #!/bin/bash set -xe +rm -rf ~/arm_temp || true mkdir ~/arm_temp cd ~/arm_temp sudo systemctl stop mirte-ros From 0dc4cfb325eca9ecad521f46252501c167bd84cd Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 6 May 2024 16:34:34 +0200 Subject: [PATCH 098/353] upd fix arm --- fix_scripts/fix_arm.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fix_scripts/fix_arm.sh b/fix_scripts/fix_arm.sh index a9a19df..f8fb07a 100644 --- a/fix_scripts/fix_arm.sh +++ b/fix_scripts/fix_arm.sh @@ -4,12 +4,11 @@ rm -rf ~/arm_temp || true mkdir ~/arm_temp cd ~/arm_temp sudo systemctl stop mirte-ros -wget https://mirte.arend-jan.com/files/telemetrix/modules2/Telemetrix4RpiPico.uf2 +wget https://mirte.arend-jan.com/files/telemetrix/release/Telemetrix4RpiPico.uf2 +sudo picotool info Telemetrix4RpiPico.uf2 sudo picotool load -f Telemetrix4RpiPico.uf2 -# git clone -b modules https://github.com/arendjan/tmx-pico-aio.git cd /usr/local/src/mirte/mirte-tmx-pico-aio git pull -# cd tmx-pico-aio pip install . pip install aioconsole python3 examples/mirte_master_reset_offset.py From f562ecd73cf7652f167f957b68b6a81f638b0756 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Wed, 8 May 2024 16:31:00 +0200 Subject: [PATCH 099/353] always restart mirte-ros --- services/mirte-ros.service | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/mirte-ros.service b/services/mirte-ros.service index a449820..c161233 100644 --- a/services/mirte-ros.service +++ b/services/mirte-ros.service @@ -4,7 +4,12 @@ After=network.target After=ssh.service After=network-online.target +StartLimitIntervalSec=500 +StartLimitBurst=5 + [Service] +Restart=always +RestartSec=5s User=mirte ExecStart=/bin/bash -c "source /home/mirte/mirte_ws/devel/setup.bash && roslaunch mirte_bringup minimal_master.launch" From 3078c027b3998fb625aa3faa92962ff1764d6b43 Mon Sep 17 00:00:00 2001 From: mklomp Date: Mon, 13 May 2024 22:10:27 +0200 Subject: [PATCH 100/353] ROS2 build in release to check if it speeds up laser_scan_matcher --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 2b27874..9dc4046 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -47,7 +47,7 @@ git clone https://github.com/ldrobotSensorTeam/ldlidar_stl_ros2 cd .. rosdep install -y --from-paths src/ --ignore-src --rosdistro humble -colcon build +colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release grep -qxF "source /home/mirte/mirte_ws/install/setup.bash" /home/mirte/.bashrc || echo "source /home/mirte/mirte_ws/install/setup.bash" >> /home/mirte/.bashrc source /home/mirte/mirte_ws/install/setup.bash From b3e9a5d614feab1594646b86faf994c8d0bfee6e Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 16 May 2024 11:13:03 +0200 Subject: [PATCH 101/353] add update pico --- fix_scripts/update_pico.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 fix_scripts/update_pico.sh diff --git a/fix_scripts/update_pico.sh b/fix_scripts/update_pico.sh new file mode 100644 index 0000000..dc98ada --- /dev/null +++ b/fix_scripts/update_pico.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -xe +mkdir test || true +cd test +wget -N https://mirte.arend-jan.com/files/telemetrix/release/Telemetrix4RpiPico.uf2.sha256sum +wget -N https://mirte.arend-jan.com/files/telemetrix/release/Telemetrix4RpiPico.uf2 +wget -N https://mirte.arend-jan.com/files/telemetrix/release/Telemetrix4RpiPico.bin.sha256sum +sudo picotool info Telemetrix4RpiPico.uf2 +sha256sum -c Telemetrix4RpiPico.uf2.sha256sum || exit 1 +sudo picotool load -f Telemetrix4RpiPico.uf2 +sleep 2 +sudo picotool save -f Telemetrix4RpiPico.bin +sha256sum -c Telemetrix4RpiPico.bin.sha256sum || exit 1 + +cd /usr/local/src/mirte/mirte-tmx-pico-aio +git pull +pip install . +pip install aioconsole +cd ~/mirte_ws/src/mirte-ros-packages/ +git pull +catkin build \ No newline at end of file From b0b86cd39d0c0e58419c261373b1e803eb961fd8 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 16 May 2024 11:15:25 +0200 Subject: [PATCH 102/353] change to update-all --- fix_scripts/{update_pico.sh => update_all.sh} | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) rename fix_scripts/{update_pico.sh => update_all.sh} (75%) diff --git a/fix_scripts/update_pico.sh b/fix_scripts/update_all.sh similarity index 75% rename from fix_scripts/update_pico.sh rename to fix_scripts/update_all.sh index dc98ada..727ea71 100644 --- a/fix_scripts/update_pico.sh +++ b/fix_scripts/update_all.sh @@ -1,7 +1,8 @@ #!/bin/bash set -xe -mkdir test || true -cd test +sudo systemctl stop mirte-ros +mkdir ~/update_all || true +cd ~/update_all wget -N https://mirte.arend-jan.com/files/telemetrix/release/Telemetrix4RpiPico.uf2.sha256sum wget -N https://mirte.arend-jan.com/files/telemetrix/release/Telemetrix4RpiPico.uf2 wget -N https://mirte.arend-jan.com/files/telemetrix/release/Telemetrix4RpiPico.bin.sha256sum @@ -11,11 +12,17 @@ sudo picotool load -f Telemetrix4RpiPico.uf2 sleep 2 sudo picotool save -f Telemetrix4RpiPico.bin sha256sum -c Telemetrix4RpiPico.bin.sha256sum || exit 1 - +cd ~ +rm -rf ~/update_all cd /usr/local/src/mirte/mirte-tmx-pico-aio git pull pip install . pip install aioconsole cd ~/mirte_ws/src/mirte-ros-packages/ git pull -catkin build \ No newline at end of file +catkin build + +cd /usr/local/src/mirte/mirte-install-scripts/ +git pull +sudo systemctl daemon-reload +sudo systemctl start mirte-ros \ No newline at end of file From 1037d00a3dcdfb8b0206b8dc49a7a62686ba6390 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 16 May 2024 11:56:04 +0200 Subject: [PATCH 103/353] extra update stuff --- fix_scripts/fix_arm.sh | 1 - fix_scripts/update_all.sh | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fix_scripts/fix_arm.sh b/fix_scripts/fix_arm.sh index f8fb07a..8742aa0 100644 --- a/fix_scripts/fix_arm.sh +++ b/fix_scripts/fix_arm.sh @@ -22,4 +22,3 @@ cd ~/mirte_ws/src/mirte-ros-packages/ git pull catkin build sudo systemctl start mirte-ros - diff --git a/fix_scripts/update_all.sh b/fix_scripts/update_all.sh index 727ea71..79b3fd7 100644 --- a/fix_scripts/update_all.sh +++ b/fix_scripts/update_all.sh @@ -19,10 +19,14 @@ git pull pip install . pip install aioconsole cd ~/mirte_ws/src/mirte-ros-packages/ +git stash # save students changes git pull +git stash pop # apply students changes +git status | grep -c "Merge conflict" || echo "RESOLVE MERGE CONFLICTS BEFORE REBOOT!!!" catkin build cd /usr/local/src/mirte/mirte-install-scripts/ git pull sudo systemctl daemon-reload -sudo systemctl start mirte-ros \ No newline at end of file +sudo systemctl start mirte-ros +sudo touch /forcefsck From 4c7631bfd1cc6ea49ac8b9edb5dfb093672d103f Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 16 May 2024 12:21:13 +0200 Subject: [PATCH 104/353] fix merge check update_all --- fix_scripts/update_all.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fix_scripts/update_all.sh b/fix_scripts/update_all.sh index 79b3fd7..725b849 100644 --- a/fix_scripts/update_all.sh +++ b/fix_scripts/update_all.sh @@ -21,8 +21,9 @@ pip install aioconsole cd ~/mirte_ws/src/mirte-ros-packages/ git stash # save students changes git pull -git stash pop # apply students changes -git status | grep -c "Merge conflict" || echo "RESOLVE MERGE CONFLICTS BEFORE REBOOT!!!" +git stash pop || true # apply students changes +git status +echo "Resolve any merge conflicts before reboot!!!" # resolve merge conflicts before reboot catkin build cd /usr/local/src/mirte/mirte-install-scripts/ From 9b4c663d428a5cb5d0cbf1905720a59be8d5719e Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 16 May 2024 14:13:42 +0200 Subject: [PATCH 105/353] add sync to sync fs on update --- fix_scripts/update_all.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fix_scripts/update_all.sh b/fix_scripts/update_all.sh index 725b849..5e41715 100644 --- a/fix_scripts/update_all.sh +++ b/fix_scripts/update_all.sh @@ -31,3 +31,5 @@ git pull sudo systemctl daemon-reload sudo systemctl start mirte-ros sudo touch /forcefsck + +sync \ No newline at end of file From 24582f26f1312ebd03f92c5c9fa6a469440746cf Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 16 May 2024 14:20:29 +0200 Subject: [PATCH 106/353] add shutdown detection --- fix_scripts/update_all.sh | 4 +++- services/mirte-shutdown.service | 1 + services/mirte_boot.sh | 12 ++++++++++++ services/mirte_shutdown.sh | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100755 services/mirte_boot.sh diff --git a/fix_scripts/update_all.sh b/fix_scripts/update_all.sh index 5e41715..026ee3a 100644 --- a/fix_scripts/update_all.sh +++ b/fix_scripts/update_all.sh @@ -28,8 +28,10 @@ catkin build cd /usr/local/src/mirte/mirte-install-scripts/ git pull +sudo ln -s /usr/local/src/mirte/mirte-install-scripts/mirte-shutdown.service /etc/systemd/system/mirte-shutdown.service || true +sudo systemctl enable --now mirte-shutdown sudo systemctl daemon-reload sudo systemctl start mirte-ros sudo touch /forcefsck -sync \ No newline at end of file +sync diff --git a/services/mirte-shutdown.service b/services/mirte-shutdown.service index 97037d6..9df45c4 100755 --- a/services/mirte-shutdown.service +++ b/services/mirte-shutdown.service @@ -5,6 +5,7 @@ After=mirte-ros.service [Service] Type=oneshot RemainAfterExit=true +ExecStart=/usr/local/src/mirte/mirte-install-scripts/services/mirte_boot.sh ExecStop=/usr/local/src/mirte/mirte-install-scripts/services/mirte_shutdown.sh TimeoutSec=30 [Install] diff --git a/services/mirte_boot.sh b/services/mirte_boot.sh new file mode 100755 index 0000000..194530b --- /dev/null +++ b/services/mirte_boot.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -xe +# check if file /home/mirte/shutdown exists +if [ -f /home/mirte/shutdown ]; then + # check if file /home/mirte/shutdown_done exists + echo "correct shutdown" + rm /home/mirte/shutdown +else + echo "incorrect shutdown" + touch /home/mirte/shutdown_incorrect +fi diff --git a/services/mirte_shutdown.sh b/services/mirte_shutdown.sh index 52ec515..e99036b 100755 --- a/services/mirte_shutdown.sh +++ b/services/mirte_shutdown.sh @@ -9,7 +9,7 @@ set -xe # exit # fi -# touch /home/mirte/shutdown +touch /home/mirte/shutdown source /home/mirte/mirte_ws/devel/setup.bash rosservice call /mirte/shutdown "data: false" # touch /home/mirte/shutdown_done From d1caeba151c2c9d97d60acd083e7d8318adc095f Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 16 May 2024 14:29:52 +0200 Subject: [PATCH 107/353] fix shutdown detection --- fix_scripts/update_all.sh | 3 ++- services/mirte_boot.sh | 8 +++++--- services/mirte_shutdown.sh | 18 ++++++++---------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/fix_scripts/update_all.sh b/fix_scripts/update_all.sh index 026ee3a..369ad2b 100644 --- a/fix_scripts/update_all.sh +++ b/fix_scripts/update_all.sh @@ -28,7 +28,8 @@ catkin build cd /usr/local/src/mirte/mirte-install-scripts/ git pull -sudo ln -s /usr/local/src/mirte/mirte-install-scripts/mirte-shutdown.service /etc/systemd/system/mirte-shutdown.service || true +sudo ln -s /usr/local/src/mirte/mirte-install-scripts/services/mirte-shutdown.service /etc/systemd/system/mirte-shutdown.service || true +sudo touch /home/mirte/.shutdown sudo systemctl enable --now mirte-shutdown sudo systemctl daemon-reload sudo systemctl start mirte-ros diff --git a/services/mirte_boot.sh b/services/mirte_boot.sh index 194530b..fac3cb8 100755 --- a/services/mirte_boot.sh +++ b/services/mirte_boot.sh @@ -2,11 +2,13 @@ set -xe # check if file /home/mirte/shutdown exists -if [ -f /home/mirte/shutdown ]; then +if [ -f /home/mirte/.shutdown ]; then # check if file /home/mirte/shutdown_done exists echo "correct shutdown" - rm /home/mirte/shutdown + rm /home/mirte/.shutdown else echo "incorrect shutdown" - touch /home/mirte/shutdown_incorrect + touch /home/mirte/.shutdown_incorrect + # append date to shutdown_incorrect file + date >> /home/mirte/.shutdown_incorrect fi diff --git a/services/mirte_shutdown.sh b/services/mirte_shutdown.sh index e99036b..c1d6b1d 100755 --- a/services/mirte_shutdown.sh +++ b/services/mirte_shutdown.sh @@ -1,16 +1,14 @@ #!/bin/bash set -xe -# Don't turn off the relay if the system is rebooting -# TODO: does not work if ros is not running -# if ! systemctl list-jobs | grep -q -e "reboot.target.*start"; then -# echo "not rebooting" -# else -# printf "Rebooting\n" -# exit -# fi +# Don't shutdown if only stopping the service + +if ! systemctl list-jobs | grep -q -E 'shutdown.target.*start' ; then + echo "shutdown target not active" + exit +fi -touch /home/mirte/shutdown +touch /home/mirte/.shutdown source /home/mirte/mirte_ws/devel/setup.bash +# TODO: does not work if ros is not running rosservice call /mirte/shutdown "data: false" -# touch /home/mirte/shutdown_done sleep 10 From 11a8c393d103dfe00047bdd90d105c0e8f06aed6 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 16 May 2024 14:49:50 +0200 Subject: [PATCH 108/353] fix shutting down text oled --- services/mirte_boot.sh | 4 ++-- services/mirte_shutdown.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/services/mirte_boot.sh b/services/mirte_boot.sh index fac3cb8..f68a43c 100755 --- a/services/mirte_boot.sh +++ b/services/mirte_boot.sh @@ -9,6 +9,6 @@ if [ -f /home/mirte/.shutdown ]; then else echo "incorrect shutdown" touch /home/mirte/.shutdown_incorrect - # append date to shutdown_incorrect file - date >> /home/mirte/.shutdown_incorrect + # append date to shutdown_incorrect file + date >>/home/mirte/.shutdown_incorrect fi diff --git a/services/mirte_shutdown.sh b/services/mirte_shutdown.sh index c1d6b1d..7b2b674 100755 --- a/services/mirte_shutdown.sh +++ b/services/mirte_shutdown.sh @@ -2,13 +2,13 @@ set -xe # Don't shutdown if only stopping the service -if ! systemctl list-jobs | grep -q -E 'shutdown.target.*start' ; then +if ! systemctl list-jobs | grep -q -E 'shutdown.target.*start'; then echo "shutdown target not active" - exit + exit fi touch /home/mirte/.shutdown source /home/mirte/mirte_ws/devel/setup.bash # TODO: does not work if ros is not running -rosservice call /mirte/shutdown "data: false" -sleep 10 +rosservice call /mirte/set_middle_image "type: 'text', value: 'Shutting down...'" +sleep 5 From 01b1a5f9cad62ebccb59f1e764402d09486086dc Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 16 May 2024 15:04:33 +0200 Subject: [PATCH 109/353] fix rosservice call shutdown --- services/mirte_shutdown.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/mirte_shutdown.sh b/services/mirte_shutdown.sh index 7b2b674..f259def 100755 --- a/services/mirte_shutdown.sh +++ b/services/mirte_shutdown.sh @@ -10,5 +10,5 @@ fi touch /home/mirte/.shutdown source /home/mirte/mirte_ws/devel/setup.bash # TODO: does not work if ros is not running -rosservice call /mirte/set_middle_image "type: 'text', value: 'Shutting down...'" -sleep 5 +rosservice call /mirte/set_middle_image "{ type: 'text', value: 'Shutting down...'}" +sleep 2 From bebf1130c5e6b233f560af8f7ea25bb5dd02cd56 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 16 May 2024 17:02:19 +0200 Subject: [PATCH 110/353] show merge conflicts --- fix_scripts/update_all.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fix_scripts/update_all.sh b/fix_scripts/update_all.sh index 369ad2b..fe1f206 100644 --- a/fix_scripts/update_all.sh +++ b/fix_scripts/update_all.sh @@ -36,3 +36,5 @@ sudo systemctl start mirte-ros sudo touch /forcefsck sync +# find any merge conflicts by looking for '<<<' in the code +grep -r '<<<' ./mirte_ws/src/mirte-ros-packages && echo "merge conflicts in mirte-ros-packages" || echo "no merge conflict" From 8a0167bd5efb3513385974150e406222d6c6cddd Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Fri, 17 May 2024 10:33:22 +0200 Subject: [PATCH 111/353] fix grep wrong folder update_all --- fix_scripts/update_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fix_scripts/update_all.sh b/fix_scripts/update_all.sh index fe1f206..142d67b 100644 --- a/fix_scripts/update_all.sh +++ b/fix_scripts/update_all.sh @@ -37,4 +37,4 @@ sudo touch /forcefsck sync # find any merge conflicts by looking for '<<<' in the code -grep -r '<<<' ./mirte_ws/src/mirte-ros-packages && echo "merge conflicts in mirte-ros-packages" || echo "no merge conflict" +grep -r '<<<' ~/mirte_ws/src/mirte-ros-packages && echo "merge conflicts in mirte-ros-packages" || echo "no merge conflict" From afa81a5e5685c042ad26f3c654a41e15c624dbe3 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Fri, 17 May 2024 16:00:15 +0200 Subject: [PATCH 112/353] add pre-commit --- .pre-commit-config.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..71265c6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,23 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: local + hooks: + - id: clang-format + name: clang-format + entry: bash -c 'FILES=`find -type f -regex ".*\.\(cpp\|hpp\|h\|c\)$" -not -path "*/build/*"`; clang-format-14 --Werror $FILES -style=llvm -i' + language: system + types: [c] + pass_filenames: false + - id: cmake-format + entry: bash -c 'FILES=`find . -name "CMakeLists.txt"`; cmake-format $FILES -i' + language: system + types: [cmake] + pass_filenames: false + name: cmake-format + - id: shell-format + entry: bash -c 'shopt -s globstar; shfmt -s -w **/**.sh' + language: system + types: [shell] + pass_filenames: false + name: shell-format From 0a256151b4208e28e522a09f10ac60c1ab03215c Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 27 May 2024 13:19:16 +0200 Subject: [PATCH 113/353] change ros astra cam to compressed repo --- .pre-commit-config.yaml | 2 +- install_ROS.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 71265c6..6a4e589 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: pass_filenames: false name: cmake-format - id: shell-format - entry: bash -c 'shopt -s globstar; shfmt -s -w **/**.sh' + entry: bash -c 'shopt -s globstar; /home/arendjan/go/bin/shfmt -s -w **/**.sh' language: system types: [shell] pass_filenames: false diff --git a/install_ROS.sh b/install_ROS.sh index e2aa135..d789bf7 100755 --- a/install_ROS.sh +++ b/install_ROS.sh @@ -43,7 +43,7 @@ cd .. # install lidar and depth camera cd /home/mirte/mirte_ws/src || exit 1 git clone https://github.com/Slamtec/rplidar_ros.git -git clone https://github.com/orbbec/ros_astra_camera.git +git clone https://github.com/arendjan/ros_astra_camera.git -b fix-image-transport # compressed images git clone https://github.com/arendjan/ridgeback.git cd ../../ mkdir temp From 5e3fbf85a196b7ac8a20686966ef17dc685bc119 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 27 May 2024 19:15:34 +0200 Subject: [PATCH 114/353] update update script with uboot upgrade --- fix_scripts/update_all.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fix_scripts/update_all.sh b/fix_scripts/update_all.sh index 142d67b..cc47d1e 100644 --- a/fix_scripts/update_all.sh +++ b/fix_scripts/update_all.sh @@ -35,6 +35,14 @@ sudo systemctl daemon-reload sudo systemctl start mirte-ros sudo touch /forcefsck +mkdir uboot_fix/ +cd uboot_fix/ +# update u-boot to fix audio jack issue +wget https://mirte.arend-jan.com/files/fixes/uboot/linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb +sudo apt install ./linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb +sudo bash -c 'source /usr/lib/u-boot/platform_install.sh; write_uboot_platform_mtd $DIR /dev/mtdblock0' +cd ../ +rm -rf uboot_fix/ sync # find any merge conflicts by looking for '<<<' in the code grep -r '<<<' ~/mirte_ws/src/mirte-ros-packages && echo "merge conflicts in mirte-ros-packages" || echo "no merge conflict" From 5c5898f125adae276a5244680579656b9ab11f56 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Mon, 27 May 2024 20:24:48 +0200 Subject: [PATCH 115/353] cd to home --- fix_scripts/update_all.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/fix_scripts/update_all.sh b/fix_scripts/update_all.sh index cc47d1e..b4181b5 100644 --- a/fix_scripts/update_all.sh +++ b/fix_scripts/update_all.sh @@ -35,6 +35,7 @@ sudo systemctl daemon-reload sudo systemctl start mirte-ros sudo touch /forcefsck +cd ~ mkdir uboot_fix/ cd uboot_fix/ # update u-boot to fix audio jack issue From 7ed8e5c9daf490d537f3b2ecc745dcddc1c518cb Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Tue, 28 May 2024 14:37:52 +0200 Subject: [PATCH 116/353] install new uboot deb --- install_mirte_master.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/install_mirte_master.sh b/install_mirte_master.sh index 5708a12..be7fae7 100755 --- a/install_mirte_master.sh +++ b/install_mirte_master.sh @@ -40,3 +40,12 @@ pip install gpiod==1.5.4 # python3.8 version # chatgpt node stuff for @chris-pek pip install gtts playsound openai==0.28.0 sounddevice scipy SpeechRecognition soundfile transformers datasets pyyaml pydub Elevenlabs pip install numpy==1.23.1 # python3.8 fix + +mkdir ~/uboot_fix/ +cd ~/uboot_fix/ +# audio fix uboot +wget https://mirte.arend-jan.com/files/fixes/uboot/linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb +sudo apt install ./linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb +rm linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb +cd ../ +rm -rf uboot_fix/ From f2c4e4817162f49b615db57faaabc9c3479b563b Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 30 May 2024 11:52:39 +0000 Subject: [PATCH 117/353] add power check to boot checker script --- services/mirte_boot.sh | 1 + services/mirte_master_check.sh | 46 ++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100755 services/mirte_master_check.sh diff --git a/services/mirte_boot.sh b/services/mirte_boot.sh index f68a43c..a6087c9 100755 --- a/services/mirte_boot.sh +++ b/services/mirte_boot.sh @@ -12,3 +12,4 @@ else # append date to shutdown_incorrect file date >>/home/mirte/.shutdown_incorrect fi +$(dirname "$0")/mirte_master_check.sh & \ No newline at end of file diff --git a/services/mirte_master_check.sh b/services/mirte_master_check.sh new file mode 100755 index 0000000..f6064d4 --- /dev/null +++ b/services/mirte_master_check.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +. /opt/ros/noetic/setup.bash +SECONDS=0 +WARN_LVL=0 +while true; do + OK=false + + # echo "topics" + percentage=$( + ( rostopic echo /mirte/power/power_watcher -n2 | grep percentage | tail -1 ) & pid=$! + ( sleep 5 && kill -HUP $pid ) 2>/dev/null & watcher=$! + wait $pid 2>/dev/null && pkill -HUP -P $watcher + ) + # echo $percentage + # echo $( echo $percentage | wc -c) + if [ $( echo $percentage | wc -c) -gt 1 ]; then + # echo "percentage" + percentage=$( echo "$percentage" | awk '{print $NF}' ) + # echo $percentage + if (( $(echo "$percentage > 0.1" |bc -l) )); then + OK=true +fi + + if $OK; then + # echo "latest percentage: " + # echo $percentage + SECONDS=0 # update time since last ok + WARN_LVL=0 + fi + if [ $SECONDS -gt 300 ] && [ $WARN_LVL -eq 0 ]; then + wall "No ROS for longer than 5min" + WARN_LVL=1 + fi + if [ $SECONDS -gt 600 ] && [ $WARN_LVL -eq 1 ]; then + wall "No ROS for longer than 10min, shutting down in 5min" + WARN_LVL=2 + fi + if [ $SECONDS -gt 900 ] && [ $WARN_LVL -eq 2 ]; then + wall "shutting down" + WARN_LVL=3 + date > /home/mirte/.shutdown_power + sudo shutdown now + fi + sleep 2 +done \ No newline at end of file From b6d6c9b2f5dbe09acecccda173be57e8aecd9cd3 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 30 May 2024 14:34:26 +0200 Subject: [PATCH 118/353] style fixes power check --- services/mirte_boot.sh | 2 +- services/mirte_master_check.sh | 81 ++++++++++++++++++---------------- 2 files changed, 43 insertions(+), 40 deletions(-) diff --git a/services/mirte_boot.sh b/services/mirte_boot.sh index a6087c9..44bf74c 100755 --- a/services/mirte_boot.sh +++ b/services/mirte_boot.sh @@ -12,4 +12,4 @@ else # append date to shutdown_incorrect file date >>/home/mirte/.shutdown_incorrect fi -$(dirname "$0")/mirte_master_check.sh & \ No newline at end of file +"$(dirname "$0")/mirte_master_check.sh" & diff --git a/services/mirte_master_check.sh b/services/mirte_master_check.sh index f6064d4..3a57d28 100755 --- a/services/mirte_master_check.sh +++ b/services/mirte_master_check.sh @@ -4,43 +4,46 @@ SECONDS=0 WARN_LVL=0 while true; do - OK=false - - # echo "topics" - percentage=$( - ( rostopic echo /mirte/power/power_watcher -n2 | grep percentage | tail -1 ) & pid=$! - ( sleep 5 && kill -HUP $pid ) 2>/dev/null & watcher=$! - wait $pid 2>/dev/null && pkill -HUP -P $watcher - ) - # echo $percentage - # echo $( echo $percentage | wc -c) - if [ $( echo $percentage | wc -c) -gt 1 ]; then - # echo "percentage" - percentage=$( echo "$percentage" | awk '{print $NF}' ) - # echo $percentage - if (( $(echo "$percentage > 0.1" |bc -l) )); then - OK=true -fi + OK=false - if $OK; then - # echo "latest percentage: " - # echo $percentage - SECONDS=0 # update time since last ok - WARN_LVL=0 - fi - if [ $SECONDS -gt 300 ] && [ $WARN_LVL -eq 0 ]; then - wall "No ROS for longer than 5min" - WARN_LVL=1 - fi - if [ $SECONDS -gt 600 ] && [ $WARN_LVL -eq 1 ]; then - wall "No ROS for longer than 10min, shutting down in 5min" - WARN_LVL=2 - fi - if [ $SECONDS -gt 900 ] && [ $WARN_LVL -eq 2 ]; then - wall "shutting down" - WARN_LVL=3 - date > /home/mirte/.shutdown_power - sudo shutdown now - fi - sleep 2 -done \ No newline at end of file + # echo "topics" + percentage=$( + (rostopic echo /mirte/power/power_watcher -n2 | grep percentage | tail -1) & + pid=$! + (sleep 5 && kill -HUP $pid) 2>/dev/null & + watcher=$! + wait $pid 2>/dev/null && pkill -HUP -P $watcher + ) + # echo $percentage + # echo $( echo $percentage | wc -c) + if [ "$(echo $percentage | wc -c)" -gt 1 ]; then + # echo "percentage" + percentage=$(echo "$percentage" | awk '{print $NF}') + # echo $percentage + if (($(echo "$percentage > 0.1" | bc -l))); then + OK=true + fi + fi + + if $OK; then + # echo "latest percentage: " + # echo $percentage + SECONDS=0 # update time since last ok + WARN_LVL=0 + fi + if [ $SECONDS -gt 300 ] && [ $WARN_LVL -eq 0 ]; then + wall "No ROS for longer than 5min" + WARN_LVL=1 + fi + if [ $SECONDS -gt 600 ] && [ $WARN_LVL -eq 1 ]; then + wall "No ROS for longer than 10min, shutting down in 5min" + WARN_LVL=2 + fi + if [ $SECONDS -gt 900 ] && [ $WARN_LVL -eq 2 ]; then + wall "shutting down" + WARN_LVL=3 + date >/home/mirte/.shutdown_power + sudo shutdown now + fi + sleep 2 +done From 45bda6fa6760080d1b19b7b1c259342041fb54c1 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 30 May 2024 15:06:12 +0200 Subject: [PATCH 119/353] only update uboot when not yet done --- fix_scripts/update_all.sh | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/fix_scripts/update_all.sh b/fix_scripts/update_all.sh index b4181b5..8cf36a9 100644 --- a/fix_scripts/update_all.sh +++ b/fix_scripts/update_all.sh @@ -32,18 +32,25 @@ sudo ln -s /usr/local/src/mirte/mirte-install-scripts/services/mirte-shutdown.se sudo touch /home/mirte/.shutdown sudo systemctl enable --now mirte-shutdown sudo systemctl daemon-reload + +# uboot function +uboot() { + cd ~ + mkdir uboot_fix/ + cd uboot_fix/ + # update u-boot to fix audio jack issue + wget https://mirte.arend-jan.com/files/fixes/uboot/linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb + sudo apt install ./linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb + sudo bash -c 'source /usr/lib/u-boot/platform_install.sh; write_uboot_platform_mtd $DIR /dev/mtdblock0' + cd ../ + rm -rf uboot_fix/ +} + +# if linux-u-boot-orangepi3b-edge is not installed, install it +apt -qq list linux-u-boot-orangepi3b-edge | grep 24 || uboot + sudo systemctl start mirte-ros sudo touch /forcefsck - -cd ~ -mkdir uboot_fix/ -cd uboot_fix/ -# update u-boot to fix audio jack issue -wget https://mirte.arend-jan.com/files/fixes/uboot/linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb -sudo apt install ./linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb -sudo bash -c 'source /usr/lib/u-boot/platform_install.sh; write_uboot_platform_mtd $DIR /dev/mtdblock0' -cd ../ -rm -rf uboot_fix/ sync # find any merge conflicts by looking for '<<<' in the code grep -r '<<<' ~/mirte_ws/src/mirte-ros-packages && echo "merge conflicts in mirte-ros-packages" || echo "no merge conflict" From 83be7a5c978c2ec4b3e8368060394cc553cc4a2e Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 30 May 2024 14:17:05 +0000 Subject: [PATCH 120/353] move to ros script in service --- services/mirte-ros.service | 4 ++-- services/mirte_master_check.sh | 6 +++--- services/mirte_ros.sh | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100755 services/mirte_ros.sh diff --git a/services/mirte-ros.service b/services/mirte-ros.service index c161233..b368c2c 100644 --- a/services/mirte-ros.service +++ b/services/mirte-ros.service @@ -10,8 +10,8 @@ StartLimitBurst=5 [Service] Restart=always RestartSec=5s -User=mirte -ExecStart=/bin/bash -c "source /home/mirte/mirte_ws/devel/setup.bash && roslaunch mirte_bringup minimal_master.launch" +User=mirte +ExecStart=/usr/local/src/mirte/mirte-install-scripts/services/mirte_ros.sh [Install] WantedBy=multi-user.target diff --git a/services/mirte_master_check.sh b/services/mirte_master_check.sh index 3a57d28..1330b2a 100755 --- a/services/mirte_master_check.sh +++ b/services/mirte_master_check.sh @@ -1,5 +1,5 @@ #!/bin/bash - +set -x . /opt/ros/noetic/setup.bash SECONDS=0 WARN_LVL=0 @@ -10,7 +10,7 @@ while true; do percentage=$( (rostopic echo /mirte/power/power_watcher -n2 | grep percentage | tail -1) & pid=$! - (sleep 5 && kill -HUP $pid) 2>/dev/null & + (sleep 5 && kill -9 $pid) 2>/dev/null & watcher=$! wait $pid 2>/dev/null && pkill -HUP -P $watcher ) @@ -45,5 +45,5 @@ while true; do date >/home/mirte/.shutdown_power sudo shutdown now fi - sleep 2 + sleep 10 done diff --git a/services/mirte_ros.sh b/services/mirte_ros.sh new file mode 100755 index 0000000..b220fc5 --- /dev/null +++ b/services/mirte_ros.sh @@ -0,0 +1,18 @@ +#!/bin/bash +source /home/mirte/mirte_ws/devel/setup.bash + +ip=$(hostname -I | awk '{print $1}' ) #just get the first ip addr +echo $ip +if [ "$(echo $ip | wc -w)" -ne 1 ]; then +echo "multiple, wont use the ip from hostname" +echo $ip +echo hostname -I +else +export ROS_IP="$ip" +export ROS_MASTER_URI="http://$ip:11311/" +echo $ROS_IP +echo $ROS_MASTER_URI +fi +# If the robot user wants to add their own config: +# source /home/mirte/.bashrc +roslaunch mirte_bringup minimal_master.launch \ No newline at end of file From b9dc810eec6dfbeb5c2e05167212b1171b42711c Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 30 May 2024 14:25:33 +0000 Subject: [PATCH 121/353] fix echo mirte_ros.sh --- services/mirte_ros.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/mirte_ros.sh b/services/mirte_ros.sh index b220fc5..745e33c 100755 --- a/services/mirte_ros.sh +++ b/services/mirte_ros.sh @@ -6,7 +6,7 @@ echo $ip if [ "$(echo $ip | wc -w)" -ne 1 ]; then echo "multiple, wont use the ip from hostname" echo $ip -echo hostname -I +hostname -I else export ROS_IP="$ip" export ROS_MASTER_URI="http://$ip:11311/" From 244d40689660f1b9b4743e9453983f21f3dbb146 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 30 May 2024 16:31:51 +0200 Subject: [PATCH 122/353] style fix mirte_ros.sh --- services/mirte_ros.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/services/mirte_ros.sh b/services/mirte_ros.sh index 745e33c..1d95a0c 100755 --- a/services/mirte_ros.sh +++ b/services/mirte_ros.sh @@ -1,18 +1,19 @@ #!/bin/bash source /home/mirte/mirte_ws/devel/setup.bash -ip=$(hostname -I | awk '{print $1}' ) #just get the first ip addr +ip=$(hostname -I | awk '{print $1}') #just get the first ip addr echo $ip if [ "$(echo $ip | wc -w)" -ne 1 ]; then -echo "multiple, wont use the ip from hostname" -echo $ip -hostname -I -else -export ROS_IP="$ip" -export ROS_MASTER_URI="http://$ip:11311/" -echo $ROS_IP -echo $ROS_MASTER_URI + # happens at boot, when the network is not yet up + echo "multiple or none, wont use the ip from hostname" + echo $ip + hostname -I +else + export ROS_IP="$ip" + export ROS_MASTER_URI="http://$ip:11311/" + echo $ROS_IP + echo $ROS_MASTER_URI fi # If the robot user wants to add their own config: # source /home/mirte/.bashrc -roslaunch mirte_bringup minimal_master.launch \ No newline at end of file +roslaunch mirte_bringup minimal_master.launch From 7bf538179584596463871d214e3e9506cbc6f154 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 30 May 2024 16:33:38 +0200 Subject: [PATCH 123/353] cleanup mirte_ros.sh --- services/mirte_ros.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/services/mirte_ros.sh b/services/mirte_ros.sh index 1d95a0c..d5acd60 100755 --- a/services/mirte_ros.sh +++ b/services/mirte_ros.sh @@ -2,17 +2,15 @@ source /home/mirte/mirte_ws/devel/setup.bash ip=$(hostname -I | awk '{print $1}') #just get the first ip addr -echo $ip if [ "$(echo $ip | wc -w)" -ne 1 ]; then # happens at boot, when the network is not yet up - echo "multiple or none, wont use the ip from hostname" - echo $ip + echo "multiple or none, wont use the ip from hostname:" hostname -I else export ROS_IP="$ip" export ROS_MASTER_URI="http://$ip:11311/" - echo $ROS_IP - echo $ROS_MASTER_URI + echo "ROS_IP=$ROS_IP" + echo "ROS_MASTER_URI=$ROS_MASTER_URI" fi # If the robot user wants to add their own config: # source /home/mirte/.bashrc From 6bd1042360f4c4139061f1017c04f2f55d7c291a Mon Sep 17 00:00:00 2001 From: mklomp Date: Thu, 11 Jul 2024 19:56:55 +0200 Subject: [PATCH 124/353] Disabled systemd ros start --- install_ROS2.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 9dc4046..68be9e0 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -61,8 +61,8 @@ sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-ros.service /lib/ sudo systemctl daemon-reload sudo systemctl stop mirte-ros || /bin/true -sudo systemctl start mirte-ros -sudo systemctl enable mirte-ros +#sudo systemctl start mirte-ros +#sudo systemctl enable mirte-ros sudo usermod -a -G video mirte sudo adduser mirte dialout From 1679c5514db6fe81ab8e26c17f254445ceb584b3 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 25 Jul 2024 11:23:33 +0200 Subject: [PATCH 125/353] add some readmes mirte-master stuff --- fix_scripts/fix_arm.sh | 2 +- fix_scripts/readme.md | 2 ++ mirte-master/usb_switch/readme.md | 4 ++++ services/readme.md | 26 ++++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 fix_scripts/readme.md create mode 100644 mirte-master/usb_switch/readme.md create mode 100644 services/readme.md diff --git a/fix_scripts/fix_arm.sh b/fix_scripts/fix_arm.sh index 8742aa0..8ec0e06 100644 --- a/fix_scripts/fix_arm.sh +++ b/fix_scripts/fix_arm.sh @@ -15,7 +15,7 @@ python3 examples/mirte_master_reset_offset.py sleep 10 python3 examples/mirte_master_set_ranges_volt.py sleep 10 -python3 examples/mirte_master_check_home.py Date: Thu, 25 Jul 2024 11:39:59 +0200 Subject: [PATCH 126/353] some cleanups for easier build switching --- install_ROS.sh | 69 +++++++++++++++++-------------- install_mirte.sh | 21 +++++++--- install_mirte_master.sh | 14 ++++--- services/mirte-master-ros.service | 17 ++++++++ services/mirte-ros.service | 2 +- 5 files changed, 79 insertions(+), 44 deletions(-) create mode 100644 services/mirte-master-ros.service diff --git a/install_ROS.sh b/install_ROS.sh index d789bf7..d2192b5 100755 --- a/install_ROS.sh +++ b/install_ROS.sh @@ -40,32 +40,35 @@ cd /home/mirte/mirte_ws/src || exit 1 ln -s $MIRTE_SRC_DIR/mirte-ros-packages . cd .. -# install lidar and depth camera -cd /home/mirte/mirte_ws/src || exit 1 -git clone https://github.com/Slamtec/rplidar_ros.git -git clone https://github.com/arendjan/ros_astra_camera.git -b fix-image-transport # compressed images -git clone https://github.com/arendjan/ridgeback.git -cd ../../ -mkdir temp -cd temp || exit 1 -sudo apt install -y libudev-dev -git clone https://github.com/libuvc/libuvc.git -cd libuvc -mkdir build && cd build -cmake .. && make -j4 -sudo make install -sudo ldconfig -cd ../../../ -sudo rm -rf temp -cd /home/mirte/mirte_ws/ || exit 1 -rosdep install -y --from-paths src/ --ignore-src --rosdistro noetic -catkin build -source ./devel/setup.bash -roscd astra_camera -./scripts/create_udev_rules -sudo udevadm control --reload && sudo udevadm trigger -roscd rplidar_ros -./scripts/create_udev_rules.sh + +if [[ $MIRTE_TYPE == "mirte-master" ]]; then + # install lidar and depth camera + cd /home/mirte/mirte_ws/src || exit 1 + git clone https://github.com/Slamtec/rplidar_ros.git + git clone https://github.com/arendjan/ros_astra_camera.git -b fix-image-transport # compressed images + git clone https://github.com/arendjan/ridgeback.git + cd ../../ + mkdir temp + cd temp || exit 1 + sudo apt install -y libudev-dev + git clone https://github.com/libuvc/libuvc.git + cd libuvc + mkdir build && cd build + cmake .. && make -j4 + sudo make install + sudo ldconfig + cd ../../../ + sudo rm -rf temp + cd /home/mirte/mirte_ws/ || exit 1 + rosdep install -y --from-paths src/ --ignore-src --rosdistro noetic + catkin build + source ./devel/setup.bash + roscd astra_camera + ./scripts/create_udev_rules + sudo udevadm control --reload && sudo udevadm trigger + roscd rplidar_ros + ./scripts/create_udev_rules.sh +fi rosdep install -y --from-paths src/ --ignore-src --rosdistro noetic catkin build @@ -79,13 +82,17 @@ source /home/mirte/mirte_ws/devel/setup.bash #sudo pip3 install twisted pyOpenSSL autobahn tornado pymongo # Add systemd service to start ROS nodes -sudo rm /lib/systemd/system/mirte-ros.service || true -sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-ros.service /lib/systemd/system/ +ROS_SERVICE_NAME=mirte-ros +if [[ $MIRTE_TYPE == "mirte-master" ]]; then # master version should start a different launch file + ROS_SERVICE_NAME=mirte-master-ros +fi +sudo rm /lib/systemd/system/$ROS_SERVICE_NAME.service || true +sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/$ROS_SERVICE_NAME.service /lib/systemd/system/ sudo systemctl daemon-reload -sudo systemctl stop mirte-ros || /bin/true -sudo systemctl start mirte-ros -sudo systemctl enable mirte-ros +sudo systemctl stop $ROS_SERVICE_NAME || /bin/true +sudo systemctl start $ROS_SERVICE_NAME +sudo systemctl enable $ROS_SERVICE_NAME sudo usermod -a -G video mirte diff --git a/install_mirte.sh b/install_mirte.sh index 5d8491c..0db7db2 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -3,6 +3,8 @@ set -xe MIRTE_SRC_DIR=/usr/local/src/mirte +MIRTE_TYPE="${MIRTE_TYPE:-default}" # default, mirte-master + # disable ipv6, as not all package repositories are available over ipv6 sudo tee /etc/apt/apt.conf.d/99force-ipv4 < Date: Thu, 25 Jul 2024 11:44:44 +0200 Subject: [PATCH 127/353] add settings file reading --- install_mirte.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_mirte.sh b/install_mirte.sh index 0db7db2..5131503 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -2,7 +2,7 @@ set -xe MIRTE_SRC_DIR=/usr/local/src/mirte - +. $MIRTE_SRC_DIR/settings.sh || true # read settings, like MIRTE_TYPE MIRTE_TYPE="${MIRTE_TYPE:-default}" # default, mirte-master # disable ipv6, as not all package repositories are available over ipv6 From 0059adb429a93f173cef8e257742567a296b863e Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 25 Jul 2024 11:49:03 +0200 Subject: [PATCH 128/353] shell style fixes --- install_ROS.sh | 55 ++++++++++++++++++++--------------------- install_mirte.sh | 7 ++---- install_mirte_master.sh | 2 +- 3 files changed, 30 insertions(+), 34 deletions(-) diff --git a/install_ROS.sh b/install_ROS.sh index d2192b5..35d8c5c 100755 --- a/install_ROS.sh +++ b/install_ROS.sh @@ -40,34 +40,33 @@ cd /home/mirte/mirte_ws/src || exit 1 ln -s $MIRTE_SRC_DIR/mirte-ros-packages . cd .. - if [[ $MIRTE_TYPE == "mirte-master" ]]; then - # install lidar and depth camera - cd /home/mirte/mirte_ws/src || exit 1 - git clone https://github.com/Slamtec/rplidar_ros.git - git clone https://github.com/arendjan/ros_astra_camera.git -b fix-image-transport # compressed images - git clone https://github.com/arendjan/ridgeback.git - cd ../../ - mkdir temp - cd temp || exit 1 - sudo apt install -y libudev-dev - git clone https://github.com/libuvc/libuvc.git - cd libuvc - mkdir build && cd build - cmake .. && make -j4 - sudo make install - sudo ldconfig - cd ../../../ - sudo rm -rf temp - cd /home/mirte/mirte_ws/ || exit 1 - rosdep install -y --from-paths src/ --ignore-src --rosdistro noetic - catkin build - source ./devel/setup.bash - roscd astra_camera - ./scripts/create_udev_rules - sudo udevadm control --reload && sudo udevadm trigger - roscd rplidar_ros - ./scripts/create_udev_rules.sh + # install lidar and depth camera + cd /home/mirte/mirte_ws/src || exit 1 + git clone https://github.com/Slamtec/rplidar_ros.git + git clone https://github.com/arendjan/ros_astra_camera.git -b fix-image-transport # compressed images + git clone https://github.com/arendjan/ridgeback.git + cd ../../ + mkdir temp + cd temp || exit 1 + sudo apt install -y libudev-dev + git clone https://github.com/libuvc/libuvc.git + cd libuvc + mkdir build && cd build + cmake .. && make -j4 + sudo make install + sudo ldconfig + cd ../../../ + sudo rm -rf temp + cd /home/mirte/mirte_ws/ || exit 1 + rosdep install -y --from-paths src/ --ignore-src --rosdistro noetic + catkin build + source ./devel/setup.bash + roscd astra_camera + ./scripts/create_udev_rules + sudo udevadm control --reload && sudo udevadm trigger + roscd rplidar_ros + ./scripts/create_udev_rules.sh fi rosdep install -y --from-paths src/ --ignore-src --rosdistro noetic @@ -84,7 +83,7 @@ source /home/mirte/mirte_ws/devel/setup.bash # Add systemd service to start ROS nodes ROS_SERVICE_NAME=mirte-ros if [[ $MIRTE_TYPE == "mirte-master" ]]; then # master version should start a different launch file - ROS_SERVICE_NAME=mirte-master-ros + ROS_SERVICE_NAME=mirte-master-ros fi sudo rm /lib/systemd/system/$ROS_SERVICE_NAME.service || true sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/$ROS_SERVICE_NAME.service /lib/systemd/system/ diff --git a/install_mirte.sh b/install_mirte.sh index 5131503..a35d4b2 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -3,7 +3,7 @@ set -xe MIRTE_SRC_DIR=/usr/local/src/mirte . $MIRTE_SRC_DIR/settings.sh || true # read settings, like MIRTE_TYPE -MIRTE_TYPE="${MIRTE_TYPE:-default}" # default, mirte-master +MIRTE_TYPE="${MIRTE_TYPE:-default}" # default, mirte-master # disable ipv6, as not all package repositories are available over ipv6 sudo tee /etc/apt/apt.conf.d/99force-ipv4 < Date: Thu, 25 Jul 2024 12:04:57 +0200 Subject: [PATCH 129/353] upd mirte_ros.sh for launch file changes --- services/mirte-master-ros.service | 2 +- services/mirte_ros.sh | 5 ++++- services/readme.md | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/services/mirte-master-ros.service b/services/mirte-master-ros.service index c161233..423a684 100644 --- a/services/mirte-master-ros.service +++ b/services/mirte-master-ros.service @@ -11,7 +11,7 @@ StartLimitBurst=5 Restart=always RestartSec=5s User=mirte -ExecStart=/bin/bash -c "source /home/mirte/mirte_ws/devel/setup.bash && roslaunch mirte_bringup minimal_master.launch" +ExecStart=/usr/local/src/mirte/mirte-install-scripts/services/mirte_ros.sh minimal_master [Install] WantedBy=multi-user.target diff --git a/services/mirte_ros.sh b/services/mirte_ros.sh index d5acd60..737518b 100755 --- a/services/mirte_ros.sh +++ b/services/mirte_ros.sh @@ -1,4 +1,7 @@ #!/bin/bash + +# by default use minimal launch file, but allow to override to minimal_master +LAUNCH_FILE="${1:-minimal}" source /home/mirte/mirte_ws/devel/setup.bash ip=$(hostname -I | awk '{print $1}') #just get the first ip addr @@ -14,4 +17,4 @@ else fi # If the robot user wants to add their own config: # source /home/mirte/.bashrc -roslaunch mirte_bringup minimal_master.launch +roslaunch mirte_bringup $LAUNCH_FILE.launch diff --git a/services/readme.md b/services/readme.md index 0fa955a..59d4e32 100644 --- a/services/readme.md +++ b/services/readme.md @@ -6,7 +6,9 @@ List of services: - mirte-jupyter: - starts jupyter, not on by default - mirte-ros - - starts ROS + - starts ROS using mirte_ros.sh + - this tries to guess the IP of the robot by using hostname -I and uses this as ROS_IP + - - mirte-shutdown - Only for Mirte-master - Will run mirte_boot.sh and mirte_shutdown.sh From 4c6b860536c9c68741361d22b6cdf6ece49fc2c0 Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 25 Jul 2024 14:10:47 +0200 Subject: [PATCH 130/353] allow failing rosdep --- install_ROS.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_ROS.sh b/install_ROS.sh index 35d8c5c..c0f526b 100755 --- a/install_ROS.sh +++ b/install_ROS.sh @@ -69,7 +69,8 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then ./scripts/create_udev_rules.sh fi -rosdep install -y --from-paths src/ --ignore-src --rosdistro noetic +# -r is for continue on error, mirte-ros-packages references astra_camera which is not installed on default images. +rosdep install -y --from-paths src/ --ignore-src --rosdistro noetic -r catkin build grep -qxF "source /home/mirte/mirte_ws/devel/setup.bash" /home/mirte/.bashrc || echo "source /home/mirte/mirte_ws/devel/setup.bash" >>/home/mirte/.bashrc grep -qxF "source /home/mirte/mirte_ws/devel/setup.zsh" /home/mirte/.zshrc || echo "source /home/mirte/mirte_ws/devel/setup.zsh" >>/home/mirte/.zshrc From 01e4637ec2fb79cd03e0e2ce1a681cfd9e94691c Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Thu, 25 Jul 2024 14:13:42 +0200 Subject: [PATCH 131/353] allow failing simpleaudio --- install_mirte.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_mirte.sh b/install_mirte.sh index a35d4b2..0e4f32f 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -109,7 +109,7 @@ cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 # install audio support to use with mirte-pioneer pcb and orange pi zero 2 sudo apt install pulseaudio libasound2-dev libespeak1 -y -pip3 install simpleaudio pyttsx3 +pip3 install simpleaudio pyttsx3 || true # simpleaudio uses an old python install system. TODO: replace or update # Install overlayfs and make sd card read only (software) sudo apt install -y overlayroot From eff26f2551c5cf6aafdbbdbfea5a467af5560f80 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 25 Jul 2024 16:48:44 +0200 Subject: [PATCH 132/353] fix playsound version numbering --- install_mirte_master.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_mirte_master.sh b/install_mirte_master.sh index cdad01c..5bd8492 100755 --- a/install_mirte_master.sh +++ b/install_mirte_master.sh @@ -38,7 +38,7 @@ SUBSYSTEM=="gpio", KERNEL=="gpiochip*", GROUP="gpiod", MODE="0660"' | sudo tee / pip install gpiod==1.5.4 # python3.8 version # chatgpt node stuff for @chris-pek -pip install gtts playsound openai==0.28.0 sounddevice scipy SpeechRecognition soundfile transformers datasets pyyaml pydub Elevenlabs +pip install gtts playsound openai==0.28.0 sounddevice scipy SpeechRecognition soundfile transformers datasets pyyaml pydub Elevenlabs || true # some strange package versions pip install numpy==1.23.1 # python3.8 fix mkdir ~/uboot_fix/ From 3b0aa4e02da6aeb4f1a016ebc5500d0b55d76caa Mon Sep 17 00:00:00 2001 From: "Arend-Jan van Hilten (TU)" Date: Fri, 26 Jul 2024 09:41:50 +0200 Subject: [PATCH 133/353] just don't compile arduino code --- install_arduino.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/install_arduino.sh b/install_arduino.sh index 23e59cd..b9c19bb 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -40,10 +40,11 @@ mkdir /home/mirte/arduino_project/Blink ln -s $MIRTE_SRC_DIR/mirte-install-scripts/Blink.ino /home/mirte/arduino_project/Blink # Already build all versions so only upload is needed -./run_arduino.sh build Telemetrix4Arduino -./run_arduino.sh build_nano Telemetrix4Arduino -./run_arduino.sh build_nano_old Telemetrix4Arduino -./run_arduino.sh build_uno Telemetrix4Arduino +# TODO: somehow this takes ages, removed for now: +# ./run_arduino.sh build Telemetrix4Arduino +# ./run_arduino.sh build_nano Telemetrix4Arduino +# ./run_arduino.sh build_nano_old Telemetrix4Arduino +# ./run_arduino.sh build_uno Telemetrix4Arduino # Add mirte to dialout sudo adduser mirte dialout From 112887778bd5b5bf15f2091eea30445495ed4ef6 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 19 Aug 2024 11:54:35 +0200 Subject: [PATCH 134/353] add clone mirte-telemetrix-cpp --- install_mirte_master.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install_mirte_master.sh b/install_mirte_master.sh index 5bd8492..df9c23a 100755 --- a/install_mirte_master.sh +++ b/install_mirte_master.sh @@ -51,3 +51,6 @@ if [[ ${type:=""} == "mirte_orangepi3b" ]]; then cd ../ rm -rf uboot_fix/ fi + +cd ~/mirte_ws/src +git clone --recurse-submodules https://github.com/arendjan/mirte-telemetrix-cpp.git \ No newline at end of file From 55b7a4a69f650181550356908768434e46b8132a Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 19 Aug 2024 11:56:23 +0200 Subject: [PATCH 135/353] colcon build telemetrix-cpp --- install_mirte_master.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install_mirte_master.sh b/install_mirte_master.sh index df9c23a..2c8dd14 100755 --- a/install_mirte_master.sh +++ b/install_mirte_master.sh @@ -53,4 +53,8 @@ if [[ ${type:=""} == "mirte_orangepi3b" ]]; then fi cd ~/mirte_ws/src -git clone --recurse-submodules https://github.com/arendjan/mirte-telemetrix-cpp.git \ No newline at end of file +git clone --recurse-submodules https://github.com/arendjan/mirte-telemetrix-cpp.git +cd ~/mirte_ws +source /opt/ros/humble/setup.bash +rosdep install -y --from-paths src/ --ignore-src --rosdistro humble +colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release \ No newline at end of file From 866b2f6c8ea48c3df3a408e0b80cf982dc147d9e Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 19 Aug 2024 13:18:32 +0200 Subject: [PATCH 136/353] add ros2 packages --- install_ROS2.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/install_ROS2.sh b/install_ROS2.sh index 68be9e0..2ac86d4 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -72,3 +72,32 @@ python3 -m pip install telemetrix-rpi-pico sudo apt install -y python3-bitstring libfreetype6-dev libjpeg-dev zlib1g-dev fonts-dejavu sudo pip3 install adafruit-circuitpython-busdevice==5.1.1 adafruit-circuitpython-framebuf==1.4.9 adafruit-circuitpython-typing==1.7.0 Adafruit-PlatformDetect==3.22.1 sudo pip3 install pillow adafruit-circuitpython-ssd1306==2.12.1 + +if [[ $MIRTE_TYPE == "mirte-master" ]]; then + # install lidar and depth camera + cd /home/mirte/mirte_ws/src || exit 1 + git clone https://github.com/Slamtec/rplidar_ros.git -b ros2 + git clone https://github.com/rafal-gorecki/ros2_astra_camera.git -b master # compressed images image transport fixes, fork of orbbec/... + git clone https://github.com/clearpathrobotics/clearpath_mecanum_drive_controller + cd ../../ + mkdir temp + cd temp || exit 1 + sudo apt install -y libudev-dev + git clone https://github.com/libuvc/libuvc.git + cd libuvc + mkdir build && cd build + cmake .. && make -j4 + sudo make install + sudo ldconfig + cd ../../../ + sudo rm -rf temp + cd /home/mirte/mirte_ws/ || exit 1 + rosdep install -y --from-paths src/ --ignore-src --rosdistro humble + colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release + source ./install/setup.bash + cd src/ros2_astra_camera/astra_camera + ./scripts/install.sh + sudo udevadm control --reload && sudo udevadm trigger + cd ../../rplidar_ros + ./scripts/create_udev_rules.sh +fi From 62631361566e9a5be6da1021d1293265861ed399 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 19 Aug 2024 13:28:21 +0200 Subject: [PATCH 137/353] add some nice colcon packages --- install_ROS2.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/install_ROS2.sh b/install_ROS2.sh index 2ac86d4..43745fc 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -73,6 +73,16 @@ sudo apt install -y python3-bitstring libfreetype6-dev libjpeg-dev zlib1g-dev fo sudo pip3 install adafruit-circuitpython-busdevice==5.1.1 adafruit-circuitpython-framebuf==1.4.9 adafruit-circuitpython-typing==1.7.0 Adafruit-PlatformDetect==3.22.1 sudo pip3 install pillow adafruit-circuitpython-ssd1306==2.12.1 +# Some nice extra packages: clean can clean workspaces and packages. No need to do it by hand. lint can check for errors in the cmake/package code. +sudo pip3 install colcon-clean colcon-lint + +# Add colcon top level workspace, this makes it possible to run colcon build from any folder, it will find the workspace and build it. Otherwise it will create a new workspace in the subdirectory. +cd /tmp +git clone https://github.com/rhaschke/colcon-top-level-workspace +cd colcon-top-level-workspace +pip install . +cd .. +rm -rf colcon-top-level-workspace if [[ $MIRTE_TYPE == "mirte-master" ]]; then # install lidar and depth camera cd /home/mirte/mirte_ws/src || exit 1 From ceb0f65ce5b347da701fd13eb3a19b9dfcb2310f Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 19 Aug 2024 13:39:03 +0200 Subject: [PATCH 138/353] add zsh ros2 source fix --- install_ROS2.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install_ROS2.sh b/install_ROS2.sh index 43745fc..94df2f1 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -49,6 +49,8 @@ cd .. rosdep install -y --from-paths src/ --ignore-src --rosdistro humble colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release grep -qxF "source /home/mirte/mirte_ws/install/setup.bash" /home/mirte/.bashrc || echo "source /home/mirte/mirte_ws/install/setup.bash" >> /home/mirte/.bashrc +grep -qxF "source /home/mirte/mirte_ws/install/setup.zsh" /home/mirte/.zshrc || echo "source /home/mirte/mirte_ws/install/setup.zsh" >> /home/mirte/.zshrc + source /home/mirte/mirte_ws/install/setup.bash # install missing python dependencies rosbridge @@ -110,4 +112,13 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then sudo udevadm control --reload && sudo udevadm trigger cd ../../rplidar_ros ./scripts/create_udev_rules.sh + # zsh does not work nicely with ros2 autocomplete, so we need to add a function to fix it. + # ROS 2 Foxy should have this fixed, but we are using ROS 2 Humble. + cat <> /home/mirte/.zshrc +sr () { # macro to source the workspace and enable autocompletion. sr stands for source ros, no other command should use this abbreviation. + . ~/mirte_ws/install/setup.zsh + eval "$(register-python-argcomplete3 ros2)" + eval "$(register-python-argcomplete3 colcon)" +} +EOF fi From f3480c280625542b35ed07b2f2eb3aa459e9021b Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 19 Aug 2024 16:53:12 +0200 Subject: [PATCH 139/353] add ros service start on boot --- install_ROS2.sh | 23 ++++++++++++++++++----- install_mirte.sh | 1 + 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 94df2f1..45841ef 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -58,13 +58,18 @@ source /home/mirte/mirte_ws/install/setup.bash #sudo pip3 install twisted pyOpenSSL autobahn tornado pymongo # Add systemd service to start ROS nodes -sudo rm /lib/systemd/system/mirte-ros.service -sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-ros.service /lib/systemd/system/ +ROS_SERVICE_NAME=mirte-ros +if [[ $MIRTE_TYPE == "mirte-master" ]]; then # master version should start a different launch file + ROS_SERVICE_NAME=mirte-master-ros +fi +sudo rm /lib/systemd/system/$ROS_SERVICE_NAME.service || true +sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/$ROS_SERVICE_NAME.service /lib/systemd/system/ sudo systemctl daemon-reload -sudo systemctl stop mirte-ros || /bin/true -#sudo systemctl start mirte-ros -#sudo systemctl enable mirte-ros +sudo systemctl stop $ROS_SERVICE_NAME || /bin/true +sudo systemctl start $ROS_SERVICE_NAME +sudo systemctl enable $ROS_SERVICE_NAME + sudo usermod -a -G video mirte sudo adduser mirte dialout @@ -116,9 +121,17 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then # ROS 2 Foxy should have this fixed, but we are using ROS 2 Humble. cat <> /home/mirte/.zshrc sr () { # macro to source the workspace and enable autocompletion. sr stands for source ros, no other command should use this abbreviation. + . /opt/ros/humble/setup.zsh . ~/mirte_ws/install/setup.zsh eval "$(register-python-argcomplete3 ros2)" eval "$(register-python-argcomplete3 colcon)" } +cb () { + colcon build --symlink-install +} +cbr () { + colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release +} +sr EOF fi diff --git a/install_mirte.sh b/install_mirte.sh index 222cb31..7978fbe 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -12,6 +12,7 @@ EOF # Update sudo apt update || true +sudo bash -c 'echo "mirte ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers' # allow mirte to use sudo without password, needed for auto-shutdown on battery # Install locales sudo apt install -y locales From 5494ebcfe5015f1900ca95e140df45a71dd69652 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 19 Aug 2024 17:22:37 +0200 Subject: [PATCH 140/353] upd services for ros2 --- install_ROS2.sh | 2 +- services/mirte_master_check.sh | 5 +++-- services/mirte_shutdown.sh | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 45841ef..5465990 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -44,7 +44,7 @@ sudo apt install libboost-all-dev -y git clone https://github.com/AlexKaravaev/ros2_laser_scan_matcher git clone https://github.com/AlexKaravaev/csm git clone https://github.com/ldrobotSensorTeam/ldlidar_stl_ros2 - +git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 cd .. rosdep install -y --from-paths src/ --ignore-src --rosdistro humble colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release diff --git a/services/mirte_master_check.sh b/services/mirte_master_check.sh index 1330b2a..50bc265 100755 --- a/services/mirte_master_check.sh +++ b/services/mirte_master_check.sh @@ -1,6 +1,7 @@ #!/bin/bash set -x -. /opt/ros/noetic/setup.bash +. /opt/ros/humble/setup.bash +. /home/mirte/mirte_ws/install/setup.bash SECONDS=0 WARN_LVL=0 while true; do @@ -8,7 +9,7 @@ while true; do # echo "topics" percentage=$( - (rostopic echo /mirte/power/power_watcher -n2 | grep percentage | tail -1) & + (ros2 topic echo /mirte/power/power_watcher --once | grep percentage | tail -1) & pid=$! (sleep 5 && kill -9 $pid) 2>/dev/null & watcher=$! diff --git a/services/mirte_shutdown.sh b/services/mirte_shutdown.sh index f259def..9774991 100755 --- a/services/mirte_shutdown.sh +++ b/services/mirte_shutdown.sh @@ -8,7 +8,8 @@ if ! systemctl list-jobs | grep -q -E 'shutdown.target.*start'; then fi touch /home/mirte/.shutdown -source /home/mirte/mirte_ws/devel/setup.bash +source /home/mirte/mirte_ws/install/setup.bash # TODO: does not work if ros is not running -rosservice call /mirte/set_middle_image "{ type: 'text', value: 'Shutting down...'}" + +ros2 service call /mirte/set_middle_image "{ type: 'text', value: 'Shutting down...'}" sleep 2 From 22006f3e9626194c148be7425ae8832079e7a1e1 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 20 Aug 2024 08:47:27 +0200 Subject: [PATCH 141/353] enable web interface again (not working) and shfmt --- download_repos.sh | 2 +- install_ROS2.sh | 19 +++++++++---------- install_mirte.sh | 4 ++-- install_mirte_master.sh | 6 +++--- services/mirte_ros.sh | 2 +- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/download_repos.sh b/download_repos.sh index 0983353..1967bb0 100755 --- a/download_repos.sh +++ b/download_repos.sh @@ -2,7 +2,7 @@ set -xe # Install vcstool sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg -echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list >/dev/null sudo apt-get update sudo apt-get install -y python3-vcstool diff --git a/install_ROS2.sh b/install_ROS2.sh index 5465990..aeaf78b 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -12,12 +12,12 @@ sudo apt install software-properties-common -y sudo add-apt-repository universe -y sudo apt update && sudo apt install curl -y sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg -echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list >/dev/null sudo apt update sudo apt install -y ros-humble-ros-base sudo apt install -y ros-humble-xacro sudo apt install -y ros-dev-tools -grep -qxF "source /opt/ros/humble/setup.bash" /home/mirte/.bashrc || echo "source /opt/ros/humble/setup.bash" >> /home/mirte/.bashrc +grep -qxF "source /opt/ros/humble/setup.bash" /home/mirte/.bashrc || echo "source /opt/ros/humble/setup.bash" >>/home/mirte/.bashrc source /opt/ros/humble/setup.bash sudo rosdep init rosdep update @@ -48,8 +48,8 @@ git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 cd .. rosdep install -y --from-paths src/ --ignore-src --rosdistro humble colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -grep -qxF "source /home/mirte/mirte_ws/install/setup.bash" /home/mirte/.bashrc || echo "source /home/mirte/mirte_ws/install/setup.bash" >> /home/mirte/.bashrc -grep -qxF "source /home/mirte/mirte_ws/install/setup.zsh" /home/mirte/.zshrc || echo "source /home/mirte/mirte_ws/install/setup.zsh" >> /home/mirte/.zshrc +grep -qxF "source /home/mirte/mirte_ws/install/setup.bash" /home/mirte/.bashrc || echo "source /home/mirte/mirte_ws/install/setup.bash" >>/home/mirte/.bashrc +grep -qxF "source /home/mirte/mirte_ws/install/setup.zsh" /home/mirte/.zshrc || echo "source /home/mirte/mirte_ws/install/setup.zsh" >>/home/mirte/.zshrc source /home/mirte/mirte_ws/install/setup.bash @@ -70,7 +70,6 @@ sudo systemctl stop $ROS_SERVICE_NAME || /bin/true sudo systemctl start $ROS_SERVICE_NAME sudo systemctl enable $ROS_SERVICE_NAME - sudo usermod -a -G video mirte sudo adduser mirte dialout python3 -m pip install telemetrix-rpi-pico @@ -81,7 +80,7 @@ sudo pip3 install adafruit-circuitpython-busdevice==5.1.1 adafruit-circuitpython sudo pip3 install pillow adafruit-circuitpython-ssd1306==2.12.1 # Some nice extra packages: clean can clean workspaces and packages. No need to do it by hand. lint can check for errors in the cmake/package code. -sudo pip3 install colcon-clean colcon-lint +sudo pip3 install colcon-clean colcon-lint # Add colcon top level workspace, this makes it possible to run colcon build from any folder, it will find the workspace and build it. Otherwise it will create a new workspace in the subdirectory. cd /tmp @@ -112,14 +111,14 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then rosdep install -y --from-paths src/ --ignore-src --rosdistro humble colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release source ./install/setup.bash - cd src/ros2_astra_camera/astra_camera + cd src/ros2_astra_camera/astra_camera ./scripts/install.sh sudo udevadm control --reload && sudo udevadm trigger cd ../../rplidar_ros ./scripts/create_udev_rules.sh - # zsh does not work nicely with ros2 autocomplete, so we need to add a function to fix it. - # ROS 2 Foxy should have this fixed, but we are using ROS 2 Humble. - cat <> /home/mirte/.zshrc + # zsh does not work nicely with ros2 autocomplete, so we need to add a function to fix it. + # ROS 2 Foxy should have this fixed, but we are using ROS 2 Humble. + cat <>/home/mirte/.zshrc sr () { # macro to source the workspace and enable autocompletion. sr stands for source ros, no other command should use this abbreviation. . /opt/ros/humble/setup.zsh . ~/mirte_ws/install/setup.zsh diff --git a/install_mirte.sh b/install_mirte.sh index 7978fbe..3b3bafa 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -58,8 +58,8 @@ pip3 install . #pip3 install . # Install Mirte Interface -#cd $MIRTE_SRC_DIR/mirte-install-scripts -#./install_web.sh +cd $MIRTE_SRC_DIR/mirte-install-scripts +./install_web.sh # Install Jupyter Notebook #cd $MIRTE_SRC_DIR/mirte-install-scripts diff --git a/install_mirte_master.sh b/install_mirte_master.sh index 2c8dd14..fb2ee2f 100755 --- a/install_mirte_master.sh +++ b/install_mirte_master.sh @@ -39,7 +39,7 @@ pip install gpiod==1.5.4 # python3.8 version # chatgpt node stuff for @chris-pek pip install gtts playsound openai==0.28.0 sounddevice scipy SpeechRecognition soundfile transformers datasets pyyaml pydub Elevenlabs || true # some strange package versions -pip install numpy==1.23.1 # python3.8 fix +pip install numpy==1.23.1 # python3.8 fix mkdir ~/uboot_fix/ cd ~/uboot_fix/ @@ -53,8 +53,8 @@ if [[ ${type:=""} == "mirte_orangepi3b" ]]; then fi cd ~/mirte_ws/src -git clone --recurse-submodules https://github.com/arendjan/mirte-telemetrix-cpp.git +git clone --recurse-submodules https://github.com/arendjan/mirte-telemetrix-cpp.git cd ~/mirte_ws source /opt/ros/humble/setup.bash rosdep install -y --from-paths src/ --ignore-src --rosdistro humble -colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release \ No newline at end of file +colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release diff --git a/services/mirte_ros.sh b/services/mirte_ros.sh index 952c39e..297d8bc 100755 --- a/services/mirte_ros.sh +++ b/services/mirte_ros.sh @@ -18,4 +18,4 @@ source /home/mirte/mirte_ws/install/setup.bash # fi # If the robot user wants to add their own config: # source /home/mirte/.bashrc -ros2 launch mirte_bringup $LAUNCH_FILE.launch.py \ No newline at end of file +ros2 launch mirte_bringup $LAUNCH_FILE.launch.py From 46e8ad2a1de55aaa9bb425533b8bce611a016b4e Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 21 Aug 2024 10:34:38 +0200 Subject: [PATCH 142/353] Add install libusb --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index aeaf78b..ef4ab5a 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -98,7 +98,7 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then cd ../../ mkdir temp cd temp || exit 1 - sudo apt install -y libudev-dev + sudo apt install -y libudev-dev libusb-1.0.0-dev git clone https://github.com/libuvc/libuvc.git cd libuvc mkdir build && cd build From dae54828efb79348ae6e45ca1424870cfc0d5034 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 21 Aug 2024 10:56:43 +0200 Subject: [PATCH 143/353] fix apt pkg --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index ef4ab5a..42a6d62 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -98,7 +98,7 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then cd ../../ mkdir temp cd temp || exit 1 - sudo apt install -y libudev-dev libusb-1.0.0-dev + sudo apt install -y libudev-dev libusb-1.0-0-dev git clone https://github.com/libuvc/libuvc.git cd libuvc mkdir build && cd build From 1b3d09c90b4e5557bc08f3b75c02ef3f64de6584 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 21 Aug 2024 11:06:30 +0200 Subject: [PATCH 144/353] camera installs --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 42a6d62..bb3c93a 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -98,7 +98,7 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then cd ../../ mkdir temp cd temp || exit 1 - sudo apt install -y libudev-dev libusb-1.0-0-dev + sudo apt install -y libudev-dev libusb-1.0-0-dev nlohmann-json3-dev git clone https://github.com/libuvc/libuvc.git cd libuvc mkdir build && cd build From 7342f62f5e3053cb21fdef5572b581f618f1cb6f Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 21 Aug 2024 11:49:43 +0200 Subject: [PATCH 145/353] set xe for faster failing --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index bb3c93a..312a644 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -1,5 +1,5 @@ #!/bin/bash - +set -xe # IMPORTANT: # Do not upgrade apt-get since it will break the image. libc-bin will for some # reason break and not be able to install new stuff on the image. From 2dd31e1fed02d0110c0fc1c619209d4efd329ca0 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 21 Aug 2024 13:16:18 +0200 Subject: [PATCH 146/353] fix not allowed camera --- install_ROS2.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 312a644..108a153 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -112,10 +112,12 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release source ./install/setup.bash cd src/ros2_astra_camera/astra_camera - ./scripts/install.sh + chmod +x ./scripts/install.sh || true + ./scripts/install.sh || true sudo udevadm control --reload && sudo udevadm trigger cd ../../rplidar_ros - ./scripts/create_udev_rules.sh + chmod +x ./scripts/create_udev_rules.sh || true + ./scripts/create_udev_rules.sh || true # zsh does not work nicely with ros2 autocomplete, so we need to add a function to fix it. # ROS 2 Foxy should have this fixed, but we are using ROS 2 Humble. cat <>/home/mirte/.zshrc From f420e8b619ef4df226d3c84197ee4e513e310f11 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 21 Aug 2024 13:33:22 +0200 Subject: [PATCH 147/353] add optional package param cb --- install_ROS2.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 108a153..c6d32b3 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -128,10 +128,22 @@ sr () { # macro to source the workspace and enable autocompletion. sr stands for eval "$(register-python-argcomplete3 colcon)" } cb () { - colcon build --symlink-install + pkg=$1 + # if package not empty + if [ -n "$pkg" ]; then + colcon build --symlink-install --packages-up-to $pkg + else + colcon build --symlink-install + fi } cbr () { - colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release + pkg=$1 + # if package not empty + if [ -n "$pkg" ]; then + colcon build --symlink-install --packages-up-to $pkg --cmake-args -DCMAKE_BUILD_TYPE=Release + else + colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release + fi } sr EOF From f2d5a41a39e45ad15768a97795102f07ac109976 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 21 Aug 2024 15:43:15 +0200 Subject: [PATCH 148/353] Fix macros scripts --- install_ROS2.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index c6d32b3..f6bb38e 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -124,23 +124,23 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then sr () { # macro to source the workspace and enable autocompletion. sr stands for source ros, no other command should use this abbreviation. . /opt/ros/humble/setup.zsh . ~/mirte_ws/install/setup.zsh - eval "$(register-python-argcomplete3 ros2)" - eval "$(register-python-argcomplete3 colcon)" + eval "\$(register-python-argcomplete3 ros2)" + eval "\$(register-python-argcomplete3 colcon)" } cb () { - pkg=$1 + pkg=\$1 # if package not empty - if [ -n "$pkg" ]; then - colcon build --symlink-install --packages-up-to $pkg + if [ -n "\$pkg" ]; then + colcon build --symlink-install --packages-up-to \$pkg else colcon build --symlink-install fi } cbr () { - pkg=$1 + pkg=\$1 # if package not empty - if [ -n "$pkg" ]; then - colcon build --symlink-install --packages-up-to $pkg --cmake-args -DCMAKE_BUILD_TYPE=Release + if [ -n "\$pkg" ]; then + colcon build --symlink-install --packages-up-to \$pkg --cmake-args -DCMAKE_BUILD_TYPE=Release else colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release fi From 9a1e4d9854d80f18b0cf92826b48b5c5e5d280e9 Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Mon, 2 Sep 2024 10:52:08 +0200 Subject: [PATCH 149/353] Initial Sync --- repos.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/repos.yaml b/repos.yaml index 4389036..0d2fa30 100644 --- a/repos.yaml +++ b/repos.yaml @@ -9,8 +9,8 @@ repositories: version: master mirte-install-scripts: type: git - url: https://github.com/arendjan/mirte-install-scripts.git - version: mirte-master-ros2 + url: https://github.com/SuperJappie08/mirte-install-scripts.git + version: mirte-ros2 mirte-telemetrix-aio: type: git url: https://github.com/mirte-robot/telemetrix-aio.git @@ -37,8 +37,8 @@ repositories: version: main mirte-documentation: type: git - url: https://github.com/mirte-robot/mirte-documentation.git - version: main + url: https://github.com/arendjan/mirte-documentation.git + version: mirte-master mirte-telemetrix4rpipico: type: git url: https://github.com/arendjan/Telemetrix4RpiPico.git From 96e174e289f90c1ed1a00d1bdeced23063d67bd8 Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Mon, 2 Sep 2024 11:26:36 +0200 Subject: [PATCH 150/353] Add own mirte-ros-packages --- repos.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos.yaml b/repos.yaml index 0d2fa30..8c92516 100644 --- a/repos.yaml +++ b/repos.yaml @@ -21,8 +21,8 @@ repositories: version: modules mirte-ros-packages: type: git - url: https://github.com/arendjan/mirte-ros-packages.git - version: ros2 + url: https://github.com/SuperJappie08/mirte-ros-packages.git + version: mirte-ros2 mirte-oled-images: type: git url: https://github.com/mirte-robot/mirte-oled-images.git From a2e5f56513ca2a2d8baf5643d385ffb90f5e9094 Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:30:19 +0200 Subject: [PATCH 151/353] Add mirte-telemetrix-cpp to repos.yaml --- install_ROS2.sh | 1 + install_mirte_master.sh | 4 ++-- repos.yaml | 9 +++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index f6bb38e..e8fd630 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -37,6 +37,7 @@ python3 -m pip install mergedeep mkdir -p /home/mirte/mirte_ws/src cd /home/mirte/mirte_ws/src ln -s $MIRTE_SRC_DIR/mirte-ros-packages . +ln -s $MIRTE_SRC_DIR/mirte-telemetrix-cpp . # Install source dependencies for slam sudo apt install ros-humble-slam-toolbox -y diff --git a/install_mirte_master.sh b/install_mirte_master.sh index fb2ee2f..6792d47 100755 --- a/install_mirte_master.sh +++ b/install_mirte_master.sh @@ -52,8 +52,8 @@ if [[ ${type:=""} == "mirte_orangepi3b" ]]; then rm -rf uboot_fix/ fi -cd ~/mirte_ws/src -git clone --recurse-submodules https://github.com/arendjan/mirte-telemetrix-cpp.git +# cd ~/mirte_ws/src +# git clone --recurse-submodules https://github.com/arendjan/mirte-telemetrix-cpp.git cd ~/mirte_ws source /opt/ros/humble/setup.bash rosdep install -y --from-paths src/ --ignore-src --rosdistro humble diff --git a/repos.yaml b/repos.yaml index 8c92516..56cb0ec 100644 --- a/repos.yaml +++ b/repos.yaml @@ -33,7 +33,7 @@ repositories: version: main mirte-python: type: git - url: https://github.com/mirte-robot/mirte-python.git + url: https://github.com/SuperJappie08/mirte-python.git version: main mirte-documentation: type: git @@ -42,4 +42,9 @@ repositories: mirte-telemetrix4rpipico: type: git url: https://github.com/arendjan/Telemetrix4RpiPico.git - version: modules2 \ No newline at end of file + version: modules2 + mirte-telemetrix-cpp: + type: git + url: https://github.com/SuperJappie08/mirte-telemetrix-cpp.git + version: main + recursive: true \ No newline at end of file From 67599313df21f3232bd8e705b9e0a81500468598 Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Thu, 5 Sep 2024 12:06:42 +0200 Subject: [PATCH 152/353] Update mirte-telemetrix-cpp branch --- download_repos.sh | 7 +++++++ repos.yaml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/download_repos.sh b/download_repos.sh index 1967bb0..63166eb 100755 --- a/download_repos.sh +++ b/download_repos.sh @@ -9,4 +9,11 @@ sudo apt-get install -y python3-vcstool # Download all Mirte repositories vcs import --workers 1 Date: Thu, 5 Sep 2024 15:43:12 +0200 Subject: [PATCH 153/353] select correct ros2 version based on ubuntu codename --- install_ROS2.sh | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index f6bb38e..5f0fcd5 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -14,11 +14,24 @@ sudo apt update && sudo apt install curl -y sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list >/dev/null sudo apt update -sudo apt install -y ros-humble-ros-base -sudo apt install -y ros-humble-xacro + +. /etc/os-release +# select ros2 type based on UBUNTU_CODENAME +if [[ $UBUNTU_CODENAME == "jammy" ]]; then + ROS_NAME=humble +elif [[ $UBUNTU_CODENAME == "noble" ]]; then + ROS_NAME=jazzy +else + echo "Unknown UBUNTU_CODENAME: $UBUNTU_CODENAME" + exit 1 +fi + + +sudo apt install -y ros-$ROS_NAME-ros-base +sudo apt install -y ros-$ROS_NAME-xacro sudo apt install -y ros-dev-tools -grep -qxF "source /opt/ros/humble/setup.bash" /home/mirte/.bashrc || echo "source /opt/ros/humble/setup.bash" >>/home/mirte/.bashrc -source /opt/ros/humble/setup.bash +grep -qxF "source /opt/ros/$ROS_NAME/setup.bash" /home/mirte/.bashrc || echo "source /opt/ros/$ROS_NAME/setup.bash" >>/home/mirte/.bashrc +source /opt/ros/$ROS_NAME/setup.bash sudo rosdep init rosdep update @@ -39,14 +52,14 @@ cd /home/mirte/mirte_ws/src ln -s $MIRTE_SRC_DIR/mirte-ros-packages . # Install source dependencies for slam -sudo apt install ros-humble-slam-toolbox -y +sudo apt install ros-$ROS_NAME-slam-toolbox -y sudo apt install libboost-all-dev -y git clone https://github.com/AlexKaravaev/ros2_laser_scan_matcher git clone https://github.com/AlexKaravaev/csm git clone https://github.com/ldrobotSensorTeam/ldlidar_stl_ros2 git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 cd .. -rosdep install -y --from-paths src/ --ignore-src --rosdistro humble +rosdep install -y --from-paths src/ --ignore-src --rosdistro $ROS_NAME colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release grep -qxF "source /home/mirte/mirte_ws/install/setup.bash" /home/mirte/.bashrc || echo "source /home/mirte/mirte_ws/install/setup.bash" >>/home/mirte/.bashrc grep -qxF "source /home/mirte/mirte_ws/install/setup.zsh" /home/mirte/.zshrc || echo "source /home/mirte/mirte_ws/install/setup.zsh" >>/home/mirte/.zshrc @@ -108,7 +121,7 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then cd ../../../ sudo rm -rf temp cd /home/mirte/mirte_ws/ || exit 1 - rosdep install -y --from-paths src/ --ignore-src --rosdistro humble + rosdep install -y --from-paths src/ --ignore-src --rosdistro $ROS_NAME colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release source ./install/setup.bash cd src/ros2_astra_camera/astra_camera @@ -120,6 +133,7 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then ./scripts/create_udev_rules.sh || true # zsh does not work nicely with ros2 autocomplete, so we need to add a function to fix it. # ROS 2 Foxy should have this fixed, but we are using ROS 2 Humble. + # TODO: check for ROS2 jazzy cat <>/home/mirte/.zshrc sr () { # macro to source the workspace and enable autocompletion. sr stands for source ros, no other command should use this abbreviation. . /opt/ros/humble/setup.zsh From 33e0fb2b94004883c844a0d25cc0028793351ddf Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Mon, 9 Sep 2024 12:23:20 +0200 Subject: [PATCH 154/353] Change web_video_server to a patched branch --- install_ROS2.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index e8fd630..d6ff2ad 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -45,7 +45,8 @@ sudo apt install libboost-all-dev -y git clone https://github.com/AlexKaravaev/ros2_laser_scan_matcher git clone https://github.com/AlexKaravaev/csm git clone https://github.com/ldrobotSensorTeam/ldlidar_stl_ros2 -git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 +# git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 +git clone https://github.com/cellumation/web_video_server.git -b ros2 cd .. rosdep install -y --from-paths src/ --ignore-src --rosdistro humble colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release From b84650ae542620ba83cd1f67dddcd5e7f7f07ef1 Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Mon, 9 Sep 2024 13:46:00 +0200 Subject: [PATCH 155/353] Patch web_video_server --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index d6ff2ad..2a32a46 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -46,7 +46,7 @@ git clone https://github.com/AlexKaravaev/ros2_laser_scan_matcher git clone https://github.com/AlexKaravaev/csm git clone https://github.com/ldrobotSensorTeam/ldlidar_stl_ros2 # git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 -git clone https://github.com/cellumation/web_video_server.git -b ros2 +git clone https://github.com/SuperJappie08/web_video_server.git -b ros2 cd .. rosdep install -y --from-paths src/ --ignore-src --rosdistro humble colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release From 43cd1ea4764a72d201b918e717168e515cf9b03c Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:26:11 +0200 Subject: [PATCH 156/353] Update repos --- repos.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repos.yaml b/repos.yaml index ca0918e..9210bcc 100644 --- a/repos.yaml +++ b/repos.yaml @@ -34,17 +34,17 @@ repositories: mirte-python: type: git url: https://github.com/SuperJappie08/mirte-python.git - version: main + version: ros2-dev mirte-documentation: type: git url: https://github.com/arendjan/mirte-documentation.git version: mirte-master mirte-telemetrix4rpipico: type: git - url: https://github.com/arendjan/Telemetrix4RpiPico.git + url: https://github.com/SuperJappie08/Telemetrix4RpiPico.git version: modules2 mirte-telemetrix-cpp: type: git url: https://github.com/SuperJappie08/mirte-telemetrix-cpp.git version: mirte-pioneer - recursive: true \ No newline at end of file + recursive: true From 5254dee0e6179e38ee92471e8476d918f6484e4d Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Fri, 4 Oct 2024 14:07:52 +0200 Subject: [PATCH 157/353] Revert back to (upstream) patched web video server --- install_ROS2.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 2a32a46..e8fd630 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -45,8 +45,7 @@ sudo apt install libboost-all-dev -y git clone https://github.com/AlexKaravaev/ros2_laser_scan_matcher git clone https://github.com/AlexKaravaev/csm git clone https://github.com/ldrobotSensorTeam/ldlidar_stl_ros2 -# git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 -git clone https://github.com/SuperJappie08/web_video_server.git -b ros2 +git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 cd .. rosdep install -y --from-paths src/ --ignore-src --rosdistro humble colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release From fe1886f9da3fd65fb96bfcd6657abdb7b48d79b2 Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Fri, 4 Oct 2024 17:45:33 +0200 Subject: [PATCH 158/353] Start work on ROS2 Web interface --- install_ROS2.sh | 2 +- install_mirte.sh | 18 ++++++++++++------ install_web.sh | 1 + repos.yaml | 4 ++-- services/mirte-web-interface.service | 2 +- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index e8fd630..4918ccb 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -7,7 +7,7 @@ set -xe #TODO: get this as a parameter MIRTE_SRC_DIR=/usr/local/src/mirte -# Install ROS Noetic +# Install ROS Humble sudo apt install software-properties-common -y sudo add-apt-repository universe -y sudo apt update && sudo apt install curl -y diff --git a/install_mirte.sh b/install_mirte.sh index 3b3bafa..a80e7eb 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -54,12 +54,16 @@ pip3 install . #./install_arduino.sh # Install Mirte Python package -#cd $MIRTE_SRC_DIR/mirte-python -#pip3 install . +if [[ "$INSTALL_PYTHON" = true ]]; then + cd $MIRTE_SRC_DIR/mirte-python + pip3 install . +fi # Install Mirte Interface -cd $MIRTE_SRC_DIR/mirte-install-scripts -./install_web.sh +if [[ "$INSTALL_WEB" = true ]]; then + cd $MIRTE_SRC_DIR/mirte-install-scripts + ./install_web.sh +fi # Install Jupyter Notebook #cd $MIRTE_SRC_DIR/mirte-install-scripts @@ -105,8 +109,10 @@ fi #make html #deactivate -cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 -./install_vscode.sh +if [[ "$INSTALL_VSCODE" = true ]]; then + cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 + ./install_vscode.sh +fi # install audio support to use with mirte-pioneer pcb and orange pi zero 2 sudo apt install pulseaudio libasound2-dev libespeak1 -y diff --git a/install_web.sh b/install_web.sh index 164be2a..9670ec2 100755 --- a/install_web.sh +++ b/install_web.sh @@ -31,6 +31,7 @@ deactivate_node # Install strace for linetrace functionality sudo apt install -y strace +sudo apt install xxd # Install nginx (as reverse proxy to all services) sudo apt install -y nginx libnginx-mod-http-auth-pam diff --git a/repos.yaml b/repos.yaml index 9210bcc..843d255 100644 --- a/repos.yaml +++ b/repos.yaml @@ -1,8 +1,8 @@ repositories: mirte-web-interface: type: git - url: https://github.com/mirte-robot/mirte-web-interface.git - version: main + url: https://github.com/SuperJappie08/mirte-web-interface.git + version: ros2-dev mirte-telemetrix4arduino: type: git url: https://github.com/mirte-robot/Telemetrix4Arduino.git diff --git a/services/mirte-web-interface.service b/services/mirte-web-interface.service index 116f4a2..42d7d3f 100644 --- a/services/mirte-web-interface.service +++ b/services/mirte-web-interface.service @@ -7,7 +7,7 @@ After=network-online.target [Service] User=mirte # We need bash in bash since ROS noetic and NPM do not work nicely together -ExecStart=/bin/bash -c '/bin/bash -c "source /home/mirte/mirte_ws/devel/setup.bash && python3 -m mirte_robot.linetrace" & /bin/bash -c "cd /usr/local/src/mirte/mirte-web-interface/ && source ./node_env/bin/activate && cd nodejs-backend && npm run backend"' +ExecStart=/bin/bash -c '/bin/bash -c "source /home/mirte/mirte_ws/install/setup.bash && python3 -m mirte_robot.linetrace" & /bin/bash -c "cd /usr/local/src/mirte/mirte-web-interface/ && source ./node_env/bin/activate && cd nodejs-backend && npm run backend"' # And we need a tty to strace it StandardInput=tty-force TTYVHangup=yes From 0a08bbc602eb1bf4c317c0fb28534f79e66c616f Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Fri, 4 Oct 2024 18:10:23 +0200 Subject: [PATCH 159/353] Reorder installation setups for depenency issues --- install_mirte.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install_mirte.sh b/install_mirte.sh index a80e7eb..08cb7eb 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -53,6 +53,10 @@ pip3 install . #cd $MIRTE_SRC_DIR/mirte-install-scripts #./install_arduino.sh +# Install Mirte ROS2 packages +cd $MIRTE_SRC_DIR/mirte-install-scripts +./install_ROS2.sh + # Install Mirte Python package if [[ "$INSTALL_PYTHON" = true ]]; then cd $MIRTE_SRC_DIR/mirte-python @@ -69,10 +73,6 @@ fi #cd $MIRTE_SRC_DIR/mirte-install-scripts #./install_jupyter_ros.sh -# Install Mirte ROS2 packages -cd $MIRTE_SRC_DIR/mirte-install-scripts -./install_ROS2.sh - # Install numpy pip3 install numpy From 8c1ac70bfa484453ee5fc05bfca6effdf67c83ff Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:06:37 +0200 Subject: [PATCH 160/353] Update Repos --- install_ROS2.sh | 2 +- repos.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 4918ccb..6ed985f 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -93,7 +93,7 @@ rm -rf colcon-top-level-workspace if [[ $MIRTE_TYPE == "mirte-master" ]]; then # install lidar and depth camera cd /home/mirte/mirte_ws/src || exit 1 - git clone https://github.com/Slamtec/rplidar_ros.git -b ros2 + git clone https://github.com/Slamtec/rplidar_ros.git -b ros2 # FIXME-FUTURE: Can be installed in newer versions if V2.1.5 is released git clone https://github.com/rafal-gorecki/ros2_astra_camera.git -b master # compressed images image transport fixes, fork of orbbec/... git clone https://github.com/clearpathrobotics/clearpath_mecanum_drive_controller cd ../../ diff --git a/repos.yaml b/repos.yaml index 843d255..57db5e9 100644 --- a/repos.yaml +++ b/repos.yaml @@ -42,7 +42,7 @@ repositories: mirte-telemetrix4rpipico: type: git url: https://github.com/SuperJappie08/Telemetrix4RpiPico.git - version: modules2 + version: refactor mirte-telemetrix-cpp: type: git url: https://github.com/SuperJappie08/mirte-telemetrix-cpp.git From 7779728ffbc145bed3d01c589ee350d5befe5a0e Mon Sep 17 00:00:00 2001 From: mklomp Date: Thu, 31 Oct 2024 21:23:26 +0100 Subject: [PATCH 161/353] Fixing ros websocket link --- nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index d8e6588..7509085 100644 --- a/nginx.conf +++ b/nginx.conf @@ -54,7 +54,7 @@ server { location /ws/ros { include /etc/nginx/nginx_login.conf; - proxy_pass http://localhost:9090; + proxy_pass http://localhost:9090/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; @@ -141,4 +141,4 @@ server { location /error/ { alias /var/www/html/; } -} \ No newline at end of file +} From 62aeeb172ece8220bc02418a3905eb3e4baf0bb0 Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Fri, 1 Nov 2024 20:20:57 +0100 Subject: [PATCH 162/353] Add explantion and question status quo --- install_ROS2.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 6ed985f..5b95ad1 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -94,12 +94,15 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then # install lidar and depth camera cd /home/mirte/mirte_ws/src || exit 1 git clone https://github.com/Slamtec/rplidar_ros.git -b ros2 # FIXME-FUTURE: Can be installed in newer versions if V2.1.5 is released + git clone https://github.com/rafal-gorecki/ros2_astra_camera.git -b master # compressed images image transport fixes, fork of orbbec/... - git clone https://github.com/clearpathrobotics/clearpath_mecanum_drive_controller + # git clone https://github.com/SuperJappie08/ros2_astra_camera.git -b dep-fix # compressed images image transport fixes, fork of orbbec/... # Fork of Fork: Fix dependencies + git clone https://github.com/clearpathrobotics/clearpath_mecanum_drive_controller # FIXME: Can be installed from apt? why build? cd ../../ mkdir temp cd temp || exit 1 sudo apt install -y libudev-dev libusb-1.0-0-dev nlohmann-json3-dev + # Install lubuvc-dev manually for newer version git clone https://github.com/libuvc/libuvc.git cd libuvc mkdir build && cd build From 846814415a85d87a152535904589e1b4d0cfb229 Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:12:47 +0100 Subject: [PATCH 163/353] Fix styling --- install_ROS2.sh | 2 +- network_install.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 5b95ad1..b9b61e9 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -93,7 +93,7 @@ rm -rf colcon-top-level-workspace if [[ $MIRTE_TYPE == "mirte-master" ]]; then # install lidar and depth camera cd /home/mirte/mirte_ws/src || exit 1 - git clone https://github.com/Slamtec/rplidar_ros.git -b ros2 # FIXME-FUTURE: Can be installed in newer versions if V2.1.5 is released + git clone https://github.com/Slamtec/rplidar_ros.git -b ros2 # FIXME-FUTURE: Can be installed in newer versions if V2.1.5 is released git clone https://github.com/rafal-gorecki/ros2_astra_camera.git -b master # compressed images image transport fixes, fork of orbbec/... # git clone https://github.com/SuperJappie08/ros2_astra_camera.git -b dep-fix # compressed images image transport fixes, fork of orbbec/... # Fork of Fork: Fix dependencies diff --git a/network_install.sh b/network_install.sh index 25a199f..b575edb 100755 --- a/network_install.sh +++ b/network_install.sh @@ -23,7 +23,8 @@ sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf' # Install wifi-connect MY_ARCH=$(arch) if [[ "$MY_ARCH" == "armv7l" ]]; then MY_ARCH="rpi"; fi -wget https://github.com/balena-os/wifi-connect/releases/download/v4.11.1/wifi-connect-v4.11.1-linux-$(echo "$MY_ARCH").zip +# TODO: This version is from Feb 20, 2023 maybe upgrade soon... +wget "https://github.com/balena-os/wifi-connect/releases/download/v4.11.1/wifi-connect-v4.11.1-linux-$(echo "$MY_ARCH").zip" unzip wifi-connect* sudo mv wifi-connect /usr/local/sbin rm wifi-connect* From 36ec7442d76691eb5b67e7674345c03d8b147539 Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:41:06 +0100 Subject: [PATCH 164/353] Fix Shellcheck warnings --- install_ROS2.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index e2d3adf..d147149 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -7,15 +7,17 @@ set -xe #TODO: get this as a parameter MIRTE_SRC_DIR=/usr/local/src/mirte -# Install ROS Humble +# shellcheck source=/dev/null +source /etc/os-release + +# Install ROS 2 (Humble) sudo apt install software-properties-common -y sudo add-apt-repository universe -y sudo apt update && sudo apt install curl -y sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg -echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list >/dev/null +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $UBUNTU_CODENAME main" | sudo tee /etc/apt/sources.list.d/ros2.list >/dev/null sudo apt update -. /etc/os-release # select ros2 type based on UBUNTU_CODENAME if [[ $UBUNTU_CODENAME == "jammy" ]]; then ROS_NAME=humble @@ -26,11 +28,11 @@ else exit 1 fi - sudo apt install -y ros-$ROS_NAME-ros-base sudo apt install -y ros-$ROS_NAME-xacro sudo apt install -y ros-dev-tools grep -qxF "source /opt/ros/$ROS_NAME/setup.bash" /home/mirte/.bashrc || echo "source /opt/ros/$ROS_NAME/setup.bash" >>/home/mirte/.bashrc +# shellcheck source=/dev/null source /opt/ros/$ROS_NAME/setup.bash sudo rosdep init rosdep update @@ -65,6 +67,7 @@ colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release grep -qxF "source /home/mirte/mirte_ws/install/setup.bash" /home/mirte/.bashrc || echo "source /home/mirte/mirte_ws/install/setup.bash" >>/home/mirte/.bashrc grep -qxF "source /home/mirte/mirte_ws/install/setup.zsh" /home/mirte/.zshrc || echo "source /home/mirte/mirte_ws/install/setup.zsh" >>/home/mirte/.zshrc +# shellcheck source=/dev/null source /home/mirte/mirte_ws/install/setup.bash # install missing python dependencies rosbridge @@ -127,6 +130,7 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then cd /home/mirte/mirte_ws/ || exit 1 rosdep install -y --from-paths src/ --ignore-src --rosdistro $ROS_NAME colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release + # shellcheck source=/dev/null source ./install/setup.bash cd src/ros2_astra_camera/astra_camera chmod +x ./scripts/install.sh || true From 7cae73d9f75f475e8ca165faf91dbf737e75bb2b Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:43:44 +0100 Subject: [PATCH 165/353] Fix README styling --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a7c1e50..bcffec5 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,4 @@ Scripts that are ran during creation of the image and on the Mirte itself. - [shfmt](https://github.com/mvdan/sh): styling (whitespace) of all shell scripts - [ShellCheck](https://github.com/koalaman/shellcheck): static analysis to find (possible) bugs. Only errors and warnings are enabled -Check & format using their command line tools or vscode plugins. Or check the GitHub workflows with (act)[https://github.com/nektos/act]. \ No newline at end of file +Check & format using their command line tools or vscode plugins. Or check the GitHub workflows with [act](https://github.com/nektos/act). \ No newline at end of file From daf8630cb154248299960f3c081c68d540223113 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 15 Nov 2024 16:26:56 +0100 Subject: [PATCH 166/353] Some first comments on ros2 code --- fix_scripts/fix_arm.sh | 2 ++ fix_scripts/readme.md | 1 + fix_scripts/update_all.sh | 2 ++ fix_scripts/update_tmx.sh | 2 ++ install_ROS.sh | 2 ++ install_ROS2.sh | 9 ++------- install_arduino.sh | 20 +++++++++----------- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/fix_scripts/fix_arm.sh b/fix_scripts/fix_arm.sh index 8ec0e06..2993c72 100644 --- a/fix_scripts/fix_arm.sh +++ b/fix_scripts/fix_arm.sh @@ -1,5 +1,7 @@ #!/bin/bash set -xe +#TODO: fix for ROS2 if required + rm -rf ~/arm_temp || true mkdir ~/arm_temp cd ~/arm_temp diff --git a/fix_scripts/readme.md b/fix_scripts/readme.md index 79e2e00..97c2141 100644 --- a/fix_scripts/readme.md +++ b/fix_scripts/readme.md @@ -1,2 +1,3 @@ # Scripts for online updates of Mirte-master +#TODO: fix for ROS2 if required Shouldn't be required anymore, but can be used to check for updates and calibrate arm. \ No newline at end of file diff --git a/fix_scripts/update_all.sh b/fix_scripts/update_all.sh index 8cf36a9..36ce9a2 100644 --- a/fix_scripts/update_all.sh +++ b/fix_scripts/update_all.sh @@ -1,5 +1,7 @@ #!/bin/bash set -xe +#TODO: fix for ROS2 if required + sudo systemctl stop mirte-ros mkdir ~/update_all || true cd ~/update_all diff --git a/fix_scripts/update_tmx.sh b/fix_scripts/update_tmx.sh index 239bd5f..7ccd152 100644 --- a/fix_scripts/update_tmx.sh +++ b/fix_scripts/update_tmx.sh @@ -1,5 +1,7 @@ #!/bin/bash set -xe +#TODO: fix for ROS2 if required + mkdir temp_upd cd temp_upd wget https://mirte.arend-jan.com/files/telemetrix/modules2/Telemetrix4RpiPico.uf2 diff --git a/install_ROS.sh b/install_ROS.sh index c0f526b..01aafc0 100755 --- a/install_ROS.sh +++ b/install_ROS.sh @@ -1,5 +1,7 @@ #!/bin/bash set -xe + +THIS SCRIPT IS NOT USED ANYMORE, LOOK AT install_ROS2.sh #TODO: get this as a parameter MIRTE_SRC_DIR=/usr/local/src/mirte diff --git a/install_ROS2.sh b/install_ROS2.sh index d147149..5dbdbf7 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -3,6 +3,7 @@ set -xe # IMPORTANT: # Do not upgrade apt-get since it will break the image. libc-bin will for some # reason break and not be able to install new stuff on the image. +# TODO: check above info #TODO: get this as a parameter MIRTE_SRC_DIR=/usr/local/src/mirte @@ -47,12 +48,12 @@ sudo pip3 install pyzbar mergedeep #rm $MIRTE_SRC_DIR/mirte-ros-packages/mirte_telemetrix/config/mirte_user_settings.yaml #ln -s /home/mirte/.user_settings.yaml $MIRTE_SRC_DIR/mirte-ros-packages/config/mirte_user_settings.yaml +# TODO: install in a separate workspace or install the debs. # Install Mirte ROS package python3 -m pip install mergedeep mkdir -p /home/mirte/mirte_ws/src cd /home/mirte/mirte_ws/src ln -s $MIRTE_SRC_DIR/mirte-ros-packages . -ln -s $MIRTE_SRC_DIR/mirte-telemetrix-cpp . # Install source dependencies for slam sudo apt install ros-$ROS_NAME-slam-toolbox -y @@ -89,12 +90,6 @@ sudo systemctl enable $ROS_SERVICE_NAME sudo usermod -a -G video mirte sudo adduser mirte dialout -python3 -m pip install telemetrix-rpi-pico - -# Install OLED dependencies (adafruit dependecies often break, so explicityle set to versions) -sudo apt install -y python3-bitstring libfreetype6-dev libjpeg-dev zlib1g-dev fonts-dejavu -sudo pip3 install adafruit-circuitpython-busdevice==5.1.1 adafruit-circuitpython-framebuf==1.4.9 adafruit-circuitpython-typing==1.7.0 Adafruit-PlatformDetect==3.22.1 -sudo pip3 install pillow adafruit-circuitpython-ssd1306==2.12.1 # Some nice extra packages: clean can clean workspaces and packages. No need to do it by hand. lint can check for errors in the cmake/package code. sudo pip3 install colcon-clean colcon-lint diff --git a/install_arduino.sh b/install_arduino.sh index b9c19bb..179dd95 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -62,9 +62,10 @@ sudo bash -c 'echo "mirte ALL = (root) NOPASSWD: /usr/local/bin/arduino-cli" >> # Install picotool for the Raspberry Pi Pico sudo apt install build-essential pkg-config libusb-1.0-0-dev cmake -y -cd /tmp/ || exit 1 +cd /home/mirte/ || exit 1 +mkdir pico/ git clone https://github.com/raspberrypi/pico-sdk.git # somehow needed for picotool -export PICO_SDK_PATH=/tmp/pico-sdk +export PICO_SDK_PATH=/home/mirte/pico/pico-sdk git clone https://github.com/raspberrypi/picotool.git cd picotool || exit 1 sudo cp udev/99-picotool.rules /etc/udev/rules.d/ @@ -75,17 +76,14 @@ cmake .. -DCMAKE_BUILD_TYPE=Release make -j sudo make install -cd /tmp || exit 1 -rm -rf pico-sdk -rm -rf picotool # Download latest uf2 release, resulting in Telemetrix4RpiPico.uf2 # TODO: Downlaods from arendjan/telemetrix4rpipico, as it isn't released yet on the official repo cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 -# curl -s https://api.github.com/repos/arendjan/telemetrix4rpipico/releases/latest | -# grep ".*/Telemetrix4RpiPico.uf2" | -# cut -d : -f 2,3 | -# tr -d \" | -# wget -qi - +curl -s https://api.github.com/repos/arendjan/telemetrix4rpipico/releases/latest | + grep ".*/Telemetrix4RpiPico.uf2" | + cut -d : -f 2,3 | + tr -d \" | + wget -qi - -wget https://mirte.arend-jan.com/files/telemetrix/modules2/Telemetrix4RpiPico.uf2 +# wget https://mirte.arend-jan.com/files/telemetrix/modules2/Telemetrix4RpiPico.uf2 From 0f4a65b1da16d6ef72dbf472e35a82a773169218 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 15 Nov 2024 16:28:27 +0100 Subject: [PATCH 167/353] style fix after comments --- install_arduino.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install_arduino.sh b/install_arduino.sh index 179dd95..21db43c 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -76,7 +76,6 @@ cmake .. -DCMAKE_BUILD_TYPE=Release make -j sudo make install - # Download latest uf2 release, resulting in Telemetrix4RpiPico.uf2 # TODO: Downlaods from arendjan/telemetrix4rpipico, as it isn't released yet on the official repo cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 From 611c186e7a432b4660f6d1e38bf6919a4ab6b740 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 6 Dec 2024 13:13:42 +0100 Subject: [PATCH 168/353] add repocheck + other branches? --- .github/workflows/repocheck.yml | 22 ++++++++++++++ repos.yaml | 51 +++++++++++++++++---------------- 2 files changed, 48 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/repocheck.yml diff --git a/.github/workflows/repocheck.yml b/.github/workflows/repocheck.yml new file mode 100644 index 0000000..fc914bf --- /dev/null +++ b/.github/workflows/repocheck.yml @@ -0,0 +1,22 @@ +on: + # - push + - pull_request + - workflow_call + +name: "reposcheck" +permissions: {} + +jobs: + reposcheck: + name: reposcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + sudo apt update + curl -s https://packagecloud.io/install/repositories/dirk-thomas/vcstool/script.deb.sh | sudo bash + sudo apt-get update + sudo apt-get install python3-vcstool -y + mkdir check + - name: check + run: vcs import --input repos.yaml check diff --git a/repos.yaml b/repos.yaml index 57db5e9..7f342c7 100644 --- a/repos.yaml +++ b/repos.yaml @@ -1,28 +1,29 @@ repositories: mirte-web-interface: type: git - url: https://github.com/SuperJappie08/mirte-web-interface.git - version: ros2-dev + url: https://github.com/mirte-robot/mirte-web-interface.git + version: develop mirte-telemetrix4arduino: type: git url: https://github.com/mirte-robot/Telemetrix4Arduino.git version: master mirte-install-scripts: type: git - url: https://github.com/SuperJappie08/mirte-install-scripts.git - version: mirte-ros2 - mirte-telemetrix-aio: - type: git - url: https://github.com/mirte-robot/telemetrix-aio.git - version: master - mirte-tmx-pico-aio: - type: git - url: https://github.com/arendjan/tmx-pico-aio.git - version: modules + url: https://github.com/mirte-robot/mirte-install-scripts.git + version: develop + # mirte-telemetrix-aio: + # type: git + # url: https://github.com/mirte-robot/telemetrix-aio.git + # version: master + # mirte-tmx-pico-aio: + # type: git + # url: https://github.com/arendjan/tmx-pico-aio.git + # version: modules mirte-ros-packages: type: git - url: https://github.com/SuperJappie08/mirte-ros-packages.git - version: mirte-ros2 + url: https://github.com/mirte-robot/mirte-ros-packages.git + version: develop + recursive: true mirte-oled-images: type: git url: https://github.com/mirte-robot/mirte-oled-images.git @@ -33,18 +34,18 @@ repositories: version: main mirte-python: type: git - url: https://github.com/SuperJappie08/mirte-python.git - version: ros2-dev + url: https://github.com/mirte-robot/mirte-python.git + version: develop mirte-documentation: type: git - url: https://github.com/arendjan/mirte-documentation.git - version: mirte-master + url: https://github.com/mirte-robot/mirte-documentation.git + version: develop mirte-telemetrix4rpipico: type: git - url: https://github.com/SuperJappie08/Telemetrix4RpiPico.git - version: refactor - mirte-telemetrix-cpp: - type: git - url: https://github.com/SuperJappie08/mirte-telemetrix-cpp.git - version: mirte-pioneer - recursive: true + url: https://github.com/mirte-robot/Telemetrix4RpiPico.git + version: develop + # mirte-telemetrix-cpp: + # type: git + # url: https://github.com/mirte-robot/mirte-telemetrix-cpp.git + # version: mirte-pioneer + From a6dddc4263f2ddc4f2478e7544e6c7d2a5d5a9ec Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 12:00:01 +0100 Subject: [PATCH 169/353] cleanup arduino platformio and pico --- create_user.sh | 2 + install_arduino.sh | 84 +++++++++++------------------------------- run_arduino.sh | 92 +++++++++++++++++++++------------------------- tools.sh | 17 +++++++++ 4 files changed, 82 insertions(+), 113 deletions(-) create mode 100644 tools.sh diff --git a/create_user.sh b/create_user.sh index 9e1b9bf..7c60f5d 100755 --- a/create_user.sh +++ b/create_user.sh @@ -11,6 +11,8 @@ sudo chown mirte:mirte /home/mirte/workdir sudo ./install_pam.sh # setup pam before changing the password for the mirte user. echo "mirte:mirte_mirte" | sudo chpasswd +echo "root:mirte_mirte" | sudo chpasswd + sudo mkdir -p $MIRTE_SRC_DIR sudo chown mirte:mirte $MIRTE_SRC_DIR diff --git a/install_arduino.sh b/install_arduino.sh index 21db43c..f645a9b 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -2,70 +2,30 @@ set -xe MIRTE_SRC_DIR=/usr/local/src/mirte +. $MIRTE_SRC_DIR/mirte-install-scripts/tools.sh # Install dependencies sudo apt install -y git curl binutils libusb-1.0-0 -# Install arduino-cli -# We need to install version 0.13.0. From version 0.14.0 on a check is done on the hash of the packages, -# while the community version of the STM (see below) needs insecure packages. -curl https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sudo BINDIR=/usr/local/bin sh -s 0.13.0 +# install platformio +curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -o get-platformio.py +python3 get-platformio.py -# Install arduino avr support (for nano) -arduino-cli -v core update-index --additional-urls https://raw.githubusercontent.com/koendv/stm32duino-raspberrypi/master/BoardManagerFiles/package_stm_index.json -arduino-cli -v core install arduino:avr - -# Install STM32 support. Currently not supported by stm32duino (see https://github.com/stm32duino/Arduino_Core_STM32/issues/708), but there is already -# a community version (https://github.com/koendv/stm32duino-raspberrypi). TODO: go back to stm32duino as soon as it is merged into stm32duino. -arduino-cli -v core install STM32:stm32 --additional-urls https://github.com/koendv/stm32duino-raspberrypi/blob/v1.3.2-4/BoardManagerFiles/package_stm_index.json -#arduino-cli -v core install STM32:stm32 --additional-urls https://github.com/zoef-robot/stm32duino-raspberrypi/master/BoardManagerFiles/package_stm_index.json - -# Fix for community STM32 (TODO: make version independant) -sed -i 's/dfu-util\.sh/dfu-util\/dfu-util/g' /home/mirte/.arduino15/packages/STM32/tools/STM32Tools/1.4.0/tools/linux/maple_upload -ln -s /home/mirte/.arduino15/packages/STM32/tools/STM32Tools/1.4.0/tools/linux/maple_upload /home/mirte/.arduino15/packages/STM32/tools/STM32Tools/1.4.0/tools/linux/maple_upload.sh -sudo cp /home/mirte/.arduino15/packages/STM32/tools/STM32Tools/1.4.0/tools/linux/45-maple.rules /etc/udev/rules.d/45-maple.rules -# Retartsing should only be done when not in qemu -#sudo service udev restart - -# Install libraries needed by FirmataExpress -arduino-cli lib install "NewPing" -arduino-cli lib install "Stepper" -arduino-cli lib install "Servo" -arduino-cli lib install "DHTNEW" - -# Install our own arduino libraries -ln -s $MIRTE_SRC_DIR/mirte-arduino-libraries/OpticalEncoder /home/mirte/Arduino/libraries - -# Install Blink example code -mkdir /home/mirte/arduino_project/Blink -ln -s $MIRTE_SRC_DIR/mirte-install-scripts/Blink.ino /home/mirte/arduino_project/Blink - -# Already build all versions so only upload is needed -# TODO: somehow this takes ages, removed for now: -# ./run_arduino.sh build Telemetrix4Arduino -# ./run_arduino.sh build_nano Telemetrix4Arduino -# ./run_arduino.sh build_nano_old Telemetrix4Arduino -# ./run_arduino.sh build_uno Telemetrix4Arduino - -# Add mirte to dialout -sudo adduser mirte dialout - -# By default, armbian has ssh login for root enabled with password 1234. -# The password need to be set to mirte_mirte so users can use the -# Arduino IDE remotely. -# TODO: when the Arduino IDE also supports ssh for non-root-users -# this has to be changed -echo -e "mirte_mirte\nmirte_mirte" | sudo passwd root - -# Enable tuploading from remote IDE -sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/run-avrdude /usr/bin -sudo bash -c 'echo "mirte ALL = (root) NOPASSWD: /usr/local/bin/arduino-cli" >> /etc/sudoers' +# Add platformio to path +export PATH=$PATH:$HOME/.local/bin +mkdir -p ~/.local/bin || true +ln -s ~/.platformio/penv/bin/platformio ~/.local/bin/platformio +ln -s ~/.platformio/penv/bin/pio ~/.local/bin/pio +ln -s ~/.platformio/penv/bin/piodebuggdb ~/.local/bin/piodebuggdb +pio --version +add_rc 'export PATH=$PATH:$HOME/.local/bin' # Install picotool for the Raspberry Pi Pico sudo apt install build-essential pkg-config libusb-1.0-0-dev cmake -y cd /home/mirte/ || exit 1 mkdir pico/ git clone https://github.com/raspberrypi/pico-sdk.git # somehow needed for picotool export PICO_SDK_PATH=/home/mirte/pico/pico-sdk +add_rc 'export PICO_SDK_PATH=/home/mirte/pico/pico-sdk' git clone https://github.com/raspberrypi/picotool.git cd picotool || exit 1 sudo cp udev/99-picotool.rules /etc/udev/rules.d/ @@ -76,13 +36,11 @@ cmake .. -DCMAKE_BUILD_TYPE=Release make -j sudo make install -# Download latest uf2 release, resulting in Telemetrix4RpiPico.uf2 -# TODO: Downlaods from arendjan/telemetrix4rpipico, as it isn't released yet on the official repo -cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 -curl -s https://api.github.com/repos/arendjan/telemetrix4rpipico/releases/latest | - grep ".*/Telemetrix4RpiPico.uf2" | - cut -d : -f 2,3 | - tr -d \" | - wget -qi - - -# wget https://mirte.arend-jan.com/files/telemetrix/modules2/Telemetrix4RpiPico.uf2 +# Already build all versions so only upload is needed +./run_arduino.sh build Telemetrix4Arduino +./run_arduino.sh build_nano Telemetrix4Arduino +./run_arduino.sh build_nano_old Telemetrix4Arduino +./run_arduino.sh build_uno Telemetrix4Arduino +./run_arduino.sh build_pico +# Add mirte to dialout +sudo adduser mirte dialout diff --git a/run_arduino.sh b/run_arduino.sh index a859d08..2c935a3 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -3,7 +3,7 @@ # with mcu_type and arduino_folder optional # Check if ROS is running -ROS_RUNNING=$(ps aux | grep -c "[r]osmaster") +ROS_RUNNING=$(systemctl is-active mirte-ros || /bin/true) COMMAND=$1 PROJECT=$2 # Stop ROS when uploading new code @@ -13,61 +13,53 @@ if [[ $COMMAND == upload* ]] && [[ $ROS_RUNNING == "1" ]]; then # test for any u sudo service mirte-ros stop || /bin/true STOPPED_ROS=true fi +cd /home/mirte/arduino_project/$PROJECT || exit 1 # Different build scripts -if test "$COMMAND" == "build"; then - arduino-cli -v compile --fqbn STM32:stm32:GenF1:pnum=BLUEPILL_F103C8,upload_method=dfu2Method,xserial=generic,usb=CDCgen,xusb=FS,opt=osstd,rtlib=nano /home/mirte/arduino_project/$PROJECT -fi -if test "$COMMAND" == "build_nano"; then - arduino-cli -v compile --fqbn arduino:avr:nano:cpu=atmega328 /home/mirte/arduino_project/$PROJECT -fi -if test "$COMMAND" == "build_nano_old"; then - arduino-cli -v compile --fqbn arduino:avr:nano:cpu=atmega328old /home/mirte/arduino_project/$PROJECT -fi -if test "$COMMAND" == "build_uno"; then - arduino-cli -v compile --fqbn arduino:avr:uno /home/mirte/arduino_project/$PROJECT -fi -upload() { - PORT=$1 +if [[ $COMMAND == build* ]]; then + if test "$COMMAND" == "build"; then + pio run + elif test "$COMMAND" == "build_nano"; then + pio run -e nanoatmega328new + arduino-cli -v compile --fqbn arduino:avr:nano:cpu=atmega328 /home/mirte/arduino_project/$PROJECT + elif test "$COMMAND" == "build_nano_old"; then + pio run -e nanoatmega328 + arduino-cli -v compile --fqbn arduino:avr:nano:cpu=atmega328old /home/mirte/arduino_project/$PROJECT + elif test "$COMMAND" == "build_pico"; then + cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 + cd build || mkdir build && cd build + cmake .. + make + else + echo "Unknown build command $COMMAND" + exit 1 + fi +elif [[ $COMMAND == upload* ]]; then # Different upload scripts if test "$COMMAND" == "upload" || test "$COMMAND" == "upload_stm32"; then - arduino-cli -v upload -p $PORT --fqbn STM32:stm32:GenF1:pnum=BLUEPILL_F103C8,upload_method=dfu2Method,xserial=generic,usb=CDCgen,xusb=FS,opt=osstd,rtlib=nano /home/mirte/arduino_project/$PROJECT - fi - if test "$COMMAND" == "upload_nano"; then - arduino-cli -v upload -p $PORT --fqbn arduino:avr:nano:cpu=atmega328 /home/mirte/arduino_project/$PROJECT - fi - if test "$COMMAND" == "upload_nano_old"; then - arduino-cli -v upload -p $PORT --fqbn arduino:avr:nano:cpu=atmega328old /home/mirte/arduino_project/$PROJECT - fi - if test "$COMMAND" == "upload_uno"; then - arduino-cli -v upload -p $PORT --fqbn arduino:avr:uno /home/mirte/arduino_project/$PROJECT - fi -} - -if [[ $COMMAND == upload* ]] && test "$1" != "upload_pico"; then - shopt -s nullglob - for PORT in "/dev/ttyUSB"*; do - echo "Uploading to $PORT" - upload $PORT - done - for PORT in "/dev/ttyACM"*; do - echo "Uploading to $PORT" - upload $PORT - done -fi - -if test "$1" == "upload_pico"; then - MIRTE_SRC_DIR=/usr/local/src/mirte - # This will always upload telemetrix4rpipico.uf2, so no need to pass a file - sudo picotool load -f $MIRTE_SRC_DIR/mirte-install-scripts/Telemetrix4RpiPico.uf2 - retVal=$? - if [ $retVal -ne 0 ]; then - echo "Failed to upload to Pico" - echo "Please check the connection and try again" - echo "Or unplug the Pico, press the BOOTSEL button and plug it in again" + pio run -e robotdyn_blackpill_f303cc -t upload + elif test "$COMMAND" == "upload_nano"; then + pio run -e nanoatmega328new -t upload + elif test "$COMMAND" == "upload_nano_old"; then + pio run -e nanoatmega328 -t upload + elif test "$1" == "upload_pico"; then + # This will always upload telemetrix4rpipico.uf2, so no need to pass a file + sudo picotool load -f $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/Telemetrix4RpiPico.uf2 + retVal=$? + if [ $retVal -ne 0 ]; then + echo "Failed to upload to Pico" + echo "Please check the connection and try again" + echo "Or unplug the Pico, press the BOOTSEL button and plug it in again" + exit 1 + fi + sudo picotool reboot # just to make sure, sometimes it does not reboot automatically + else + echo "Unknown upload command $COMMAND" exit 1 fi - sudo picotool reboot # just to make sure, sometimes it does not reboot automatically +else + echo "Unknown command $COMMAND" + exit 1 fi # Start ROS again diff --git a/tools.sh b/tools.sh new file mode 100644 index 0000000..fb5f8ca --- /dev/null +++ b/tools.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# some functions to help with the setup + +add_rc() { + lines=$1 + + grep -qxF "$1" ~/.bashrc || echo "$1" >>~/.bashrc + + # if we have a second argument, we use that as lines to add to zshrc, otherwise keep the same as bashrc + if [ -z "$2" ]; then + lines=$1 + else + lines=$2 + fi + grep -qxF "$1" ~/.zshrc || echo "$1" >>~/.zshrc +} From 88b41e6fc2bd052be6d111f93eba95d9eeab22a3 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 12:06:06 +0100 Subject: [PATCH 170/353] fix shellcheck --- tools.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools.sh b/tools.sh index fb5f8ca..b8f467a 100644 --- a/tools.sh +++ b/tools.sh @@ -5,7 +5,7 @@ add_rc() { lines=$1 - grep -qxF "$1" ~/.bashrc || echo "$1" >>~/.bashrc + grep -qxF "$lines" ~/.bashrc || echo "$lines" >>~/.bashrc # if we have a second argument, we use that as lines to add to zshrc, otherwise keep the same as bashrc if [ -z "$2" ]; then @@ -13,5 +13,5 @@ add_rc() { else lines=$2 fi - grep -qxF "$1" ~/.zshrc || echo "$1" >>~/.zshrc + grep -qxF "$lines" ~/.zshrc || echo "$lines" >>~/.zshrc } From e4c5ac64b418d7a947489647f1f26f95493597e8 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 13:51:54 +0100 Subject: [PATCH 171/353] final fix shellcheck + add install arduino check --- .github/workflows/test_install.yml | 24 ++++++++++++++++++++++++ install_arduino.sh | 17 ++++++++++------- install_mirte.sh | 14 +++----------- run_arduino.sh | 10 +++++----- 4 files changed, 42 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/test_install.yml diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml new file mode 100644 index 0000000..b621e6c --- /dev/null +++ b/.github/workflows/test_install.yml @@ -0,0 +1,24 @@ +name: test-install-parts + +on: [push, pull_request] + +jobs: + arduino-install: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - run: | + mkdir -p /etc/udev/rules.d/ # just for testing, folder should just exist on the real image + adduser mirte + MIRTE_SRC_DIR=/usr/local/src/mirte + sudo mkdir -p $MIRTE_SRC_DIR + mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ + cp -r ./* $MIRTE_SRC_DIR/mirte-install-scripts/ + cd $MIRTE_SRC_DIR + sudo apt update + git clone https://github.com/mirte-robot/telemetrix4arduino.git mirte-telemetrix4arduino -b develop + # TODO: clone rpipico + git clone https://github.com/mirte-robot/telemetrix4rpipico.git mirte-telemetrix4rpipico -b develop --recursive + cd $MIRTE_SRC_DIR/mirte-install-scripts/ + ./install_arduino.sh \ No newline at end of file diff --git a/install_arduino.sh b/install_arduino.sh index f645a9b..54c67eb 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -20,12 +20,16 @@ pio --version add_rc 'export PATH=$PATH:$HOME/.local/bin' # Install picotool for the Raspberry Pi Pico -sudo apt install build-essential pkg-config libusb-1.0-0-dev cmake -y -cd /home/mirte/ || exit 1 +sudo apt install gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib build-essential pkg-config libusb-1.0-0-dev cmake -y +cd $MIRTE_SRC_DIR || exit 1 mkdir pico/ -git clone https://github.com/raspberrypi/pico-sdk.git # somehow needed for picotool -export PICO_SDK_PATH=/home/mirte/pico/pico-sdk -add_rc 'export PICO_SDK_PATH=/home/mirte/pico/pico-sdk' +cd pico/ || exit 1 +git clone https://github.com/raspberrypi/pico-sdk.git --recursive # somehow needed for picotool +ls +realpath pico-sdk +ls +export PICO_SDK_PATH=$MIRTE_SRC_DIR/pico/pico-sdk +add_rc "export PICO_SDK_PATH=$MIRTE_SRC_DIR/pico/pico-sdk" git clone https://github.com/raspberrypi/picotool.git cd picotool || exit 1 sudo cp udev/99-picotool.rules /etc/udev/rules.d/ @@ -35,12 +39,11 @@ cd build || exit 1 cmake .. -DCMAKE_BUILD_TYPE=Release make -j sudo make install - +cd $MIRTE_SRC_DIR/mirte-install-scripts/ # Already build all versions so only upload is needed ./run_arduino.sh build Telemetrix4Arduino ./run_arduino.sh build_nano Telemetrix4Arduino ./run_arduino.sh build_nano_old Telemetrix4Arduino -./run_arduino.sh build_uno Telemetrix4Arduino ./run_arduino.sh build_pico # Add mirte to dialout sudo adduser mirte dialout diff --git a/install_mirte.sh b/install_mirte.sh index 08cb7eb..92508d7 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -41,17 +41,9 @@ pip3 install . cd $MIRTE_SRC_DIR/mirte-tmx-pico-aio pip3 install . -# Install Telemtrix4Arduino project -# TODO: building STM sometimes fails (and/or hangs) -#cd $MIRTE_SRC_DIR/mirte-install-scripts -#mkdir -p /home/mirte/Arduino/libraries -#mkdir -p /home/mirte/arduino_project/Telemetrix4Arduino -#ln -s $MIRTE_SRC_DIR/mirte-telemetrix4arduino /home/mirte/Arduino/libraries/Telemetrix4Arduino -#ln -s $MIRTE_SRC_DIR/mirte-telemetrix4arduino/examples/Telemetrix4Arduino/Telemetrix4Arduino.ino /home/mirte/arduino_project/Telemetrix4Arduino - -# Install arduino firmata upload script -#cd $MIRTE_SRC_DIR/mirte-install-scripts -#./install_arduino.sh +Install arduino firmata upload script +cd $MIRTE_SRC_DIR/mirte-install-scripts +./install_arduino.sh # Install Mirte ROS2 packages cd $MIRTE_SRC_DIR/mirte-install-scripts diff --git a/run_arduino.sh b/run_arduino.sh index 2c935a3..07a1ec1 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -1,11 +1,10 @@ #!/bin/bash -#TODO: script should have format ./run.sh build|upload] mcu_type arduino_folder -# with mcu_type and arduino_folder optional - +#TODO: script should have format ./run.sh build|upload] mcu_type +MIRTE_SRC_DIR=/usr/local/src/mirte # Check if ROS is running ROS_RUNNING=$(systemctl is-active mirte-ros || /bin/true) COMMAND=$1 -PROJECT=$2 +PROJECT="mirte-telemetrix4arduino" # Stop ROS when uploading new code STOPPED_ROS=false if [[ $COMMAND == upload* ]] && [[ $ROS_RUNNING == "1" ]]; then # test for any upload... command @@ -13,7 +12,7 @@ if [[ $COMMAND == upload* ]] && [[ $ROS_RUNNING == "1" ]]; then # test for any u sudo service mirte-ros stop || /bin/true STOPPED_ROS=true fi -cd /home/mirte/arduino_project/$PROJECT || exit 1 +cd $MIRTE_SRC_DIR/$PROJECT || exit 1 # Different build scripts if [[ $COMMAND == build* ]]; then @@ -27,6 +26,7 @@ if [[ $COMMAND == build* ]]; then arduino-cli -v compile --fqbn arduino:avr:nano:cpu=atmega328old /home/mirte/arduino_project/$PROJECT elif test "$COMMAND" == "build_pico"; then cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 + # shellcheck disable=SC2164 cd build || mkdir build && cd build cmake .. make From ff2c454632d05a4f84380e218189e8a8de7156be Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 13:52:59 +0100 Subject: [PATCH 172/353] wf fix? --- .github/workflows/test_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index b621e6c..2730636 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - run: | mkdir -p /etc/udev/rules.d/ # just for testing, folder should just exist on the real image - adduser mirte + sudo adduser mirte MIRTE_SRC_DIR=/usr/local/src/mirte sudo mkdir -p $MIRTE_SRC_DIR mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ From 1a9d9c31ed274891935b627b0cfd45ee88262d51 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 13:57:31 +0100 Subject: [PATCH 173/353] gecos? --- .github/workflows/test_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 2730636..2b0a54b 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - run: | mkdir -p /etc/udev/rules.d/ # just for testing, folder should just exist on the real image - sudo adduser mirte + sudo adduser -gecos mirte MIRTE_SRC_DIR=/usr/local/src/mirte sudo mkdir -p $MIRTE_SRC_DIR mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ From bcec28db4ecf8f989a5860102f235c1e1bf6f449 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 13:58:12 +0100 Subject: [PATCH 174/353] gecos 2 --- .github/workflows/test_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 2b0a54b..bba659f 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - run: | mkdir -p /etc/udev/rules.d/ # just for testing, folder should just exist on the real image - sudo adduser -gecos mirte + sudo adduser --gecos mirte MIRTE_SRC_DIR=/usr/local/src/mirte sudo mkdir -p $MIRTE_SRC_DIR mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ From c3a7415c02543927e4d3c592776dda690df67213 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 14:00:21 +0100 Subject: [PATCH 175/353] gecos3 --- .github/workflows/test_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index bba659f..072c649 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - run: | mkdir -p /etc/udev/rules.d/ # just for testing, folder should just exist on the real image - sudo adduser --gecos mirte + sudo adduser --gecos "" mirte MIRTE_SRC_DIR=/usr/local/src/mirte sudo mkdir -p $MIRTE_SRC_DIR mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ From 6fe4f0dad3967685e9dfbd49d196234d737046d4 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 14:02:19 +0100 Subject: [PATCH 176/353] test3 useradd --- .github/workflows/test_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 072c649..96ede98 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - run: | mkdir -p /etc/udev/rules.d/ # just for testing, folder should just exist on the real image - sudo adduser --gecos "" mirte + sudo useradd -m -s /bin/bash mirte MIRTE_SRC_DIR=/usr/local/src/mirte sudo mkdir -p $MIRTE_SRC_DIR mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ From 5e011dd00a2063503ca2508266597408383be8bb Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 14:03:55 +0100 Subject: [PATCH 177/353] ls usrlocal --- .github/workflows/test_install.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 96ede98..1f98611 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -12,6 +12,8 @@ jobs: mkdir -p /etc/udev/rules.d/ # just for testing, folder should just exist on the real image sudo useradd -m -s /bin/bash mirte MIRTE_SRC_DIR=/usr/local/src/mirte + ls -ld /usr/local/ + ls -ld /usr/local/src/ sudo mkdir -p $MIRTE_SRC_DIR mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ cp -r ./* $MIRTE_SRC_DIR/mirte-install-scripts/ From b901affed730b01e8b632638657e5538a398499a Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 14:05:06 +0100 Subject: [PATCH 178/353] sudo test_install --- .github/workflows/test_install.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 1f98611..878f51c 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -15,12 +15,12 @@ jobs: ls -ld /usr/local/ ls -ld /usr/local/src/ sudo mkdir -p $MIRTE_SRC_DIR - mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ - cp -r ./* $MIRTE_SRC_DIR/mirte-install-scripts/ + sudo mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ + sudo cp -r ./* $MIRTE_SRC_DIR/mirte-install-scripts/ cd $MIRTE_SRC_DIR sudo apt update - git clone https://github.com/mirte-robot/telemetrix4arduino.git mirte-telemetrix4arduino -b develop + sudo git clone https://github.com/mirte-robot/telemetrix4arduino.git mirte-telemetrix4arduino -b develop # TODO: clone rpipico - git clone https://github.com/mirte-robot/telemetrix4rpipico.git mirte-telemetrix4rpipico -b develop --recursive + sudo git clone https://github.com/mirte-robot/telemetrix4rpipico.git mirte-telemetrix4rpipico -b develop --recursive cd $MIRTE_SRC_DIR/mirte-install-scripts/ - ./install_arduino.sh \ No newline at end of file + sudo ./install_arduino.sh \ No newline at end of file From 2cb161203c0d8ead8921b16ee9eb8e50d59799ef Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 14:12:28 +0100 Subject: [PATCH 179/353] style fixes --- install_arduino.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_arduino.sh b/install_arduino.sh index 54c67eb..542a6d5 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -20,7 +20,7 @@ pio --version add_rc 'export PATH=$PATH:$HOME/.local/bin' # Install picotool for the Raspberry Pi Pico -sudo apt install gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib build-essential pkg-config libusb-1.0-0-dev cmake -y +sudo apt install gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib build-essential pkg-config libusb-1.0-0-dev cmake -y cd $MIRTE_SRC_DIR || exit 1 mkdir pico/ cd pico/ || exit 1 From 9239645c99290e03ca6c4377c2f44e025873d1b1 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 15:36:11 +0100 Subject: [PATCH 180/353] Add ros2 install check --- .github/workflows/test_install.yml | 22 +++++++++++-- install_ROS2.sh | 53 ++++++++++++++++++++++++++---- 2 files changed, 67 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 878f51c..39fff60 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -20,7 +20,25 @@ jobs: cd $MIRTE_SRC_DIR sudo apt update sudo git clone https://github.com/mirte-robot/telemetrix4arduino.git mirte-telemetrix4arduino -b develop - # TODO: clone rpipico sudo git clone https://github.com/mirte-robot/telemetrix4rpipico.git mirte-telemetrix4rpipico -b develop --recursive cd $MIRTE_SRC_DIR/mirte-install-scripts/ - sudo ./install_arduino.sh \ No newline at end of file + sudo ./install_arduino.sh + + ros2-install: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - run: | + sudo useradd -m -s /bin/bash mirte + MIRTE_SRC_DIR=/usr/local/src/mirte + sudo mkdir -p $MIRTE_SRC_DIR + + sudo mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ + sudo cp -r ./* $MIRTE_SRC_DIR/mirte-install-scripts/ + cd $MIRTE_SRC_DIR + sudo git clone https://github.com/arendjan/mirte-ros-packages.git mirte-ros-packages -b develop --recursive + + sudo apt update + cd $MIRTE_SRC_DIR/mirte-install-scripts/ + sudo ./install_ROS2.sh \ No newline at end of file diff --git a/install_ROS2.sh b/install_ROS2.sh index 5dbdbf7..d2d8dad 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -7,7 +7,7 @@ set -xe #TODO: get this as a parameter MIRTE_SRC_DIR=/usr/local/src/mirte - +. tools.sh # shellcheck source=/dev/null source /etc/os-release @@ -55,18 +55,59 @@ mkdir -p /home/mirte/mirte_ws/src cd /home/mirte/mirte_ws/src ln -s $MIRTE_SRC_DIR/mirte-ros-packages . +# if mirte-ros-packages is from main or develop, use the precompiled version, otherwise compile on-device +cd $MIRTE_SRC_DIR/mirte-ros-packages +branch=$(git rev-parse --abbrev-ref HEAD) +arch=$(dpkg --print-architecture) +ubuntu_version=$(lsb_release -cs) +github_url=$(git config --get remote.origin.url | sed 's/\.git$//') +fallback=true +if [[ $branch == "develop" || $branch == "main" ]]; then + fallback=false + + # Install mirte ros packages with apt from github, since they take ages to compile and it's easier to update them. + # colcon ignore those packages + + echo "Using precompiled version of mirte-ros-packages" + cd /home/mirte/mirte_ws/src/mirte-ros-packages || exit 1 + ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop mirte_base_control mirte_control) + packages='' + for i in "${ignore[@]}"; do + touch $i/COLCON_IGNORE + i_dash=$(echo $i | tr '_' '-') + packages="$packages ros-$ROS_NAME-$i_dash" + done + if [[ $branch == "develop" ]]; then + arch="${arch}_develop" + fi + echo "deb [trusted=yes] $github_url/raw/ros_mirte_${ROS_NAME}_${ubuntu_version}_${arch}/ ./" | sudo tee /etc/apt/sources.list.d/mirte-ros-packages.list + echo "yaml $github_url/raw/ros_mirte_${ROS_NAME}_${ubuntu_version}_${arch}/local.yaml ${ROS_NAME}" | sudo tee /etc/ros/rosdep/sources.list.d/mirte-ros-packages.list + sudo apt update + sudo apt install -y $packages || fallback=true +fi + +if $fallback; then + echo "Compiling mirte-ros-packages on-device" + cd /home/mirte/mirte_ws/src/mirte-ros-packages || exit 1 + find . -name ".COLCON_IGNORE" -type f -delete + # colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release +fi + +# do take + # Install source dependencies for slam sudo apt install ros-$ROS_NAME-slam-toolbox -y sudo apt install libboost-all-dev -y -git clone https://github.com/AlexKaravaev/ros2_laser_scan_matcher -git clone https://github.com/AlexKaravaev/csm +cd /home/mirte/mirte_ws/src || exit 1 +# git clone https://github.com/AlexKaravaev/ros2_laser_scan_matcher +# git clone https://github.com/AlexKaravaev/csm git clone https://github.com/ldrobotSensorTeam/ldlidar_stl_ros2 git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 -cd .. +cd .. || exit 1 rosdep install -y --from-paths src/ --ignore-src --rosdistro $ROS_NAME colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -grep -qxF "source /home/mirte/mirte_ws/install/setup.bash" /home/mirte/.bashrc || echo "source /home/mirte/mirte_ws/install/setup.bash" >>/home/mirte/.bashrc -grep -qxF "source /home/mirte/mirte_ws/install/setup.zsh" /home/mirte/.zshrc || echo "source /home/mirte/mirte_ws/install/setup.zsh" >>/home/mirte/.zshrc + +add_rc "source /home/mirte/mirte_ws/install/setup.bash" "source /home/mirte/mirte_ws/install/setup.zsh" # shellcheck source=/dev/null source /home/mirte/mirte_ws/install/setup.bash From 364645e5ee9bc54b701ac19b8fa4c346e40aff4a Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 15:41:24 +0100 Subject: [PATCH 181/353] disable systemctl in ros2-install --- .github/workflows/test_install.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 39fff60..22cda12 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -41,4 +41,5 @@ jobs: sudo apt update cd $MIRTE_SRC_DIR/mirte-install-scripts/ + sudo sed -i '/systemctl/d' install_ROS2.sh # remove systemctl command as it is not available in the github runner/container sudo ./install_ROS2.sh \ No newline at end of file From c33905cde043be218db28385a4457fe1b9cef508 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 15:46:59 +0100 Subject: [PATCH 182/353] test fix strange libgoogle-glog-dev install err --- .github/workflows/test_install.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 22cda12..90dce5a 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -42,4 +42,5 @@ jobs: sudo apt update cd $MIRTE_SRC_DIR/mirte-install-scripts/ sudo sed -i '/systemctl/d' install_ROS2.sh # remove systemctl command as it is not available in the github runner/container + sudo apt install libunwind-dev -y sudo ./install_ROS2.sh \ No newline at end of file From bc867154359eb427396bc272b0b512cbbbc5be69 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 11 Dec 2024 15:59:02 +0100 Subject: [PATCH 183/353] small cleanups install ros2 --- install_ROS2.sh | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index d2d8dad..08630d9 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -3,7 +3,7 @@ set -xe # IMPORTANT: # Do not upgrade apt-get since it will break the image. libc-bin will for some # reason break and not be able to install new stuff on the image. -# TODO: check above info +# TODO: check above info, no issues yet (2024-12-11) #TODO: get this as a parameter MIRTE_SRC_DIR=/usr/local/src/mirte @@ -32,8 +32,7 @@ fi sudo apt install -y ros-$ROS_NAME-ros-base sudo apt install -y ros-$ROS_NAME-xacro sudo apt install -y ros-dev-tools -grep -qxF "source /opt/ros/$ROS_NAME/setup.bash" /home/mirte/.bashrc || echo "source /opt/ros/$ROS_NAME/setup.bash" >>/home/mirte/.bashrc -# shellcheck source=/dev/null + source /opt/ros/$ROS_NAME/setup.bash sudo rosdep init rosdep update @@ -43,14 +42,13 @@ rosdep update sudo apt install -y python3-pip python3-wheel python3-setuptools python3-opencv libzbar0 sudo pip3 install pyzbar mergedeep -# Move custom settings to writabel filesystem +# TODO: move configs to mirte bringup #cp $MIRTE_SRC_DIR/mirte-ros-packages/mirte_telemetrix/config/mirte_user_settings.yaml /home/mirte/.user_settings.yaml #rm $MIRTE_SRC_DIR/mirte-ros-packages/mirte_telemetrix/config/mirte_user_settings.yaml #ln -s /home/mirte/.user_settings.yaml $MIRTE_SRC_DIR/mirte-ros-packages/config/mirte_user_settings.yaml # TODO: install in a separate workspace or install the debs. # Install Mirte ROS package -python3 -m pip install mergedeep mkdir -p /home/mirte/mirte_ws/src cd /home/mirte/mirte_ws/src ln -s $MIRTE_SRC_DIR/mirte-ros-packages . @@ -90,18 +88,13 @@ if $fallback; then echo "Compiling mirte-ros-packages on-device" cd /home/mirte/mirte_ws/src/mirte-ros-packages || exit 1 find . -name ".COLCON_IGNORE" -type f -delete - # colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release fi -# do take - -# Install source dependencies for slam -sudo apt install ros-$ROS_NAME-slam-toolbox -y sudo apt install libboost-all-dev -y cd /home/mirte/mirte_ws/src || exit 1 # git clone https://github.com/AlexKaravaev/ros2_laser_scan_matcher # git clone https://github.com/AlexKaravaev/csm -git clone https://github.com/ldrobotSensorTeam/ldlidar_stl_ros2 +# git clone https://github.com/ldrobotSensorTeam/ldlidar_stl_ros2 git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 cd .. || exit 1 rosdep install -y --from-paths src/ --ignore-src --rosdistro $ROS_NAME @@ -112,10 +105,6 @@ add_rc "source /home/mirte/mirte_ws/install/setup.bash" "source /home/mirte/mirt # shellcheck source=/dev/null source /home/mirte/mirte_ws/install/setup.bash -# install missing python dependencies rosbridge -#sudo apt install -y libffi-dev libjpeg-dev zlib1g-dev -#sudo pip3 install twisted pyOpenSSL autobahn tornado pymongo - # Add systemd service to start ROS nodes ROS_SERVICE_NAME=mirte-ros if [[ $MIRTE_TYPE == "mirte-master" ]]; then # master version should start a different launch file @@ -143,6 +132,9 @@ pip install . cd .. rm -rf colcon-top-level-workspace if [[ $MIRTE_TYPE == "mirte-master" ]]; then + # TODO: need to check and edit the next part: + sudo apt install ros-$ROS_NAME-slam-toolbox -y + # install lidar and depth camera cd /home/mirte/mirte_ws/src || exit 1 git clone https://github.com/Slamtec/rplidar_ros.git -b ros2 # FIXME-FUTURE: Can be installed in newer versions if V2.1.5 is released From cc76eeee8446fe9d6fecbfa6d37201f5be00bd6c Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 12 Dec 2024 10:13:15 +0100 Subject: [PATCH 184/353] remove old install code --- install_mirte.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/install_mirte.sh b/install_mirte.sh index 92508d7..10ed450 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -33,15 +33,6 @@ sudo apt install -y python3 python3-pip python3-setuptools sudo bash -c "echo '[global]' > /etc/pip.conf" sudo bash -c "echo 'extra-index-url=https://www.piwheels.org/simple' >> /etc/pip.conf" -# Install telemetrix -cd $MIRTE_SRC_DIR/mirte-telemetrix-aio || exit 1 -pip3 install . -cd $MIRTE_SRC_DIR/mirte-tmx-pico-aio || exit 1 -pip3 install . -cd $MIRTE_SRC_DIR/mirte-tmx-pico-aio -pip3 install . - -Install arduino firmata upload script cd $MIRTE_SRC_DIR/mirte-install-scripts ./install_arduino.sh @@ -113,6 +104,7 @@ pip3 install simpleaudio pyttsx3 || true # simpleaudio uses an old python instal # Install overlayfs and make sd card read only (software) sudo apt install -y overlayroot # Currently only instaling, not enabled + #sudo bash -c "echo 'overlayroot=\"tmpfs\"' >> /etc/overlayroot.conf" # remove force ipv4 From 37ff8e1be931a3ef585adaf2c1d9cbb698569ade Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 12 Dec 2024 16:11:38 +0100 Subject: [PATCH 185/353] cleanup --- install_ROS2.sh | 14 +++++++------- run-avrdude | 13 ------------- run_arduino.sh | 2 -- 3 files changed, 7 insertions(+), 22 deletions(-) delete mode 100755 run-avrdude diff --git a/install_ROS2.sh b/install_ROS2.sh index 08630d9..5a51b08 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -87,7 +87,7 @@ fi if $fallback; then echo "Compiling mirte-ros-packages on-device" cd /home/mirte/mirte_ws/src/mirte-ros-packages || exit 1 - find . -name ".COLCON_IGNORE" -type f -delete + find . -name "COLCON_IGNORE" -type f -delete fi sudo apt install libboost-all-dev -y @@ -110,13 +110,13 @@ ROS_SERVICE_NAME=mirte-ros if [[ $MIRTE_TYPE == "mirte-master" ]]; then # master version should start a different launch file ROS_SERVICE_NAME=mirte-master-ros fi -sudo rm /lib/systemd/system/$ROS_SERVICE_NAME.service || true -sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/$ROS_SERVICE_NAME.service /lib/systemd/system/ - +sudo rm /lib/systemd/system/mirte-ros.service || true +# uses same service name, but different links. The service file starts mirte_ros with the correct launch file as argument +sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/$ROS_SERVICE_NAME.service /lib/systemd/system/mirte-ros.service sudo systemctl daemon-reload -sudo systemctl stop $ROS_SERVICE_NAME || /bin/true -sudo systemctl start $ROS_SERVICE_NAME -sudo systemctl enable $ROS_SERVICE_NAME +sudo systemctl stop mirte-ros || /bin/true +sudo systemctl start mirte-ros +sudo systemctl enable mirte-ros sudo usermod -a -G video mirte sudo adduser mirte dialout diff --git a/run-avrdude b/run-avrdude deleted file mode 100755 index bd38927..0000000 --- a/run-avrdude +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -#TODO: this now only works for STM, also make nano work -#TODO: maybe merge this into run.sh from aruino repo? - -# Stop ROS when uploading new code -sudo service mirte-ros stop - -if test "$1" == "upload"; then - sudo arduino-cli upload -p /dev/ttyACM0 -b STM32:stm32:GenF1:pnum=BLACKPILL_F103C8,upload_method=dfu2Method,xserial=generic,usb=CDCgen,xusb=FS,opt=osstd,rtlib=nano -i /home/mirte/firmware.bin -else - objcopy --input-target=ihex --output-target=binary /tmp/sketch.hex /tmp/sketch.bin - runuser -l mirte -c 'sudo arduino-cli upload -p /dev/ttyACM0 -b STM32:stm32:GenF1:pnum=BLACKPILL_F103C8,upload_method=dfu2Method,xserial=generic,usb=CDCgen,xusb=FS,opt=osstd,rtlib=nano -i /tmp/sketch.bin' -fi diff --git a/run_arduino.sh b/run_arduino.sh index 07a1ec1..490f104 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -20,10 +20,8 @@ if [[ $COMMAND == build* ]]; then pio run elif test "$COMMAND" == "build_nano"; then pio run -e nanoatmega328new - arduino-cli -v compile --fqbn arduino:avr:nano:cpu=atmega328 /home/mirte/arduino_project/$PROJECT elif test "$COMMAND" == "build_nano_old"; then pio run -e nanoatmega328 - arduino-cli -v compile --fqbn arduino:avr:nano:cpu=atmega328old /home/mirte/arduino_project/$PROJECT elif test "$COMMAND" == "build_pico"; then cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 # shellcheck disable=SC2164 From 6f78217267f2d0dbbe1f65a4a3a0f8faf77a47bc Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 12 Dec 2024 16:16:57 +0100 Subject: [PATCH 186/353] Add expandoverlay service --- install_mirte.sh | 9 +++++++++ services/mirte-overlay.service | 12 ++++++++++++ services/mirte_expandoverlay.sh | 31 +++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 services/mirte-overlay.service create mode 100755 services/mirte_expandoverlay.sh diff --git a/install_mirte.sh b/install_mirte.sh index 10ed450..9bc56ec 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -105,6 +105,15 @@ pip3 install simpleaudio pyttsx3 || true # simpleaudio uses an old python instal sudo apt install -y overlayroot # Currently only instaling, not enabled +# Install overlayfs (done in sd image tools) +# Setup expand overlayfs +{ + # enable mirte-overlay service + sudo rm /lib/systemd/system/mirte-overlay.service || true + sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-overlay.service /lib/systemd/system/ + sudo systemctl enable mirte-overlay.service +} 2>&1 | sed -u 's/^/overlayfs::: /' & + #sudo bash -c "echo 'overlayroot=\"tmpfs\"' >> /etc/overlayroot.conf" # remove force ipv4 diff --git a/services/mirte-overlay.service b/services/mirte-overlay.service new file mode 100644 index 0000000..7dab1e9 --- /dev/null +++ b/services/mirte-overlay.service @@ -0,0 +1,12 @@ +[Unit] +Description=Mirte-overlay +After=mirte-ros.service + +[Service] +Type=oneshot +RemainAfterExit=false +ExecStart=/usr/local/src/mirte/mirte-install-scripts/services/mirte_expandoverlay.sh +TimeoutSec=30 +[Install] +WantedBy=multi-user.target +WantedBy=mirte-ros.service diff --git a/services/mirte_expandoverlay.sh b/services/mirte_expandoverlay.sh new file mode 100755 index 0000000..fb2a3a7 --- /dev/null +++ b/services/mirte_expandoverlay.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# check if overlayfs is mounted +if grep -qs 'overlayroot' /proc/mounts; then + echo "overlayroot is on." +else + echo "overlayroot is off. Exiting." + exit 0 +fi + +# check if /home/mirte/.overlay_expanded file exists +if [ -f /home/mirte/.overlay_expanded ]; then + echo "Overlay is already expanded." + exit 0 +fi + +# get partition of /media/root-rw +DISK_AND_PART=$(realpath /dev/disk/by-label/mirte_root) # always this name + +# remove p1 from $DISK_AND_PART +DISK=$(echo $DISK_AND_PART | sed 's/p.//') + +PART=$(echo $DISK_AND_PART | sed 's/.*p//') +cat < Date: Mon, 16 Dec 2024 10:57:31 +0100 Subject: [PATCH 187/353] Add executable check --- .github/workflows/shellcheck.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 199da69..eda7a85 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -15,3 +15,6 @@ jobs: uses: ludeeus/action-shellcheck@master with: severity: warning + - name: Check executable bit sh files + run: | + find . -type f -name "*.sh" -exec sh -c 'if ! test -x {}; then echo "File {} is not executable"; exit 1; fi' \; From 48e5f3a9a74e7119563cbeb3b343dd7945d65d33 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 19 Dec 2024 15:54:11 +0100 Subject: [PATCH 188/353] Fix shellcheck error source uanble to follow --- install_ROS2.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install_ROS2.sh b/install_ROS2.sh index 5a51b08..8271d44 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -33,6 +33,7 @@ sudo apt install -y ros-$ROS_NAME-ros-base sudo apt install -y ros-$ROS_NAME-xacro sudo apt install -y ros-dev-tools +# shellcheck source=/dev/null source /opt/ros/$ROS_NAME/setup.bash sudo rosdep init rosdep update From cdd443246f4a88d3b0f98b6803a4dff7b3f2b312 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 19 Dec 2024 15:55:35 +0100 Subject: [PATCH 189/353] Fix runs-on ubuntu22 for reposcheck --- .github/workflows/repocheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/repocheck.yml b/.github/workflows/repocheck.yml index fc914bf..929bd23 100644 --- a/.github/workflows/repocheck.yml +++ b/.github/workflows/repocheck.yml @@ -9,7 +9,7 @@ permissions: {} jobs: reposcheck: name: reposcheck - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - run: | From 64057be6d4672ffad289537975c9c224c324838f Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 19 Dec 2024 16:14:13 +0100 Subject: [PATCH 190/353] Add venv package --- install_mirte.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_mirte.sh b/install_mirte.sh index 08cb7eb..b083e63 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -27,7 +27,8 @@ cd $MIRTE_SRC_DIR || exit 1 ./download_repos.sh # Install dependencies to be able to run python3 (3.10 default) -sudo apt install -y python3 python3-pip python3-setuptools +sudo apt install -y python3 python3-pip python3-setuptools python3.10-venv + # Set piwheels as pip repo sudo bash -c "echo '[global]' > /etc/pip.conf" From ba1e79558ce08a298ae1a3301e431fe1f7669129 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 19 Dec 2024 16:21:32 +0100 Subject: [PATCH 191/353] Fix styling --- install_mirte.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install_mirte.sh b/install_mirte.sh index 6c370ec..5bea2a1 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -29,7 +29,6 @@ cd $MIRTE_SRC_DIR || exit 1 # Install dependencies to be able to run python3 (3.10 default) sudo apt install -y python3 python3-pip python3-setuptools python3.10-venv - # Set piwheels as pip repo sudo bash -c "echo '[global]' > /etc/pip.conf" sudo bash -c "echo 'extra-index-url=https://www.piwheels.org/simple' >> /etc/pip.conf" From 38edb8b6eef052ef9d714572d03faf375db30123 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 20 Dec 2024 13:13:21 +0100 Subject: [PATCH 192/353] maybe fix mirte ros install master --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 8271d44..46bc8b7 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -109,7 +109,7 @@ source /home/mirte/mirte_ws/install/setup.bash # Add systemd service to start ROS nodes ROS_SERVICE_NAME=mirte-ros if [[ $MIRTE_TYPE == "mirte-master" ]]; then # master version should start a different launch file - ROS_SERVICE_NAME=mirte-master-ros + ROS_SERVICE_NAME="mirte-master-ros" fi sudo rm /lib/systemd/system/mirte-ros.service || true # uses same service name, but different links. The service file starts mirte_ros with the correct launch file as argument From 9dd1fa6131330549c41a80b27a0a83f6edd69cac Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 20 Dec 2024 13:54:34 +0100 Subject: [PATCH 193/353] test mirte master type ci --- .github/workflows/test_install.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 90dce5a..0f47aa5 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -26,14 +26,16 @@ jobs: ros2-install: runs-on: ubuntu-latest - + strategy: + matrix: + type: [mirte, mirte-master] steps: - uses: actions/checkout@v4 - run: | sudo useradd -m -s /bin/bash mirte MIRTE_SRC_DIR=/usr/local/src/mirte sudo mkdir -p $MIRTE_SRC_DIR - + sudo mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ sudo cp -r ./* $MIRTE_SRC_DIR/mirte-install-scripts/ cd $MIRTE_SRC_DIR @@ -43,4 +45,5 @@ jobs: cd $MIRTE_SRC_DIR/mirte-install-scripts/ sudo sed -i '/systemctl/d' install_ROS2.sh # remove systemctl command as it is not available in the github runner/container sudo apt install libunwind-dev -y + export MIRTE_TYPE=${{ matrix.type }} sudo ./install_ROS2.sh \ No newline at end of file From 92e962d1b956298ac5233dd570b9982139819035 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 20 Dec 2024 13:55:45 +0100 Subject: [PATCH 194/353] ros2 install ubu22.04 ci --- .github/workflows/test_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 0f47aa5..a686c7f 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -25,7 +25,7 @@ jobs: sudo ./install_arduino.sh ros2-install: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: type: [mirte, mirte-master] From 8b62f11cc873526093a7ee8a5f47bea97340d277 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 20 Dec 2024 14:02:40 +0100 Subject: [PATCH 195/353] test2 ros install mirte-master --- .github/workflows/test_install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index a686c7f..13cea84 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -45,5 +45,5 @@ jobs: cd $MIRTE_SRC_DIR/mirte-install-scripts/ sudo sed -i '/systemctl/d' install_ROS2.sh # remove systemctl command as it is not available in the github runner/container sudo apt install libunwind-dev -y - export MIRTE_TYPE=${{ matrix.type }} - sudo ./install_ROS2.sh \ No newline at end of file + MIRTE_TYPE=${{ matrix.type }} + sudo . ./install_ROS2.sh \ No newline at end of file From a26e04c751baf5a527e2a637b2faf724d0af7e20 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 20 Dec 2024 14:03:37 +0100 Subject: [PATCH 196/353] . ->source --- .github/workflows/test_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 13cea84..e3cf4a8 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -46,4 +46,4 @@ jobs: sudo sed -i '/systemctl/d' install_ROS2.sh # remove systemctl command as it is not available in the github runner/container sudo apt install libunwind-dev -y MIRTE_TYPE=${{ matrix.type }} - sudo . ./install_ROS2.sh \ No newline at end of file + sudo source ./install_ROS2.sh \ No newline at end of file From 4fe4e7fc155f1f087c80e7ae06a7e0d38187da64 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 7 Jan 2025 12:24:34 +0100 Subject: [PATCH 197/353] test fix systemctl severed link master --- install_ROS2.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 46bc8b7..19e3900 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -107,13 +107,14 @@ add_rc "source /home/mirte/mirte_ws/install/setup.bash" "source /home/mirte/mirt source /home/mirte/mirte_ws/install/setup.bash # Add systemd service to start ROS nodes -ROS_SERVICE_NAME=mirte-ros if [[ $MIRTE_TYPE == "mirte-master" ]]; then # master version should start a different launch file - ROS_SERVICE_NAME="mirte-master-ros" + # rename the service file to the correct name, otherwise systemctl will error with a "Failed to look up unit file state: Link has been severed" error + mv $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-ros.service $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-ros-pioneer.service + mv $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-master-ros.service $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-ros.service fi sudo rm /lib/systemd/system/mirte-ros.service || true # uses same service name, but different links. The service file starts mirte_ros with the correct launch file as argument -sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/$ROS_SERVICE_NAME.service /lib/systemd/system/mirte-ros.service +sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-ros.service /lib/systemd/system/mirte-ros.service sudo systemctl daemon-reload sudo systemctl stop mirte-ros || /bin/true sudo systemctl start mirte-ros From 7094ce419a13cfcf1a1af6556d16dd5ec3dc1507 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 7 Jan 2025 13:23:17 +0100 Subject: [PATCH 198/353] change shell check actions --- .github/workflows/test_install.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index e3cf4a8..472e0d6 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -8,7 +8,8 @@ jobs: steps: - uses: actions/checkout@v4 - - run: | + - shell: bash + run: | mkdir -p /etc/udev/rules.d/ # just for testing, folder should just exist on the real image sudo useradd -m -s /bin/bash mirte MIRTE_SRC_DIR=/usr/local/src/mirte @@ -31,7 +32,8 @@ jobs: type: [mirte, mirte-master] steps: - uses: actions/checkout@v4 - - run: | + - shell: bash + run: | sudo useradd -m -s /bin/bash mirte MIRTE_SRC_DIR=/usr/local/src/mirte sudo mkdir -p $MIRTE_SRC_DIR From 9a5c1f4f9f6007c7d19bfe238d1a030a02a007c8 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 7 Jan 2025 13:25:52 +0100 Subject: [PATCH 199/353] check shell --- .github/workflows/test_install.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 472e0d6..aea4224 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -32,8 +32,9 @@ jobs: type: [mirte, mirte-master] steps: - uses: actions/checkout@v4 - - shell: bash + - shell: /bin/bash run: | + echo $0 sudo useradd -m -s /bin/bash mirte MIRTE_SRC_DIR=/usr/local/src/mirte sudo mkdir -p $MIRTE_SRC_DIR From dd2afec3dc0dc6e4d029c43e94bd78a6497545d6 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 7 Jan 2025 13:26:24 +0100 Subject: [PATCH 200/353] check shell 2 --- .github/workflows/test_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index aea4224..40030f7 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -32,7 +32,7 @@ jobs: type: [mirte, mirte-master] steps: - uses: actions/checkout@v4 - - shell: /bin/bash + - shell: bash run: | echo $0 sudo useradd -m -s /bin/bash mirte From 6c2641b1449391a10d60165916d5af676ca00154 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 7 Jan 2025 13:31:59 +0100 Subject: [PATCH 201/353] test ros2 install no sudo --- .github/workflows/test_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 40030f7..e6f3604 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -49,4 +49,4 @@ jobs: sudo sed -i '/systemctl/d' install_ROS2.sh # remove systemctl command as it is not available in the github runner/container sudo apt install libunwind-dev -y MIRTE_TYPE=${{ matrix.type }} - sudo source ./install_ROS2.sh \ No newline at end of file + source ./install_ROS2.sh \ No newline at end of file From 5c52b42a64c5d89b3657bfd923847883a7063ac7 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 7 Jan 2025 13:45:17 +0100 Subject: [PATCH 202/353] Fix ros2 isntall check --- .github/workflows/test_install.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index e6f3604..cd9cc4c 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -35,10 +35,9 @@ jobs: - shell: bash run: | echo $0 - sudo useradd -m -s /bin/bash mirte + sudo useradd -m -s /bin/bash mirte MIRTE_SRC_DIR=/usr/local/src/mirte sudo mkdir -p $MIRTE_SRC_DIR - sudo mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ sudo cp -r ./* $MIRTE_SRC_DIR/mirte-install-scripts/ cd $MIRTE_SRC_DIR @@ -49,4 +48,4 @@ jobs: sudo sed -i '/systemctl/d' install_ROS2.sh # remove systemctl command as it is not available in the github runner/container sudo apt install libunwind-dev -y MIRTE_TYPE=${{ matrix.type }} - source ./install_ROS2.sh \ No newline at end of file + sudo /bin/bash -c "MIRTE_TYPE=${{ matrix.type }} source ./install_ROS2.sh" \ No newline at end of file From 54663c25546b2b4349834310a78279a7003469cd Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 7 Jan 2025 16:57:09 +0100 Subject: [PATCH 203/353] Cleanups for platformio --- install_arduino.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/install_arduino.sh b/install_arduino.sh index 542a6d5..6314ff3 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -40,10 +40,11 @@ cmake .. -DCMAKE_BUILD_TYPE=Release make -j sudo make install cd $MIRTE_SRC_DIR/mirte-install-scripts/ -# Already build all versions so only upload is needed -./run_arduino.sh build Telemetrix4Arduino -./run_arduino.sh build_nano Telemetrix4Arduino -./run_arduino.sh build_nano_old Telemetrix4Arduino +# Already build all versions so only upload is needed *don't do for all, as it requires loads of space for the tools. +# ./run_arduino.sh build Telemetrix4Arduino +./run_arduino.sh upload_nano Telemetrix4Arduino # 'try to upload to the nano', to also install the upload tools. +# ./run_arduino.sh build_nano_old Telemetrix4Arduino ./run_arduino.sh build_pico +pio system prune -f # Add mirte to dialout sudo adduser mirte dialout From 8f4e1b1f135875dce7035dee8b9ddd0e91c377fd Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 7 Jan 2025 17:02:01 +0100 Subject: [PATCH 204/353] Force git submodule update tmx pico --- install_arduino.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install_arduino.sh b/install_arduino.sh index 6314ff3..d74cd8b 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -39,6 +39,10 @@ cd build || exit 1 cmake .. -DCMAKE_BUILD_TYPE=Release make -j sudo make install + +cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 +git submodule update --init --recursive + cd $MIRTE_SRC_DIR/mirte-install-scripts/ # Already build all versions so only upload is needed *don't do for all, as it requires loads of space for the tools. # ./run_arduino.sh build Telemetrix4Arduino From b7edcc3411da04603aa08079dacad4cf1588c691 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 7 Jan 2025 17:16:06 +0100 Subject: [PATCH 205/353] build pico better run_arduino --- run_arduino.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/run_arduino.sh b/run_arduino.sh index 490f104..03d31b9 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -14,6 +14,15 @@ if [[ $COMMAND == upload* ]] && [[ $ROS_RUNNING == "1" ]]; then # test for any u fi cd $MIRTE_SRC_DIR/$PROJECT || exit 1 +buildpico() { + cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 + # shellcheck disable=SC2164 + mkdir -p build && cd build + cmake .. -DCMAKE_BUILD_TYPE=Release + make +} + + # Different build scripts if [[ $COMMAND == build* ]]; then if test "$COMMAND" == "build"; then @@ -23,11 +32,7 @@ if [[ $COMMAND == build* ]]; then elif test "$COMMAND" == "build_nano_old"; then pio run -e nanoatmega328 elif test "$COMMAND" == "build_pico"; then - cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 - # shellcheck disable=SC2164 - cd build || mkdir build && cd build - cmake .. - make + buildpico else echo "Unknown build command $COMMAND" exit 1 @@ -41,6 +46,7 @@ elif [[ $COMMAND == upload* ]]; then elif test "$COMMAND" == "upload_nano_old"; then pio run -e nanoatmega328 -t upload elif test "$1" == "upload_pico"; then + buildpico # This will always upload telemetrix4rpipico.uf2, so no need to pass a file sudo picotool load -f $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/Telemetrix4RpiPico.uf2 retVal=$? From bac304220960e215616ef325ad8bdc36a6448e49 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 7 Jan 2025 17:47:45 +0100 Subject: [PATCH 206/353] blink improvements --- blink.sh | 68 ++++++++++++++++++++++++++++---------------------- run_arduino.sh | 1 - 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/blink.sh b/blink.sh index 7594ed1..7d11818 100755 --- a/blink.sh +++ b/blink.sh @@ -11,43 +11,51 @@ if [ "$RPI" ]; then echo none >/sys/class/leds/PWR/trigger fi -red_on() { - if [ "$OPI" ]; then - echo 'default-on' >/sys/class/leds/orangepi\:red\:status/trigger - elif [ "$OPI2" ]; then - echo '255' >/sys/class/leds/orangepi\:red\:power/brightness - elif [ "$RPI" ]; then - echo 1 >/sys/class/leds/PWR/brightness +findleds() { + LEDS_ALL=$(ls /sys/class/leds) + # try to set green as first led, red as second + # if not found, set the first two leds found + if echo "$LEDS_ALL" | grep -q "green"; then + GR_LED="$(echo "$LEDS_ALL" | grep "green")" + elif echo "$LEDS_ALL" | grep -q "ACT"; then + GR_LED="$(echo "$LEDS_ALL" | grep "ACT")" + else + GR_LED="$(echo "$LEDS_ALL" | head -n 1)" + fi + + if echo "$LEDS_ALL" | grep -q "red"; then + RED_LED="$(echo "$LEDS_ALL" | grep "red")" + elif echo "$LEDS_ALL" | grep -q "PWR"; then + RED_LED="$(echo "$LEDS_ALL" | grep "PWR")" + else + RED_LED="$(echo "$LEDS_ALL" | head -n 2 | tail -n 1)" fi + + echo "RED: $RED_LED" + echo "GREEN: $GR_LED" +} +findleds +# store trigger to reset later, take only part in [ ] to remove the list of options +GR_TRIGGER="$(cat /sys/class/leds/$GR_LED/trigger | awk -F'[][]' '{print $2}')" +RED_TRIGGER="$(cat /sys/class/leds/$RED_LED/trigger | awk -F'[][]' '{print $2}')" + +echo "none" >/sys/class/leds/$GR_LED/trigger +echo "none" >/sys/class/leds/$RED_LED/trigger + + +red_on() { + echo 'default-on' >/sys/class/leds/$RED_LED/trigger } red_off() { - if [ "$OPI" ]; then - echo 'none' >/sys/class/leds/orangepi\:red\:status/trigger - elif [ "$OPI2" ]; then - echo '0' >/sys/class/leds/orangepi\:red\:power/brightness - elif [ "$RPI" ]; then - echo '0' >/sys/class/leds/PWR/brightness - fi + echo 'none' >/sys/class/leds/$RED_LED/trigger } green_on() { - if [ "$OPI" ]; then - echo 'default-on' >/sys/class/leds/orangepi\:green\:pwr/trigger - elif [ "$OPI2" ]; then - echo '255' >/sys/class/leds/orangepi\:green\:status/brightness - elif [ "$RPI" ]; then - echo 1 >/sys/class/leds/ACT/brightness - fi + echo 'default-on' >/sys/class/leds/$GR_LED/trigger } green_off() { - if [ "$OPI" ]; then - echo 'none' >/sys/class/leds/orangepi\:green\:pwr/trigger - elif [ "$OPI2" ]; then - echo '0' >/sys/class/leds/orangepi\:green\:status/brightness - elif [ "$RPI" ]; then - echo 0 >/sys/class/leds/ACT/brightness - fi + echo 'none' >/sys/class/leds/$GR_LED/trigger } echo "Blinking" @@ -101,5 +109,5 @@ for ((repeat = 0; repeat < 5; repeat++)); do done # Reset to defaults -green_on -red_off +echo "$GR_TRIGGER" >/sys/class/leds/$GR_LED/trigger +echo "$RED_TRIGGER" >/sys/class/leds/$RED_LED/trigger \ No newline at end of file diff --git a/run_arduino.sh b/run_arduino.sh index 03d31b9..dcc4ff6 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -22,7 +22,6 @@ buildpico() { make } - # Different build scripts if [[ $COMMAND == build* ]]; then if test "$COMMAND" == "build"; then From 4771ac4236f205b7f59779d9b096cbca313f69ca Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 7 Jan 2025 17:53:09 +0100 Subject: [PATCH 207/353] test smaller build --- install_arduino.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install_arduino.sh b/install_arduino.sh index d74cd8b..b692b23 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -21,6 +21,12 @@ pio --version add_rc 'export PATH=$PATH:$HOME/.local/bin' # Install picotool for the Raspberry Pi Pico sudo apt install gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib build-essential pkg-config libusb-1.0-0-dev cmake -y + +# Remove newlib versions that are not compatible with the pico or pico2, otherwise it takes 2GB of space +cd /usr/lib/arm-none-eabi/newlib/thumb || true +rm -rf v8-a* || true +rm -rf v7* || true + cd $MIRTE_SRC_DIR || exit 1 mkdir pico/ cd pico/ || exit 1 From 5a9655a530c8321826a7b82a5995f7b3bef29adb Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 8 Jan 2025 11:31:39 +0100 Subject: [PATCH 208/353] Fixes for run_arduino and blink --- blink.sh | 21 ++++++--------------- install_arduino.sh | 11 +++++++---- run_arduino.sh | 21 +++++++++++++++++++-- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/blink.sh b/blink.sh index 7d11818..dcceb14 100755 --- a/blink.sh +++ b/blink.sh @@ -2,14 +2,6 @@ BLINK_SPEED=.5 VALUE=$1 -OPI=$(uname -a | grep sunxi) -OPI2=$(grep "Orange Pi Zero 2" /proc/device-tree/model) -RPI=$(grep -a "Raspberry" /proc/device-tree/model) - -if [ "$RPI" ]; then - echo none >/sys/class/leds/ACT/trigger - echo none >/sys/class/leds/PWR/trigger -fi findleds() { LEDS_ALL=$(ls /sys/class/leds) @@ -35,14 +27,13 @@ findleds() { echo "GREEN: $GR_LED" } findleds -# store trigger to reset later, take only part in [ ] to remove the list of options -GR_TRIGGER="$(cat /sys/class/leds/$GR_LED/trigger | awk -F'[][]' '{print $2}')" -RED_TRIGGER="$(cat /sys/class/leds/$RED_LED/trigger | awk -F'[][]' '{print $2}')" +# store trigger to reset later to, take only part in [ ] to remove the list of options +# GR_TRIGGER="$(cat /sys/class/leds/$GR_LED/trigger | awk -F'[][]' '{print $2}')" +# RED_TRIGGER="$(cat /sys/class/leds/$RED_LED/trigger | awk -F'[][]' '{print $2}')" echo "none" >/sys/class/leds/$GR_LED/trigger echo "none" >/sys/class/leds/$RED_LED/trigger - red_on() { echo 'default-on' >/sys/class/leds/$RED_LED/trigger } @@ -108,6 +99,6 @@ for ((repeat = 0; repeat < 5; repeat++)); do done done -# Reset to defaults -echo "$GR_TRIGGER" >/sys/class/leds/$GR_LED/trigger -echo "$RED_TRIGGER" >/sys/class/leds/$RED_LED/trigger \ No newline at end of file +# Set to nice blinking, defaults are often heartbeat and off. +echo "activity" >/sys/class/leds/$GR_LED/trigger +echo "heartbeat" >/sys/class/leds/$RED_LED/trigger diff --git a/install_arduino.sh b/install_arduino.sh index b692b23..ceb46ca 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -19,24 +19,27 @@ ln -s ~/.platformio/penv/bin/piodebuggdb ~/.local/bin/piodebuggdb pio --version add_rc 'export PATH=$PATH:$HOME/.local/bin' + +curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/system/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules + # Install picotool for the Raspberry Pi Pico sudo apt install gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib build-essential pkg-config libusb-1.0-0-dev cmake -y # Remove newlib versions that are not compatible with the pico or pico2, otherwise it takes 2GB of space cd /usr/lib/arm-none-eabi/newlib/thumb || true -rm -rf v8-a* || true -rm -rf v7* || true +sudo rm -rf v8-a* || true +sudo rm -rf v7* || true cd $MIRTE_SRC_DIR || exit 1 mkdir pico/ cd pico/ || exit 1 -git clone https://github.com/raspberrypi/pico-sdk.git --recursive # somehow needed for picotool +git clone https://github.com/raspberrypi/pico-sdk.git --recursive --depth=1 # somehow needed for picotool ls realpath pico-sdk ls export PICO_SDK_PATH=$MIRTE_SRC_DIR/pico/pico-sdk add_rc "export PICO_SDK_PATH=$MIRTE_SRC_DIR/pico/pico-sdk" -git clone https://github.com/raspberrypi/picotool.git +git clone https://github.com/raspberrypi/picotool.git --depth=1 # shallow clone to save space cd picotool || exit 1 sudo cp udev/99-picotool.rules /etc/udev/rules.d/ diff --git a/run_arduino.sh b/run_arduino.sh index dcc4ff6..5ed2661 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -1,9 +1,22 @@ #!/bin/bash #TODO: script should have format ./run.sh build|upload] mcu_type +COMMAND=$1 + +if [ -z "$COMMAND" ]; then + echo "Usage: $0 build_[mcu] | upload_[mcu]" + echo "Example: $0 build_nano" + echo "MCU types: nano, nano_old, pico, stm32" + exit 1 +fi + MIRTE_SRC_DIR=/usr/local/src/mirte # Check if ROS is running -ROS_RUNNING=$(systemctl is-active mirte-ros || /bin/true) -COMMAND=$1 +ROS_RUNNING=1 +systemctl is-active mirte-ros | grep 'inactive' &>/dev/null +if [ $? == 0 ]; then + ROS_RUNNING=0 +fi +echo "ROS_RUNNING: $ROS_RUNNING" PROJECT="mirte-telemetrix4arduino" # Stop ROS when uploading new code STOPPED_ROS=false @@ -25,10 +38,12 @@ buildpico() { # Different build scripts if [[ $COMMAND == build* ]]; then if test "$COMMAND" == "build"; then + echo "Building all versions, this will take a while and might need internet connection for tools" pio run elif test "$COMMAND" == "build_nano"; then pio run -e nanoatmega328new elif test "$COMMAND" == "build_nano_old"; then + echo "Building non-default mcu, might need internet connection for tools" pio run -e nanoatmega328 elif test "$COMMAND" == "build_pico"; then buildpico @@ -39,10 +54,12 @@ if [[ $COMMAND == build* ]]; then elif [[ $COMMAND == upload* ]]; then # Different upload scripts if test "$COMMAND" == "upload" || test "$COMMAND" == "upload_stm32"; then + echo "Uploading to non-default mcu, might need internet connection for tools" pio run -e robotdyn_blackpill_f303cc -t upload elif test "$COMMAND" == "upload_nano"; then pio run -e nanoatmega328new -t upload elif test "$COMMAND" == "upload_nano_old"; then + echo "Uploading to non-default mcu, might need internet connection for tools" pio run -e nanoatmega328 -t upload elif test "$1" == "upload_pico"; then buildpico From 2d6c708722c76793e3de118b3e3d66c4e2b1c2a6 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 13 Jan 2025 18:19:33 +0100 Subject: [PATCH 209/353] update submodules --- install_ROS2.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install_ROS2.sh b/install_ROS2.sh index 19e3900..a350f9d 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -56,6 +56,7 @@ ln -s $MIRTE_SRC_DIR/mirte-ros-packages . # if mirte-ros-packages is from main or develop, use the precompiled version, otherwise compile on-device cd $MIRTE_SRC_DIR/mirte-ros-packages +git submodule update --init --recursive branch=$(git rev-parse --abbrev-ref HEAD) arch=$(dpkg --print-architecture) ubuntu_version=$(lsb_release -cs) From 83c2c0bb82b4a3e03b7a81612f9306c3fba79603 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 15 Jan 2025 11:17:45 +0100 Subject: [PATCH 210/353] Fix precompiled ros2 packages --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index a350f9d..b278163 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -70,7 +70,7 @@ if [[ $branch == "develop" || $branch == "main" ]]; then echo "Using precompiled version of mirte-ros-packages" cd /home/mirte/mirte_ws/src/mirte-ros-packages || exit 1 - ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop mirte_base_control mirte_control) + ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop mirte_control/mirte_master_base_control mirte_control/mirte_master_arm_control mirte_control/mirte_pioneer_control) packages='' for i in "${ignore[@]}"; do touch $i/COLCON_IGNORE From 9c226a82b4f719ff738853247cbf65dce0a58e7f Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 17 Jan 2025 17:09:04 +0100 Subject: [PATCH 211/353] disable fallback as mirte-arm doesn't compile --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index b278163..0c572cf 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -83,7 +83,7 @@ if [[ $branch == "develop" || $branch == "main" ]]; then echo "deb [trusted=yes] $github_url/raw/ros_mirte_${ROS_NAME}_${ubuntu_version}_${arch}/ ./" | sudo tee /etc/apt/sources.list.d/mirte-ros-packages.list echo "yaml $github_url/raw/ros_mirte_${ROS_NAME}_${ubuntu_version}_${arch}/local.yaml ${ROS_NAME}" | sudo tee /etc/ros/rosdep/sources.list.d/mirte-ros-packages.list sudo apt update - sudo apt install -y $packages || fallback=true + sudo apt install -y $packages || fallback=false # TODO: disabled fallback for now as mirte-arm doesn't compile. fi if $fallback; then From 3a1a18f82c019a445c3036b5d1a215c25896b166 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 22 Jan 2025 13:45:10 +0100 Subject: [PATCH 212/353] fix mirte master check always triggering wrong topic name --- services/mirte_master_check.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/mirte_master_check.sh b/services/mirte_master_check.sh index 50bc265..8550275 100755 --- a/services/mirte_master_check.sh +++ b/services/mirte_master_check.sh @@ -4,12 +4,13 @@ set -x . /home/mirte/mirte_ws/install/setup.bash SECONDS=0 WARN_LVL=0 +mirte_space=$(cat /etc/hostname | tr '[:upper:]' '[:lower:]' | tr '-' '_') while true; do OK=false # echo "topics" percentage=$( - (ros2 topic echo /mirte/power/power_watcher --once | grep percentage | tail -1) & + (ros2 topic echo /$mirte_space/io/power/power_watcher --once | grep percentage | tail -1) & pid=$! (sleep 5 && kill -9 $pid) 2>/dev/null & watcher=$! From 3d163e808946efef4e04c0a5669c2f175443ca05 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 22 Jan 2025 21:16:10 +0100 Subject: [PATCH 213/353] fix? install ros2? --- install_ROS2.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 0c572cf..f618695 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -70,7 +70,7 @@ if [[ $branch == "develop" || $branch == "main" ]]; then echo "Using precompiled version of mirte-ros-packages" cd /home/mirte/mirte_ws/src/mirte-ros-packages || exit 1 - ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop mirte_control/mirte_master_base_control mirte_control/mirte_master_arm_control mirte_control/mirte_pioneer_control) + ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop ) # mirte_control/mirte_master_base_control mirte_control/mirte_master_arm_control mirte_control/mirte_pioneer_control # TODO: this doesn't work with subfolders packages='' for i in "${ignore[@]}"; do touch $i/COLCON_IGNORE @@ -83,7 +83,7 @@ if [[ $branch == "develop" || $branch == "main" ]]; then echo "deb [trusted=yes] $github_url/raw/ros_mirte_${ROS_NAME}_${ubuntu_version}_${arch}/ ./" | sudo tee /etc/apt/sources.list.d/mirte-ros-packages.list echo "yaml $github_url/raw/ros_mirte_${ROS_NAME}_${ubuntu_version}_${arch}/local.yaml ${ROS_NAME}" | sudo tee /etc/ros/rosdep/sources.list.d/mirte-ros-packages.list sudo apt update - sudo apt install -y $packages || fallback=false # TODO: disabled fallback for now as mirte-arm doesn't compile. + sudo apt install -y -m $packages || fallback=false # TODO: disabled fallback for now as mirte-arm doesn't compile. fi if $fallback; then From 6c4dccd62431559e7972526d9b6d0b06b18ced33 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 22 Jan 2025 21:37:53 +0100 Subject: [PATCH 214/353] style fixes --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index f618695..77187d2 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -70,7 +70,7 @@ if [[ $branch == "develop" || $branch == "main" ]]; then echo "Using precompiled version of mirte-ros-packages" cd /home/mirte/mirte_ws/src/mirte-ros-packages || exit 1 - ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop ) # mirte_control/mirte_master_base_control mirte_control/mirte_master_arm_control mirte_control/mirte_pioneer_control # TODO: this doesn't work with subfolders + ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop) # mirte_control/mirte_master_base_control mirte_control/mirte_master_arm_control mirte_control/mirte_pioneer_control # TODO: this doesn't work with subfolders packages='' for i in "${ignore[@]}"; do touch $i/COLCON_IGNORE From 0b3a8f6f21ab3d27de23661ee6ca7d0f0409774e Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 23 Jan 2025 09:25:24 +0100 Subject: [PATCH 215/353] don't install wifi connect x86 --- network_install.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/network_install.sh b/network_install.sh index b575edb..4a47043 100755 --- a/network_install.sh +++ b/network_install.sh @@ -24,11 +24,13 @@ sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf' MY_ARCH=$(arch) if [[ "$MY_ARCH" == "armv7l" ]]; then MY_ARCH="rpi"; fi # TODO: This version is from Feb 20, 2023 maybe upgrade soon... -wget "https://github.com/balena-os/wifi-connect/releases/download/v4.11.1/wifi-connect-v4.11.1-linux-$(echo "$MY_ARCH").zip" -unzip wifi-connect* -sudo mv wifi-connect /usr/local/sbin -rm wifi-connect* - +# skip if amd64 +if [[ "$MY_ARCH" != "x86_64" ]]; then + wget "https://github.com/balena-os/wifi-connect/releases/download/v4.11.1/wifi-connect-v4.11.1-linux-$(echo "$MY_ARCH").zip" + unzip wifi-connect* + sudo mv wifi-connect /usr/local/sbin + rm wifi-connect* +fi # Added systemd service to account for fix: https://askubuntu.com/questions/472794/hostapd-error-nl80211-could-not-configure-driver-mode sudo rm /lib/systemd/system/mirte-ap.service || true sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-ap.service /lib/systemd/system/ From a517d0c80aebcbf27c181de467b1cc8fd2b7fd6c Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 28 Jan 2025 09:17:49 +0000 Subject: [PATCH 216/353] fix pico folder --- run_arduino.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_arduino.sh b/run_arduino.sh index 5ed2661..96024da 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -64,7 +64,7 @@ elif [[ $COMMAND == upload* ]]; then elif test "$1" == "upload_pico"; then buildpico # This will always upload telemetrix4rpipico.uf2, so no need to pass a file - sudo picotool load -f $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/Telemetrix4RpiPico.uf2 + sudo picotool load -f $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico.uf2 retVal=$? if [ $retVal -ne 0 ]; then echo "Failed to upload to Pico" From a3a479973d4af7cffbf1b1270b4306ecd9efafea Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 31 Jan 2025 13:57:40 +0000 Subject: [PATCH 217/353] start uart upload pico --- install_arduino.sh | 2 ++ run_arduino.sh | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/install_arduino.sh b/install_arduino.sh index ceb46ca..ae62bfc 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -51,6 +51,8 @@ sudo make install cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 git submodule update --init --recursive +pip install -U "pip>=25" # pico-py-serial-flash requires a newer version of pip, otherwise it'll be installed as UNKNOWN package +pip install git+https://github.com/arendjan/pico-py-serial-flash.git@cli # uart flashing utility when using the pcb cd $MIRTE_SRC_DIR/mirte-install-scripts/ # Already build all versions so only upload is needed *don't do for all, as it requires loads of space for the tools. diff --git a/run_arduino.sh b/run_arduino.sh index 96024da..78d7766 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -35,6 +35,13 @@ buildpico() { make } +upload_pico_uart() { + # for each port in /dev/serial/by-id + # try to upload + # send reboot command + # run pico upload +} + # Different build scripts if [[ $COMMAND == build* ]]; then if test "$COMMAND" == "build"; then @@ -64,10 +71,12 @@ elif [[ $COMMAND == upload* ]]; then elif test "$1" == "upload_pico"; then buildpico # This will always upload telemetrix4rpipico.uf2, so no need to pass a file - sudo picotool load -f $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico.uf2 - retVal=$? - if [ $retVal -ne 0 ]; then - echo "Failed to upload to Pico" + ERR=false + sudo picotool load -f $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico_combinedf.uf2 || ERR=true + echo $ERR + if [ $ERR ]; then + echo "Failed to upload to Pico using picotool" + upload_pico_uart echo "Please check the connection and try again" echo "Or unplug the Pico, press the BOOTSEL button and plug it in again" exit 1 From caf1688487b847cb83ecc56326e73a23df16fb7a Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 31 Jan 2025 16:01:30 +0100 Subject: [PATCH 218/353] add upload pico uart to run_arduino --- run_arduino.sh | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/run_arduino.sh b/run_arduino.sh index 78d7766..ac2462e 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -1,4 +1,5 @@ #!/bin/bash +# set -xe #TODO: script should have format ./run.sh build|upload] mcu_type COMMAND=$1 @@ -31,15 +32,28 @@ buildpico() { cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 # shellcheck disable=SC2164 mkdir -p build && cd build - cmake .. -DCMAKE_BUILD_TYPE=Release + cmake .. -DCMAKE_BUILD_TYPE=Debug make } upload_pico_uart() { - # for each port in /dev/serial/by-id - # try to upload - # send reboot command - # run pico upload + for port in /dev/serial/by-id/*; do # these are only the usb serial ports, not all the other uart ports. + port=$(realpath $port) + # send reboot command + stty 115200 -F $port + echo -ne '\x01\x25' > $port # 1 byte message, message id 0x25==reset_to_bootloader + sleep 1 + # try to upload + ERR=false + pico_py_serial_flasher $port $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico_combined.elf || ERR=true + if $ERR; then + echo "Failed to upload to Pico using pico_py_serial_flash port $port" + else + echo "Successfully uploaded to Pico using pico_py_serial_flash port $port" + return 0 + fi + done + return 1 } # Different build scripts @@ -72,16 +86,20 @@ elif [[ $COMMAND == upload* ]]; then buildpico # This will always upload telemetrix4rpipico.uf2, so no need to pass a file ERR=false - sudo picotool load -f $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico_combinedf.uf2 || ERR=true - echo $ERR - if [ $ERR ]; then - echo "Failed to upload to Pico using picotool" + sudo picotool load -f $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico_combined.uf2 || ERR=true + sleep 1 + sudo picotool reboot || true # just to make sure, sometimes it does not reboot automatically + if $ERR; then + echo "Failed to upload to Pico using picotool, trying using uart" upload_pico_uart - echo "Please check the connection and try again" - echo "Or unplug the Pico, press the BOOTSEL button and plug it in again" - exit 1 + FAILED=$? + if [ $FAILED -eq 1 ]; then + echo "Failed to upload using uart." + echo "Please check the connection and try again" + echo "Or unplug the Pico, press the BOOTSEL button and plug it in again" + exit 1 + fi fi - sudo picotool reboot # just to make sure, sometimes it does not reboot automatically else echo "Unknown upload command $COMMAND" exit 1 From 81414054337a4ede5a25d2df30702f8d8545c11e Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 31 Jan 2025 16:21:07 +0100 Subject: [PATCH 219/353] stylefixes run_arduino --- install_arduino.sh | 3 ++- run_arduino.sh | 4 ++-- tools.sh | 0 3 files changed, 4 insertions(+), 3 deletions(-) mode change 100644 => 100755 tools.sh diff --git a/install_arduino.sh b/install_arduino.sh index ae62bfc..440d463 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -51,7 +51,8 @@ sudo make install cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 git submodule update --init --recursive -pip install -U "pip>=25" # pico-py-serial-flash requires a newer version of pip, otherwise it'll be installed as UNKNOWN package + +pip install -U "pip>=25" # pico-py-serial-flash requires a newer version of pip, otherwise it'll be installed as UNKNOWN package pip install git+https://github.com/arendjan/pico-py-serial-flash.git@cli # uart flashing utility when using the pcb cd $MIRTE_SRC_DIR/mirte-install-scripts/ diff --git a/run_arduino.sh b/run_arduino.sh index ac2462e..0269167 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -41,9 +41,9 @@ upload_pico_uart() { port=$(realpath $port) # send reboot command stty 115200 -F $port - echo -ne '\x01\x25' > $port # 1 byte message, message id 0x25==reset_to_bootloader + echo -ne '\x01\x25' >$port # 1 byte message, message id 0x25==reset_to_bootloader sleep 1 - # try to upload + # try to upload ERR=false pico_py_serial_flasher $port $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico_combined.elf || ERR=true if $ERR; then diff --git a/tools.sh b/tools.sh old mode 100644 new mode 100755 From 3fc810e18be0a14086acaba0f9064f34a0a83f70 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 31 Jan 2025 17:32:45 +0100 Subject: [PATCH 220/353] upd default repos files for aj dev --- repos.yaml | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/repos.yaml b/repos.yaml index 7f342c7..e362f25 100644 --- a/repos.yaml +++ b/repos.yaml @@ -6,32 +6,20 @@ repositories: mirte-telemetrix4arduino: type: git url: https://github.com/mirte-robot/Telemetrix4Arduino.git - version: master + version: develop mirte-install-scripts: type: git - url: https://github.com/mirte-robot/mirte-install-scripts.git + url: https://github.com/arendjan/mirte-install-scripts.git version: develop - # mirte-telemetrix-aio: - # type: git - # url: https://github.com/mirte-robot/telemetrix-aio.git - # version: master - # mirte-tmx-pico-aio: - # type: git - # url: https://github.com/arendjan/tmx-pico-aio.git - # version: modules mirte-ros-packages: type: git - url: https://github.com/mirte-robot/mirte-ros-packages.git + url: https://github.com/arendjan/mirte-ros-packages.git version: develop recursive: true mirte-oled-images: type: git url: https://github.com/mirte-robot/mirte-oled-images.git version: main - mirte-arduino-libraries: - type: git - url: https://github.com/mirte-robot/mirte-arduino-libraries.git - version: main mirte-python: type: git url: https://github.com/mirte-robot/mirte-python.git @@ -43,9 +31,5 @@ repositories: mirte-telemetrix4rpipico: type: git url: https://github.com/mirte-robot/Telemetrix4RpiPico.git - version: develop - # mirte-telemetrix-cpp: - # type: git - # url: https://github.com/mirte-robot/mirte-telemetrix-cpp.git - # version: mirte-pioneer - + recursive: true + version: develop \ No newline at end of file From 0644e72ce9a7093ca3e83109841ae203d6660ea8 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 5 Feb 2025 21:37:38 +0100 Subject: [PATCH 221/353] Fix shutdown always triggering --- services/mirte-shutdown.service | 1 + 1 file changed, 1 insertion(+) diff --git a/services/mirte-shutdown.service b/services/mirte-shutdown.service index 9df45c4..fa425d8 100755 --- a/services/mirte-shutdown.service +++ b/services/mirte-shutdown.service @@ -3,6 +3,7 @@ Description=Mirte-shutdown After=mirte-ros.service [Service] +User=mirte Type=oneshot RemainAfterExit=true ExecStart=/usr/local/src/mirte/mirte-install-scripts/services/mirte_boot.sh From 0a03beb4f2a67db0b5722dd9b35a916b428f24fa Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 5 Feb 2025 21:42:58 +0100 Subject: [PATCH 222/353] Fix camera permissions setup --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 77187d2..a0839ec 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -165,7 +165,7 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then source ./install/setup.bash cd src/ros2_astra_camera/astra_camera chmod +x ./scripts/install.sh || true - ./scripts/install.sh || true + sudo ./scripts/install.sh || true sudo udevadm control --reload && sudo udevadm trigger cd ../../rplidar_ros chmod +x ./scripts/create_udev_rules.sh || true From 42b030f296a345c6be722455e0f994e9fc58af1e Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 5 Feb 2025 21:52:58 +0100 Subject: [PATCH 223/353] switch to correct camera repo --- install_ROS2.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index a0839ec..be2bf57 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -142,8 +142,7 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then cd /home/mirte/mirte_ws/src || exit 1 git clone https://github.com/Slamtec/rplidar_ros.git -b ros2 # FIXME-FUTURE: Can be installed in newer versions if V2.1.5 is released - git clone https://github.com/rafal-gorecki/ros2_astra_camera.git -b master # compressed images image transport fixes, fork of orbbec/... - # git clone https://github.com/SuperJappie08/ros2_astra_camera.git -b dep-fix # compressed images image transport fixes, fork of orbbec/... # Fork of Fork: Fix dependencies + git clone https://github.com/ArendJan/ros2_astra_camera.git -b fix-ros-jammy # compressed images image transport fixes, fork of orbbec/... with also lazy nodes git clone https://github.com/clearpathrobotics/clearpath_mecanum_drive_controller # FIXME: Can be installed from apt? why build? cd ../../ mkdir temp From 0132d88374f531e2385ca2b2747ddf6f66eb4195 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 5 Feb 2025 21:56:56 +0100 Subject: [PATCH 224/353] fix test failing pip install pip --- install_arduino.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_arduino.sh b/install_arduino.sh index 440d463..1b65ca9 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -52,7 +52,7 @@ sudo make install cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 git submodule update --init --recursive -pip install -U "pip>=25" # pico-py-serial-flash requires a newer version of pip, otherwise it'll be installed as UNKNOWN package +pip install -U "pip>=25" || true # pico-py-serial-flash requires a newer version of pip, otherwise it'll be installed as UNKNOWN package pip install git+https://github.com/arendjan/pico-py-serial-flash.git@cli # uart flashing utility when using the pcb cd $MIRTE_SRC_DIR/mirte-install-scripts/ From c210b4b0a0b92b77720664367b54a4b5f977116d Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 6 Feb 2025 10:55:38 +0100 Subject: [PATCH 225/353] rm uboot 'update' and fix telemetrix upload file path --- install_mirte_master.sh | 20 ++++++++++---------- run_arduino.sh | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/install_mirte_master.sh b/install_mirte_master.sh index 6792d47..9f9b2c2 100755 --- a/install_mirte_master.sh +++ b/install_mirte_master.sh @@ -41,16 +41,16 @@ pip install gpiod==1.5.4 # python3.8 version pip install gtts playsound openai==0.28.0 sounddevice scipy SpeechRecognition soundfile transformers datasets pyyaml pydub Elevenlabs || true # some strange package versions pip install numpy==1.23.1 # python3.8 fix -mkdir ~/uboot_fix/ -cd ~/uboot_fix/ -# audio fix uboot for orange pi 3b -if [[ ${type:=""} == "mirte_orangepi3b" ]]; then - wget https://mirte.arend-jan.com/files/fixes/uboot/linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb - sudo apt install ./linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb - rm linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb - cd ../ - rm -rf uboot_fix/ -fi +# mkdir ~/uboot_fix/ +# cd ~/uboot_fix/ +# # audio fix uboot for orange pi 3b +# if [[ ${type:=""} == "mirte_orangepi3b" ]]; then +# wget https://mirte.arend-jan.com/files/fixes/uboot/linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb +# sudo apt install ./linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb +# rm linux-u-boot-orangepi3b-edge_24.2.1_arm64__2023.10-S095b-P0000-H264e-V49ed-B11a8-R448a.deb +# cd ../ +# rm -rf uboot_fix/ +# fi # cd ~/mirte_ws/src # git clone --recurse-submodules https://github.com/arendjan/mirte-telemetrix-cpp.git diff --git a/run_arduino.sh b/run_arduino.sh index 0269167..b8b196b 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -45,7 +45,7 @@ upload_pico_uart() { sleep 1 # try to upload ERR=false - pico_py_serial_flasher $port $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico_combined.elf || ERR=true + pico_py_serial_flasher $port $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico.elf || ERR=true if $ERR; then echo "Failed to upload to Pico using pico_py_serial_flash port $port" else From 44efbbb40d3eed4838a77de0afec6bb2c35bc56e Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 6 Feb 2025 13:37:04 +0100 Subject: [PATCH 226/353] set ros log dir --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index be2bf57..b9343e9 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -103,7 +103,7 @@ rosdep install -y --from-paths src/ --ignore-src --rosdistro $ROS_NAME colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release add_rc "source /home/mirte/mirte_ws/install/setup.bash" "source /home/mirte/mirte_ws/install/setup.zsh" - +add_rc "export ROS_LOG_DIR=/tmp/ros_log/" # log to tmp to not fill up the disk # shellcheck source=/dev/null source /home/mirte/mirte_ws/install/setup.bash From 9f18f3d7c3b8b5e484dcdfc56f654d3f899ed32f Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 6 Feb 2025 13:37:14 +0100 Subject: [PATCH 227/353] source home bashrc --- services/mirte_ros.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/mirte_ros.sh b/services/mirte_ros.sh index 297d8bc..03531ed 100755 --- a/services/mirte_ros.sh +++ b/services/mirte_ros.sh @@ -17,5 +17,5 @@ source /home/mirte/mirte_ws/install/setup.bash # echo "ROS_MASTER_URI=$ROS_MASTER_URI" # fi # If the robot user wants to add their own config: -# source /home/mirte/.bashrc +source /home/mirte/.bashrc ros2 launch mirte_bringup $LAUNCH_FILE.launch.py From f6e47dacb9528b4e875cd75bf037687c4805815e Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 20 Feb 2025 10:06:45 +0100 Subject: [PATCH 228/353] add zenoh --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index b9343e9..56ea815 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -29,7 +29,7 @@ else exit 1 fi -sudo apt install -y ros-$ROS_NAME-ros-base +sudo apt install -y ros-$ROS_NAME-ros-base ros-$ROS_NAME-zenoh-bridge-dds ros-$ROS_NAME-rmw-zenoh-cpp sudo apt install -y ros-$ROS_NAME-xacro sudo apt install -y ros-dev-tools From 07a484b6a929f00a07dd7835e622ce2cfbe0fa67 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 25 Feb 2025 12:41:00 +0100 Subject: [PATCH 229/353] Random wifi channel --- network_setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/network_setup.sh b/network_setup.sh index 29b2667..39ea530 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -42,6 +42,7 @@ function start_acces_point { nmcli con modify "$(cat /etc/hostname)" 802-11-wireless-security.proto wpa # nmcli con modify `cat /etc/hostname` 802-11-wireless-security.group ccmp # nmcli con modify `cat /etc/hostname` 802-11-wireless-security.pairwise ccmp + nmcli c modify "$(cat /etc/hostname)" 802-11-wireless.band bg 802-11-wireless.channel "$(shuf -i 1-11 -n 1)" nmcli con down "$(cat /etc/hostname)" sleep 10 nmcli con up "$(cat /etc/hostname)" From 83f414fb683afafac7fdb228830b21adac22534a Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 27 Feb 2025 16:41:20 +0100 Subject: [PATCH 230/353] Fix zenoh stuff --- install_ROS2.sh | 3 ++- services/mirte_ros.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 56ea815..6e68110 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -101,7 +101,7 @@ git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 cd .. || exit 1 rosdep install -y --from-paths src/ --ignore-src --rosdistro $ROS_NAME colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release - +add_rc "export MIRTE_ZENOH=true" add_rc "source /home/mirte/mirte_ws/install/setup.bash" "source /home/mirte/mirte_ws/install/setup.zsh" add_rc "export ROS_LOG_DIR=/tmp/ros_log/" # log to tmp to not fill up the disk # shellcheck source=/dev/null @@ -200,3 +200,4 @@ cbr () { sr EOF fi + diff --git a/services/mirte_ros.sh b/services/mirte_ros.sh index 03531ed..ed7a7be 100755 --- a/services/mirte_ros.sh +++ b/services/mirte_ros.sh @@ -17,5 +17,6 @@ source /home/mirte/mirte_ws/install/setup.bash # echo "ROS_MASTER_URI=$ROS_MASTER_URI" # fi # If the robot user wants to add their own config: +ros2 run rmw_zenoh_cpp rmw_zenohd & source /home/mirte/.bashrc ros2 launch mirte_bringup $LAUNCH_FILE.launch.py From e82cdb9879545cd10a7f4bfc0e298df5ffad13b4 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 28 Feb 2025 15:32:25 +0100 Subject: [PATCH 231/353] upd fixes --- install_ROS2.sh | 2 ++ run_arduino.sh | 2 +- services/mirte_master_check.sh | 34 ++++++++++++++++++++++++++++------ services/mirte_shutdown.sh | 2 +- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 6e68110..f1310ef 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -102,6 +102,8 @@ cd .. || exit 1 rosdep install -y --from-paths src/ --ignore-src --rosdistro $ROS_NAME colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release add_rc "export MIRTE_ZENOH=true" +add_rc "export MIRTE_USE_MULTIROBOT=false" + add_rc "source /home/mirte/mirte_ws/install/setup.bash" "source /home/mirte/mirte_ws/install/setup.zsh" add_rc "export ROS_LOG_DIR=/tmp/ros_log/" # log to tmp to not fill up the disk # shellcheck source=/dev/null diff --git a/run_arduino.sh b/run_arduino.sh index b8b196b..8a04371 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -86,7 +86,7 @@ elif [[ $COMMAND == upload* ]]; then buildpico # This will always upload telemetrix4rpipico.uf2, so no need to pass a file ERR=false - sudo picotool load -f $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico_combined.uf2 || ERR=true + sudo picotool load -f $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico.uf2 || ERR=true sleep 1 sudo picotool reboot || true # just to make sure, sometimes it does not reboot automatically if $ERR; then diff --git a/services/mirte_master_check.sh b/services/mirte_master_check.sh index 8550275..868dc6a 100755 --- a/services/mirte_master_check.sh +++ b/services/mirte_master_check.sh @@ -3,19 +3,29 @@ set -x . /opt/ros/humble/setup.bash . /home/mirte/mirte_ws/install/setup.bash SECONDS=0 +LAST_SECONDS=0 WARN_LVL=0 mirte_space=$(cat /etc/hostname | tr '[:upper:]' '[:lower:]' | tr '-' '_') + +# ros2 topic echo restarts when the topic appears again, so we can just echo always +# on every check, it will read the file, take the last reading and then clear the file +# if the sensor is off, then the file will be empty and will trigger shutdown after some time. +topic=/io/power/power_watcher +if [ "$MIRTE_USE_MULTIROBOT" = "true" ]; then + topic=/$mirte_space/io/power/power_watcher +fi +ros2 topic echo $topic sensor_msgs/msg/BatteryState --field percentage > /tmp/batteryState & + while true; do OK=false # echo "topics" percentage=$( - (ros2 topic echo /$mirte_space/io/power/power_watcher --once | grep percentage | tail -1) & - pid=$! - (sleep 5 && kill -9 $pid) 2>/dev/null & - watcher=$! - wait $pid 2>/dev/null && pkill -HUP -P $watcher - ) + tail -2 /tmp/batteryState | head -1 + ) || true + echo $percentage + > /tmp/batteryState + # percentage=$(echo "$percentage" | tail -1) # echo $percentage # echo $( echo $percentage | wc -c) if [ "$(echo $percentage | wc -c)" -gt 1 ]; then @@ -31,8 +41,20 @@ while true; do # echo "latest percentage: " # echo $percentage SECONDS=0 # update time since last ok + LAST_SECONDS=0 WARN_LVL=0 fi + # if there is a time jump and seconds is more than last_seconds+2, reset seconds + # time jumps happen when the time is updated (on connecting to wifi) + next_second=$((LAST_SECONDS + 2)) + if [ $SECONDS -gt $next_second ]; then + echo "time jump" + SECONDS=0 + LAST_SECONDS=0 + WARN_LVL=0 + fi + LAST_SECONDS=$SECONDS + if [ $SECONDS -gt 300 ] && [ $WARN_LVL -eq 0 ]; then wall "No ROS for longer than 5min" WARN_LVL=1 diff --git a/services/mirte_shutdown.sh b/services/mirte_shutdown.sh index 9774991..dc87def 100755 --- a/services/mirte_shutdown.sh +++ b/services/mirte_shutdown.sh @@ -11,5 +11,5 @@ touch /home/mirte/.shutdown source /home/mirte/mirte_ws/install/setup.bash # TODO: does not work if ros is not running -ros2 service call /mirte/set_middle_image "{ type: 'text', value: 'Shutting down...'}" +ros2 service call /io/oled/oled/set_text mirte_msgs/srv/SetOLEDText "{ text: 'Shutting down...'}" sleep 2 From 0f221fe9a5988a5f703452aa15073dd8f0aa12c3 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 28 Feb 2025 15:34:30 +0100 Subject: [PATCH 232/353] stylefixes --- install_ROS2.sh | 1 - services/mirte_master_check.sh | 6 +++--- services/mirte_ros.sh | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index f1310ef..0ee65bb 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -202,4 +202,3 @@ cbr () { sr EOF fi - diff --git a/services/mirte_master_check.sh b/services/mirte_master_check.sh index 868dc6a..119769c 100755 --- a/services/mirte_master_check.sh +++ b/services/mirte_master_check.sh @@ -14,7 +14,7 @@ topic=/io/power/power_watcher if [ "$MIRTE_USE_MULTIROBOT" = "true" ]; then topic=/$mirte_space/io/power/power_watcher fi -ros2 topic echo $topic sensor_msgs/msg/BatteryState --field percentage > /tmp/batteryState & +ros2 topic echo $topic sensor_msgs/msg/BatteryState --field percentage >/tmp/batteryState & while true; do OK=false @@ -24,7 +24,7 @@ while true; do tail -2 /tmp/batteryState | head -1 ) || true echo $percentage - > /tmp/batteryState + true >/tmp/batteryState # percentage=$(echo "$percentage" | tail -1) # echo $percentage # echo $( echo $percentage | wc -c) @@ -46,7 +46,7 @@ while true; do fi # if there is a time jump and seconds is more than last_seconds+2, reset seconds # time jumps happen when the time is updated (on connecting to wifi) - next_second=$((LAST_SECONDS + 2)) + next_second=$((LAST_SECONDS + 2)) if [ $SECONDS -gt $next_second ]; then echo "time jump" SECONDS=0 diff --git a/services/mirte_ros.sh b/services/mirte_ros.sh index ed7a7be..1e38ded 100755 --- a/services/mirte_ros.sh +++ b/services/mirte_ros.sh @@ -17,6 +17,6 @@ source /home/mirte/mirte_ws/install/setup.bash # echo "ROS_MASTER_URI=$ROS_MASTER_URI" # fi # If the robot user wants to add their own config: -ros2 run rmw_zenoh_cpp rmw_zenohd & +ros2 run rmw_zenoh_cpp rmw_zenohd & source /home/mirte/.bashrc ros2 launch mirte_bringup $LAUNCH_FILE.launch.py From 7cd7939d29cb36de488092ebcad9105a1683c9f4 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 28 Feb 2025 15:41:39 +0100 Subject: [PATCH 233/353] shutdown script fixes --- services/mirte_shutdown.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/services/mirte_shutdown.sh b/services/mirte_shutdown.sh index dc87def..ad40a4d 100755 --- a/services/mirte_shutdown.sh +++ b/services/mirte_shutdown.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -xe +# set -xe # Don't shutdown if only stopping the service if ! systemctl list-jobs | grep -q -E 'shutdown.target.*start'; then @@ -7,9 +7,16 @@ if ! systemctl list-jobs | grep -q -E 'shutdown.target.*start'; then exit fi +source /home/mirte/.bashrc touch /home/mirte/.shutdown -source /home/mirte/mirte_ws/install/setup.bash -# TODO: does not work if ros is not running +service=/io/oled/oled/set_text +if [ "$MIRTE_USE_MULTIROBOT" = "true" ]; then + mirte_space=$(cat /etc/hostname | tr '[:upper:]' '[:lower:]' | tr '-' '_') + service="/$mirte_space$service" +fi + +if [ "$(ros2 service list | grep "$service$")" ]; then + ros2 service call "$service" mirte_msgs/srv/SetOLEDText "{ text: 'Shutting down...'}" +fi -ros2 service call /io/oled/oled/set_text mirte_msgs/srv/SetOLEDText "{ text: 'Shutting down...'}" sleep 2 From 6ffc7dbf9b0a59be9fc50116f19d222252f5a2a7 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 4 Mar 2025 14:16:33 +0100 Subject: [PATCH 234/353] Takeaways from proj rob branch #6 --- install_mirte.sh | 3 ++- network_install.sh | 21 ++++++++++++--------- network_setup.sh | 16 +++++++++++++--- services/mirte_expandoverlay.sh | 5 +++-- services/mirte_ros.sh | 2 ++ usb_ethernet.sh | 3 +++ 6 files changed, 35 insertions(+), 15 deletions(-) diff --git a/install_mirte.sh b/install_mirte.sh index 5bea2a1..cd8ab4c 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -105,7 +105,7 @@ pip3 install simpleaudio pyttsx3 || true # simpleaudio uses an old python instal sudo apt install -y overlayroot # Currently only instaling, not enabled -# Install overlayfs (done in sd image tools) +# Install overlayfs (enabling in sd image tools) # Setup expand overlayfs { # enable mirte-overlay service @@ -118,3 +118,4 @@ sudo apt install -y overlayroot # remove force ipv4 sudo rm /etc/apt/apt.conf.d/99force-ipv4 || true +sudo rm /etc/resolv.conf || true # remove resolv.conf to use the one from the network. diff --git a/network_install.sh b/network_install.sh index 4a47043..133bc8b 100755 --- a/network_install.sh +++ b/network_install.sh @@ -2,10 +2,16 @@ set -xe MIRTE_SRC_DIR=/usr/local/src/mirte +# Fix for bug in systemd-resolved +# (https://askubuntu.com/questions/973017/wrong-nameserver-set-by-resolvconf-and-networkmanager) +# For the installation we need 8.8.8.8, but linking will be done in network_setup.sh +sudo rm -rf /etc/resolv.conf +sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf' + # Make sure there are no conflicting hcdp-servers sudo apt install -y dnsmasq-base systemctl disable hostapd -sed -i 's/#DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf +# sed -i 's/#DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf # TODO: check this # Install netplan (not installed on armbian) and networmanager (not installed by Raspberry) #sudo apt install -y netplan.io @@ -14,11 +20,6 @@ sudo apt install -y network-manager #sudo netplan apply #sudo apt purge -y ifupdown -# Fix for bug in systemd-resolved -# (https://askubuntu.com/questions/973017/wrong-nameserver-set-by-resolvconf-and-networkmanager) -# For the installation we need 8.8.8.8, but linking will be done in network_setup.sh -sudo rm -rf /etc/resolv.conf -sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf' # Install wifi-connect MY_ARCH=$(arch) @@ -63,8 +64,8 @@ sudo apt install -y inotify-tools wireless-tools # Disable ssh root login sed -i 's/#PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config -# Install usb_ethernet script from EV3 -wget https://raw.githubusercontent.com/ev3dev/ev3-systemd/ev3dev-buster/scripts/ev3-usb.sh -P $MIRTE_SRC_DIR/mirte-install-scripts +# Install usb_ethernet script from EV3 (already downloaded with a fix) +# wget https://raw.githubusercontent.com/ev3dev/ev3-systemd/ev3dev-buster/scripts/ev3-usb.sh -P $MIRTE_SRC_DIR/mirte-install-scripts sudo chmod +x $MIRTE_SRC_DIR/mirte-install-scripts/ev3-usb.sh sudo chown mirte:mirte $MIRTE_SRC_DIR/mirte-install-scripts/ev3-usb.sh sudo bash -c 'echo "libcomposite" >> /etc/modules' @@ -84,10 +85,12 @@ sudo bash -c 'echo "Mirte-XXXXXX" > /etc/hostname' sudo chmod 777 /etc/hostname # Fix for wpa_supplicant error -sudo bash -c "echo 'match-device=driver:wlan0' >> /etc/NetworkManager/NetworkManager.conf" +# sudo bash -c "echo 'match-device=driver:wlan0' >> /etc/NetworkManager/NetworkManager.conf" # Reboot after kernel panic # The OPi has a fairly unstable wifi driver which might # panic the kernel (at boot). Instead of waiting an unkown # time and reboot manually, we will reboot automatically sudo bash -c 'echo "kernel.panic = 10" > /etc/sysctl.conf' + +rm -rf /etc/resolv.conf || true # remove resolv.conf to use the one from the network. diff --git a/network_setup.sh b/network_setup.sh index 39ea530..bebabaa 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -42,6 +42,7 @@ function start_acces_point { nmcli con modify "$(cat /etc/hostname)" 802-11-wireless-security.proto wpa # nmcli con modify `cat /etc/hostname` 802-11-wireless-security.group ccmp # nmcli con modify `cat /etc/hostname` 802-11-wireless-security.pairwise ccmp + # generate a random channel, can even change to 5Ghz if wanted, then check how to find a correct channel nmcli c modify "$(cat /etc/hostname)" 802-11-wireless.band bg 802-11-wireless.channel "$(shuf -i 1-11 -n 1)" nmcli con down "$(cat /etc/hostname)" sleep 10 @@ -76,7 +77,7 @@ function check_connection { # Get wifi connection if connected if sudo nmcli con show --active | grep wlan0; then # Bugfix (see network_install.sh) - sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf + # sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf printf 'Connected to wifi connection:' nmcli con show --active | grep wlan0 @@ -128,12 +129,19 @@ function file_empty() { MIRTE_SRC_DIR=/usr/local/src/mirte -$MIRTE_SRC_DIR/mirte-install-scripts/usb_ethernet.sh - # Create unique SSID # This must be run every time on boot, since it should # be generated on first boot (so not when generating # the image in network_setup.sh) + +if false; then # when using mac for hostname. + mac=$(ip addr show "wlan0" | awk '/ether/{print $2}') + UNIQUE_ID=$(echo -n $mac | tr -cd "1-9A-Fa-f" | tail -c 6) # last 6 characters of mac address, without colons or 0s + MIRTE_SSID="Mirte-$(echo ${UNIQUE_ID^^})" + echo "Generated SSID: $MIRTE_SSID" + # add to check: || [[ "$(cat /etc/hostname)" != "$MIRTE_SSID" ]] +fi + if [ ! -f /etc/ssid ] || [[ $(cat /etc/hostname) == "Mirte-XXXXXX" ]]; then UNIQUE_ID=$(tr -cd "1-9A-F" Date: Tue, 4 Mar 2025 14:22:21 +0100 Subject: [PATCH 235/353] stylechecks --- network_install.sh | 1 - network_setup.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/network_install.sh b/network_install.sh index 133bc8b..a95613f 100755 --- a/network_install.sh +++ b/network_install.sh @@ -20,7 +20,6 @@ sudo apt install -y network-manager #sudo netplan apply #sudo apt purge -y ifupdown - # Install wifi-connect MY_ARCH=$(arch) if [[ "$MY_ARCH" == "armv7l" ]]; then MY_ARCH="rpi"; fi diff --git a/network_setup.sh b/network_setup.sh index bebabaa..0ae95c8 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -139,7 +139,7 @@ if false; then # when using mac for hostname. UNIQUE_ID=$(echo -n $mac | tr -cd "1-9A-Fa-f" | tail -c 6) # last 6 characters of mac address, without colons or 0s MIRTE_SSID="Mirte-$(echo ${UNIQUE_ID^^})" echo "Generated SSID: $MIRTE_SSID" - # add to check: || [[ "$(cat /etc/hostname)" != "$MIRTE_SSID" ]] + # add to check: || [[ "$(cat /etc/hostname)" != "$MIRTE_SSID" ]] fi if [ ! -f /etc/ssid ] || [[ $(cat /etc/hostname) == "Mirte-XXXXXX" ]]; then From 00116a3d5532f9a852fa735528f2bfd59e625511 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 4 Mar 2025 17:03:42 +0100 Subject: [PATCH 236/353] Fix for zenoh mirte ros boot script --- install_ROS2.sh | 4 ++-- services/mirte_ros.sh | 18 ++++-------------- tools.sh | 6 ++++++ 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 0ee65bb..93d20e0 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -101,8 +101,8 @@ git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 cd .. || exit 1 rosdep install -y --from-paths src/ --ignore-src --rosdistro $ROS_NAME colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -add_rc "export MIRTE_ZENOH=true" -add_rc "export MIRTE_USE_MULTIROBOT=false" +add_profile "export MIRTE_ZENOH=true" +add_profile "export MIRTE_USE_MULTIROBOT=false" add_rc "source /home/mirte/mirte_ws/install/setup.bash" "source /home/mirte/mirte_ws/install/setup.zsh" add_rc "export ROS_LOG_DIR=/tmp/ros_log/" # log to tmp to not fill up the disk diff --git a/services/mirte_ros.sh b/services/mirte_ros.sh index 1e38ded..7d8cbd4 100755 --- a/services/mirte_ros.sh +++ b/services/mirte_ros.sh @@ -2,21 +2,11 @@ # by default use minimal launch file, but allow to override to minimal_master LAUNCH_FILE="${1:-minimal}" -source /home/mirte/mirte_ws/install/setup.bash -# Not needed anymore, since we use the ROS_DOMAIN_ID -# ip=$(hostname -I | awk '{print $1}') #just get the first ip addr -# if [ "$(echo $ip | wc -w)" -ne 1 ]; then -# # happens at boot, when the network is not yet up -# echo "multiple or none, wont use the ip from hostname:" -# hostname -I -# else -# export ROS_IP="$ip" -# export ROS_MASTER_URI="http://$ip:11311/" -# echo "ROS_IP=$ROS_IP" -# echo "ROS_MASTER_URI=$ROS_MASTER_URI" -# fi # If the robot user wants to add their own config: +source /home/mirte/.profile +source /home/mirte/mirte_ws/install/setup.bash + +# .bashrc wont be sourced in this file, as its not an interactive shell. ros2 run rmw_zenoh_cpp rmw_zenohd & -source /home/mirte/.bashrc ros2 launch mirte_bringup $LAUNCH_FILE.launch.py diff --git a/tools.sh b/tools.sh index b8f467a..3f89ada 100755 --- a/tools.sh +++ b/tools.sh @@ -15,3 +15,9 @@ add_rc() { fi grep -qxF "$lines" ~/.zshrc || echo "$lines" >>~/.zshrc } + +add_profile() { + lines=$1 + + grep -qxF "$lines" ~/.profile || echo "$lines" >>~/.profile +} \ No newline at end of file From 66c8c396b2ea6cb6c4c3545c150660ef3daa9306 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 4 Mar 2025 17:23:11 +0100 Subject: [PATCH 237/353] Fix time jump check --- services/mirte_master_check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/mirte_master_check.sh b/services/mirte_master_check.sh index 119769c..71acfbc 100755 --- a/services/mirte_master_check.sh +++ b/services/mirte_master_check.sh @@ -46,7 +46,7 @@ while true; do fi # if there is a time jump and seconds is more than last_seconds+2, reset seconds # time jumps happen when the time is updated (on connecting to wifi) - next_second=$((LAST_SECONDS + 2)) + next_second=$((LAST_SECONDS + 20)) if [ $SECONDS -gt $next_second ]; then echo "time jump" SECONDS=0 From 0206986c9c42469843553fc86be586fb1839204a Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 4 Mar 2025 17:24:16 +0100 Subject: [PATCH 238/353] set log dir in profile --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 93d20e0..9032333 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -105,7 +105,7 @@ add_profile "export MIRTE_ZENOH=true" add_profile "export MIRTE_USE_MULTIROBOT=false" add_rc "source /home/mirte/mirte_ws/install/setup.bash" "source /home/mirte/mirte_ws/install/setup.zsh" -add_rc "export ROS_LOG_DIR=/tmp/ros_log/" # log to tmp to not fill up the disk +add_profile "export ROS_LOG_DIR=/tmp/ros_log/" # log to tmp to not fill up the disk # shellcheck source=/dev/null source /home/mirte/mirte_ws/install/setup.bash From 8eddaaaf738a01a08f1d7cc9c6775480f6775e96 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 4 Mar 2025 17:37:47 +0100 Subject: [PATCH 239/353] fix profile change script --- tools.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools.sh b/tools.sh index 3f89ada..800580d 100755 --- a/tools.sh +++ b/tools.sh @@ -19,5 +19,5 @@ add_rc() { add_profile() { lines=$1 - grep -qxF "$lines" ~/.profile || echo "$lines" >>~/.profile + grep -qxF "$lines" ~/.profile || sed -i "10i\\$lines\\" ~/.profile } \ No newline at end of file From 48ec205706717968262c656be3003c17578e5ae3 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 4 Mar 2025 17:38:42 +0100 Subject: [PATCH 240/353] fix styling tools.sh --- tools.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools.sh b/tools.sh index 800580d..62c67bb 100755 --- a/tools.sh +++ b/tools.sh @@ -20,4 +20,4 @@ add_profile() { lines=$1 grep -qxF "$lines" ~/.profile || sed -i "10i\\$lines\\" ~/.profile -} \ No newline at end of file +} From 9f01776ef5900e99024e887587ac6dd02a11bd4b Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 5 Mar 2025 17:50:50 +0100 Subject: [PATCH 241/353] Add ev3 fixed script --- .gitignore | 1 - ev3-usb.sh | 178 +++++++++++++++++++++++++++++++++++++++++++++ network_install.sh | 2 +- 3 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 ev3-usb.sh diff --git a/.gitignore b/.gitignore index d1941eb..3c4de97 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ build/ -ev3-usb.sh ui/ *.uf2 diff --git a/ev3-usb.sh b/ev3-usb.sh new file mode 100644 index 0000000..1d2fb81 --- /dev/null +++ b/ev3-usb.sh @@ -0,0 +1,178 @@ +#!/bin/dash +# Copied from: https://raw.githubusercontent.com/ev3dev/ev3-systemd/ev3dev-buster/scripts/ev3-usb.sh +# EDITED: serial num, as it didn't work with newer kernels +# USB Gadget for LEGO MINDSTORMS EV3 hardware +# +# Copyright (C) 2015,2017 David Lechner +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . + +# TODO: get new usb vid:pid from https://pid.codes/ + +set -e + +# command line parameters +command="$1" # "up" or "down" +udc_device="$2" # a udc device name, such as "musb-hdrc.1.auto" + +g="/sys/kernel/config/usb_gadget/ev3dev" + +ev3_usb_up() { + usb_ver="0x0200" # USB 2.0 + dev_class="2" # Communications - LEGO firmware is 0 + vid="0x0694" # LEGO Group + pid="0x0005" # EV3 + device="0x3001" # this should be incremented any time there are breaking changes + # to this script so that the host OS sees it as a new device and + # re-enumerates everything rather than relying on cached values + mfg="LEGO Group" # matches LEGO firmware + prod="EV3+ev3dev" # LEGO firmware is just "EV3" + # Read bluetooth mac address from eeprom - this is what LEGO firmware uses for serial + # FIXME: hard-coding the sysfs path could be fragile + serial="10" # AJ: just some random serial num + attr="0xC0" # Self powered + pwr="1" # 2mA + cfg1="CDC" + cfg2="RNDIS" + # add colons for MAC address format + mac="$(echo ${serial} | sed 's/\(\w\w\)/:\1/g' | cut -b 2-)" + # Change the first number for each MAC address - the second digit of 2 indicates + # that these are "locally assigned (b2=1), unicast (b1=0)" addresses. This is + # so that they don't conflict with any existing vendors. Care should be taken + # not to change these two bits. + dev_mac1="02$(echo ${mac} | cut -b 3-)" + host_mac1="12$(echo ${mac} | cut -b 3-)" + dev_mac2="22$(echo ${mac} | cut -b 3-)" + host_mac2="32$(echo ${mac} | cut -b 3-)" + ms_vendor_code="0xcd" # Microsoft + ms_qw_sign="MSFT100" # also Microsoft (if you couldn't tell) + ms_compat_id="RNDIS" # matches Windows RNDIS Drivers + ms_subcompat_id="5162001" # matches Windows RNDIS 6.0 Driver + + if [ -d ${g} ]; then + if [ "$(cat ${g}/UDC)" != "" ]; then + echo "Gadget is already up." + exit 1 + fi + echo "Cleaning up old directory..." + ev3_usb_down + fi + echo "Setting up gadget..." + + # Create a new gadget + + mkdir ${g} + echo "${usb_ver}" >${g}/bcdUSB + echo "${dev_class}" >${g}/bDeviceClass + echo "${vid}" >${g}/idVendor + echo "${pid}" >${g}/idProduct + echo "${device}" >${g}/bcdDevice + mkdir ${g}/strings/0x409 + echo "${mfg}" >${g}/strings/0x409/manufacturer + echo "${prod}" >${g}/strings/0x409/product + echo "${serial}" >${g}/strings/0x409/serialnumber + + # Create 2 configurations. The first will be CDC. The second will be RNDIS. + # Thanks to os_desc, Windows should use the second configuration. + + # config 1 is for CDC + + mkdir ${g}/configs/c.1 + echo "${attr}" >${g}/configs/c.1/bmAttributes + echo "${pwr}" >${g}/configs/c.1/MaxPower + mkdir ${g}/configs/c.1/strings/0x409 + echo "${cfg1}" >${g}/configs/c.1/strings/0x409/configuration + + # Create the CDC function + + mkdir ${g}/functions/ecm.usb0 + echo "${dev_mac1}" >${g}/functions/ecm.usb0/dev_addr + echo "${host_mac1}" >${g}/functions/ecm.usb0/host_addr + + # config 2 is for RNDIS + + mkdir ${g}/configs/c.2 + echo "${attr}" >${g}/configs/c.2/bmAttributes + echo "${pwr}" >${g}/configs/c.2/MaxPower + mkdir ${g}/configs/c.2/strings/0x409 + echo "${cfg2}" >${g}/configs/c.2/strings/0x409/configuration + + # On Windows 7 and later, the RNDIS 5.1 driver would be used by default, + # but it does not work very well. The RNDIS 6.0 driver works better. In + # order to get this driver to load automatically, we have to use a + # Microsoft-specific extension of USB. + + echo "1" >${g}/os_desc/use + echo "${ms_vendor_code}" >${g}/os_desc/b_vendor_code + echo "${ms_qw_sign}" >${g}/os_desc/qw_sign + + # Create the RNDIS function, including the Microsoft-specific bits + + mkdir ${g}/functions/rndis.usb0 + echo "${dev_mac2}" >${g}/functions/rndis.usb0/dev_addr + echo "${host_mac2}" >${g}/functions/rndis.usb0/host_addr + echo "${ms_compat_id}" >${g}/functions/rndis.usb0/os_desc/interface.rndis/compatible_id + echo "${ms_subcompat_id}" >${g}/functions/rndis.usb0/os_desc/interface.rndis/sub_compatible_id + + # Link everything up and bind the USB device + + ln -s ${g}/functions/ecm.usb0 ${g}/configs/c.1 + ln -s ${g}/functions/rndis.usb0 ${g}/configs/c.2 + ln -s ${g}/configs/c.2 ${g}/os_desc + echo "${udc_device}" >${g}/UDC + + echo "Done." +} + +ev3_usb_down() { + if [ ! -d ${g} ]; then + echo "Gadget is already down." + exit 1 + fi + echo "Taking down gadget..." + + # Have to unlink and remove directories in reverse order. + # Checks allow to finish takedown after error. + + if [ "$(cat ${g}/UDC)" != "" ]; then + echo "" >${g}/UDC + fi + rm -f ${g}/os_desc/c.2 + rm -f ${g}/configs/c.2/rndis.usb0 + rm -f ${g}/configs/c.1/ecm.usb0 + [ -d ${g}/functions/ecm.usb0 ] && rmdir ${g}/functions/ecm.usb0 + [ -d ${g}/functions/rndis.usb0 ] && rmdir ${g}/functions/rndis.usb0 + [ -d ${g}/configs/c.2/strings/0x409 ] && rmdir ${g}/configs/c.2/strings/0x409 + [ -d ${g}/configs/c.2 ] && rmdir ${g}/configs/c.2 + [ -d ${g}/configs/c.1/strings/0x409 ] && rmdir ${g}/configs/c.1/strings/0x409 + [ -d ${g}/configs/c.1 ] && rmdir ${g}/configs/c.1 + [ -d ${g}/strings/0x409 ] && rmdir ${g}/strings/0x409 + rmdir ${g} + + echo "Done." +} + +case ${command} in + +up) + ev3_usb_up + ;; +down) + ev3_usb_down + ;; +*) + echo "Usage: ev3-usb.sh up|down " + exit 1 + ;; +esac diff --git a/network_install.sh b/network_install.sh index a95613f..71c000b 100755 --- a/network_install.sh +++ b/network_install.sh @@ -65,7 +65,7 @@ sed -i 's/#PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config # Install usb_ethernet script from EV3 (already downloaded with a fix) # wget https://raw.githubusercontent.com/ev3dev/ev3-systemd/ev3dev-buster/scripts/ev3-usb.sh -P $MIRTE_SRC_DIR/mirte-install-scripts -sudo chmod +x $MIRTE_SRC_DIR/mirte-install-scripts/ev3-usb.sh +# sudo chmod +x $MIRTE_SRC_DIR/mirte-install-scripts/ev3-usb.sh sudo chown mirte:mirte $MIRTE_SRC_DIR/mirte-install-scripts/ev3-usb.sh sudo bash -c 'echo "libcomposite" >> /etc/modules' # remove g_serial from modules to let the ev3-usb script enable usb ethernet on the orange pi zero 1 as well. From bb04c62bd7caf6dbe61e7f36dd6c84432338fb3a Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 6 Mar 2025 14:03:33 +0100 Subject: [PATCH 242/353] mirte settings fixes --- install_ROS2.sh | 7 +++++-- network_setup.sh | 2 +- services/mirte_master_check.sh | 1 + services/mirte_ros.sh | 13 ++++++++----- services/mirte_shutdown.sh | 2 ++ tools.sh | 5 +++++ 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 9032333..b0a2de1 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -101,8 +101,11 @@ git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 cd .. || exit 1 rosdep install -y --from-paths src/ --ignore-src --rosdistro $ROS_NAME colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -add_profile "export MIRTE_ZENOH=true" -add_profile "export MIRTE_USE_MULTIROBOT=false" +add_mirte_settings "export MIRTE_ZENOH=false" # disable zenoh by default, but can be enabled by setting to true +add_mirte_settings "export MIRTE_USE_MULTIROBOT=false" # TODO: use this in the launch file? +add_mirte_settings "export ROS_LOG_DIR=/tmp/ros" +add_rc "source /home/mirte/.mirte_settings.sh" +add_rc "# Enable Zenoh and multirobot in .mirte_settings.sh" add_rc "source /home/mirte/mirte_ws/install/setup.bash" "source /home/mirte/mirte_ws/install/setup.zsh" add_profile "export ROS_LOG_DIR=/tmp/ros_log/" # log to tmp to not fill up the disk diff --git a/network_setup.sh b/network_setup.sh index 0ae95c8..d716b47 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -77,7 +77,7 @@ function check_connection { # Get wifi connection if connected if sudo nmcli con show --active | grep wlan0; then # Bugfix (see network_install.sh) - # sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf + sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf printf 'Connected to wifi connection:' nmcli con show --active | grep wlan0 diff --git a/services/mirte_master_check.sh b/services/mirte_master_check.sh index 71acfbc..ea6ceb3 100755 --- a/services/mirte_master_check.sh +++ b/services/mirte_master_check.sh @@ -1,5 +1,6 @@ #!/bin/bash set -x +. /home/mirte/.mirte_settings.sh . /opt/ros/humble/setup.bash . /home/mirte/mirte_ws/install/setup.bash SECONDS=0 diff --git a/services/mirte_ros.sh b/services/mirte_ros.sh index 1cdfd8e..5b4291e 100755 --- a/services/mirte_ros.sh +++ b/services/mirte_ros.sh @@ -3,13 +3,16 @@ # by default use minimal launch file, but allow to override to minimal_master LAUNCH_FILE="${1:-minimal}" -export ROS_LOG_DIR=/tmp/ros -mkdir -p $ROS_LOG_DIR # If the robot user wants to add their own config: -source /home/mirte/.profile -# .bashrc wont be sourced in this file, as its not in an interactive shell. +source /home/mirte/.mirte_settings +mkdir -p $ROS_LOG_DIR source /home/mirte/mirte_ws/install/setup.bash +# if zenoh is enabled, start the zenoh daemon +if [ "$RMW_IMPLEMENTATION" = "rmw_zenoh_cpp" ]; then + # kill ros deamon + sudo pkill -9 -f ^ros && ros2 daemon stop + ros2 run rmw_zenoh_cpp rmw_zenohd & +fi -ros2 run rmw_zenoh_cpp rmw_zenohd & ros2 launch mirte_bringup $LAUNCH_FILE.launch.py diff --git a/services/mirte_shutdown.sh b/services/mirte_shutdown.sh index ad40a4d..2955bbc 100755 --- a/services/mirte_shutdown.sh +++ b/services/mirte_shutdown.sh @@ -8,6 +8,8 @@ if ! systemctl list-jobs | grep -q -E 'shutdown.target.*start'; then fi source /home/mirte/.bashrc +source /home/mirte/.mirte_settings +source /home/mirte/mirte_ws/install/setup.bash touch /home/mirte/.shutdown service=/io/oled/oled/set_text if [ "$MIRTE_USE_MULTIROBOT" = "true" ]; then diff --git a/tools.sh b/tools.sh index 62c67bb..b6136fb 100755 --- a/tools.sh +++ b/tools.sh @@ -21,3 +21,8 @@ add_profile() { grep -qxF "$lines" ~/.profile || sed -i "10i\\$lines\\" ~/.profile } + +add_mirte_settings () { + lines=$1 + echo "$lines" > ~/.mirte_settings.sh +} \ No newline at end of file From 4e6ac83f11202881cff91a2f834042ecd4d29217 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 6 Mar 2025 14:14:23 +0100 Subject: [PATCH 243/353] Fix zsh double source ros --- install_ROS2.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index b0a2de1..7f83280 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -202,6 +202,7 @@ cbr () { colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release fi } -sr +eval "\$(register-python-argcomplete3 ros2)" +eval "\$(register-python-argcomplete3 colcon)" EOF fi From 8133051550742809861c92411c2dfdc0da332c9c Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 6 Mar 2025 14:30:01 +0100 Subject: [PATCH 244/353] Always link systemd resolv --- network_setup.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/network_setup.sh b/network_setup.sh index d716b47..df1ef7b 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -76,8 +76,6 @@ function check_connection { # Get wifi connection if connected if sudo nmcli con show --active | grep wlan0; then - # Bugfix (see network_install.sh) - sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf printf 'Connected to wifi connection:' nmcli con show --active | grep wlan0 @@ -129,6 +127,9 @@ function file_empty() { MIRTE_SRC_DIR=/usr/local/src/mirte + +sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf || true + # Create unique SSID # This must be run every time on boot, since it should # be generated on first boot (so not when generating From cd53721575b29620ae16cd2ec1394481ff15938d Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 6 Mar 2025 14:30:55 +0100 Subject: [PATCH 245/353] stylefixes + add_mirte_settings fix --- install_ROS2.sh | 2 +- network_setup.sh | 1 - services/mirte_ros.sh | 6 +++--- tools.sh | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 7f83280..d210354 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -101,7 +101,7 @@ git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 cd .. || exit 1 rosdep install -y --from-paths src/ --ignore-src --rosdistro $ROS_NAME colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -add_mirte_settings "export MIRTE_ZENOH=false" # disable zenoh by default, but can be enabled by setting to true +add_mirte_settings "export MIRTE_ZENOH=false" # disable zenoh by default, but can be enabled by setting to true add_mirte_settings "export MIRTE_USE_MULTIROBOT=false" # TODO: use this in the launch file? add_mirte_settings "export ROS_LOG_DIR=/tmp/ros" add_rc "source /home/mirte/.mirte_settings.sh" diff --git a/network_setup.sh b/network_setup.sh index df1ef7b..d0b1641 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -127,7 +127,6 @@ function file_empty() { MIRTE_SRC_DIR=/usr/local/src/mirte - sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf || true # Create unique SSID diff --git a/services/mirte_ros.sh b/services/mirte_ros.sh index 5b4291e..158641d 100755 --- a/services/mirte_ros.sh +++ b/services/mirte_ros.sh @@ -10,9 +10,9 @@ mkdir -p $ROS_LOG_DIR source /home/mirte/mirte_ws/install/setup.bash # if zenoh is enabled, start the zenoh daemon if [ "$RMW_IMPLEMENTATION" = "rmw_zenoh_cpp" ]; then - # kill ros deamon - sudo pkill -9 -f ^ros && ros2 daemon stop - ros2 run rmw_zenoh_cpp rmw_zenohd & + # kill ros deamon + sudo pkill -9 -f ^ros && ros2 daemon stop + ros2 run rmw_zenoh_cpp rmw_zenohd & fi ros2 launch mirte_bringup $LAUNCH_FILE.launch.py diff --git a/tools.sh b/tools.sh index b6136fb..ea07748 100755 --- a/tools.sh +++ b/tools.sh @@ -22,7 +22,7 @@ add_profile() { grep -qxF "$lines" ~/.profile || sed -i "10i\\$lines\\" ~/.profile } -add_mirte_settings () { +add_mirte_settings() { lines=$1 - echo "$lines" > ~/.mirte_settings.sh -} \ No newline at end of file + echo "$lines" >>~/.mirte_settings.sh +} From 9012dee5b5ba2ef99bd1c6aebe9b0a4a994953a7 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 6 Mar 2025 14:32:48 +0100 Subject: [PATCH 246/353] better zsh doubles source fix --- install_ROS2.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index d210354..bba96aa 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -107,7 +107,7 @@ add_mirte_settings "export ROS_LOG_DIR=/tmp/ros" add_rc "source /home/mirte/.mirte_settings.sh" add_rc "# Enable Zenoh and multirobot in .mirte_settings.sh" -add_rc "source /home/mirte/mirte_ws/install/setup.bash" "source /home/mirte/mirte_ws/install/setup.zsh" +add_rc "source /home/mirte/mirte_ws/install/setup.bash" "# sourced later on" add_profile "export ROS_LOG_DIR=/tmp/ros_log/" # log to tmp to not fill up the disk # shellcheck source=/dev/null source /home/mirte/mirte_ws/install/setup.bash @@ -174,10 +174,13 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then cd ../../rplidar_ros chmod +x ./scripts/create_udev_rules.sh || true ./scripts/create_udev_rules.sh || true - # zsh does not work nicely with ros2 autocomplete, so we need to add a function to fix it. - # ROS 2 Foxy should have this fixed, but we are using ROS 2 Humble. - # TODO: check for ROS2 jazzy - cat <>/home/mirte/.zshrc + +fi + +# zsh does not work nicely with ros2 autocomplete, so we need to add a function to fix it. +# ROS 2 Foxy should have this fixed, but we are using ROS 2 Humble. +# TODO: check for ROS2 jazzy +cat <>/home/mirte/.zshrc sr () { # macro to source the workspace and enable autocompletion. sr stands for source ros, no other command should use this abbreviation. . /opt/ros/humble/setup.zsh . ~/mirte_ws/install/setup.zsh @@ -202,7 +205,5 @@ cbr () { colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release fi } -eval "\$(register-python-argcomplete3 ros2)" -eval "\$(register-python-argcomplete3 colcon)" +sr EOF -fi From 011730a7bf2087910a95ab0ed7bdd53095fbf748 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 6 Mar 2025 14:33:44 +0100 Subject: [PATCH 247/353] remove unnecesary profile settings --- install_ROS2.sh | 2 +- tools.sh | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index bba96aa..867e05c 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -108,7 +108,7 @@ add_rc "source /home/mirte/.mirte_settings.sh" add_rc "# Enable Zenoh and multirobot in .mirte_settings.sh" add_rc "source /home/mirte/mirte_ws/install/setup.bash" "# sourced later on" -add_profile "export ROS_LOG_DIR=/tmp/ros_log/" # log to tmp to not fill up the disk + # shellcheck source=/dev/null source /home/mirte/mirte_ws/install/setup.bash diff --git a/tools.sh b/tools.sh index ea07748..f78fa1d 100755 --- a/tools.sh +++ b/tools.sh @@ -16,12 +16,6 @@ add_rc() { grep -qxF "$lines" ~/.zshrc || echo "$lines" >>~/.zshrc } -add_profile() { - lines=$1 - - grep -qxF "$lines" ~/.profile || sed -i "10i\\$lines\\" ~/.profile -} - add_mirte_settings() { lines=$1 echo "$lines" >>~/.mirte_settings.sh From 9a45ccd135711e58b6d09cdcf8990a2b591acd30 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 6 Mar 2025 14:51:09 +0100 Subject: [PATCH 248/353] Update fake-hwclock on done --- install_mirte.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install_mirte.sh b/install_mirte.sh index cd8ab4c..2fe5c14 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -116,6 +116,9 @@ sudo apt install -y overlayroot #sudo bash -c "echo 'overlayroot=\"tmpfs\"' >> /etc/overlayroot.conf" +# update time in /etc/fake-hwclock.data +sudo fake-hwclock save + # remove force ipv4 sudo rm /etc/apt/apt.conf.d/99force-ipv4 || true sudo rm /etc/resolv.conf || true # remove resolv.conf to use the one from the network. From d760598d02d56ac5dcb84223d280eec17c09c2af Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 6 Mar 2025 16:48:54 +0100 Subject: [PATCH 249/353] Fix mirte_ros.sh mirte settings file --- install_mirte.sh | 2 +- services/mirte_ros.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install_mirte.sh b/install_mirte.sh index 2fe5c14..1abcfc6 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -117,7 +117,7 @@ sudo apt install -y overlayroot #sudo bash -c "echo 'overlayroot=\"tmpfs\"' >> /etc/overlayroot.conf" # update time in /etc/fake-hwclock.data -sudo fake-hwclock save +sudo fake-hwclock save # remove force ipv4 sudo rm /etc/apt/apt.conf.d/99force-ipv4 || true diff --git a/services/mirte_ros.sh b/services/mirte_ros.sh index 158641d..15608a1 100755 --- a/services/mirte_ros.sh +++ b/services/mirte_ros.sh @@ -4,7 +4,7 @@ LAUNCH_FILE="${1:-minimal}" # If the robot user wants to add their own config: -source /home/mirte/.mirte_settings +source /home/mirte/.mirte_settings.sh mkdir -p $ROS_LOG_DIR source /home/mirte/mirte_ws/install/setup.bash From 52753b64ac1de12e7b7a39bf23350699366d20b5 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Fri, 7 Mar 2025 15:02:54 +0100 Subject: [PATCH 250/353] Added mirte-gazebo to installer --- repos.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/repos.yaml b/repos.yaml index e362f25..8dad50e 100644 --- a/repos.yaml +++ b/repos.yaml @@ -16,6 +16,10 @@ repositories: url: https://github.com/arendjan/mirte-ros-packages.git version: develop recursive: true + mirte-gazebo: + type: git + url: https://github.com/mirte-robot/mirte-gazebo.git + version: develop mirte-oled-images: type: git url: https://github.com/mirte-robot/mirte-oled-images.git @@ -32,4 +36,4 @@ repositories: type: git url: https://github.com/mirte-robot/Telemetrix4RpiPico.git recursive: true - version: develop \ No newline at end of file + version: develop From c93037bd64d9082a920b1d403ce0d661beb42e56 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Wed, 19 Mar 2025 22:03:23 +0100 Subject: [PATCH 251/353] Updated nodejs to 18.0.0 --- install_web.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_web.sh b/install_web.sh index 9670ec2..3a7253d 100755 --- a/install_web.sh +++ b/install_web.sh @@ -10,7 +10,7 @@ sudo apt install -y python3-pip python3-setuptools python3-wheel sudo -H pip install nodeenv # Install nodeenv -nodeenv --node=16.2.0 $MIRTE_SRC_DIR/mirte-web-interface/node_env +nodeenv --node=18.0.0 $MIRTE_SRC_DIR/mirte-web-interface/node_env # Install web interface . $MIRTE_SRC_DIR/mirte-web-interface/node_env/bin/activate From fe175bc3a82fde3d143d756a51da1e23111fdd43 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 20 Mar 2025 15:49:23 +0100 Subject: [PATCH 252/353] add rosboard and create web interface script --- install_web.sh | 6 ++++++ services/mirte-web-interface.service | 2 +- services/mirte_web_interface.sh | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 services/mirte_web_interface.sh diff --git a/install_web.sh b/install_web.sh index 3a7253d..aa76017 100755 --- a/install_web.sh +++ b/install_web.sh @@ -18,12 +18,18 @@ nodeenv --node=18.0.0 $MIRTE_SRC_DIR/mirte-web-interface/node_env # Install frontend cd $MIRTE_SRC_DIR/mirte-web-interface/vue-frontend || exit 1 npm install . +npm rebuild npm run build # Install backend cd $MIRTE_SRC_DIR/mirte-web-interface/nodejs-backend || exit 1 npm install . +cd $MIRTE_SRC_DIR/mirte-web-interface +git clone https://github.com/dheera/rosboard.git +sudo pip3 install tornado +sudo pip3 install simplejpeg # recommended, but ROSboard can fall back to cv2 or PIL instead + # Install wetty #cd $MIRTE_SRC_DIR/mirte-web-interface #npm -g install wetty diff --git a/services/mirte-web-interface.service b/services/mirte-web-interface.service index 42d7d3f..458768c 100644 --- a/services/mirte-web-interface.service +++ b/services/mirte-web-interface.service @@ -7,7 +7,7 @@ After=network-online.target [Service] User=mirte # We need bash in bash since ROS noetic and NPM do not work nicely together -ExecStart=/bin/bash -c '/bin/bash -c "source /home/mirte/mirte_ws/install/setup.bash && python3 -m mirte_robot.linetrace" & /bin/bash -c "cd /usr/local/src/mirte/mirte-web-interface/ && source ./node_env/bin/activate && cd nodejs-backend && npm run backend"' +ExecStart=/usr/local/src/mirte/mirte-install-scripts/services/mirte_web_interface.sh # And we need a tty to strace it StandardInput=tty-force TTYVHangup=yes diff --git a/services/mirte_web_interface.sh b/services/mirte_web_interface.sh new file mode 100755 index 0000000..06487b0 --- /dev/null +++ b/services/mirte_web_interface.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -xe +source /home/mirte/.mirte_settings.sh + +source /home/mirte/mirte_ws/install/setup.bash + +python3 -m mirte_robot.linetrace & + +cd /usr/local/src/mirte/mirte-web-interface/rosboard +./run & + +cd /usr/local/src/mirte/mirte-web-interface/ +source ./node_env/bin/activate +cd nodejs-backend +npm run backend From 0a71ac288319c481bbed6e223031e064a349a594 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Tue, 25 Mar 2025 13:29:15 +0000 Subject: [PATCH 253/353] Let blink forever --- blink.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blink.sh b/blink.sh index dcceb14..a440b19 100755 --- a/blink.sh +++ b/blink.sh @@ -52,7 +52,7 @@ green_off() { echo "Blinking" echo "$VALUE" -for ((repeat = 0; repeat < 5; repeat++)); do +while true; do # Start sequence with fast blinking both for ((i = 0; i < 10; i++)); do FAST=$(echo "scale=2; $BLINK_SPEED/20" | bc) From 25c6816fc48bdea7929085d3fd90ce971563b983 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Fri, 28 Mar 2025 16:56:20 +0100 Subject: [PATCH 254/353] tmp fix for rosbridge_server not terminating --- services/mirte-ros.service | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/mirte-ros.service b/services/mirte-ros.service index b368c2c..14341ae 100644 --- a/services/mirte-ros.service +++ b/services/mirte-ros.service @@ -12,6 +12,8 @@ Restart=always RestartSec=5s User=mirte ExecStart=/usr/local/src/mirte/mirte-install-scripts/services/mirte_ros.sh +TimeoutStopSec=5s +#Need to be done due to bug https://github.com/RobotWebTools/rosbridge_suite/issues/1024 [Install] WantedBy=multi-user.target From e8ff8df78a2e60d3fd0c7470027b0cd5c7634819 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Fri, 28 Mar 2025 17:01:00 +0100 Subject: [PATCH 255/353] Disabling bluetooth on OPi Zero2 due to issues with wifi --- network_install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/network_install.sh b/network_install.sh index 71c000b..4a37f54 100755 --- a/network_install.sh +++ b/network_install.sh @@ -86,6 +86,11 @@ sudo chmod 777 /etc/hostname # Fix for wpa_supplicant error # sudo bash -c "echo 'match-device=driver:wlan0' >> /etc/NetworkManager/NetworkManager.conf" +# Fix for the aw859a (Orange Pi Zero2) driver. The wifi crashes when the bluetooth is +# working. We might need to see if bluetooth can be enabled after wifi was started +# correctly. For now, just disabling since we are not using it. +sudo systemctl disable aw859a-bluetooth || true + # Reboot after kernel panic # The OPi has a fairly unstable wifi driver which might # panic the kernel (at boot). Instead of waiting an unkown From 0fc00c763528280c0f98b745ce1c68a2db49403a Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 1 Apr 2025 15:07:08 +0200 Subject: [PATCH 256/353] Add zerotier to image --- install_web.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install_web.sh b/install_web.sh index aa76017..d125e39 100755 --- a/install_web.sh +++ b/install_web.sh @@ -58,3 +58,10 @@ sudo systemctl daemon-reload sudo systemctl stop mirte-web-interface || /bin/true sudo systemctl start mirte-web-interface sudo systemctl enable mirte-web-interface + +# install zerotier for better ros2 networking. User will need to manually join the network +curl -s https://install.zerotier.com | sudo bash +# remove zerotier identity as it otherwise will be the same for all devices using the same image +sudo rm /var/lib/zerotier-one/identity.public +sudo rm /var/lib/zerotier-one/identity.secret +# new identity should be generated on first boot From 50d41a3e7e4fe198255aa5c0060c3999ed39ed47 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 1 Apr 2025 15:28:33 +0200 Subject: [PATCH 257/353] Fix pam module strange chars passwords --- pam/storepassword.c | 36 +++++++++++++++++++++++++++++++----- pam/test.c | 2 ++ 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/pam/storepassword.c b/pam/storepassword.c index 3fd0fbb..44e94a0 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -1,5 +1,7 @@ #define PAM_SM_PASSWORD 1 #include "mirte_pam.h" +#include +#include PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv) { if (flags & PAM_PRELIM_CHECK) { @@ -18,14 +20,38 @@ void savePassword(char *username, char *passwd) { if (strcmp(username, mirte_username) != 0) { return; } + // filter out string with non-ASCII characters, only allow a-zA-Z0-9 + // and some special characters + char *new_passwd = (char *)malloc(strlen(passwd) + 1); + if (new_passwd == NULL) { + printf(RED "Mirte:\t" RESET "Memory allocation failed.\n"); + return; + } + int new_passwd_i = 0; + for (int i = 0; i < strlen(passwd); i++) { + if (isalpha(passwd[i]) || isdigit(passwd[i]) || passwd[i] == '-' || + passwd[i] == '_') { + new_passwd[new_passwd_i] = passwd[i]; + new_passwd_i++; + } + } + new_passwd[new_passwd_i] = '\0'; + if (new_passwd_i < 8) { + printf(RED "Mirte:\t" RESET "Password is too short, not storing " + "password for Wi-Fi.\n"); + free(new_passwd); + return; + } printf(GRN "Mirte:\t" RESET "The new password for \"%s\" is \"%s\".\n" GRN "Mirte:\t" RESET "The password will be updated for the webpages.\n" GRN "Mirte:\t" RESET "The Wi-Fi password will be updated at next boot!\n", - username, passwd); - if (strlen(passwd) < 8) { - printf(RED "Mirte:\t" RESET "Password is too short, not storing " - "password for Wi-Fi.\n"); + username, new_passwd); + if (strlen(new_passwd) != strlen(passwd)) { + printf(RED "Mirte:\t" RESET + "Original password contained non-ASCII characters, they are " + "removed from the Wi-Fi password.\n"); + free(new_passwd); return; } if (!checkDirectory()) { @@ -35,7 +61,7 @@ void savePassword(char *username, char *passwd) { return; } FILE *file = fopen(wifi_filename, "w"); - fprintf(file, "%s", passwd); + fprintf(file, "%s", new_passwd); fclose(file); } diff --git a/pam/test.c b/pam/test.c index ad0b5ce..45dce0a 100644 --- a/pam/test.c +++ b/pam/test.c @@ -9,4 +9,6 @@ int main() { savePassword("mirte", "ww"); printf("Mirte user test:\n"); savePassword("mirte", "ww12345677"); + printf("Mirte user test strange chars:\n"); + savePassword("mirte", "ww12345677!@#$%^&*()_+"); } \ No newline at end of file From 8db650b05cd8bbb798b814ff5f6419d118a1f746 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 1 Apr 2025 15:55:24 +0200 Subject: [PATCH 258/353] improve pam text when removed chars pwd --- pam/storepassword.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pam/storepassword.c b/pam/storepassword.c index 44e94a0..2c93d7e 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -46,11 +46,13 @@ void savePassword(char *username, char *passwd) { "Mirte:\t" RESET "The new password for \"%s\" is \"%s\".\n" GRN "Mirte:\t" RESET "The password will be updated for the webpages.\n" GRN "Mirte:\t" RESET "The Wi-Fi password will be updated at next boot!\n", - username, new_passwd); + username, passwd); if (strlen(new_passwd) != strlen(passwd)) { printf(RED "Mirte:\t" RESET "Original password contained non-ASCII characters, they are " - "removed from the Wi-Fi password.\n"); + "removed from the Wi-Fi password.\n" + RED + "Mirte:\t" RESET "New Wi-Fi password is \"%s\".\n", new_passwd); free(new_passwd); return; } From cdbdf71b3a1e0adb47ddb5f851b85898c2c50cd7 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 1 Apr 2025 16:00:20 +0200 Subject: [PATCH 259/353] Fix styling pam --- pam/storepassword.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pam/storepassword.c b/pam/storepassword.c index 2c93d7e..6283eb9 100644 --- a/pam/storepassword.c +++ b/pam/storepassword.c @@ -50,9 +50,9 @@ void savePassword(char *username, char *passwd) { if (strlen(new_passwd) != strlen(passwd)) { printf(RED "Mirte:\t" RESET "Original password contained non-ASCII characters, they are " - "removed from the Wi-Fi password.\n" - RED - "Mirte:\t" RESET "New Wi-Fi password is \"%s\".\n", new_passwd); + "removed from the Wi-Fi password.\n" RED "Mirte:\t" RESET + "New Wi-Fi password is \"%s\".\n", + new_passwd); free(new_passwd); return; } From 73933c60e3d55337c414d49836dc31bd9b9967ec Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 2 Apr 2025 07:19:53 +0200 Subject: [PATCH 260/353] Update install_web.sh --- install_web.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_web.sh b/install_web.sh index d125e39..88c142f 100755 --- a/install_web.sh +++ b/install_web.sh @@ -62,6 +62,6 @@ sudo systemctl enable mirte-web-interface # install zerotier for better ros2 networking. User will need to manually join the network curl -s https://install.zerotier.com | sudo bash # remove zerotier identity as it otherwise will be the same for all devices using the same image -sudo rm /var/lib/zerotier-one/identity.public -sudo rm /var/lib/zerotier-one/identity.secret +sudo rm /var/lib/zerotier-one/identity.public || true +sudo rm /var/lib/zerotier-one/identity.secret || true # new identity should be generated on first boot From e289d810ee318ebd950ef7b702c21118d6585e51 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 2 Apr 2025 16:17:23 +0200 Subject: [PATCH 261/353] Update cmakelists --- .github/workflows/test_install.yml | 2 +- mirte-master/usb_switch/CMakeLists.txt | 2 +- pam/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index cd9cc4c..f8ccb7f 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: arduino-install: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 diff --git a/mirte-master/usb_switch/CMakeLists.txt b/mirte-master/usb_switch/CMakeLists.txt index 52be395..0886ec7 100644 --- a/mirte-master/usb_switch/CMakeLists.txt +++ b/mirte-master/usb_switch/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10..3.22) project(mirte_master_usb_switch) add_compile_options(-lgpiodcxx) diff --git a/pam/CMakeLists.txt b/pam/CMakeLists.txt index 565d6b7..a1dc633 100644 --- a/pam/CMakeLists.txt +++ b/pam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.10..3.22) project(mirte_pam) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") From e6b0702b376220c8f006dc5e236a492d2f3ab77a Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 3 Apr 2025 13:05:09 +0200 Subject: [PATCH 262/353] Add tmp fix rosbridge_server to master ros as well --- services/mirte-master-ros.service | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/mirte-master-ros.service b/services/mirte-master-ros.service index 423a684..b267cfb 100644 --- a/services/mirte-master-ros.service +++ b/services/mirte-master-ros.service @@ -12,6 +12,8 @@ Restart=always RestartSec=5s User=mirte ExecStart=/usr/local/src/mirte/mirte-install-scripts/services/mirte_ros.sh minimal_master +TimeoutStopSec=5s +#Need to be done due to bug https://github.com/RobotWebTools/rosbridge_suite/issues/1024 [Install] WantedBy=multi-user.target From e0d343432b719b499570a7582531b67b8922aa3e Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 3 Apr 2025 14:51:44 +0200 Subject: [PATCH 263/353] Add check pico for easy updating + fix pico not rebooting after flash --- check_pico.sh | 17 +++++++++++++++++ run_arduino.sh | 8 +++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 check_pico.sh diff --git a/check_pico.sh b/check_pico.sh new file mode 100755 index 0000000..611cba9 --- /dev/null +++ b/check_pico.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +sudo picotool verify -f ../mirte-telemetrix4rpipico/build/Telemetrix4RpiPico.uf2 +if [ $? -eq 0 ]; then + echo "Verification successful!" +else + echo "Verification failed!" + echo "running upload" + sudo picotool load -f ../mirte-telemetrix4rpipico/build/telemetrix4rpipico.uf2 +fi + +sleep 5 +# if lsusb has pico boot, then run reboot +if lsusb | grep -q "Raspberry Pi RP2 Boot"; then + echo "Pico found, rebooting..." + sudo picotool reboot +fi \ No newline at end of file diff --git a/run_arduino.sh b/run_arduino.sh index 8a04371..3a472f1 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -88,7 +88,13 @@ elif [[ $COMMAND == upload* ]]; then ERR=false sudo picotool load -f $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico.uf2 || ERR=true sleep 1 - sudo picotool reboot || true # just to make sure, sometimes it does not reboot automatically + sudo picotool verify -f ../mirte-telemetrix4rpipico/build/Telemetrix4RpiPico.uf2 + + # if lsusb has pico boot, then run reboot + if lsusb | grep -q "Raspberry Pi RP2 Boot"; then + sudo picotool reboot + fi + if $ERR; then echo "Failed to upload to Pico using picotool, trying using uart" upload_pico_uart From e11b2ba4473ae1d59bb9dadcba77f3d4a35688f1 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 4 Apr 2025 11:35:30 +0200 Subject: [PATCH 264/353] Fix run arduino usb boot --- run_arduino.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/run_arduino.sh b/run_arduino.sh index 3a472f1..2354704 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -1,8 +1,9 @@ #!/bin/bash -# set -xe +# set -x #TODO: script should have format ./run.sh build|upload] mcu_type COMMAND=$1 + if [ -z "$COMMAND" ]; then echo "Usage: $0 build_[mcu] | upload_[mcu]" echo "Example: $0 build_nano" @@ -11,6 +12,8 @@ if [ -z "$COMMAND" ]; then fi MIRTE_SRC_DIR=/usr/local/src/mirte +PICO_BUILD_LOCATION=$MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico + # Check if ROS is running ROS_RUNNING=1 systemctl is-active mirte-ros | grep 'inactive' &>/dev/null @@ -45,7 +48,7 @@ upload_pico_uart() { sleep 1 # try to upload ERR=false - pico_py_serial_flasher $port $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico.elf || ERR=true + pico_py_serial_flasher $port $PICO_BUILD_LOCATION.elf || ERR=true if $ERR; then echo "Failed to upload to Pico using pico_py_serial_flash port $port" else @@ -86,10 +89,10 @@ elif [[ $COMMAND == upload* ]]; then buildpico # This will always upload telemetrix4rpipico.uf2, so no need to pass a file ERR=false - sudo picotool load -f $MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico.uf2 || ERR=true - sleep 1 - sudo picotool verify -f ../mirte-telemetrix4rpipico/build/Telemetrix4RpiPico.uf2 - + sudo picotool load -f $PICO_BUILD_LOCATION.uf2 || ERR=true + sleep 2 + sudo picotool verify -f $PICO_BUILD_LOCATION.uf2 && ERR=false || ERR=true # if verifying is okay, then it's also good + sleep 2 # if lsusb has pico boot, then run reboot if lsusb | grep -q "Raspberry Pi RP2 Boot"; then sudo picotool reboot From cc9ce02574cefd4e49ddd6df614ffb57b04cbdce Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 4 Apr 2025 11:50:55 +0200 Subject: [PATCH 265/353] reboot after overlay expansion + mac for hostname --- network_setup.sh | 17 ++++++++++++----- services/mirte_expandoverlay.sh | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/network_setup.sh b/network_setup.sh index d0b1641..36c2c4f 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -133,18 +133,25 @@ sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf || true # This must be run every time on boot, since it should # be generated on first boot (so not when generating # the image in network_setup.sh) - -if false; then # when using mac for hostname. +USE_MAC=true +if ! ip addr show "wlan0" | grep -q ether; then + USE_MAC=false + echo "No MAC address found, using random ID" +fi +if $USE_MAC; then # when using mac for hostname. mac=$(ip addr show "wlan0" | awk '/ether/{print $2}') UNIQUE_ID=$(echo -n $mac | tr -cd "1-9A-Fa-f" | tail -c 6) # last 6 characters of mac address, without colons or 0s MIRTE_SSID="Mirte-$(echo ${UNIQUE_ID^^})" echo "Generated SSID: $MIRTE_SSID" # add to check: || [[ "$(cat /etc/hostname)" != "$MIRTE_SSID" ]] -fi - -if [ ! -f /etc/ssid ] || [[ $(cat /etc/hostname) == "Mirte-XXXXXX" ]]; then +else + # This is the default SSID, when no MAC address is found + # This should be changed to a unique ID UNIQUE_ID=$(tr -cd "1-9A-F" /etc/hostname' sudo ln -s /etc/hostname /etc/ssid # And add them to the hosts file diff --git a/services/mirte_expandoverlay.sh b/services/mirte_expandoverlay.sh index 685e12f..b530dbd 100755 --- a/services/mirte_expandoverlay.sh +++ b/services/mirte_expandoverlay.sh @@ -30,3 +30,4 @@ EOF sudo resize2fs "$DISK_AND_PART" touch /home/mirte/.overlay_expanded # create file to indicate that overlay is expanded, this is stored on the overlay +sudo reboot now \ No newline at end of file From 4e3e9a2c68e41baf8d292d924b417285f427cc97 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 4 Apr 2025 13:15:07 +0200 Subject: [PATCH 266/353] stylecheck fixes --- check_pico.sh | 14 +++++++------- network_setup.sh | 2 +- run_arduino.sh | 3 +-- services/mirte_expandoverlay.sh | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/check_pico.sh b/check_pico.sh index 611cba9..4329ecd 100755 --- a/check_pico.sh +++ b/check_pico.sh @@ -2,16 +2,16 @@ sudo picotool verify -f ../mirte-telemetrix4rpipico/build/Telemetrix4RpiPico.uf2 if [ $? -eq 0 ]; then - echo "Verification successful!" + echo "Verification successful!" else - echo "Verification failed!" - echo "running upload" - sudo picotool load -f ../mirte-telemetrix4rpipico/build/telemetrix4rpipico.uf2 + echo "Verification failed!" + echo "running upload" + sudo picotool load -f ../mirte-telemetrix4rpipico/build/telemetrix4rpipico.uf2 fi sleep 5 # if lsusb has pico boot, then run reboot if lsusb | grep -q "Raspberry Pi RP2 Boot"; then - echo "Pico found, rebooting..." - sudo picotool reboot -fi \ No newline at end of file + echo "Pico found, rebooting..." + sudo picotool reboot +fi diff --git a/network_setup.sh b/network_setup.sh index 36c2c4f..7f3af31 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -151,7 +151,7 @@ else MIRTE_SSID=Mirte-$(echo ${UNIQUE_ID^^}) fi -if [ ! -f /etc/ssid ] || [[ $(cat /etc/hostname) == "Mirte-XXXXXX" ]] || ( $USE_MAC && [[ "$(cat /etc/hostname)" != "$MIRTE_SSID" ]] ); then +if [ ! -f /etc/ssid ] || [[ $(cat /etc/hostname) == "Mirte-XXXXXX" ]] || ($USE_MAC && [[ "$(cat /etc/hostname)" != "$MIRTE_SSID" ]]); then sudo bash -c 'echo '$MIRTE_SSID' > /etc/hostname' sudo ln -s /etc/hostname /etc/ssid # And add them to the hosts file diff --git a/run_arduino.sh b/run_arduino.sh index 2354704..ab21631 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -3,7 +3,6 @@ #TODO: script should have format ./run.sh build|upload] mcu_type COMMAND=$1 - if [ -z "$COMMAND" ]; then echo "Usage: $0 build_[mcu] | upload_[mcu]" echo "Example: $0 build_nano" @@ -97,7 +96,7 @@ elif [[ $COMMAND == upload* ]]; then if lsusb | grep -q "Raspberry Pi RP2 Boot"; then sudo picotool reboot fi - + if $ERR; then echo "Failed to upload to Pico using picotool, trying using uart" upload_pico_uart diff --git a/services/mirte_expandoverlay.sh b/services/mirte_expandoverlay.sh index b530dbd..39347dc 100755 --- a/services/mirte_expandoverlay.sh +++ b/services/mirte_expandoverlay.sh @@ -30,4 +30,4 @@ EOF sudo resize2fs "$DISK_AND_PART" touch /home/mirte/.overlay_expanded # create file to indicate that overlay is expanded, this is stored on the overlay -sudo reboot now \ No newline at end of file +sudo reboot now From 17e25f480169bf562d09ff92ce0a0cf0e81d98c1 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Fri, 4 Apr 2025 20:45:09 +0200 Subject: [PATCH 267/353] Disabled armbian-led-state --- network_install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/network_install.sh b/network_install.sh index 4a37f54..389caf9 100755 --- a/network_install.sh +++ b/network_install.sh @@ -89,7 +89,10 @@ sudo chmod 777 /etc/hostname # Fix for the aw859a (Orange Pi Zero2) driver. The wifi crashes when the bluetooth is # working. We might need to see if bluetooth can be enabled after wifi was started # correctly. For now, just disabling since we are not using it. -sudo systemctl disable aw859a-bluetooth || true +sudo systemctl disable aw859a-bluetooth || /bin/true + +# Disable armbian-led-state +sudo systemctl disable armbian-led-state || /bin/true # Reboot after kernel panic # The OPi has a fairly unstable wifi driver which might From c1127774f1bcc62a157d69ea4ac1872893bf38cb Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Fri, 4 Apr 2025 18:47:14 +0000 Subject: [PATCH 268/353] Fix for late IP addresses --- network_setup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/network_setup.sh b/network_setup.sh index d0b1641..5ea4b04 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -79,7 +79,12 @@ function check_connection { printf 'Connected to wifi connection:' nmcli con show --active | grep wlan0 - $MIRTE_SRC_DIR/mirte-install-scripts/blink.sh "$(hostname -I)" & + while [ -z "$(hostname -I)" ]; do + echo "Waiting for IP address..." + sleep 1 + done + echo "Got IP: $(hostname -I)" + $MIRTE_SRC_DIR/mirte-install-scripts/blink.sh $(hostname -I) & start_avahi else printf 'No connection found, starting AP with wifi connect\n' From 6f316a16f7879222fe72c91e8083e0f9de27b655 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 7 Apr 2025 16:31:19 +0200 Subject: [PATCH 269/353] Change clearpath repo for fix --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 867e05c..1d43cc0 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -148,7 +148,7 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then git clone https://github.com/Slamtec/rplidar_ros.git -b ros2 # FIXME-FUTURE: Can be installed in newer versions if V2.1.5 is released git clone https://github.com/ArendJan/ros2_astra_camera.git -b fix-ros-jammy # compressed images image transport fixes, fork of orbbec/... with also lazy nodes - git clone https://github.com/clearpathrobotics/clearpath_mecanum_drive_controller # FIXME: Can be installed from apt? why build? + git clone https://github.com/ArendJan/clearpath_mecanum_drive_controller.git -b devAJ # FIXME: Revert to main repo once PR is merged. Can be installed from apt? why build? cd ../../ mkdir temp cd temp || exit 1 From 4a9a3b3687c289591e7b4aea33e3f4a241030954 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 7 Apr 2025 17:07:49 +0200 Subject: [PATCH 270/353] stylefixes --- install_ROS2.sh | 2 +- network_setup.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 1d43cc0..04d9477 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -147,7 +147,7 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then cd /home/mirte/mirte_ws/src || exit 1 git clone https://github.com/Slamtec/rplidar_ros.git -b ros2 # FIXME-FUTURE: Can be installed in newer versions if V2.1.5 is released - git clone https://github.com/ArendJan/ros2_astra_camera.git -b fix-ros-jammy # compressed images image transport fixes, fork of orbbec/... with also lazy nodes + git clone https://github.com/ArendJan/ros2_astra_camera.git -b fix-ros-jammy # compressed images image transport fixes, fork of orbbec/... with also lazy nodes git clone https://github.com/ArendJan/clearpath_mecanum_drive_controller.git -b devAJ # FIXME: Revert to main repo once PR is merged. Can be installed from apt? why build? cd ../../ mkdir temp diff --git a/network_setup.sh b/network_setup.sh index a9330e5..7363036 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -79,12 +79,12 @@ function check_connection { printf 'Connected to wifi connection:' nmcli con show --active | grep wlan0 - while [ -z "$(hostname -I)" ]; do - echo "Waiting for IP address..." - sleep 1 - done - echo "Got IP: $(hostname -I)" - $MIRTE_SRC_DIR/mirte-install-scripts/blink.sh $(hostname -I) & + while [ -z "$(hostname -I)" ]; do + echo "Waiting for IP address..." + sleep 1 + done + echo "Got IP: $(hostname -I)" + $MIRTE_SRC_DIR/mirte-install-scripts/blink.sh "$(hostname -I)" & start_avahi else printf 'No connection found, starting AP with wifi connect\n' From ebc208dc3d7562ab7cd70e0e0efab3c6b131b76f Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 8 Apr 2025 12:58:53 +0200 Subject: [PATCH 271/353] ev3 executable --- ev3-usb.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 ev3-usb.sh diff --git a/ev3-usb.sh b/ev3-usb.sh old mode 100644 new mode 100755 From 8fba88b45fff677d4f1499e3c02a3626d94d3409 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 8 Apr 2025 13:12:09 +0200 Subject: [PATCH 272/353] waiting for wlan up 3b fix --- network_setup.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/network_setup.sh b/network_setup.sh index 7363036..da76024 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -1,5 +1,14 @@ #!/bin/bash +# wait for wlan0 to be up, with max 30 seconds +TIMEOUT=30 +NEXT_WAIT_TIME=0 +until [ $NEXT_WAIT_TIME -eq $TIMEOUT ] || ip addr show "wlan0"; do + echo "waiting for wlan0" + sleep 1 + let "NEXT_WAIT_TIME=NEXT_WAIT_TIME+1" +done + function start_avahi { # Restart avahi-daemon, to clear all previous addresses and hosts service avahi-daemon restart && sleep 1 From bc6347bdb543bee9487e4fac36452a711af34874 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 10 Apr 2025 22:41:57 +0200 Subject: [PATCH 273/353] Revert to clearpath repo mechanum drive --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 04d9477..28b22ca 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -148,7 +148,7 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then git clone https://github.com/Slamtec/rplidar_ros.git -b ros2 # FIXME-FUTURE: Can be installed in newer versions if V2.1.5 is released git clone https://github.com/ArendJan/ros2_astra_camera.git -b fix-ros-jammy # compressed images image transport fixes, fork of orbbec/... with also lazy nodes - git clone https://github.com/ArendJan/clearpath_mecanum_drive_controller.git -b devAJ # FIXME: Revert to main repo once PR is merged. Can be installed from apt? why build? + git clone https://github.com/clearpathrobotics/clearpath_mecanum_drive_controller # FIXME: Can be installed from apt? why build? cd ../../ mkdir temp cd temp || exit 1 From 5073342fca733d104d5de4022769850ca8caca5f Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Thu, 24 Apr 2025 19:24:43 +0200 Subject: [PATCH 274/353] Added Apache2 license --- LICENSE | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..307b1ab --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2025, TU Delft + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 0ed6c38d98a280c11331f2873aadf42d4d2cec7f Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 2 May 2025 12:02:35 +0200 Subject: [PATCH 275/353] Fix zerotier wifi-connect --- network_install.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/network_install.sh b/network_install.sh index 389caf9..5a979e6 100755 --- a/network_install.sh +++ b/network_install.sh @@ -23,10 +23,15 @@ sudo apt install -y network-manager # Install wifi-connect MY_ARCH=$(arch) if [[ "$MY_ARCH" == "armv7l" ]]; then MY_ARCH="rpi"; fi -# TODO: This version is from Feb 20, 2023 maybe upgrade soon... +# TODO: check with armv7 if it works and dynamically download the correct version # skip if amd64 if [[ "$MY_ARCH" != "x86_64" ]]; then - wget "https://github.com/balena-os/wifi-connect/releases/download/v4.11.1/wifi-connect-v4.11.1-linux-$(echo "$MY_ARCH").zip" + if [[ "$MY_ARCH" == "aarch64" ]]; then + wget https://github.com/ArendJan/balena-os-wifi-connect/releases/download/fix-zerotier/wifi-connect-aarch64-unknown-linux-gnu.zip + fi + if [[ "$MY_ARCH" == "???" ]]; then + wget https://github.com/ArendJan/balena-os-wifi-connect/releases/download/fix-zerotier/wifi-connect-armv7-unknown-linux-gnueabihf.zip + fi unzip wifi-connect* sudo mv wifi-connect /usr/local/sbin rm wifi-connect* From 5cd7bac9b3c528588e03ecd134d26131166d7dcc Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 2 May 2025 12:07:56 +0200 Subject: [PATCH 276/353] Upd fix scripts for wifi-connect --- fix_scripts/fix-wifi-connect.sh | 16 +++++++++ fix_scripts/fix_arm.sh | 26 --------------- fix_scripts/update_all.sh | 58 --------------------------------- fix_scripts/update_tmx.sh | 12 ------- 4 files changed, 16 insertions(+), 96 deletions(-) create mode 100644 fix_scripts/fix-wifi-connect.sh delete mode 100644 fix_scripts/fix_arm.sh delete mode 100644 fix_scripts/update_all.sh delete mode 100644 fix_scripts/update_tmx.sh diff --git a/fix_scripts/fix-wifi-connect.sh b/fix_scripts/fix-wifi-connect.sh new file mode 100644 index 0000000..24e4790 --- /dev/null +++ b/fix_scripts/fix-wifi-connect.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -xe +# create tmp directory +tmp_dir=$(mktemp -d) + +cd $tmp_dir +MY_ARCH=$(arch) +if [[ "$MY_ARCH" == "aarch64" ]]; then + wget https://github.com/ArendJan/balena-os-wifi-connect/releases/download/fix-zerotier/wifi-connect-aarch64-unknown-linux-gnu.zip +fi +if [[ "$MY_ARCH" == "???" ]]; then + wget https://github.com/ArendJan/balena-os-wifi-connect/releases/download/fix-zerotier/wifi-connect-armv7-unknown-linux-gnueabihf.zip +fi +unzip wifi-connect* +sudo mv wifi-connect /usr/local/sbin +rm wifi-connect* diff --git a/fix_scripts/fix_arm.sh b/fix_scripts/fix_arm.sh deleted file mode 100644 index 2993c72..0000000 --- a/fix_scripts/fix_arm.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -set -xe -#TODO: fix for ROS2 if required - -rm -rf ~/arm_temp || true -mkdir ~/arm_temp -cd ~/arm_temp -sudo systemctl stop mirte-ros -wget https://mirte.arend-jan.com/files/telemetrix/release/Telemetrix4RpiPico.uf2 -sudo picotool info Telemetrix4RpiPico.uf2 -sudo picotool load -f Telemetrix4RpiPico.uf2 -cd /usr/local/src/mirte/mirte-tmx-pico-aio -git pull -pip install . -pip install aioconsole -python3 examples/mirte_master_reset_offset.py -sleep 10 -python3 examples/mirte_master_set_ranges_volt.py -sleep 10 -python3 examples/mirte_master_check_home.py Date: Fri, 2 May 2025 13:34:40 +0200 Subject: [PATCH 277/353] style fixes --- fix_scripts/fix-wifi-connect.sh | 4 ++-- install_ROS2.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fix_scripts/fix-wifi-connect.sh b/fix_scripts/fix-wifi-connect.sh index 24e4790..c1930c8 100644 --- a/fix_scripts/fix-wifi-connect.sh +++ b/fix_scripts/fix-wifi-connect.sh @@ -6,10 +6,10 @@ tmp_dir=$(mktemp -d) cd $tmp_dir MY_ARCH=$(arch) if [[ "$MY_ARCH" == "aarch64" ]]; then - wget https://github.com/ArendJan/balena-os-wifi-connect/releases/download/fix-zerotier/wifi-connect-aarch64-unknown-linux-gnu.zip + wget https://github.com/ArendJan/balena-os-wifi-connect/releases/download/fix-zerotier/wifi-connect-aarch64-unknown-linux-gnu.zip fi if [[ "$MY_ARCH" == "???" ]]; then - wget https://github.com/ArendJan/balena-os-wifi-connect/releases/download/fix-zerotier/wifi-connect-armv7-unknown-linux-gnueabihf.zip + wget https://github.com/ArendJan/balena-os-wifi-connect/releases/download/fix-zerotier/wifi-connect-armv7-unknown-linux-gnueabihf.zip fi unzip wifi-connect* sudo mv wifi-connect /usr/local/sbin diff --git a/install_ROS2.sh b/install_ROS2.sh index 28b22ca..867e05c 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -147,7 +147,7 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then cd /home/mirte/mirte_ws/src || exit 1 git clone https://github.com/Slamtec/rplidar_ros.git -b ros2 # FIXME-FUTURE: Can be installed in newer versions if V2.1.5 is released - git clone https://github.com/ArendJan/ros2_astra_camera.git -b fix-ros-jammy # compressed images image transport fixes, fork of orbbec/... with also lazy nodes + git clone https://github.com/ArendJan/ros2_astra_camera.git -b fix-ros-jammy # compressed images image transport fixes, fork of orbbec/... with also lazy nodes git clone https://github.com/clearpathrobotics/clearpath_mecanum_drive_controller # FIXME: Can be installed from apt? why build? cd ../../ mkdir temp From d45c0c2e6f1dd1cfa7a0327319eea1da991b7428 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Mon, 12 May 2025 10:02:21 +0000 Subject: [PATCH 278/353] Set ROS2 default to localhost only --- install_ROS2.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install_ROS2.sh b/install_ROS2.sh index 867e05c..87e545a 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -109,6 +109,9 @@ add_rc "# Enable Zenoh and multirobot in .mirte_settings.sh" add_rc "source /home/mirte/mirte_ws/install/setup.bash" "# sourced later on" +# By default the ROS communication should only be localhost. +add_mirte_settings "export ROS_LOCALHOST_ONLY=1" + # shellcheck source=/dev/null source /home/mirte/mirte_ws/install/setup.bash From 21a186e6768767fa33077e9d01f1c9b2ac3ae6cd Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 15 May 2025 14:07:38 +0200 Subject: [PATCH 279/353] hostname generation back to default, not mac --- fix_scripts/fix-wifi-connect.sh | 2 +- install_ROS2.sh | 1 + network_setup.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fix_scripts/fix-wifi-connect.sh b/fix_scripts/fix-wifi-connect.sh index c1930c8..b7338b4 100644 --- a/fix_scripts/fix-wifi-connect.sh +++ b/fix_scripts/fix-wifi-connect.sh @@ -8,7 +8,7 @@ MY_ARCH=$(arch) if [[ "$MY_ARCH" == "aarch64" ]]; then wget https://github.com/ArendJan/balena-os-wifi-connect/releases/download/fix-zerotier/wifi-connect-aarch64-unknown-linux-gnu.zip fi -if [[ "$MY_ARCH" == "???" ]]; then +if [[ "$MY_ARCH" == "armv7l" ]]; then wget https://github.com/ArendJan/balena-os-wifi-connect/releases/download/fix-zerotier/wifi-connect-armv7-unknown-linux-gnueabihf.zip fi unzip wifi-connect* diff --git a/install_ROS2.sh b/install_ROS2.sh index 87e545a..06a16c2 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -117,6 +117,7 @@ source /home/mirte/mirte_ws/install/setup.bash # Add systemd service to start ROS nodes if [[ $MIRTE_TYPE == "mirte-master" ]]; then # master version should start a different launch file + add_mirte_settings "export ROS_LOCALHOST_ONLY=0" # rename the service file to the correct name, otherwise systemctl will error with a "Failed to look up unit file state: Link has been severed" error mv $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-ros.service $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-ros-pioneer.service mv $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-master-ros.service $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-ros.service diff --git a/network_setup.sh b/network_setup.sh index da76024..8d89163 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -147,7 +147,7 @@ sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf || true # This must be run every time on boot, since it should # be generated on first boot (so not when generating # the image in network_setup.sh) -USE_MAC=true +USE_MAC=false if ! ip addr show "wlan0" | grep -q ether; then USE_MAC=false echo "No MAC address found, using random ID" From 2d782598461fed18599d7e8d8ba7b643c2ff2404 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 16 May 2025 13:35:34 +0200 Subject: [PATCH 280/353] Add fastdds discovery support mirte-ros service --- services/mirte_ros.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/services/mirte_ros.sh b/services/mirte_ros.sh index 15608a1..f625daa 100755 --- a/services/mirte_ros.sh +++ b/services/mirte_ros.sh @@ -14,5 +14,13 @@ if [ "$RMW_IMPLEMENTATION" = "rmw_zenoh_cpp" ]; then sudo pkill -9 -f ^ros && ros2 daemon stop ros2 run rmw_zenoh_cpp rmw_zenohd & fi - +if [ "$MIRTE_FASTDDS" = "true" ]; then + if [ -z "$(ss -l | grep -w "11811")" ]; then + echo "starting discovery server on port 11811" + # echo "Please run a discovery server on port 11811 with the following command:" + fastdds discovery --server-id 0 -p 11811 & + fi + ros2 daemon stop + ros2 daemon start +fi ros2 launch mirte_bringup $LAUNCH_FILE.launch.py From ad4a4b3d4e1dfedf6c41d4ad524f6263fa361a97 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 21 May 2025 13:08:30 +0200 Subject: [PATCH 281/353] Add fix networking --- fix_scripts/fix-networking.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 fix_scripts/fix-networking.sh diff --git a/fix_scripts/fix-networking.sh b/fix_scripts/fix-networking.sh new file mode 100644 index 0000000..aa2e44d --- /dev/null +++ b/fix_scripts/fix-networking.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -xe +echo "Starting networking fix script" + +cd /home/mirte/mirte_ws/src/mirte-ros-packages/ +git fetch --all +git pull +git switch develop || true +cd /home/mirte/mirte_ws/src/ros_astra_camera/ +git fetch --all +git pull +cd /home/mirte/mirte_ws/ + +colcon build --symlink-install --package-select mirte_fastdds_discovery_setup astra_camera +source /home/mirte/mirte_ws/install/setup.bash +# add MIRTE_FASTDDS=true to .mirte_settings.sh +echo "MIRTE_FASTDDS=true" >> /home/mirte/.mirte_settings.sh + +echo "rebooting in 10 seconds" +sleep 10 +sudo reboot now \ No newline at end of file From 7d8ad4164f2fa656c1218439b0510e03d75564de Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 21 May 2025 13:29:42 +0200 Subject: [PATCH 282/353] Fix fix networking script --- fix_scripts/fix-networking.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fix_scripts/fix-networking.sh b/fix_scripts/fix-networking.sh index aa2e44d..a9eb1c2 100644 --- a/fix_scripts/fix-networking.sh +++ b/fix_scripts/fix-networking.sh @@ -1,21 +1,25 @@ #!/bin/bash set -xe echo "Starting networking fix script" - +sudo apt update +# sudo apt-get upgrade -y "ros-humble- cd /home/mirte/mirte_ws/src/mirte-ros-packages/ git fetch --all git pull git switch develop || true -cd /home/mirte/mirte_ws/src/ros_astra_camera/ +cd /home/mirte/mirte_ws/src/ros2_astra_camera/ git fetch --all git pull cd /home/mirte/mirte_ws/ - -colcon build --symlink-install --package-select mirte_fastdds_discovery_setup astra_camera +source ./install/setup.bash +colcon build --symlink-install --packages-select mirte_fastdds_discovery_setup astra_camera source /home/mirte/mirte_ws/install/setup.bash # add MIRTE_FASTDDS=true to .mirte_settings.sh echo "MIRTE_FASTDDS=true" >> /home/mirte/.mirte_settings.sh +cd /usr/local/src/mirte/mirte-install-scripts/ +git fetch --all +git pull echo "rebooting in 10 seconds" sleep 10 sudo reboot now \ No newline at end of file From 689d4e8b7b18f0853cf391d96110060034712e3a Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 21 May 2025 13:57:38 +0200 Subject: [PATCH 283/353] Fix service update networking fix --- fix_scripts/fix-networking.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fix_scripts/fix-networking.sh b/fix_scripts/fix-networking.sh index a9eb1c2..2a0990f 100644 --- a/fix_scripts/fix-networking.sh +++ b/fix_scripts/fix-networking.sh @@ -15,11 +15,14 @@ source ./install/setup.bash colcon build --symlink-install --packages-select mirte_fastdds_discovery_setup astra_camera source /home/mirte/mirte_ws/install/setup.bash # add MIRTE_FASTDDS=true to .mirte_settings.sh -echo "MIRTE_FASTDDS=true" >> /home/mirte/.mirte_settings.sh +echo "MIRTE_FASTDDS=true" >>/home/mirte/.mirte_settings.sh cd /usr/local/src/mirte/mirte-install-scripts/ -git fetch --all -git pull + +# overwrite file with new version +download_url="https://raw.githubusercontent.com/mirte-robot/mirte-install-scripts/refs/heads/develop/services/mirte_ros.sh" +curl -o /usr/local/src/mirte/mirte-install-scripts/services/mirte_ros.sh $download_url + echo "rebooting in 10 seconds" sleep 10 -sudo reboot now \ No newline at end of file +sudo reboot now From 2c267a36c4b089e9b64a6b1ebe86e8c3a5af0ad0 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 21 May 2025 15:25:33 +0200 Subject: [PATCH 284/353] add rosdep install to fix networking --- fix_scripts/fix-networking.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/fix_scripts/fix-networking.sh b/fix_scripts/fix-networking.sh index 2a0990f..7de9218 100644 --- a/fix_scripts/fix-networking.sh +++ b/fix_scripts/fix-networking.sh @@ -12,6 +12,7 @@ git fetch --all git pull cd /home/mirte/mirte_ws/ source ./install/setup.bash +rosdep install -y --from-paths src/ --ignore-src --rosdistro humble colcon build --symlink-install --packages-select mirte_fastdds_discovery_setup astra_camera source /home/mirte/mirte_ws/install/setup.bash # add MIRTE_FASTDDS=true to .mirte_settings.sh From 8f5c8a24b98d117efef558f2b642ab7b35e11d38 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 21 May 2025 21:04:27 +0200 Subject: [PATCH 285/353] maybe fix build err fix netw --- fix_scripts/fix-networking.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fix_scripts/fix-networking.sh b/fix_scripts/fix-networking.sh index 7de9218..4b95b72 100644 --- a/fix_scripts/fix-networking.sh +++ b/fix_scripts/fix-networking.sh @@ -13,7 +13,8 @@ git pull cd /home/mirte/mirte_ws/ source ./install/setup.bash rosdep install -y --from-paths src/ --ignore-src --rosdistro humble -colcon build --symlink-install --packages-select mirte_fastdds_discovery_setup astra_camera +source /home/mirte/mirte_ws/install/setup.bash +colcon build --symlink-install --packages-up-to mirte_fastdds_discovery_setup astra_camera source /home/mirte/mirte_ws/install/setup.bash # add MIRTE_FASTDDS=true to .mirte_settings.sh echo "MIRTE_FASTDDS=true" >>/home/mirte/.mirte_settings.sh From 26a13609c8ac348dee4442a5d8db51077a9215f2 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 22 May 2025 10:52:27 +0200 Subject: [PATCH 286/353] continue on error rosdep fix netw --- fix_scripts/fix-networking.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fix_scripts/fix-networking.sh b/fix_scripts/fix-networking.sh index 4b95b72..f1a3b8b 100644 --- a/fix_scripts/fix-networking.sh +++ b/fix_scripts/fix-networking.sh @@ -12,7 +12,7 @@ git fetch --all git pull cd /home/mirte/mirte_ws/ source ./install/setup.bash -rosdep install -y --from-paths src/ --ignore-src --rosdistro humble +rosdep install -y --from-paths src/ --ignore-src --rosdistro humble -r source /home/mirte/mirte_ws/install/setup.bash colcon build --symlink-install --packages-up-to mirte_fastdds_discovery_setup astra_camera source /home/mirte/mirte_ws/install/setup.bash @@ -28,3 +28,4 @@ curl -o /usr/local/src/mirte/mirte-install-scripts/services/mirte_ros.sh $downlo echo "rebooting in 10 seconds" sleep 10 sudo reboot now +# \ No newline at end of file From 281126d7ac3a8e27ba0678f049dc65fbceb19bb3 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 22 May 2025 10:53:10 +0200 Subject: [PATCH 287/353] stop ros and shutdown during fix netw --- fix_scripts/fix-networking.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fix_scripts/fix-networking.sh b/fix_scripts/fix-networking.sh index f1a3b8b..e5e8e3e 100644 --- a/fix_scripts/fix-networking.sh +++ b/fix_scripts/fix-networking.sh @@ -1,6 +1,8 @@ #!/bin/bash set -xe echo "Starting networking fix script" +sudo systemctl stop mirte-shutdown +sudo systemctl stop mirte-ros sudo apt update # sudo apt-get upgrade -y "ros-humble- cd /home/mirte/mirte_ws/src/mirte-ros-packages/ From 97c1a0f3aefa9e9029e78b046863af13a99284ef Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Mon, 26 May 2025 07:04:39 +0000 Subject: [PATCH 288/353] Using MAC as SSID as default --- network_setup.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/network_setup.sh b/network_setup.sh index 8d89163..adb5569 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -147,7 +147,7 @@ sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf || true # This must be run every time on boot, since it should # be generated on first boot (so not when generating # the image in network_setup.sh) -USE_MAC=false +USE_MAC=true if ! ip addr show "wlan0" | grep -q ether; then USE_MAC=false echo "No MAC address found, using random ID" @@ -159,13 +159,17 @@ if $USE_MAC; then # when using mac for hostname. echo "Generated SSID: $MIRTE_SSID" # add to check: || [[ "$(cat /etc/hostname)" != "$MIRTE_SSID" ]] else - # This is the default SSID, when no MAC address is found + # When no MAC address is found, a random ID is generated # This should be changed to a unique ID UNIQUE_ID=$(tr -cd "1-9A-F" /etc/hostname' sudo ln -s /etc/hostname /etc/ssid # And add them to the hosts file From 870cc72bcd93060a822cb3c81b7581a56c64a166 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 26 May 2025 12:10:03 +0200 Subject: [PATCH 289/353] install ros2 fix debs astra & lidar --- fix_scripts/fix-networking.sh | 2 +- install_ROS2.sh | 46 ++++++++++++++++++++--------------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/fix_scripts/fix-networking.sh b/fix_scripts/fix-networking.sh index e5e8e3e..a4a941b 100644 --- a/fix_scripts/fix-networking.sh +++ b/fix_scripts/fix-networking.sh @@ -16,7 +16,7 @@ cd /home/mirte/mirte_ws/ source ./install/setup.bash rosdep install -y --from-paths src/ --ignore-src --rosdistro humble -r source /home/mirte/mirte_ws/install/setup.bash -colcon build --symlink-install --packages-up-to mirte_fastdds_discovery_setup astra_camera +colcon build --symlink-install --packages-up-to mirte_fastdds_discovery_setup astra_camera mirte_bringup --cmake-args -DCMAKE_BUILD_TYPE=Release source /home/mirte/mirte_ws/install/setup.bash # add MIRTE_FASTDDS=true to .mirte_settings.sh echo "MIRTE_FASTDDS=true" >>/home/mirte/.mirte_settings.sh diff --git a/install_ROS2.sh b/install_ROS2.sh index 06a16c2..0ec57ad 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -62,18 +62,26 @@ arch=$(dpkg --print-architecture) ubuntu_version=$(lsb_release -cs) github_url=$(git config --get remote.origin.url | sed 's/\.git$//') fallback=true +vcs import src < $MIRTE_SRC_DIR/mirte-ros-packages/sources.repos || true if [[ $branch == "develop" || $branch == "main" ]]; then fallback=false # Install mirte ros packages with apt from github, since they take ages to compile and it's easier to update them. # colcon ignore those packages - echo "Using precompiled version of mirte-ros-packages" - cd /home/mirte/mirte_ws/src/mirte-ros-packages || exit 1 - ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop) # mirte_control/mirte_master_base_control mirte_control/mirte_master_arm_control mirte_control/mirte_pioneer_control # TODO: this doesn't work with subfolders + echo "Using precompiled version of packages" + cd /home/mirte/mirte_ws/src/ || exit 1 + ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop astra_camera astra_camera_msgs libuvc mirte_master_base_control mirte_master_arm_control mirte_pioneer_control ) packages='' for i in "${ignore[@]}"; do - touch $i/COLCON_IGNORE + path=$(colcon list --packages-select $i -p) + path=$(realpath "$path") + echo "Checking package $i at $path" + if [[ ! -d $path ]]; then + echo "Package $i not found, skipping." + continue + fi + # touch $path/COLCON_IGNORE i_dash=$(echo $i | tr '_' '-') packages="$packages ros-$ROS_NAME-$i_dash" done @@ -151,21 +159,21 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then cd /home/mirte/mirte_ws/src || exit 1 git clone https://github.com/Slamtec/rplidar_ros.git -b ros2 # FIXME-FUTURE: Can be installed in newer versions if V2.1.5 is released - git clone https://github.com/ArendJan/ros2_astra_camera.git -b fix-ros-jammy # compressed images image transport fixes, fork of orbbec/... with also lazy nodes - git clone https://github.com/clearpathrobotics/clearpath_mecanum_drive_controller # FIXME: Can be installed from apt? why build? - cd ../../ - mkdir temp - cd temp || exit 1 - sudo apt install -y libudev-dev libusb-1.0-0-dev nlohmann-json3-dev - # Install lubuvc-dev manually for newer version - git clone https://github.com/libuvc/libuvc.git - cd libuvc - mkdir build && cd build - cmake .. && make -j4 - sudo make install - sudo ldconfig - cd ../../../ - sudo rm -rf temp + # git clone https://github.com/ArendJan/ros2_astra_camera.git -b fix-ros-jammy # compressed images image transport fixes, fork of orbbec/... with also lazy nodes + # git clone https://github.com/clearpathrobotics/clearpath_mecanum_drive_controller # FIXME: Can be installed from apt? why build? + # cd ../../ + # mkdir temp + # cd temp || exit 1 + # sudo apt install -y libudev-dev libusb-1.0-0-dev nlohmann-json3-dev + # # Install lubuvc-dev manually for newer version + # git clone https://github.com/libuvc/libuvc.git + # cd libuvc + # mkdir build && cd build + # cmake .. && make -j4 + # sudo make install + # sudo ldconfig + # cd ../../../ + # sudo rm -rf temp cd /home/mirte/mirte_ws/ || exit 1 rosdep install -y --from-paths src/ --ignore-src --rosdistro $ROS_NAME colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release From 7eb3366cf000d4d4a0ba38543a53ff0dd4e5d0e0 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Wed, 28 May 2025 15:38:40 +0200 Subject: [PATCH 290/353] Added jupyter notebooks again --- install_jupyter_ros.sh | 2 +- install_mirte.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/install_jupyter_ros.sh b/install_jupyter_ros.sh index 4eac751..e8d87d6 100755 --- a/install_jupyter_ros.sh +++ b/install_jupyter_ros.sh @@ -19,7 +19,7 @@ sudo apt install -y libjpeg-dev zlib1g-dev pip3 install wheel pip3 install markupsafe==2.0.1 pyzmq==24 zipp==3.1.0 \ ipython==8.7.0 ipykernel==6.17.1 ipywidgets==7.7.2 \ - jupyter-client==7.4.8 jupyter-core==5.1.0 \ + typeguard==4.4.2 jupyter-client==7.4.8 jupyter-core==5.1.0 \ nbclient==0.7.2 nbconvert==7.2.6 nbformat==5.7.0 \ qtconsole==5.4.0 traitlets==5.6.0 \ notebook==6.5.2 bqplot==0.12.18 pyyaml \ diff --git a/install_mirte.sh b/install_mirte.sh index 1abcfc6..c95ad81 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -53,8 +53,10 @@ if [[ "$INSTALL_WEB" = true ]]; then fi # Install Jupyter Notebook -#cd $MIRTE_SRC_DIR/mirte-install-scripts -#./install_jupyter_ros.sh +if [[ "$INSTALL_JUPYTER" = true ]]; then + cd $MIRTE_SRC_DIR/mirte-install-scripts + ./install_jupyter_ros.sh +fi # Install numpy pip3 install numpy From dfcc9be29afd6248d03387570b2def0f28797082 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Wed, 28 May 2025 16:24:58 +0200 Subject: [PATCH 291/353] Added TU Delft OSS statement --- LICENSE | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 307b1ab..258df23 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025, TU Delft + Copyright 2025, MIRTE team Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -199,3 +199,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + Technische Universiteit Delft hereby disclaims all copyright interest + in the software of "MIRTE robot" (en educational robot) written by the + Author(s). + prof. dr. ir. Fred van Keulen, Dean of Mechanical Engineering From 24539fe96d731c80e1db9466d1c230cb212735a5 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Fri, 30 May 2025 19:08:05 +0200 Subject: [PATCH 292/353] Fixed shfmt errors --- LICENSE | 2 +- fix_scripts/fix-networking.sh | 2 +- install_mirte.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LICENSE b/LICENSE index 258df23..ac7b420 100644 --- a/LICENSE +++ b/LICENSE @@ -201,6 +201,6 @@ limitations under the License. Technische Universiteit Delft hereby disclaims all copyright interest - in the software of "MIRTE robot" (en educational robot) written by the + in the software of "MIRTE robot" (an educational robot) written by the Author(s). prof. dr. ir. Fred van Keulen, Dean of Mechanical Engineering diff --git a/fix_scripts/fix-networking.sh b/fix_scripts/fix-networking.sh index e5e8e3e..c123d96 100644 --- a/fix_scripts/fix-networking.sh +++ b/fix_scripts/fix-networking.sh @@ -30,4 +30,4 @@ curl -o /usr/local/src/mirte/mirte-install-scripts/services/mirte_ros.sh $downlo echo "rebooting in 10 seconds" sleep 10 sudo reboot now -# \ No newline at end of file +# diff --git a/install_mirte.sh b/install_mirte.sh index c95ad81..d2c3846 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -54,8 +54,8 @@ fi # Install Jupyter Notebook if [[ "$INSTALL_JUPYTER" = true ]]; then - cd $MIRTE_SRC_DIR/mirte-install-scripts - ./install_jupyter_ros.sh + cd $MIRTE_SRC_DIR/mirte-install-scripts + ./install_jupyter_ros.sh fi # Install numpy From 382319c783c6def96a3dc836215ec811f5fea666 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Fri, 30 May 2025 19:28:36 +0200 Subject: [PATCH 293/353] Updates README --- README.md | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bcffec5..2737204 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,42 @@ -# Mirte Install Scripts -Scripts that are ran during creation of the image and on the Mirte itself. +# mirte-install-scripts + +These scripts will install all the software needed for the MIRTE OS. This +can be run when creating an image, or on the robot itself. + +## Install + +You can install this by running the main script: + +``` +./install_mirte.sh +``` + +## Checks + +To contribute to this repository the code needs to pass the shell +[style checks](). -## Stylecheck - [shfmt](https://github.com/mvdan/sh): styling (whitespace) of all shell scripts -- [ShellCheck](https://github.com/koalaman/shellcheck): static analysis to find (possible) bugs. Only errors and warnings are enabled -Check & format using their command line tools or vscode plugins. Or check the GitHub workflows with [act](https://github.com/nektos/act). \ No newline at end of file + + To check this locally before you commit/push: + ```sh + curl -sS https://webi.sh/shfmt | sh + find . -type f -name "*.sh" -print0 | xargs -0 shfmt -d + # Fix by using: + find . -type f -name "*.sh" -print0 | xargs -0 shfmt -w + ``` + +- [ShellCheck](https://github.com/koalaman/shellcheck): static analysis to find + (possible) bugs. Only errors and warnings are enabled. + + To check this locally before you commit/push: + ```sh + curl -sS https://webi.sh/shellcheck | sh + find . -type f -name "*.sh" -print0 | xargs -0 shellcheck --severity=warning + # Fix manually + ``` + +## License + +This work is licensed under a Apache-2.0 OSS license. From f01520ac3fc97da59a7e5775214b3f306f5808f8 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 2 Jun 2025 15:02:58 +0200 Subject: [PATCH 294/353] Fix ros2 install vcs --- fix_scripts/fix-networking.sh | 2 +- install_ROS2.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fix_scripts/fix-networking.sh b/fix_scripts/fix-networking.sh index a4a941b..536e9d3 100644 --- a/fix_scripts/fix-networking.sh +++ b/fix_scripts/fix-networking.sh @@ -30,4 +30,4 @@ curl -o /usr/local/src/mirte/mirte-install-scripts/services/mirte_ros.sh $downlo echo "rebooting in 10 seconds" sleep 10 sudo reboot now -# \ No newline at end of file +# diff --git a/install_ROS2.sh b/install_ROS2.sh index 0ec57ad..0599358 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -62,7 +62,8 @@ arch=$(dpkg --print-architecture) ubuntu_version=$(lsb_release -cs) github_url=$(git config --get remote.origin.url | sed 's/\.git$//') fallback=true -vcs import src < $MIRTE_SRC_DIR/mirte-ros-packages/sources.repos || true +cd /home/mirte/mirte_ws/ || exit 1 +vcs import src <$MIRTE_SRC_DIR/mirte-ros-packages/sources.repos || true if [[ $branch == "develop" || $branch == "main" ]]; then fallback=false @@ -71,7 +72,7 @@ if [[ $branch == "develop" || $branch == "main" ]]; then echo "Using precompiled version of packages" cd /home/mirte/mirte_ws/src/ || exit 1 - ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop astra_camera astra_camera_msgs libuvc mirte_master_base_control mirte_master_arm_control mirte_pioneer_control ) + ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop astra_camera astra_camera_msgs libuvc mirte_master_base_control mirte_master_arm_control mirte_pioneer_control) packages='' for i in "${ignore[@]}"; do path=$(colcon list --packages-select $i -p) From cee328f2eb671eb7acdcdefeaac35afa7bf36006 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 2 Jun 2025 15:08:13 +0200 Subject: [PATCH 295/353] fix default repos file (to repo with correct sources.repos) --- repos.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos.yaml b/repos.yaml index 8dad50e..f70826c 100644 --- a/repos.yaml +++ b/repos.yaml @@ -13,7 +13,7 @@ repositories: version: develop mirte-ros-packages: type: git - url: https://github.com/arendjan/mirte-ros-packages.git + url: https://github.com/mirte-robot/mirte-ros-packages.git version: develop recursive: true mirte-gazebo: From e30a813afbb7ac03c124181a12bd8c4b7aa8615f Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 2 Jun 2025 15:59:23 +0200 Subject: [PATCH 296/353] Fix mirte_base_control package name ros2 install --- install_ROS2.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 0599358..fd865d9 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -72,10 +72,15 @@ if [[ $branch == "develop" || $branch == "main" ]]; then echo "Using precompiled version of packages" cd /home/mirte/mirte_ws/src/ || exit 1 - ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop astra_camera astra_camera_msgs libuvc mirte_master_base_control mirte_master_arm_control mirte_pioneer_control) + ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop astra_camera astra_camera_msgs libuvc mirte_base_control mirte_master_arm_control mirte_pioneer_control) packages='' for i in "${ignore[@]}"; do path=$(colcon list --packages-select $i -p) + # if path is empty, skip + if [[ -z $path ]]; then + echo "Package $i not found, skipping." + continue + fi path=$(realpath "$path") echo "Checking package $i at $path" if [[ ! -d $path ]]; then From 857c8a023847496279bddfd6ef7d2e6ea35fba57 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 2 Jun 2025 16:08:38 +0200 Subject: [PATCH 297/353] fix duplicate git clone web video server --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index fd865d9..e334682 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -111,7 +111,7 @@ cd /home/mirte/mirte_ws/src || exit 1 # git clone https://github.com/AlexKaravaev/ros2_laser_scan_matcher # git clone https://github.com/AlexKaravaev/csm # git clone https://github.com/ldrobotSensorTeam/ldlidar_stl_ros2 -git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 +# git clone https://github.com/RobotWebTools/web_video_server.git -b ros2 cd .. || exit 1 rosdep install -y --from-paths src/ --ignore-src --rosdistro $ROS_NAME colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release From 9f0d5f516ed99f148aa99a1c31a942c107bbb0fa Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 2 Jun 2025 16:27:44 +0200 Subject: [PATCH 298/353] Fix documentation repo branch --- repos.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos.yaml b/repos.yaml index f70826c..025234d 100644 --- a/repos.yaml +++ b/repos.yaml @@ -9,7 +9,7 @@ repositories: version: develop mirte-install-scripts: type: git - url: https://github.com/arendjan/mirte-install-scripts.git + url: https://github.com/mirte-robot/mirte-install-scripts.git version: develop mirte-ros-packages: type: git @@ -31,7 +31,7 @@ repositories: mirte-documentation: type: git url: https://github.com/mirte-robot/mirte-documentation.git - version: develop + version: main mirte-telemetrix4rpipico: type: git url: https://github.com/mirte-robot/Telemetrix4RpiPico.git From b76ffbb102751bdbc077b0b4ab25d606923cb5b7 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 2 Jun 2025 16:45:18 +0200 Subject: [PATCH 299/353] colcon ignore fix --- install_ROS2.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index e334682..1b9b63c 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -72,7 +72,7 @@ if [[ $branch == "develop" || $branch == "main" ]]; then echo "Using precompiled version of packages" cd /home/mirte/mirte_ws/src/ || exit 1 - ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop astra_camera astra_camera_msgs libuvc mirte_base_control mirte_master_arm_control mirte_pioneer_control) + ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop astra_camera astra_camera_msgs libuvc mirte_base_control mirte_master_arm_control mirte_control) packages='' for i in "${ignore[@]}"; do path=$(colcon list --packages-select $i -p) @@ -87,7 +87,7 @@ if [[ $branch == "develop" || $branch == "main" ]]; then echo "Package $i not found, skipping." continue fi - # touch $path/COLCON_IGNORE + touch $path/COLCON_IGNORE i_dash=$(echo $i | tr '_' '-') packages="$packages ros-$ROS_NAME-$i_dash" done From 6a7e5067033e7bb2302d4689f19e1d093dfff9f8 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 2 Jun 2025 16:52:54 +0200 Subject: [PATCH 300/353] Add usb cam prebuild --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 1b9b63c..11a83c7 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -72,7 +72,7 @@ if [[ $branch == "develop" || $branch == "main" ]]; then echo "Using precompiled version of packages" cd /home/mirte/mirte_ws/src/ || exit 1 - ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop astra_camera astra_camera_msgs libuvc mirte_base_control mirte_master_arm_control mirte_control) + ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop astra_camera astra_camera_msgs libuvc mirte_base_control mirte_master_arm_control mirte_control usb_cam) packages='' for i in "${ignore[@]}"; do path=$(colcon list --packages-select $i -p) From 110811e0b47d73504faee5f143e9ae262e9c2e7a Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 2 Jun 2025 17:11:20 +0200 Subject: [PATCH 301/353] reorder colcon top level ws install to later for udev install --- install_ROS2.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 11a83c7..2707995 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -151,12 +151,7 @@ sudo adduser mirte dialout sudo pip3 install colcon-clean colcon-lint # Add colcon top level workspace, this makes it possible to run colcon build from any folder, it will find the workspace and build it. Otherwise it will create a new workspace in the subdirectory. -cd /tmp -git clone https://github.com/rhaschke/colcon-top-level-workspace -cd colcon-top-level-workspace -pip install . -cd .. -rm -rf colcon-top-level-workspace + if [[ $MIRTE_TYPE == "mirte-master" ]]; then # TODO: need to check and edit the next part: sudo apt install ros-$ROS_NAME-slam-toolbox -y @@ -195,6 +190,12 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then fi +cd /tmp +git clone https://github.com/rhaschke/colcon-top-level-workspace +cd colcon-top-level-workspace +pip install . +cd .. +rm -rf colcon-top-level-workspace # zsh does not work nicely with ros2 autocomplete, so we need to add a function to fix it. # ROS 2 Foxy should have this fixed, but we are using ROS 2 Humble. # TODO: check for ROS2 jazzy From ce6c15fa12ec308f1baec4940fd9564830f64b0f Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 2 Jun 2025 20:42:39 +0200 Subject: [PATCH 302/353] update to the new ros2 key setup --- install_ROS2.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 2707995..e74154a 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -15,8 +15,9 @@ source /etc/os-release sudo apt install software-properties-common -y sudo add-apt-repository universe -y sudo apt update && sudo apt install curl -y -sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg -echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $UBUNTU_CODENAME main" | sudo tee /etc/apt/sources.list.d/ros2.list >/dev/null +ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F\" '{print $4}') +curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo $VERSION_CODENAME)_all.deb" +sudo apt install /tmp/ros2-apt-source.deb sudo apt update # select ros2 type based on UBUNTU_CODENAME From 3e49dd41799b26076cc546d751cc452bd01b8630 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 3 Jun 2025 11:17:24 +0200 Subject: [PATCH 303/353] Fix 2 ros new key setup --- download_repos.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/download_repos.sh b/download_repos.sh index 63166eb..2bcbc57 100755 --- a/download_repos.sh +++ b/download_repos.sh @@ -1,9 +1,10 @@ #!/bin/bash set -xe # Install vcstool -sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg -echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list >/dev/null -sudo apt-get update +ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F\" '{print $4}') +curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo $VERSION_CODENAME)_all.deb" +sudo apt install /tmp/ros2-apt-source.deb +sudo apt update sudo apt-get install -y python3-vcstool # Download all Mirte repositories From a2cb9d33eb099320db2a82d53a988da04365cd70 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Wed, 4 Jun 2025 09:41:08 +0200 Subject: [PATCH 304/353] =?UTF-8?q?Downloading=20ev3-script=20and=20applyi?= =?UTF-8?q?ng=20patch=20to=20have=20clean=20OSS=20l=C3=AFcense?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + ev3-usb.sh | 178 -------------------------------------- fix_scripts/ev3-usb.patch | 13 +++ network_install.sh | 7 +- 4 files changed, 18 insertions(+), 181 deletions(-) delete mode 100755 ev3-usb.sh create mode 100644 fix_scripts/ev3-usb.patch diff --git a/.gitignore b/.gitignore index 3c4de97..53fcc16 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ build/ ui/ *.uf2 +ev3-usb.sh diff --git a/ev3-usb.sh b/ev3-usb.sh deleted file mode 100755 index 1d2fb81..0000000 --- a/ev3-usb.sh +++ /dev/null @@ -1,178 +0,0 @@ -#!/bin/dash -# Copied from: https://raw.githubusercontent.com/ev3dev/ev3-systemd/ev3dev-buster/scripts/ev3-usb.sh -# EDITED: serial num, as it didn't work with newer kernels -# USB Gadget for LEGO MINDSTORMS EV3 hardware -# -# Copyright (C) 2015,2017 David Lechner -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . - -# TODO: get new usb vid:pid from https://pid.codes/ - -set -e - -# command line parameters -command="$1" # "up" or "down" -udc_device="$2" # a udc device name, such as "musb-hdrc.1.auto" - -g="/sys/kernel/config/usb_gadget/ev3dev" - -ev3_usb_up() { - usb_ver="0x0200" # USB 2.0 - dev_class="2" # Communications - LEGO firmware is 0 - vid="0x0694" # LEGO Group - pid="0x0005" # EV3 - device="0x3001" # this should be incremented any time there are breaking changes - # to this script so that the host OS sees it as a new device and - # re-enumerates everything rather than relying on cached values - mfg="LEGO Group" # matches LEGO firmware - prod="EV3+ev3dev" # LEGO firmware is just "EV3" - # Read bluetooth mac address from eeprom - this is what LEGO firmware uses for serial - # FIXME: hard-coding the sysfs path could be fragile - serial="10" # AJ: just some random serial num - attr="0xC0" # Self powered - pwr="1" # 2mA - cfg1="CDC" - cfg2="RNDIS" - # add colons for MAC address format - mac="$(echo ${serial} | sed 's/\(\w\w\)/:\1/g' | cut -b 2-)" - # Change the first number for each MAC address - the second digit of 2 indicates - # that these are "locally assigned (b2=1), unicast (b1=0)" addresses. This is - # so that they don't conflict with any existing vendors. Care should be taken - # not to change these two bits. - dev_mac1="02$(echo ${mac} | cut -b 3-)" - host_mac1="12$(echo ${mac} | cut -b 3-)" - dev_mac2="22$(echo ${mac} | cut -b 3-)" - host_mac2="32$(echo ${mac} | cut -b 3-)" - ms_vendor_code="0xcd" # Microsoft - ms_qw_sign="MSFT100" # also Microsoft (if you couldn't tell) - ms_compat_id="RNDIS" # matches Windows RNDIS Drivers - ms_subcompat_id="5162001" # matches Windows RNDIS 6.0 Driver - - if [ -d ${g} ]; then - if [ "$(cat ${g}/UDC)" != "" ]; then - echo "Gadget is already up." - exit 1 - fi - echo "Cleaning up old directory..." - ev3_usb_down - fi - echo "Setting up gadget..." - - # Create a new gadget - - mkdir ${g} - echo "${usb_ver}" >${g}/bcdUSB - echo "${dev_class}" >${g}/bDeviceClass - echo "${vid}" >${g}/idVendor - echo "${pid}" >${g}/idProduct - echo "${device}" >${g}/bcdDevice - mkdir ${g}/strings/0x409 - echo "${mfg}" >${g}/strings/0x409/manufacturer - echo "${prod}" >${g}/strings/0x409/product - echo "${serial}" >${g}/strings/0x409/serialnumber - - # Create 2 configurations. The first will be CDC. The second will be RNDIS. - # Thanks to os_desc, Windows should use the second configuration. - - # config 1 is for CDC - - mkdir ${g}/configs/c.1 - echo "${attr}" >${g}/configs/c.1/bmAttributes - echo "${pwr}" >${g}/configs/c.1/MaxPower - mkdir ${g}/configs/c.1/strings/0x409 - echo "${cfg1}" >${g}/configs/c.1/strings/0x409/configuration - - # Create the CDC function - - mkdir ${g}/functions/ecm.usb0 - echo "${dev_mac1}" >${g}/functions/ecm.usb0/dev_addr - echo "${host_mac1}" >${g}/functions/ecm.usb0/host_addr - - # config 2 is for RNDIS - - mkdir ${g}/configs/c.2 - echo "${attr}" >${g}/configs/c.2/bmAttributes - echo "${pwr}" >${g}/configs/c.2/MaxPower - mkdir ${g}/configs/c.2/strings/0x409 - echo "${cfg2}" >${g}/configs/c.2/strings/0x409/configuration - - # On Windows 7 and later, the RNDIS 5.1 driver would be used by default, - # but it does not work very well. The RNDIS 6.0 driver works better. In - # order to get this driver to load automatically, we have to use a - # Microsoft-specific extension of USB. - - echo "1" >${g}/os_desc/use - echo "${ms_vendor_code}" >${g}/os_desc/b_vendor_code - echo "${ms_qw_sign}" >${g}/os_desc/qw_sign - - # Create the RNDIS function, including the Microsoft-specific bits - - mkdir ${g}/functions/rndis.usb0 - echo "${dev_mac2}" >${g}/functions/rndis.usb0/dev_addr - echo "${host_mac2}" >${g}/functions/rndis.usb0/host_addr - echo "${ms_compat_id}" >${g}/functions/rndis.usb0/os_desc/interface.rndis/compatible_id - echo "${ms_subcompat_id}" >${g}/functions/rndis.usb0/os_desc/interface.rndis/sub_compatible_id - - # Link everything up and bind the USB device - - ln -s ${g}/functions/ecm.usb0 ${g}/configs/c.1 - ln -s ${g}/functions/rndis.usb0 ${g}/configs/c.2 - ln -s ${g}/configs/c.2 ${g}/os_desc - echo "${udc_device}" >${g}/UDC - - echo "Done." -} - -ev3_usb_down() { - if [ ! -d ${g} ]; then - echo "Gadget is already down." - exit 1 - fi - echo "Taking down gadget..." - - # Have to unlink and remove directories in reverse order. - # Checks allow to finish takedown after error. - - if [ "$(cat ${g}/UDC)" != "" ]; then - echo "" >${g}/UDC - fi - rm -f ${g}/os_desc/c.2 - rm -f ${g}/configs/c.2/rndis.usb0 - rm -f ${g}/configs/c.1/ecm.usb0 - [ -d ${g}/functions/ecm.usb0 ] && rmdir ${g}/functions/ecm.usb0 - [ -d ${g}/functions/rndis.usb0 ] && rmdir ${g}/functions/rndis.usb0 - [ -d ${g}/configs/c.2/strings/0x409 ] && rmdir ${g}/configs/c.2/strings/0x409 - [ -d ${g}/configs/c.2 ] && rmdir ${g}/configs/c.2 - [ -d ${g}/configs/c.1/strings/0x409 ] && rmdir ${g}/configs/c.1/strings/0x409 - [ -d ${g}/configs/c.1 ] && rmdir ${g}/configs/c.1 - [ -d ${g}/strings/0x409 ] && rmdir ${g}/strings/0x409 - rmdir ${g} - - echo "Done." -} - -case ${command} in - -up) - ev3_usb_up - ;; -down) - ev3_usb_down - ;; -*) - echo "Usage: ev3-usb.sh up|down " - exit 1 - ;; -esac diff --git a/fix_scripts/ev3-usb.patch b/fix_scripts/ev3-usb.patch new file mode 100644 index 0000000..025c8b7 --- /dev/null +++ b/fix_scripts/ev3-usb.patch @@ -0,0 +1,13 @@ +40c40 +< serial="$(grep ^BOARD_INFO_SERIAL_NUM= /sys/class/board-info/board0/uevent | cut -d = -f 2)" +--- +> serial="10" # original does not work anymore for newer kernels, needs 'random' value +59,66d58 +< +< +< tmpdir=$(mktemp -d) +< mount /dev/mmcblk0p1 $tmpdir +< if [ -f $tmpdir/ev3dev.txt ]; then +< cdc_only=$(grep -i "^cdc_only=\(true\|yes\|1\)" $tmpdir/ev3dev.txt | cut -b 10-) +< fi +< umount $tmpdir diff --git a/network_install.sh b/network_install.sh index 5a979e6..04a83a7 100755 --- a/network_install.sh +++ b/network_install.sh @@ -68,10 +68,11 @@ sudo apt install -y inotify-tools wireless-tools # Disable ssh root login sed -i 's/#PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config -# Install usb_ethernet script from EV3 (already downloaded with a fix) -# wget https://raw.githubusercontent.com/ev3dev/ev3-systemd/ev3dev-buster/scripts/ev3-usb.sh -P $MIRTE_SRC_DIR/mirte-install-scripts -# sudo chmod +x $MIRTE_SRC_DIR/mirte-install-scripts/ev3-usb.sh +# Install usb_ethernet script from EV3 (and apply the patch) +wget https://raw.githubusercontent.com/ev3dev/ev3-systemd/ev3dev-buster/scripts/ev3-usb.sh -P $MIRTE_SRC_DIR/mirte-install-scripts sudo chown mirte:mirte $MIRTE_SRC_DIR/mirte-install-scripts/ev3-usb.sh +chmod +x $MIRTE_SRC_DIR/mirte-install-scripts/ev3-usb.sh +patch sudo bash -c 'echo "libcomposite" >> /etc/modules' # remove g_serial from modules to let the ev3-usb script enable usb ethernet on the orange pi zero 1 as well. sudo bash -c "sed -i '/g_serial/d' /etc/modules" From 5a6bce59afb3ac0bafa7816fba8c7193ee9eae88 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Wed, 4 Jun 2025 09:44:40 +0200 Subject: [PATCH 305/353] Forgot actual patching of the script --- network_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_install.sh b/network_install.sh index 04a83a7..fd2ab25 100755 --- a/network_install.sh +++ b/network_install.sh @@ -72,7 +72,7 @@ sed -i 's/#PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config wget https://raw.githubusercontent.com/ev3dev/ev3-systemd/ev3dev-buster/scripts/ev3-usb.sh -P $MIRTE_SRC_DIR/mirte-install-scripts sudo chown mirte:mirte $MIRTE_SRC_DIR/mirte-install-scripts/ev3-usb.sh chmod +x $MIRTE_SRC_DIR/mirte-install-scripts/ev3-usb.sh -patch +patch $MIRTE_SRC_DIR/mirte-install-scripts/ev3-usb.sh -i $MIRTE_SRC_DIR/mirte-install-scripts/fix_scripts/ev3-usb.patch sudo bash -c 'echo "libcomposite" >> /etc/modules' # remove g_serial from modules to let the ev3-usb script enable usb ethernet on the orange pi zero 1 as well. sudo bash -c "sed -i '/g_serial/d' /etc/modules" From 08cd6c9d7184f1ba08579510c4d9806e2a4f398f Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Mon, 23 Jun 2025 08:15:11 +0000 Subject: [PATCH 306/353] Fix for wifi connection --- install_mirte.sh | 4 ++-- network_install.sh | 4 ++++ network_setup.sh | 8 -------- services/mirte-ap.service | 15 +++++++++++++-- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/install_mirte.sh b/install_mirte.sh index d2c3846..c11a09e 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -62,8 +62,8 @@ fi pip3 install numpy # Install bluetooth -cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 -./install_bt.sh +#cd $MIRTE_SRC_DIR/mirte-install-scripts || exit 1 +#./install_bt.sh # if building for mirte-master: if [[ $MIRTE_TYPE == "mirte-master" ]]; then diff --git a/network_install.sh b/network_install.sh index fd2ab25..d3c1ff0 100755 --- a/network_install.sh +++ b/network_install.sh @@ -96,6 +96,10 @@ sudo chmod 777 /etc/hostname # working. We might need to see if bluetooth can be enabled after wifi was started # correctly. For now, just disabling since we are not using it. sudo systemctl disable aw859a-bluetooth || /bin/true +sudo systemctl disable bluetooth || /bin/true +sudo bash -c 'echo "install sprdbt_tty /bin/false" > /etc/modprobe.d/disable-sprdbt_tty.conf' +sudo bash -c 'echo "blacklist sprdbt_tty" > /etc/modprobe.d/disable-sprdbt_tty.conf' +sudo update-initramfs -u # Disable armbian-led-state sudo systemctl disable armbian-led-state || /bin/true diff --git a/network_setup.sh b/network_setup.sh index adb5569..6bbc261 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -29,13 +29,6 @@ function start_acces_point { sudo killall -9 blink.sh || /bin/true echo "Killed all previous instances" - # It takes some time for NetworkManager to find all - # networks. - nmcli con down "$(cat /etc/hostname)" - iw dev wlan0 scan | grep SSID - nmcli device wifi list - echo "Rescanned networks" - # Start wifi-connect (this starts the AP, and uses dnsmasq # as DHCP server wifi-connect -o 8080 -p "$(cat /home/mirte/.wifi_pwd)" -s "$(cat /etc/hostname)" & @@ -54,7 +47,6 @@ function start_acces_point { # generate a random channel, can even change to 5Ghz if wanted, then check how to find a correct channel nmcli c modify "$(cat /etc/hostname)" 802-11-wireless.band bg 802-11-wireless.channel "$(shuf -i 1-11 -n 1)" nmcli con down "$(cat /etc/hostname)" - sleep 10 nmcli con up "$(cat /etc/hostname)" # Start all avahi addresses and services diff --git a/services/mirte-ap.service b/services/mirte-ap.service index a860243..7d46763 100644 --- a/services/mirte-ap.service +++ b/services/mirte-ap.service @@ -1,10 +1,21 @@ [Unit] Description=Mirte Wifi AP -After=NetworkManager.service -After=network-online.target +Wants=multi-user.target +After=multi-user.target [Service] KillMode=process +# The orange pi (zero 2) has a flacky wifi chip. This means we have to wait +# for this AP to start. The result below are better when we fully disable +# bluetooth in the network_install.sh script. +# This is probably related to: https://github.com/orangepi-xunlong/firmware/issues/1 + +# Testing this setup: +# sleep 0: 99/100 failed +# sleep 10: 50/100 failed +# sleep 20: 31/100 failed +# sleep 30: 0/100 failed +ExecStartPre=/bin/sleep 30 ExecStart=/bin/bash -c "/usr/local/src/mirte/mirte-install-scripts/network_setup.sh" [Install] From 8bdeeb42597915b0b1ed8bd48515d22774cf9b21 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Mon, 23 Jun 2025 08:25:50 +0000 Subject: [PATCH 307/353] Fixed github workflow --- .github/workflows/c_check.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/c_check.yml b/.github/workflows/c_check.yml index 6d43ab9..1927820 100644 --- a/.github/workflows/c_check.yml +++ b/.github/workflows/c_check.yml @@ -23,7 +23,7 @@ jobs: - uses: lukka/get-cmake@latest - name: Build pam module run: | - apt update && apt install libpam0g-dev -y + sudo apt update && sudo apt install libpam0g-dev -y ./install_pam.sh ./pam/build/myprogram - name: Build usb_switch @@ -34,4 +34,3 @@ jobs: cd build cmake .. make -j - \ No newline at end of file From 1b638cc1c360757745f70368908e19a88c5772be Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 23 Jun 2025 13:21:16 +0200 Subject: [PATCH 308/353] add ip networking improvements for rmw --- network_install.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/network_install.sh b/network_install.sh index d3c1ff0..30f3d01 100755 --- a/network_install.sh +++ b/network_install.sh @@ -104,6 +104,16 @@ sudo update-initramfs -u # Disable armbian-led-state sudo systemctl disable armbian-led-state || /bin/true +# set some network settings to have ROS2 working better https://autowarefoundation.github.io/autoware-documentation/main/installation/additional-settings-for-developers/network-configuration/dds-settings/#tune-system-wide-network-settings +cat <>/etc/sysctl.d/10-cyclone-max.conf +# Increase the maximum receive buffer size for network packets +net.core.rmem_max=10485760 # 10Mib, default is 208 KiB + +# IP fragmentation settings +net.ipv4.ipfrag_time=3 # in seconds, default is 30 s +net.ipv4.ipfrag_high_thresh=134217728 # 128 MiB, default is 256 KiB +EOF +sudo service procps force-reload # Reboot after kernel panic # The OPi has a fairly unstable wifi driver which might # panic the kernel (at boot). Instead of waiting an unkown From 67cc10375a66dbc320e0975b4398747c7b16cb29 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Mon, 7 Jul 2025 10:04:58 +0000 Subject: [PATCH 309/353] Fix for ROS dections in arduino script --- run_arduino.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run_arduino.sh b/run_arduino.sh index ab21631..cbb4beb 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -14,10 +14,10 @@ MIRTE_SRC_DIR=/usr/local/src/mirte PICO_BUILD_LOCATION=$MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico # Check if ROS is running -ROS_RUNNING=1 -systemctl is-active mirte-ros | grep 'inactive' &>/dev/null +ROS_RUNNING=0 +systemctl is-active mirte-ros | grep 'active' &>/dev/null if [ $? == 0 ]; then - ROS_RUNNING=0 + ROS_RUNNING=1 fi echo "ROS_RUNNING: $ROS_RUNNING" PROJECT="mirte-telemetrix4arduino" From b1686b502c432fd753914915aa58ac5d82907317 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Mon, 7 Jul 2025 10:05:36 +0000 Subject: [PATCH 310/353] Removed get-platformio script after installation --- install_arduino.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install_arduino.sh b/install_arduino.sh index 1b65ca9..3eb8b7d 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -9,6 +9,7 @@ sudo apt install -y git curl binutils libusb-1.0-0 # install platformio curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -o get-platformio.py python3 get-platformio.py +rm get-platformio.py # Add platformio to path export PATH=$PATH:$HOME/.local/bin From 7d8dc43b38b09a0b068d50a3fbf6cf266a120b1b Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Mon, 7 Jul 2025 10:06:36 +0000 Subject: [PATCH 311/353] Reboot after dmesg wifi error --- wifi-watchdog.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/wifi-watchdog.sh b/wifi-watchdog.sh index 1777f88..a9a33f7 100755 --- a/wifi-watchdog.sh +++ b/wifi-watchdog.sh @@ -1,16 +1,11 @@ #!/bin/sh -#echo "begin watchdog" > /home/mirte/test.txt - -# echo "wifi watchdog service restarted" > /dev/kmsg - -# sub="xradio" - dmesg --follow | while read -r line; do - if echo "$line" | grep -q "xradio WSM-ERR: CMD timeout!"; then + # OrangePi Zero 1: xradio WSM-ERR: CMD timeout! + # OrangePi Zero 2: WCN_ERR: dumpmem_rx_callback open + if echo "$line" | grep -qE "xradio WSM-ERR: CMD timeout!|WCN_ERR: dumpmem_rx_callback open"; then echo "CRASH! REBOOT!" >/dev/kmsg - echo "$line" >>./test.txt - # reboot -f now + echo "$line" >> /home/mirte/wifi-watchdog.err echo b >/proc/sysrq-trigger fi done From e7718fc2f356cc535f16e6fc88c5d18484ca3bb5 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Mon, 7 Jul 2025 10:13:14 +0000 Subject: [PATCH 312/353] Fixing shfmt --- wifi-watchdog.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wifi-watchdog.sh b/wifi-watchdog.sh index a9a33f7..56da689 100755 --- a/wifi-watchdog.sh +++ b/wifi-watchdog.sh @@ -1,11 +1,11 @@ #!/bin/sh dmesg --follow | while read -r line; do - # OrangePi Zero 1: xradio WSM-ERR: CMD timeout! - # OrangePi Zero 2: WCN_ERR: dumpmem_rx_callback open + # OrangePi Zero 1: xradio WSM-ERR: CMD timeout! + # OrangePi Zero 2: WCN_ERR: dumpmem_rx_callback open if echo "$line" | grep -qE "xradio WSM-ERR: CMD timeout!|WCN_ERR: dumpmem_rx_callback open"; then echo "CRASH! REBOOT!" >/dev/kmsg - echo "$line" >> /home/mirte/wifi-watchdog.err + echo "$line" >>/home/mirte/wifi-watchdog.err echo b >/proc/sysrq-trigger fi done From 0853e8dea299cb2d0d1c759f65938791ee03f817 Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Mon, 7 Jul 2025 12:28:24 +0200 Subject: [PATCH 313/353] Modified TUD OSS waiver without changing the original Apache2 LICENCE --- NOTICE | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 NOTICE diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..0090a31 --- /dev/null +++ b/NOTICE @@ -0,0 +1,7 @@ +This software is licensed under the Apache License, Version 2.0. +See the LICENSE file for details. + +Technische Universiteit Delft hereby disclaims all copyright interest +in the software of "MIRTE robot" (an educational robot) written by the +Author(s). +prof. dr. ir. Fred van Keulen, Dean of Mechanical Engineering From b97a474a4823a80f2713e9db2038c3629cdaa61d Mon Sep 17 00:00:00 2001 From: Martin Klomp Date: Mon, 7 Jul 2025 12:52:54 +0200 Subject: [PATCH 314/353] Added modified LICENCE --- LICENSE | 5 ----- 1 file changed, 5 deletions(-) diff --git a/LICENSE b/LICENSE index ac7b420..dee5c37 100644 --- a/LICENSE +++ b/LICENSE @@ -199,8 +199,3 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - Technische Universiteit Delft hereby disclaims all copyright interest - in the software of "MIRTE robot" (an educational robot) written by the - Author(s). - prof. dr. ir. Fred van Keulen, Dean of Mechanical Engineering From d8698a66a7fcdfe3335fd8f66746556e2daf002a Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 9 Jul 2025 16:39:04 +0200 Subject: [PATCH 315/353] upd repos arduino test --- repos.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos.yaml b/repos.yaml index 8dad50e..a37348d 100644 --- a/repos.yaml +++ b/repos.yaml @@ -5,7 +5,7 @@ repositories: version: develop mirte-telemetrix4arduino: type: git - url: https://github.com/mirte-robot/Telemetrix4Arduino.git + url: https://github.com/arendjan/Telemetrix4Arduino.git version: develop mirte-install-scripts: type: git @@ -34,6 +34,6 @@ repositories: version: develop mirte-telemetrix4rpipico: type: git - url: https://github.com/mirte-robot/Telemetrix4RpiPico.git + url: https://github.com/arendjan/Telemetrix4RpiPico.git recursive: true version: develop From 22c87e30d643f550ea53f3906d743205e08153b4 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 11 Jul 2025 16:05:03 +0200 Subject: [PATCH 316/353] Fix msg id for bootloader reset arduino fixes pico --- run_arduino.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_arduino.sh b/run_arduino.sh index cbb4beb..e8d65b1 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -43,7 +43,7 @@ upload_pico_uart() { port=$(realpath $port) # send reboot command stty 115200 -F $port - echo -ne '\x01\x25' >$port # 1 byte message, message id 0x25==reset_to_bootloader + echo -ne '\x01\x26' >$port # 1 byte message, message id 0x26==reset_to_bootloader sleep 1 # try to upload ERR=false From 63f2e262756b0cae3319d1aba1af145b4cca6f44 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 14 Jul 2025 17:58:22 +0200 Subject: [PATCH 317/353] Fix mirte master shutdown time --- services/mirte_master_check.sh | 10 ++++++++-- services/mirte_shutdown.sh | 2 -- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/services/mirte_master_check.sh b/services/mirte_master_check.sh index ea6ceb3..87a3248 100755 --- a/services/mirte_master_check.sh +++ b/services/mirte_master_check.sh @@ -8,6 +8,8 @@ LAST_SECONDS=0 WARN_LVL=0 mirte_space=$(cat /etc/hostname | tr '[:upper:]' '[:lower:]' | tr '-' '_') +STOP=false +trap 'echo "Stopping mirte_master_check"; kill $ECHO_PID; STOP=true' SIGTERM SIGINT # ros2 topic echo restarts when the topic appears again, so we can just echo always # on every check, it will read the file, take the last reading and then clear the file # if the sensor is off, then the file will be empty and will trigger shutdown after some time. @@ -16,8 +18,8 @@ if [ "$MIRTE_USE_MULTIROBOT" = "true" ]; then topic=/$mirte_space/io/power/power_watcher fi ros2 topic echo $topic sensor_msgs/msg/BatteryState --field percentage >/tmp/batteryState & - -while true; do +ECHO_PID=$! +while ! systemctl list-jobs | grep -q -E 'shutdown.target.*start' && ! $STOP; do OK=false # echo "topics" @@ -72,3 +74,7 @@ while true; do fi sleep 10 done + +kill $ECHO_PID || true +jobs -p +ros2 daemon stop || true # deamon is sometimes started by ros2 topic echo, otherwise the shutdown will get stuck and wait for 30+ seconds diff --git a/services/mirte_shutdown.sh b/services/mirte_shutdown.sh index 2955bbc..349e427 100755 --- a/services/mirte_shutdown.sh +++ b/services/mirte_shutdown.sh @@ -20,5 +20,3 @@ fi if [ "$(ros2 service list | grep "$service$")" ]; then ros2 service call "$service" mirte_msgs/srv/SetOLEDText "{ text: 'Shutting down...'}" fi - -sleep 2 From 73de8ff10e8bc05c9d7db6540b41dfa12ede39e3 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 17 Jul 2025 10:04:53 +0200 Subject: [PATCH 318/353] Add default colcon_defaults with symlink and ccache mixin --- install_ROS2.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index e74154a..8053305 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -32,7 +32,7 @@ fi sudo apt install -y ros-$ROS_NAME-ros-base ros-$ROS_NAME-zenoh-bridge-dds ros-$ROS_NAME-rmw-zenoh-cpp sudo apt install -y ros-$ROS_NAME-xacro -sudo apt install -y ros-dev-tools +sudo apt install -y ros-dev-tools ccache # shellcheck source=/dev/null source /opt/ros/$ROS_NAME/setup.bash @@ -55,6 +55,16 @@ mkdir -p /home/mirte/mirte_ws/src cd /home/mirte/mirte_ws/src ln -s $MIRTE_SRC_DIR/mirte-ros-packages . +# Add colcon_defaults.yaml to the workspace, symlink and ccache +cat <>/home/mirte/mirte_ws/colcon_defaults.yaml +# Default colcon build options for the Mirte workspace +build: + symlink-install: true + mixin: + - "ccache" +EOF + + # if mirte-ros-packages is from main or develop, use the precompiled version, otherwise compile on-device cd $MIRTE_SRC_DIR/mirte-ros-packages git submodule update --init --recursive From db68cb45565df55a5a1b57e9847a9df6d8d5b2ff Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 18 Jul 2025 12:23:07 +0200 Subject: [PATCH 319/353] Add colcon mixin + revert repos --- install_ROS2.sh | 3 +++ repos.yaml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 8053305..17eaf7b 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -55,6 +55,9 @@ mkdir -p /home/mirte/mirte_ws/src cd /home/mirte/mirte_ws/src ln -s $MIRTE_SRC_DIR/mirte-ros-packages . +sudo apt install python3-colcon-mixin -y +colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml + # Add colcon_defaults.yaml to the workspace, symlink and ccache cat <>/home/mirte/mirte_ws/colcon_defaults.yaml # Default colcon build options for the Mirte workspace diff --git a/repos.yaml b/repos.yaml index dd49666..025234d 100644 --- a/repos.yaml +++ b/repos.yaml @@ -5,7 +5,7 @@ repositories: version: develop mirte-telemetrix4arduino: type: git - url: https://github.com/arendjan/Telemetrix4Arduino.git + url: https://github.com/mirte-robot/Telemetrix4Arduino.git version: develop mirte-install-scripts: type: git @@ -34,6 +34,6 @@ repositories: version: main mirte-telemetrix4rpipico: type: git - url: https://github.com/arendjan/Telemetrix4RpiPico.git + url: https://github.com/mirte-robot/Telemetrix4RpiPico.git recursive: true version: develop From bc5373300603a4b2c99286ba1f97c360b7f0082b Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 18 Jul 2025 12:34:13 +0200 Subject: [PATCH 320/353] stylefixes --- install_ROS2.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 17eaf7b..da61948 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -67,7 +67,6 @@ build: - "ccache" EOF - # if mirte-ros-packages is from main or develop, use the precompiled version, otherwise compile on-device cd $MIRTE_SRC_DIR/mirte-ros-packages git submodule update --init --recursive From ab09801dc9b8ca345ce55d7084502e62f74bbbb8 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 18 Jul 2025 14:57:37 +0200 Subject: [PATCH 321/353] Fix colcon mixin install --- .github/workflows/test_install.yml | 24 ++++++++++++++++++------ install_ROS2.sh | 1 + 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index f8ccb7f..61239ce 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -30,22 +30,34 @@ jobs: strategy: matrix: type: [mirte, mirte-master] + fail-fast: false steps: - uses: actions/checkout@v4 - shell: bash run: | echo $0 sudo useradd -m -s /bin/bash mirte + # allow nopasswd sudo for mirte user + echo "mirte ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/mirte + sudo chmod 777 /home/runner/ MIRTE_SRC_DIR=/usr/local/src/mirte sudo mkdir -p $MIRTE_SRC_DIR - sudo mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ - sudo cp -r ./* $MIRTE_SRC_DIR/mirte-install-scripts/ + sudo chown mirte: $MIRTE_SRC_DIR + sudo chmod 755 $MIRTE_SRC_DIR + sudo -u mirte mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ + sudo -u mirte cp -r ./* $MIRTE_SRC_DIR/mirte-install-scripts/ cd $MIRTE_SRC_DIR - sudo git clone https://github.com/arendjan/mirte-ros-packages.git mirte-ros-packages -b develop --recursive + sudo -u mirte git clone https://github.com/arendjan/mirte-ros-packages.git mirte-ros-packages -b develop --recursive sudo apt update cd $MIRTE_SRC_DIR/mirte-install-scripts/ - sudo sed -i '/systemctl/d' install_ROS2.sh # remove systemctl command as it is not available in the github runner/container - sudo apt install libunwind-dev -y + sudo -u mirte sed -i '/systemctl/d' install_ROS2.sh # remove systemctl command as it is not available in the github runner/container + + # TODO: add deb proxy if wanted + # sudo apt install dbus libunwind-dev squid-deb-proxy-client -y + # mkdir -p /run/dbus + # dbus-daemon --system + # # sed -i 's/.*enable-dbus=.*/enable-dbus=no/' /etc/avahi/avahi-daemon.conf + # avahi-daemon -D & MIRTE_TYPE=${{ matrix.type }} - sudo /bin/bash -c "MIRTE_TYPE=${{ matrix.type }} source ./install_ROS2.sh" \ No newline at end of file + sudo -u mirte /bin/bash -c "MIRTE_TYPE=${{ matrix.type }} source ./install_ROS2.sh" \ No newline at end of file diff --git a/install_ROS2.sh b/install_ROS2.sh index da61948..a0c6bb4 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -57,6 +57,7 @@ ln -s $MIRTE_SRC_DIR/mirte-ros-packages . sudo apt install python3-colcon-mixin -y colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml +colcon mixin update default # Add colcon_defaults.yaml to the workspace, symlink and ccache cat <>/home/mirte/mirte_ws/colcon_defaults.yaml From 037969c602050e09fe2f7e4325ae153897bbfc5f Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 18 Jul 2025 15:25:37 +0200 Subject: [PATCH 322/353] fix install, try docker image --- .github/workflows/test_install.yml | 3 ++- install_ROS2.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 61239ce..b35c438 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -27,6 +27,7 @@ jobs: ros2-install: runs-on: ubuntu-22.04 + container: ghcr.io/catthehacker/ubuntu:act-22.04 strategy: matrix: type: [mirte, mirte-master] @@ -39,7 +40,7 @@ jobs: sudo useradd -m -s /bin/bash mirte # allow nopasswd sudo for mirte user echo "mirte ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/mirte - sudo chmod 777 /home/runner/ + sudo chmod 777 /home/runner/ || true MIRTE_SRC_DIR=/usr/local/src/mirte sudo mkdir -p $MIRTE_SRC_DIR sudo chown mirte: $MIRTE_SRC_DIR diff --git a/install_ROS2.sh b/install_ROS2.sh index a0c6bb4..3e3509c 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -16,6 +16,9 @@ sudo apt install software-properties-common -y sudo add-apt-repository universe -y sudo apt update && sudo apt install curl -y ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F\" '{print $4}') +if [ -z "$ROS_APT_SOURCE_VERSION" ]; then + ROS_APT_SOURCE_VERSION="1.1.0" +fi curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo $VERSION_CODENAME)_all.deb" sudo apt install /tmp/ros2-apt-source.deb sudo apt update From 5469ccc54185eaf3717a18ee8fc549fe6b26e9e9 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 22 Jul 2025 14:14:01 +0200 Subject: [PATCH 323/353] Add auto dhcp eth connection --- network_setup.sh | 5 ++- services/mirte_auto_dhcp_eth.sh | 70 +++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 2 deletions(-) create mode 100755 services/mirte_auto_dhcp_eth.sh diff --git a/network_setup.sh b/network_setup.sh index 6bbc261..7df5859 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -1,4 +1,7 @@ #!/bin/bash +MIRTE_SRC_DIR=/usr/local/src/mirte + +$MIRTE_SRC_DIR/mirte-install-scripts/services/mirte_auto_dhcp_eth.sh || true # wait for wlan0 to be up, with max 30 seconds TIMEOUT=30 @@ -131,8 +134,6 @@ function file_empty() { } -MIRTE_SRC_DIR=/usr/local/src/mirte - sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf || true # Create unique SSID diff --git a/services/mirte_auto_dhcp_eth.sh b/services/mirte_auto_dhcp_eth.sh new file mode 100755 index 0000000..4d93544 --- /dev/null +++ b/services/mirte_auto_dhcp_eth.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash + +# nm dispatcher is whack and not running reliably or without the interface name. + +# this script repeatedly checks eth0, when it goes up, wait for a few seconds +# if no ip assigned: start dnsmasq +# if ip assigned:don't do anything +# when eth0 goes down, kill dnsmasq if started + +set -xe + +# start dnsmasq +SUBNET=45 +interface=eth0 + +dnsmasq_pid=$(pgrep -f "dnsmasq --address=/#/192.168.$SUBNET.1") || true + +function cleanup { + has_dhcp=false + echo "Cleaning up..." + if [ -n "$dnsmasq_pid" ]; then + echo "Stopping dnsmasq with PID $dnsmasq_pid" + sudo kill "$dnsmasq_pid" || true + dnsmasq_pid="" + else + echo "No dnsmasq process found." + fi + sudo ip address del 192.168."$SUBNET".1/24 dev eth0 || true + # exit 0 + echo "Cleanup complete." + # exit 0 +} + +function start_dhcp { + cleanup + has_dhcp=true + sudo ip address add 192.168."$SUBNET".1/24 dev eth0 + sudo dnsmasq --address=/#/192.168."$SUBNET".1 --dhcp-range=192.168."$SUBNET".10,192.168."$SUBNET".100 --conf-file --domain-needed --bogus-priv --server=8.8.8.8 --dhcp-option=option:dns-server,8.8.8.8 --interface="$interface" --except-interface=lo --bind-interfaces -p0 --dhcp-leasefile=/tmp/dnsmasq.leases + dnsmasq_pid=$(pgrep -f "dnsmasq --address=/#/192.168.$SUBNET.1") +} + +function check_up { + is_up=$(ip addr show $interface | grep -q "state UP" && echo true || echo false) + has_ip=$(ip addr show $interface | grep -q "inet " && echo true || echo false) + if [ "$is_up" = false ]; then + SECONDS=0 + elif [ $SECONDS -gt 10 ] && [ "$has_ip" = false ]; then + echo "Interface $interface has been up for more than 10 seconds." + echo "No IP address assigned, starting DHCP server." + start_dhcp + fi +} + +function check_down { + is_up=$(ip addr show $interface | grep -q "state UP" && echo true || echo false) + if [ "$is_up" = false ] && [ "$has_dhcp" = true ]; then + echo "Interface $interface is down, stopping DHCP server." + cleanup + fi +} + +trap cleanup EXIT + +is_up=false +has_dhcp=false +while true; do + check_up + check_down + sleep 5 +done From 2ea6078e6f1dcbe0d4cfa862ae3e71da323737e7 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 22 Jul 2025 14:30:50 +0200 Subject: [PATCH 324/353] Add debug packages if available --- install_ROS2.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 3e3509c..8dcff99 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -106,7 +106,13 @@ if [[ $branch == "develop" || $branch == "main" ]]; then fi touch $path/COLCON_IGNORE i_dash=$(echo $i | tr '_' '-') - packages="$packages ros-$ROS_NAME-$i_dash" + pkg_name="ros-$ROS_NAME-$i_dash" + # check if dbgsym package exists + if apt-cache madison "$pkg_name-dbgsym" | grep -vqz "Unable to locate package"; then + echo "Adding debug package $pkg_name-dbgsym" + packages="$packages $pkg_name-dbgsym" + fi + packages="$packages $pkg_name" done if [[ $branch == "develop" ]]; then arch="${arch}_develop" From 20bc3176a07596bcfd36a75f4a37c7742296a31f Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 23 Jul 2025 13:43:14 +0200 Subject: [PATCH 325/353] Add pkg source prebuild before checking availability dbugsym --- install_ROS2.sh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 8dcff99..1f3f6a5 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -88,6 +88,10 @@ if [[ $branch == "develop" || $branch == "main" ]]; then # colcon ignore those packages echo "Using precompiled version of packages" + echo "deb [trusted=yes] $github_url/raw/ros_mirte_${ROS_NAME}_${ubuntu_version}_${arch}/ ./" | sudo tee /etc/apt/sources.list.d/mirte-ros-packages.list + echo "yaml $github_url/raw/ros_mirte_${ROS_NAME}_${ubuntu_version}_${arch}/local.yaml ${ROS_NAME}" | sudo tee /etc/ros/rosdep/sources.list.d/mirte-ros-packages.list + sudo apt update + cd /home/mirte/mirte_ws/src/ || exit 1 ignore=(mirte_telemetrix_cpp mirte_msgs mirte_teleop astra_camera astra_camera_msgs libuvc mirte_base_control mirte_master_arm_control mirte_control usb_cam) packages='' @@ -117,9 +121,6 @@ if [[ $branch == "develop" || $branch == "main" ]]; then if [[ $branch == "develop" ]]; then arch="${arch}_develop" fi - echo "deb [trusted=yes] $github_url/raw/ros_mirte_${ROS_NAME}_${ubuntu_version}_${arch}/ ./" | sudo tee /etc/apt/sources.list.d/mirte-ros-packages.list - echo "yaml $github_url/raw/ros_mirte_${ROS_NAME}_${ubuntu_version}_${arch}/local.yaml ${ROS_NAME}" | sudo tee /etc/ros/rosdep/sources.list.d/mirte-ros-packages.list - sudo apt update sudo apt install -y -m $packages || fallback=false # TODO: disabled fallback for now as mirte-arm doesn't compile. fi @@ -173,7 +174,6 @@ sudo adduser mirte dialout # Some nice extra packages: clean can clean workspaces and packages. No need to do it by hand. lint can check for errors in the cmake/package code. sudo pip3 install colcon-clean colcon-lint -# Add colcon top level workspace, this makes it possible to run colcon build from any folder, it will find the workspace and build it. Otherwise it will create a new workspace in the subdirectory. if [[ $MIRTE_TYPE == "mirte-master" ]]; then # TODO: need to check and edit the next part: @@ -213,12 +213,9 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then fi -cd /tmp -git clone https://github.com/rhaschke/colcon-top-level-workspace -cd colcon-top-level-workspace -pip install . -cd .. -rm -rf colcon-top-level-workspace +# Add colcon top level workspace, this makes it possible to run colcon build from any folder, it will find the workspace and build it. Otherwise it will create a new workspace in the subdirectory. +pip install git+https://github.com/arendjan/colcon-top-level-workspace.git + # zsh does not work nicely with ros2 autocomplete, so we need to add a function to fix it. # ROS 2 Foxy should have this fixed, but we are using ROS 2 Humble. # TODO: check for ROS2 jazzy From b6ebbe3241e8f0fce796ad3bfc09be375bb8ad6f Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 23 Jul 2025 13:58:28 +0200 Subject: [PATCH 326/353] test fix dbgsym --- install_ROS2.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 1f3f6a5..c03f0d0 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -112,7 +112,9 @@ if [[ $branch == "develop" || $branch == "main" ]]; then i_dash=$(echo $i | tr '_' '-') pkg_name="ros-$ROS_NAME-$i_dash" # check if dbgsym package exists - if apt-cache madison "$pkg_name-dbgsym" | grep -vqz "Unable to locate package"; then + sudo apt-cache madison "$pkg_name-dbgsym" + + if sudo apt-cache madison "$pkg_name-dbgsym" | grep -vqz "Unable to locate package"; then echo "Adding debug package $pkg_name-dbgsym" packages="$packages $pkg_name-dbgsym" fi From ab29eea084543284e715eef8e08c94796236f742 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 23 Jul 2025 14:09:51 +0200 Subject: [PATCH 327/353] fix dev ros pkgs --- install_ROS2.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index c03f0d0..913e726 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -86,7 +86,9 @@ if [[ $branch == "develop" || $branch == "main" ]]; then # Install mirte ros packages with apt from github, since they take ages to compile and it's easier to update them. # colcon ignore those packages - + if [[ $branch == "develop" ]]; then + arch="${arch}_develop" + fi echo "Using precompiled version of packages" echo "deb [trusted=yes] $github_url/raw/ros_mirte_${ROS_NAME}_${ubuntu_version}_${arch}/ ./" | sudo tee /etc/apt/sources.list.d/mirte-ros-packages.list echo "yaml $github_url/raw/ros_mirte_${ROS_NAME}_${ubuntu_version}_${arch}/local.yaml ${ROS_NAME}" | sudo tee /etc/ros/rosdep/sources.list.d/mirte-ros-packages.list @@ -120,9 +122,6 @@ if [[ $branch == "develop" || $branch == "main" ]]; then fi packages="$packages $pkg_name" done - if [[ $branch == "develop" ]]; then - arch="${arch}_develop" - fi sudo apt install -y -m $packages || fallback=false # TODO: disabled fallback for now as mirte-arm doesn't compile. fi From 3e2c3ec883b5e94578c094dbeec7af2058cfda67 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 23 Jul 2025 16:40:19 +0200 Subject: [PATCH 328/353] start auto dhcp in background --- network_setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_setup.sh b/network_setup.sh index 7df5859..e1e9429 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -1,7 +1,7 @@ #!/bin/bash MIRTE_SRC_DIR=/usr/local/src/mirte -$MIRTE_SRC_DIR/mirte-install-scripts/services/mirte_auto_dhcp_eth.sh || true +$MIRTE_SRC_DIR/mirte-install-scripts/services/mirte_auto_dhcp_eth.sh & || true # wait for wlan0 to be up, with max 30 seconds TIMEOUT=30 From 62ced4d0bd58ce3b25d72f9f6e919a70efdf7f16 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 19 Aug 2025 11:56:57 +0200 Subject: [PATCH 329/353] fix styling and upd picotool udev file name --- install_ROS2.sh | 1 - install_arduino.sh | 2 +- network_setup.sh | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 913e726..eb89487 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -175,7 +175,6 @@ sudo adduser mirte dialout # Some nice extra packages: clean can clean workspaces and packages. No need to do it by hand. lint can check for errors in the cmake/package code. sudo pip3 install colcon-clean colcon-lint - if [[ $MIRTE_TYPE == "mirte-master" ]]; then # TODO: need to check and edit the next part: sudo apt install ros-$ROS_NAME-slam-toolbox -y diff --git a/install_arduino.sh b/install_arduino.sh index 3eb8b7d..bd6fa2f 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -42,7 +42,7 @@ export PICO_SDK_PATH=$MIRTE_SRC_DIR/pico/pico-sdk add_rc "export PICO_SDK_PATH=$MIRTE_SRC_DIR/pico/pico-sdk" git clone https://github.com/raspberrypi/picotool.git --depth=1 # shallow clone to save space cd picotool || exit 1 -sudo cp udev/99-picotool.rules /etc/udev/rules.d/ +sudo cp udev/*.rules /etc/udev/rules.d/ mkdir build cd build || exit 1 diff --git a/network_setup.sh b/network_setup.sh index e1e9429..1e0a28d 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -1,7 +1,7 @@ #!/bin/bash MIRTE_SRC_DIR=/usr/local/src/mirte -$MIRTE_SRC_DIR/mirte-install-scripts/services/mirte_auto_dhcp_eth.sh & || true +($MIRTE_SRC_DIR/mirte-install-scripts/services/mirte_auto_dhcp_eth.sh || true) & # wait for wlan0 to be up, with max 30 seconds TIMEOUT=30 From 40c6f2a3607402c41e354835ea05d5e3a158132b Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 24 Sep 2025 16:17:52 +0200 Subject: [PATCH 330/353] add some setup script mirte workshop --- fix_scripts/intro_install.sh | 15 ++++++++++ fix_scripts/set_domain_id.sh | 56 ++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100755 fix_scripts/intro_install.sh create mode 100755 fix_scripts/set_domain_id.sh diff --git a/fix_scripts/intro_install.sh b/fix_scripts/intro_install.sh new file mode 100755 index 0000000..c91154f --- /dev/null +++ b/fix_scripts/intro_install.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -xe +sudo nmcli d wifi connect smartfridge password kaasblokje +sudo apt update +sudo apt upgrade -y +export NONINTERACTIVE=1 +export ROS_INSTALL_CHOICE=1 +wget -c https://raw.githubusercontent.com/ArendJan/ros2_oneline_install/main/ros2_install_humble.sh && chmod +x ./ros2_install_humble.sh && ./ros2_install_humble.sh || true + +# add the ros2 path to the bashrc +echo "export ROS_DOMAIN_ID=1" >>~/.bashrc || true +echo "source /opt/ros/humble/setup.bash" >>~/.bashrc || true + +sudo snap install --classic code diff --git a/fix_scripts/set_domain_id.sh b/fix_scripts/set_domain_id.sh new file mode 100755 index 0000000..b36dbc3 --- /dev/null +++ b/fix_scripts/set_domain_id.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +# set -xe +wifi="wlan0" + +# wait for wlan0 to be available +while ! ip addr show "$wifi" &>/dev/null; do + echo "Waiting for $wifi to be available..." + sleep 2 +done + +mac=$(ip addr show "$wifi" | awk '/ether/{print $2}') +echo $mac +# if mac in the list, then use the domain id +macs=( + "1 e0:51:d8:67:b1:84" + "2 e0:51:d8:67:af:f2" + "3 e0:51:d8:67:b2:32" + "4 e0:51:d8:67:af:a6" + "5 e0:51:d8:67:66:be" + "6 e0:51:d8:67:ae:9e" + "7 e0:51:d8:67:76:ac" + "8 e0:51:d8:67:c1:8e" + "9 e0:51:d8:67:b1:8e" + "10 e0:51:d8:67:b0:7e" + "11 e0:51:d8:67:b1:da" + "12 e0:51:d8:67:b2:66" + "13 e0:51:d8:67:b2:40" + "14 e0:51:d8:67:c1:38" + "15 e0:51:d8:67:67:04" + "16 e0:51:d8:67:67:50" + "17 e0:51:d8:67:67:26" + "18 e0:51:d8:67:c1:a0" + "19 e0:51:d8:67:c1:36" + "20 e0:51:d8:67:67:3a" + "21 e0:51:d8:67:67:20" + "22 e0:51:d8:67:b1:a8" + "23 e0:51:d8:67:c1:26" + "24 e0:51:d8:67:c1:32" + "25 e0:51:d8:67:66:68" + "26 e0:51:d8:67:ae:96" + "27 e0:51:d8:67:b0:16" + "28 04:56:e5:61:9d:51" +) +for i in "${macs[@]}"; do + set -- $i # Convert the "tuple" into the param args $1 $2... + if [[ "$2" == "$mac" ]]; then + echo "Found matching MAC address: $mac, setting ROS_DOMAIN_ID to $1" + echo -e "\nexport ROS_DOMAIN_ID=$1\n" >>~/.bashrc || true + echo -e "\nexport ROS_DOMAIN_ID=$1\n" >>~/.mirte_settings.sh || true + ROS_DOMAIN_ID="$1" + break + fi +done + +echo "ROS_DOMAIN_ID is set to $ROS_DOMAIN_ID" From dfe960d03a4ad1960bceb69643638d0c1a14baed Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 24 Sep 2025 16:30:33 +0200 Subject: [PATCH 331/353] minimize some clones and install steps --- install_ROS2.sh | 2 +- install_arduino.sh | 6 +++--- install_web.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index eb89487..df4f03a 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -181,7 +181,7 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then # install lidar and depth camera cd /home/mirte/mirte_ws/src || exit 1 - git clone https://github.com/Slamtec/rplidar_ros.git -b ros2 # FIXME-FUTURE: Can be installed in newer versions if V2.1.5 is released + git clone https://github.com/Slamtec/rplidar_ros.git --single-branch -b ros2 # FIXME-FUTURE: Can be installed in newer versions if V2.1.5 is released # git clone https://github.com/ArendJan/ros2_astra_camera.git -b fix-ros-jammy # compressed images image transport fixes, fork of orbbec/... with also lazy nodes # git clone https://github.com/clearpathrobotics/clearpath_mecanum_drive_controller # FIXME: Can be installed from apt? why build? diff --git a/install_arduino.sh b/install_arduino.sh index bd6fa2f..42ba922 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -34,13 +34,13 @@ sudo rm -rf v7* || true cd $MIRTE_SRC_DIR || exit 1 mkdir pico/ cd pico/ || exit 1 -git clone https://github.com/raspberrypi/pico-sdk.git --recursive --depth=1 # somehow needed for picotool +git clone https://github.com/raspberrypi/pico-sdk.git --single-branch --recursive --depth=1 # somehow needed for picotool ls realpath pico-sdk ls export PICO_SDK_PATH=$MIRTE_SRC_DIR/pico/pico-sdk add_rc "export PICO_SDK_PATH=$MIRTE_SRC_DIR/pico/pico-sdk" -git clone https://github.com/raspberrypi/picotool.git --depth=1 # shallow clone to save space +git clone https://github.com/raspberrypi/picotool.git --single-branch --depth=1 # shallow clone to save space cd picotool || exit 1 sudo cp udev/*.rules /etc/udev/rules.d/ @@ -59,7 +59,7 @@ pip install git+https://github.com/arendjan/pico-py-serial-flash.git@cli # uart cd $MIRTE_SRC_DIR/mirte-install-scripts/ # Already build all versions so only upload is needed *don't do for all, as it requires loads of space for the tools. # ./run_arduino.sh build Telemetrix4Arduino -./run_arduino.sh upload_nano Telemetrix4Arduino # 'try to upload to the nano', to also install the upload tools. +# ./run_arduino.sh upload_nano Telemetrix4Arduino # 'try to upload to the nano', to also install the upload tools. # ./run_arduino.sh build_nano_old Telemetrix4Arduino ./run_arduino.sh build_pico pio system prune -f diff --git a/install_web.sh b/install_web.sh index 88c142f..dc5acc6 100755 --- a/install_web.sh +++ b/install_web.sh @@ -26,7 +26,7 @@ cd $MIRTE_SRC_DIR/mirte-web-interface/nodejs-backend || exit 1 npm install . cd $MIRTE_SRC_DIR/mirte-web-interface -git clone https://github.com/dheera/rosboard.git +git clone https://github.com/dheera/rosboard.git --single-branch sudo pip3 install tornado sudo pip3 install simplejpeg # recommended, but ROSboard can fall back to cv2 or PIL instead From 6a76bedffcc4fd833ea51c09e8176b1e494b9412 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 3 Nov 2025 13:08:34 +0100 Subject: [PATCH 332/353] dont install all pico and platformio when not required --- .github/workflows/test_install.yml | 17 ++++++ install_arduino.sh | 85 ++++++++++++++++++++---------- run_arduino.sh | 7 ++- 3 files changed, 80 insertions(+), 29 deletions(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index b35c438..539fc52 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -5,6 +5,10 @@ on: [push, pull_request] jobs: arduino-install: runs-on: ubuntu-22.04 + strategy: + matrix: + install_arduino_all: [true, false] + fail-fast: false steps: - uses: actions/checkout@v4 @@ -13,6 +17,19 @@ jobs: mkdir -p /etc/udev/rules.d/ # just for testing, folder should just exist on the real image sudo useradd -m -s /bin/bash mirte MIRTE_SRC_DIR=/usr/local/src/mirte + sudo mkdir -p $MIRTE_SRC_DIR + + echo "Matrix install_arduino_all=${{ matrix.install_arduino_all }}" + if [ "${{ matrix.install_arduino_all }}" = "true" ]; then + echo "Setting INSTALL_ARDUINO_ALL to true" + echo "export INSTALL_ARDUINO_ALL=true" > $MIRTE_SRC_DIR/settings.sh + else + echo "Setting INSTALL_ARDUINO_ALL to false" + echo "export INSTALL_ARDUINO_ALL=false" > $MIRTE_SRC_DIR/settings.sh + fi + echo "Contents of settings.sh:" + cat $MIRTE_SRC_DIR/settings.sh || echo "settings.sh does not exist yet" + ls -ld /usr/local/ ls -ld /usr/local/src/ sudo mkdir -p $MIRTE_SRC_DIR diff --git a/install_arduino.sh b/install_arduino.sh index 42ba922..d1acd71 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -1,7 +1,8 @@ #!/bin/bash set -xe MIRTE_SRC_DIR=/usr/local/src/mirte - +export INSTALL_ARDUINO_ALL=false +. $MIRTE_SRC_DIR/settings.sh . $MIRTE_SRC_DIR/mirte-install-scripts/tools.sh # Install dependencies sudo apt install -y git curl binutils libusb-1.0-0 @@ -23,39 +24,67 @@ add_rc 'export PATH=$PATH:$HOME/.local/bin' curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/system/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules -# Install picotool for the Raspberry Pi Pico -sudo apt install gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib build-essential pkg-config libusb-1.0-0-dev cmake -y +if [ "$INSTALL_ARDUINO_ALL" = true ]; then + # Install picotool for the Raspberry Pi Pico + sudo apt install gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib build-essential pkg-config libusb-1.0-0-dev cmake -y -# Remove newlib versions that are not compatible with the pico or pico2, otherwise it takes 2GB of space -cd /usr/lib/arm-none-eabi/newlib/thumb || true -sudo rm -rf v8-a* || true -sudo rm -rf v7* || true + # Remove newlib versions that are not compatible with the pico or pico2, otherwise it takes 2GB of space + cd /usr/lib/arm-none-eabi/newlib/thumb || true + sudo rm -rf v8-a* || true + sudo rm -rf v7* || true -cd $MIRTE_SRC_DIR || exit 1 -mkdir pico/ -cd pico/ || exit 1 -git clone https://github.com/raspberrypi/pico-sdk.git --single-branch --recursive --depth=1 # somehow needed for picotool -ls -realpath pico-sdk -ls -export PICO_SDK_PATH=$MIRTE_SRC_DIR/pico/pico-sdk -add_rc "export PICO_SDK_PATH=$MIRTE_SRC_DIR/pico/pico-sdk" -git clone https://github.com/raspberrypi/picotool.git --single-branch --depth=1 # shallow clone to save space -cd picotool || exit 1 -sudo cp udev/*.rules /etc/udev/rules.d/ + cd $MIRTE_SRC_DIR || exit 1 + mkdir pico/ + cd pico/ || exit 1 + git clone https://github.com/raspberrypi/pico-sdk.git --single-branch --recursive --depth=1 # somehow needed for picotool + ls + realpath pico-sdk + ls + export PICO_SDK_PATH=$MIRTE_SRC_DIR/pico/pico-sdk + add_rc "export PICO_SDK_PATH=$MIRTE_SRC_DIR/pico/pico-sdk" + git clone https://github.com/raspberrypi/picotool.git --single-branch --depth=1 # shallow clone to save space + cd picotool || exit 1 + sudo cp udev/*.rules /etc/udev/rules.d/ -mkdir build -cd build || exit 1 -cmake .. -DCMAKE_BUILD_TYPE=Release -make -j -sudo make install + mkdir build + cd build || exit 1 + cmake .. -DCMAKE_BUILD_TYPE=Release + make -j + sudo make install -cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 -git submodule update --init --recursive + cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 + git submodule update --init --recursive -pip install -U "pip>=25" || true # pico-py-serial-flash requires a newer version of pip, otherwise it'll be installed as UNKNOWN package -pip install git+https://github.com/arendjan/pico-py-serial-flash.git@cli # uart flashing utility when using the pcb + pip install -U "pip>=25" || true # pico-py-serial-flash requires a newer version of pip, otherwise it'll be installed as UNKNOWN package + pip install git+https://github.com/arendjan/pico-py-serial-flash.git@cli # uart flashing utility when using the pcb +else + echo "Skipping installation of Pico tools" + echo "Only installing tools to upload to Pico with default uf2" + # download latest picotool for current arch linux + arch=$(uname -m) + curl -s https://api.github.com/repos/raspberrypi/pico-sdk-tools/releases/latest | grep -F "browser_download_url" | awk -F\" '{print $4}' | grep "picotool-.*-$arch-lin.tar.gz" | wget -i - -O /tmp/picotool-latest-$arch-lin.tar.gz + # unzip only picotool/picotool file to /usr/local/bin/picotool + cd /usr/local/bin || exit 1 + sudo tar -xzvf /tmp/picotool-latest-$arch-lin.tar.gz picotool/picotool --strip-components=1 + sudo chmod +x ./picotool + # download last uf2 from telemetrix pico repo + cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 + mkdir -p build || true + cd build || exit 1 + REPO=$(git config --get remote.origin.url | sed 's/https:\/\/github.com\///' | sed 's/\.git//') + BRANCH=$(git rev-parse --abbrev-ref HEAD) + curl -s https://api.github.com/repos/$REPO/releases | jq "[.[] | select ((.target_commitish==\"$BRANCH\"))][0]" | grep -F "browser_download_url" | awk -F\" '{print $4}' | grep '\.uf2$' | wget -i - -O Telemetrix4RpiPico.uf2 + # if not found, try to get from main branch + if [ ! -f Telemetrix4RpiPico.uf2 ]; then + curl -s https://api.github.com/repos/$REPO/releases | jq "[.[] | select ((.target_commitish==\"main\"))][0]" | grep -F "browser_download_url" | awk -F\" '{print $4}' | grep '\.uf2$' | wget -i - -O Telemetrix4RpiPico.uf2 + echo "Downloaded Telemetrix4RpiPico.uf2 from main branch" + fi + if [ ! -f Telemetrix4RpiPico.uf2 ]; then + echo "Failed to download Telemetrix4RpiPico.uf2" + exit 1 + fi +fi cd $MIRTE_SRC_DIR/mirte-install-scripts/ # Already build all versions so only upload is needed *don't do for all, as it requires loads of space for the tools. # ./run_arduino.sh build Telemetrix4Arduino diff --git a/run_arduino.sh b/run_arduino.sh index e8d65b1..6ee203a 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -2,7 +2,6 @@ # set -x #TODO: script should have format ./run.sh build|upload] mcu_type COMMAND=$1 - if [ -z "$COMMAND" ]; then echo "Usage: $0 build_[mcu] | upload_[mcu]" echo "Example: $0 build_nano" @@ -11,6 +10,8 @@ if [ -z "$COMMAND" ]; then fi MIRTE_SRC_DIR=/usr/local/src/mirte +export INSTALL_ARDUINO_ALL=false +source $MIRTE_SRC_DIR/settings.sh PICO_BUILD_LOCATION=$MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico # Check if ROS is running @@ -31,6 +32,10 @@ fi cd $MIRTE_SRC_DIR/$PROJECT || exit 1 buildpico() { + if [ "$INSTALL_ARDUINO_ALL" != true ]; then + echo "Using prebuilt uf2, change INSTALL_ARDUINO_ALL to true to build from source" + return + fi cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 # shellcheck disable=SC2164 mkdir -p build && cd build From f98cbbec04c416bb9cb8c0a1c33edd6c8e445d13 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 3 Nov 2025 13:17:09 +0100 Subject: [PATCH 333/353] move old files to mirte-dev-scripts --- fix_scripts/fix-networking.sh | 33 ------------------- fix_scripts/fix-wifi-connect.sh | 16 ---------- fix_scripts/intro_install.sh | 15 --------- fix_scripts/set_domain_id.sh | 56 --------------------------------- 4 files changed, 120 deletions(-) delete mode 100644 fix_scripts/fix-networking.sh delete mode 100644 fix_scripts/fix-wifi-connect.sh delete mode 100755 fix_scripts/intro_install.sh delete mode 100755 fix_scripts/set_domain_id.sh diff --git a/fix_scripts/fix-networking.sh b/fix_scripts/fix-networking.sh deleted file mode 100644 index 536e9d3..0000000 --- a/fix_scripts/fix-networking.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -set -xe -echo "Starting networking fix script" -sudo systemctl stop mirte-shutdown -sudo systemctl stop mirte-ros -sudo apt update -# sudo apt-get upgrade -y "ros-humble- -cd /home/mirte/mirte_ws/src/mirte-ros-packages/ -git fetch --all -git pull -git switch develop || true -cd /home/mirte/mirte_ws/src/ros2_astra_camera/ -git fetch --all -git pull -cd /home/mirte/mirte_ws/ -source ./install/setup.bash -rosdep install -y --from-paths src/ --ignore-src --rosdistro humble -r -source /home/mirte/mirte_ws/install/setup.bash -colcon build --symlink-install --packages-up-to mirte_fastdds_discovery_setup astra_camera mirte_bringup --cmake-args -DCMAKE_BUILD_TYPE=Release -source /home/mirte/mirte_ws/install/setup.bash -# add MIRTE_FASTDDS=true to .mirte_settings.sh -echo "MIRTE_FASTDDS=true" >>/home/mirte/.mirte_settings.sh - -cd /usr/local/src/mirte/mirte-install-scripts/ - -# overwrite file with new version -download_url="https://raw.githubusercontent.com/mirte-robot/mirte-install-scripts/refs/heads/develop/services/mirte_ros.sh" -curl -o /usr/local/src/mirte/mirte-install-scripts/services/mirte_ros.sh $download_url - -echo "rebooting in 10 seconds" -sleep 10 -sudo reboot now -# diff --git a/fix_scripts/fix-wifi-connect.sh b/fix_scripts/fix-wifi-connect.sh deleted file mode 100644 index b7338b4..0000000 --- a/fix_scripts/fix-wifi-connect.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -xe -# create tmp directory -tmp_dir=$(mktemp -d) - -cd $tmp_dir -MY_ARCH=$(arch) -if [[ "$MY_ARCH" == "aarch64" ]]; then - wget https://github.com/ArendJan/balena-os-wifi-connect/releases/download/fix-zerotier/wifi-connect-aarch64-unknown-linux-gnu.zip -fi -if [[ "$MY_ARCH" == "armv7l" ]]; then - wget https://github.com/ArendJan/balena-os-wifi-connect/releases/download/fix-zerotier/wifi-connect-armv7-unknown-linux-gnueabihf.zip -fi -unzip wifi-connect* -sudo mv wifi-connect /usr/local/sbin -rm wifi-connect* diff --git a/fix_scripts/intro_install.sh b/fix_scripts/intro_install.sh deleted file mode 100755 index c91154f..0000000 --- a/fix_scripts/intro_install.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -xe -sudo nmcli d wifi connect smartfridge password kaasblokje -sudo apt update -sudo apt upgrade -y -export NONINTERACTIVE=1 -export ROS_INSTALL_CHOICE=1 -wget -c https://raw.githubusercontent.com/ArendJan/ros2_oneline_install/main/ros2_install_humble.sh && chmod +x ./ros2_install_humble.sh && ./ros2_install_humble.sh || true - -# add the ros2 path to the bashrc -echo "export ROS_DOMAIN_ID=1" >>~/.bashrc || true -echo "source /opt/ros/humble/setup.bash" >>~/.bashrc || true - -sudo snap install --classic code diff --git a/fix_scripts/set_domain_id.sh b/fix_scripts/set_domain_id.sh deleted file mode 100755 index b36dbc3..0000000 --- a/fix_scripts/set_domain_id.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -# set -xe -wifi="wlan0" - -# wait for wlan0 to be available -while ! ip addr show "$wifi" &>/dev/null; do - echo "Waiting for $wifi to be available..." - sleep 2 -done - -mac=$(ip addr show "$wifi" | awk '/ether/{print $2}') -echo $mac -# if mac in the list, then use the domain id -macs=( - "1 e0:51:d8:67:b1:84" - "2 e0:51:d8:67:af:f2" - "3 e0:51:d8:67:b2:32" - "4 e0:51:d8:67:af:a6" - "5 e0:51:d8:67:66:be" - "6 e0:51:d8:67:ae:9e" - "7 e0:51:d8:67:76:ac" - "8 e0:51:d8:67:c1:8e" - "9 e0:51:d8:67:b1:8e" - "10 e0:51:d8:67:b0:7e" - "11 e0:51:d8:67:b1:da" - "12 e0:51:d8:67:b2:66" - "13 e0:51:d8:67:b2:40" - "14 e0:51:d8:67:c1:38" - "15 e0:51:d8:67:67:04" - "16 e0:51:d8:67:67:50" - "17 e0:51:d8:67:67:26" - "18 e0:51:d8:67:c1:a0" - "19 e0:51:d8:67:c1:36" - "20 e0:51:d8:67:67:3a" - "21 e0:51:d8:67:67:20" - "22 e0:51:d8:67:b1:a8" - "23 e0:51:d8:67:c1:26" - "24 e0:51:d8:67:c1:32" - "25 e0:51:d8:67:66:68" - "26 e0:51:d8:67:ae:96" - "27 e0:51:d8:67:b0:16" - "28 04:56:e5:61:9d:51" -) -for i in "${macs[@]}"; do - set -- $i # Convert the "tuple" into the param args $1 $2... - if [[ "$2" == "$mac" ]]; then - echo "Found matching MAC address: $mac, setting ROS_DOMAIN_ID to $1" - echo -e "\nexport ROS_DOMAIN_ID=$1\n" >>~/.bashrc || true - echo -e "\nexport ROS_DOMAIN_ID=$1\n" >>~/.mirte_settings.sh || true - ROS_DOMAIN_ID="$1" - break - fi -done - -echo "ROS_DOMAIN_ID is set to $ROS_DOMAIN_ID" From db5708c03ce0c01977a3488956b9b87893460244 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 3 Nov 2025 13:33:34 +0100 Subject: [PATCH 334/353] Fix install + allow override SRC_DIR --- .github/workflows/test_install.yml | 11 ++++++----- create_user.sh | 2 +- install_ROS.sh | 2 +- install_ROS2.sh | 2 +- install_arduino.sh | 2 +- install_jupyter_ros.sh | 2 +- install_mirte.sh | 2 +- install_mirte_master.sh | 2 +- install_vscode.sh | 2 +- install_web.sh | 2 +- network_install.sh | 2 +- network_setup.sh | 5 ++++- run_arduino.sh | 2 +- usb_ethernet.sh | 2 +- 14 files changed, 22 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 539fc52..70dc74c 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -16,8 +16,9 @@ jobs: run: | mkdir -p /etc/udev/rules.d/ # just for testing, folder should just exist on the real image sudo useradd -m -s /bin/bash mirte - MIRTE_SRC_DIR=/usr/local/src/mirte - sudo mkdir -p $MIRTE_SRC_DIR + pwd + export MIRTE_SRC_DIR=~/usr/local/src/mirte + mkdir -p $MIRTE_SRC_DIR echo "Matrix install_arduino_all=${{ matrix.install_arduino_all }}" if [ "${{ matrix.install_arduino_all }}" = "true" ]; then @@ -40,7 +41,7 @@ jobs: sudo git clone https://github.com/mirte-robot/telemetrix4arduino.git mirte-telemetrix4arduino -b develop sudo git clone https://github.com/mirte-robot/telemetrix4rpipico.git mirte-telemetrix4rpipico -b develop --recursive cd $MIRTE_SRC_DIR/mirte-install-scripts/ - sudo ./install_arduino.sh + sudo -E ./install_arduino.sh ros2-install: runs-on: ubuntu-22.04 @@ -58,7 +59,7 @@ jobs: # allow nopasswd sudo for mirte user echo "mirte ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/mirte sudo chmod 777 /home/runner/ || true - MIRTE_SRC_DIR=/usr/local/src/mirte + export MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} sudo mkdir -p $MIRTE_SRC_DIR sudo chown mirte: $MIRTE_SRC_DIR sudo chmod 755 $MIRTE_SRC_DIR @@ -78,4 +79,4 @@ jobs: # # sed -i 's/.*enable-dbus=.*/enable-dbus=no/' /etc/avahi/avahi-daemon.conf # avahi-daemon -D & MIRTE_TYPE=${{ matrix.type }} - sudo -u mirte /bin/bash -c "MIRTE_TYPE=${{ matrix.type }} source ./install_ROS2.sh" \ No newline at end of file + sudo -E -u mirte /bin/bash -c "MIRTE_TYPE=${{ matrix.type }} source ./install_ROS2.sh" \ No newline at end of file diff --git a/create_user.sh b/create_user.sh index 7c60f5d..018ef63 100755 --- a/create_user.sh +++ b/create_user.sh @@ -1,7 +1,7 @@ #!/bin/bash set -ex -MIRTE_SRC_DIR=/usr/local/src/mirte +MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} # Add mirte user with sudo rights #TODO: user without homedir (create homedir for user) sudo useradd -m -G sudo,audio -s /bin/bash mirte diff --git a/install_ROS.sh b/install_ROS.sh index 01aafc0..9d15268 100755 --- a/install_ROS.sh +++ b/install_ROS.sh @@ -3,7 +3,7 @@ set -xe THIS SCRIPT IS NOT USED ANYMORE, LOOK AT install_ROS2.sh #TODO: get this as a parameter -MIRTE_SRC_DIR=/usr/local/src/mirte +MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} # There is a bug with Cmake in qemu for armhf: # https://gitlab.kitware.com/cmake/cmake/-/issues/20568 diff --git a/install_ROS2.sh b/install_ROS2.sh index df4f03a..2eb85a5 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -6,7 +6,7 @@ set -xe # TODO: check above info, no issues yet (2024-12-11) #TODO: get this as a parameter -MIRTE_SRC_DIR=/usr/local/src/mirte +MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} . tools.sh # shellcheck source=/dev/null source /etc/os-release diff --git a/install_arduino.sh b/install_arduino.sh index d1acd71..2757e3b 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -1,6 +1,6 @@ #!/bin/bash set -xe -MIRTE_SRC_DIR=/usr/local/src/mirte +MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} export INSTALL_ARDUINO_ALL=false . $MIRTE_SRC_DIR/settings.sh . $MIRTE_SRC_DIR/mirte-install-scripts/tools.sh diff --git a/install_jupyter_ros.sh b/install_jupyter_ros.sh index e8d87d6..9beedba 100755 --- a/install_jupyter_ros.sh +++ b/install_jupyter_ros.sh @@ -1,6 +1,6 @@ #!/bin/bash set -xe -MIRTE_SRC_DIR=/usr/local/src/mirte +MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} # install basic python tools sudo apt install -y python3 python3-venv python3-dev git libffi-dev diff --git a/install_mirte.sh b/install_mirte.sh index c11a09e..44695e7 100755 --- a/install_mirte.sh +++ b/install_mirte.sh @@ -1,7 +1,7 @@ #!/bin/bash set -xe -MIRTE_SRC_DIR=/usr/local/src/mirte +MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} . $MIRTE_SRC_DIR/settings.sh || true # read settings, like MIRTE_TYPE MIRTE_TYPE="${MIRTE_TYPE:-default}" # default, mirte-master diff --git a/install_mirte_master.sh b/install_mirte_master.sh index 9f9b2c2..6ebf0ff 100755 --- a/install_mirte_master.sh +++ b/install_mirte_master.sh @@ -1,7 +1,7 @@ #!/bin/bash set -xe -MIRTE_SRC_DIR=/usr/local/src/mirte +MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} if [[ ${type:=""} != "mirte_orangepi3b" ]]; then # Fix for wrong sound card diff --git a/install_vscode.sh b/install_vscode.sh index 286659f..ac1a0a4 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -1,6 +1,6 @@ #!/bin/bash set -xe -MIRTE_SRC_DIR=/usr/local/src/mirte +MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} # VScode in 2 parts: # - vscode remote server, when using the ssh plugin from another computer diff --git a/install_web.sh b/install_web.sh index dc5acc6..4425174 100755 --- a/install_web.sh +++ b/install_web.sh @@ -1,6 +1,6 @@ #!/bin/bash set -xe -MIRTE_SRC_DIR=/usr/local/src/mirte +MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} # Update sudo apt update || true diff --git a/network_install.sh b/network_install.sh index 30f3d01..4af0f2d 100755 --- a/network_install.sh +++ b/network_install.sh @@ -1,6 +1,6 @@ #!/bin/bash set -xe -MIRTE_SRC_DIR=/usr/local/src/mirte +MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} # Fix for bug in systemd-resolved # (https://askubuntu.com/questions/973017/wrong-nameserver-set-by-resolvconf-and-networkmanager) diff --git a/network_setup.sh b/network_setup.sh index 1e0a28d..28b8ba0 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -1,5 +1,8 @@ #!/bin/bash -MIRTE_SRC_DIR=/usr/local/src/mirte +MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} + +# beide crasht regelmatig, wpa3 en deze +# wpa1 disablen dunno of dat uitmaakt ($MIRTE_SRC_DIR/mirte-install-scripts/services/mirte_auto_dhcp_eth.sh || true) & diff --git a/run_arduino.sh b/run_arduino.sh index 6ee203a..24dc2f9 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -9,7 +9,7 @@ if [ -z "$COMMAND" ]; then exit 1 fi -MIRTE_SRC_DIR=/usr/local/src/mirte +MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} export INSTALL_ARDUINO_ALL=false source $MIRTE_SRC_DIR/settings.sh PICO_BUILD_LOCATION=$MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico diff --git a/usb_ethernet.sh b/usb_ethernet.sh index 692befa..989b2f8 100755 --- a/usb_ethernet.sh +++ b/usb_ethernet.sh @@ -3,7 +3,7 @@ # This script creates USB gadgets usign ConfigFS for both Linux/MacOS and Windows # The Linux and MacOS version will connect to usb0, whil Windows will connect # to usb1. Both networks then are shown on the host. -MIRTE_SRC_DIR=/usr/local/src/mirte +MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} sudo killall -9 dnsmasq sudo $MIRTE_SRC_DIR/mirte-install-scripts/ev3-usb.sh down "$(ls /sys/class/udc | tail -n1)" || true From f7c53b1a774a30050da4ad4c84b786cbe9e1ff16 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 3 Nov 2025 13:38:10 +0100 Subject: [PATCH 335/353] Fix test install env --- .github/workflows/test_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 70dc74c..91f866d 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -79,4 +79,4 @@ jobs: # # sed -i 's/.*enable-dbus=.*/enable-dbus=no/' /etc/avahi/avahi-daemon.conf # avahi-daemon -D & MIRTE_TYPE=${{ matrix.type }} - sudo -E -u mirte /bin/bash -c "MIRTE_TYPE=${{ matrix.type }} source ./install_ROS2.sh" \ No newline at end of file + sudo -u mirte /bin/bash -c "MIRTE_TYPE=${{ matrix.type }} source ./install_ROS2.sh" \ No newline at end of file From c89311effa22d27ee45ecc4833ace53d985bd4ab Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 4 Nov 2025 09:49:46 +0100 Subject: [PATCH 336/353] remove picotool install bc using prebuilt --- install_arduino.sh | 9 --------- 1 file changed, 9 deletions(-) diff --git a/install_arduino.sh b/install_arduino.sh index 2757e3b..a21ff18 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -42,15 +42,6 @@ if [ "$INSTALL_ARDUINO_ALL" = true ]; then ls export PICO_SDK_PATH=$MIRTE_SRC_DIR/pico/pico-sdk add_rc "export PICO_SDK_PATH=$MIRTE_SRC_DIR/pico/pico-sdk" - git clone https://github.com/raspberrypi/picotool.git --single-branch --depth=1 # shallow clone to save space - cd picotool || exit 1 - sudo cp udev/*.rules /etc/udev/rules.d/ - - mkdir build - cd build || exit 1 - cmake .. -DCMAKE_BUILD_TYPE=Release - make -j - sudo make install cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 git submodule update --init --recursive From a337771adfc285075443dee1fef7be98dc108a06 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 4 Nov 2025 10:22:01 +0100 Subject: [PATCH 337/353] cleanup front-end node_modules after build for space savings --- install_web.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install_web.sh b/install_web.sh index 4425174..49b88c5 100755 --- a/install_web.sh +++ b/install_web.sh @@ -20,7 +20,9 @@ cd $MIRTE_SRC_DIR/mirte-web-interface/vue-frontend || exit 1 npm install . npm rebuild npm run build - +df -h +rm -rf node_modules || true +df -h # Install backend cd $MIRTE_SRC_DIR/mirte-web-interface/nodejs-backend || exit 1 npm install . From 5b57f5fa405e4e0bd1a956f78f62d9af2f466570 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 4 Nov 2025 11:00:35 +0100 Subject: [PATCH 338/353] Add test install_web --- .github/workflows/test_install.yml | 27 ++++++++++++++++++++++++++- install_web.sh | 5 ++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 91f866d..b4d0814 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -79,4 +79,29 @@ jobs: # # sed -i 's/.*enable-dbus=.*/enable-dbus=no/' /etc/avahi/avahi-daemon.conf # avahi-daemon -D & MIRTE_TYPE=${{ matrix.type }} - sudo -u mirte /bin/bash -c "MIRTE_TYPE=${{ matrix.type }} source ./install_ROS2.sh" \ No newline at end of file + sudo -u mirte /bin/bash -c "MIRTE_TYPE=${{ matrix.type }} source ./install_ROS2.sh" + + web-install: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - shell: bash + run: | + sudo useradd -m -s /bin/bash mirte + # allow root from user + echo "mirte ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/mirte + export MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} + sudo mkdir -p $MIRTE_SRC_DIR + sudo chown mirte: $MIRTE_SRC_DIR + sudo chmod 755 $MIRTE_SRC_DIR + sudo -u mirte mkdir $MIRTE_SRC_DIR/mirte-install-scripts/ + sudo -u mirte cp -r ./* $MIRTE_SRC_DIR/mirte-install-scripts/ + cd $MIRTE_SRC_DIR + sudo -u mirte git clone https://github.com/mirte-robot/mirte-web-interface.git mirte-web-interface -b develop + SYSTEMCTL_LOCATION=$(which systemctl) + rm -f $SYSTEMCTL_LOCATION + touch $SYSTEMCTL_LOCATION + chmod +x $SYSTEMCTL_LOCATION + sudo systemctl daemon-reload + cd $MIRTE_SRC_DIR/mirte-install-scripts/ + ./install_web.sh \ No newline at end of file diff --git a/install_web.sh b/install_web.sh index 49b88c5..28212c8 100755 --- a/install_web.sh +++ b/install_web.sh @@ -20,12 +20,12 @@ cd $MIRTE_SRC_DIR/mirte-web-interface/vue-frontend || exit 1 npm install . npm rebuild npm run build -df -h rm -rf node_modules || true -df -h + # Install backend cd $MIRTE_SRC_DIR/mirte-web-interface/nodejs-backend || exit 1 npm install . +deactivate_node cd $MIRTE_SRC_DIR/mirte-web-interface git clone https://github.com/dheera/rosboard.git --single-branch @@ -35,7 +35,6 @@ sudo pip3 install simplejpeg # recommended, but ROSboard can fall back to cv2 or # Install wetty #cd $MIRTE_SRC_DIR/mirte-web-interface #npm -g install wetty -deactivate_node # Install strace for linetrace functionality sudo apt install -y strace From c69e1c4cccc8f4b31a44b14ca406c591351cfe15 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 5 Nov 2025 17:06:37 +0100 Subject: [PATCH 339/353] Fix web-install test --- .github/workflows/test_install.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index b4d0814..44293c0 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -90,7 +90,7 @@ jobs: sudo useradd -m -s /bin/bash mirte # allow root from user echo "mirte ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/mirte - export MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} + export MIRTE_SRC_DIR=/test/mirte sudo mkdir -p $MIRTE_SRC_DIR sudo chown mirte: $MIRTE_SRC_DIR sudo chmod 755 $MIRTE_SRC_DIR @@ -98,10 +98,8 @@ jobs: sudo -u mirte cp -r ./* $MIRTE_SRC_DIR/mirte-install-scripts/ cd $MIRTE_SRC_DIR sudo -u mirte git clone https://github.com/mirte-robot/mirte-web-interface.git mirte-web-interface -b develop - SYSTEMCTL_LOCATION=$(which systemctl) - rm -f $SYSTEMCTL_LOCATION - touch $SYSTEMCTL_LOCATION - chmod +x $SYSTEMCTL_LOCATION - sudo systemctl daemon-reload + # remove all lines with systemctl as not available in github runner + cd $MIRTE_SRC_DIR/mirte-install-scripts/ + sudo -u mirte sed -i '/sudo systemctl/d' install_web.sh cd $MIRTE_SRC_DIR/mirte-install-scripts/ - ./install_web.sh \ No newline at end of file + sudo -u mirte /bin/bash -c "MIRTE_SRC_DIR=$MIRTE_SRC_DIR ./install_web.sh" \ No newline at end of file From b02ea79f2c92075cbe5150137cf693f03b6a9b3a Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 5 Nov 2025 17:17:31 +0100 Subject: [PATCH 340/353] Rm old comment netw install --- network_setup.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/network_setup.sh b/network_setup.sh index 28b8ba0..97535a5 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -1,9 +1,6 @@ #!/bin/bash MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} -# beide crasht regelmatig, wpa3 en deze -# wpa1 disablen dunno of dat uitmaakt - ($MIRTE_SRC_DIR/mirte-install-scripts/services/mirte_auto_dhcp_eth.sh || true) & # wait for wlan0 to be up, with max 30 seconds From bc1b3af9c6519b11587de98d579d3a97fbbde750 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 5 Nov 2025 17:19:11 +0100 Subject: [PATCH 341/353] Improve run_arduino env check --- run_arduino.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run_arduino.sh b/run_arduino.sh index 24dc2f9..a8cfe2a 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -10,7 +10,7 @@ if [ -z "$COMMAND" ]; then fi MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} -export INSTALL_ARDUINO_ALL=false +export INSTALL_ARDUINO_ALL=${INSTALL_ARDUINO_ALL:-false} source $MIRTE_SRC_DIR/settings.sh PICO_BUILD_LOCATION=$MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico @@ -33,7 +33,7 @@ cd $MIRTE_SRC_DIR/$PROJECT || exit 1 buildpico() { if [ "$INSTALL_ARDUINO_ALL" != true ]; then - echo "Using prebuilt uf2, change INSTALL_ARDUINO_ALL to true to build from source" + echo "Using prebuilt uf2, set INSTALL_ARDUINO_ALL to true to build from source" return fi cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 From 71411023a8096b0a76f13478777e9aab59d1f978 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 5 Nov 2025 17:24:00 +0100 Subject: [PATCH 342/353] Update install_arduino.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- install_arduino.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_arduino.sh b/install_arduino.sh index a21ff18..b9a6017 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -24,7 +24,7 @@ add_rc 'export PATH=$PATH:$HOME/.local/bin' curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/system/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules -if [ "$INSTALL_ARDUINO_ALL" = true ]; then +if [ "$INSTALL_ARDUINO_ALL" = "true" ]; then # Install picotool for the Raspberry Pi Pico sudo apt install gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib build-essential pkg-config libusb-1.0-0-dev cmake -y From fa969594aa096c21b20f41b664caf48936c24c70 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 5 Nov 2025 17:24:07 +0100 Subject: [PATCH 343/353] Update run_arduino.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- run_arduino.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_arduino.sh b/run_arduino.sh index a8cfe2a..9ae49a6 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -11,7 +11,7 @@ fi MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} export INSTALL_ARDUINO_ALL=${INSTALL_ARDUINO_ALL:-false} -source $MIRTE_SRC_DIR/settings.sh +source $MIRTE_SRC_DIR/settings.sh || true PICO_BUILD_LOCATION=$MIRTE_SRC_DIR/mirte-telemetrix4rpipico/build/Telemetrix4RpiPico # Check if ROS is running From 5955d19a6ea0ff22701256bca4a973634d837791 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 5 Nov 2025 17:25:44 +0100 Subject: [PATCH 344/353] Update install_arduino.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- install_arduino.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/install_arduino.sh b/install_arduino.sh index b9a6017..6ab765c 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -54,6 +54,15 @@ else # download latest picotool for current arch linux arch=$(uname -m) curl -s https://api.github.com/repos/raspberrypi/pico-sdk-tools/releases/latest | grep -F "browser_download_url" | awk -F\" '{print $4}' | grep "picotool-.*-$arch-lin.tar.gz" | wget -i - -O /tmp/picotool-latest-$arch-lin.tar.gz + # Check that the file was downloaded and is a valid tar.gz + if [ ! -s /tmp/picotool-latest-$arch-lin.tar.gz ]; then + echo "Error: Failed to download picotool tarball for architecture $arch." + exit 1 + fi + if ! gzip -t /tmp/picotool-latest-$arch-lin.tar.gz 2>/dev/null; then + echo "Error: Downloaded picotool tarball is not a valid gzip file." + exit 1 + fi # unzip only picotool/picotool file to /usr/local/bin/picotool cd /usr/local/bin || exit 1 sudo tar -xzvf /tmp/picotool-latest-$arch-lin.tar.gz picotool/picotool --strip-components=1 From 1340b13c4098c58243327aa2f49614bea624b29c Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 20 Nov 2025 13:50:48 +0100 Subject: [PATCH 345/353] Fix minimize install not installing serial flasher + elf download for serial flasher --- install_arduino.sh | 9 +++++++-- run_arduino.sh | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/install_arduino.sh b/install_arduino.sh index 6ab765c..7bea4c2 100755 --- a/install_arduino.sh +++ b/install_arduino.sh @@ -46,8 +46,6 @@ if [ "$INSTALL_ARDUINO_ALL" = "true" ]; then cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 git submodule update --init --recursive - pip install -U "pip>=25" || true # pico-py-serial-flash requires a newer version of pip, otherwise it'll be installed as UNKNOWN package - pip install git+https://github.com/arendjan/pico-py-serial-flash.git@cli # uart flashing utility when using the pcb else echo "Skipping installation of Pico tools" echo "Only installing tools to upload to Pico with default uf2" @@ -68,6 +66,10 @@ else sudo tar -xzvf /tmp/picotool-latest-$arch-lin.tar.gz picotool/picotool --strip-components=1 sudo chmod +x ./picotool + # uploader when using uart (mirte pioneer pcb) + pip install -U "pip>=25" || true # pico-py-serial-flash requires a newer version of pip, otherwise it'll be installed as UNKNOWN package + pip install git+https://github.com/arendjan/pico-py-serial-flash.git@cli # uart flashing utility when using the pcb + # download last uf2 from telemetrix pico repo cd $MIRTE_SRC_DIR/mirte-telemetrix4rpipico || exit 1 mkdir -p build || true @@ -75,9 +77,12 @@ else REPO=$(git config --get remote.origin.url | sed 's/https:\/\/github.com\///' | sed 's/\.git//') BRANCH=$(git rev-parse --abbrev-ref HEAD) curl -s https://api.github.com/repos/$REPO/releases | jq "[.[] | select ((.target_commitish==\"$BRANCH\"))][0]" | grep -F "browser_download_url" | awk -F\" '{print $4}' | grep '\.uf2$' | wget -i - -O Telemetrix4RpiPico.uf2 + #also download elf file + curl -s https://api.github.com/repos/$REPO/releases | jq "[.[] | select ((.target_commitish==\"$BRANCH\"))][0]" | grep -F "browser_download_url" | awk -F\" '{print $4}' | grep '\.elf$' | wget -i - -O Telemetrix4RpiPico.elf # if not found, try to get from main branch if [ ! -f Telemetrix4RpiPico.uf2 ]; then curl -s https://api.github.com/repos/$REPO/releases | jq "[.[] | select ((.target_commitish==\"main\"))][0]" | grep -F "browser_download_url" | awk -F\" '{print $4}' | grep '\.uf2$' | wget -i - -O Telemetrix4RpiPico.uf2 + curl -s https://api.github.com/repos/$REPO/releases | jq "[.[] | select ((.target_commitish==\"main\"))][0]" | grep -F "browser_download_url" | awk -F\" '{print $4}' | grep '\.elf$' | wget -i - -O Telemetrix4RpiPico.elf echo "Downloaded Telemetrix4RpiPico.uf2 from main branch" fi if [ ! -f Telemetrix4RpiPico.uf2 ]; then diff --git a/run_arduino.sh b/run_arduino.sh index 9ae49a6..e36fcc0 100755 --- a/run_arduino.sh +++ b/run_arduino.sh @@ -49,7 +49,7 @@ upload_pico_uart() { # send reboot command stty 115200 -F $port echo -ne '\x01\x26' >$port # 1 byte message, message id 0x26==reset_to_bootloader - sleep 1 + sleep 3 # try to upload ERR=false pico_py_serial_flasher $port $PICO_BUILD_LOCATION.elf || ERR=true From e6cf68d8ff0f38e4c0ef0081510d7336692b48dc Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 8 Dec 2025 10:40:47 +0100 Subject: [PATCH 346/353] Use auto standby rplidar c1 --- install_ROS2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ROS2.sh b/install_ROS2.sh index 2eb85a5..103cc4f 100755 --- a/install_ROS2.sh +++ b/install_ROS2.sh @@ -181,7 +181,7 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then # install lidar and depth camera cd /home/mirte/mirte_ws/src || exit 1 - git clone https://github.com/Slamtec/rplidar_ros.git --single-branch -b ros2 # FIXME-FUTURE: Can be installed in newer versions if V2.1.5 is released + git clone https://github.com/ArendJan/rplidar_ros.git --single-branch -b auto_standby_launch_param_c1 # FIXME-FUTURE: When merged, switch back to official repo # git clone https://github.com/ArendJan/ros2_astra_camera.git -b fix-ros-jammy # compressed images image transport fixes, fork of orbbec/... with also lazy nodes # git clone https://github.com/clearpathrobotics/clearpath_mecanum_drive_controller # FIXME: Can be installed from apt? why build? From 4474b203a528729a65746ceac508af3af1f3b97b Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 11 Dec 2025 10:47:36 +0100 Subject: [PATCH 347/353] Fix vscode install for now by disabling preload remote server --- install_vscode.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/install_vscode.sh b/install_vscode.sh index ac1a0a4..d527293 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -4,16 +4,20 @@ MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} # VScode in 2 parts: # - vscode remote server, when using the ssh plugin from another computer +# preloading as the robot (and computer) might not have internet access later # - 'vscode' website # First part: -cd $MIRTE_SRC_DIR || exit -mkdir vscode -cd vscode || exit -wget https://gist.githubusercontent.com/b01/0a16b6645ab7921b0910603dfb85e4fb/raw/ea48d972a176b90b3956de59eb7a43da9be86ec5/download-vs-code-server.sh -chmod +x download-vs-code-server.sh -sudo -u mirte $MIRTE_SRC_DIR/vscode/download-vs-code-server.sh - +# Broken for now, also the newer version from his repo: https://github.com/b01/dl-vscode-server +if false; then + cd $MIRTE_SRC_DIR || exit + mkdir vscode + cd vscode || exit + wget https://raw.githubusercontent.com/b01/dl-vscode-server/main/download-vs-code-server.sh + # wget https://gist.githubusercontent.com/b01/0a16b6645ab7921b0910603dfb85e4fb/raw/ea48d972a176b90b3956de59eb7a43da9be86ec5/download-vs-code-server.sh + chmod +x download-vs-code-server.sh + sudo -u mirte $MIRTE_SRC_DIR/vscode/download-vs-code-server.sh "linux" +fi # Second part: cd $MIRTE_SRC_DIR/vscode || exit sudo -u mirte bash -c "curl -fsSL https://code-server.dev/install.sh | sh" From e7a477cbc25537e08e14a4b43e17950bb698aba8 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 11 Dec 2025 14:01:09 +0100 Subject: [PATCH 348/353] Fix vscode install --- install_vscode.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_vscode.sh b/install_vscode.sh index d527293..4dffc2d 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -11,7 +11,7 @@ MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} # Broken for now, also the newer version from his repo: https://github.com/b01/dl-vscode-server if false; then cd $MIRTE_SRC_DIR || exit - mkdir vscode + mkdir vscode || true cd vscode || exit wget https://raw.githubusercontent.com/b01/dl-vscode-server/main/download-vs-code-server.sh # wget https://gist.githubusercontent.com/b01/0a16b6645ab7921b0910603dfb85e4fb/raw/ea48d972a176b90b3956de59eb7a43da9be86ec5/download-vs-code-server.sh @@ -19,6 +19,7 @@ if false; then sudo -u mirte $MIRTE_SRC_DIR/vscode/download-vs-code-server.sh "linux" fi # Second part: +mkdir -p $MIRTE_SRC_DIR/vscode || true cd $MIRTE_SRC_DIR/vscode || exit sudo -u mirte bash -c "curl -fsSL https://code-server.dev/install.sh | sh" sudo -u mirte bash -c "mkdir -p ~/.config/code-server && cp $MIRTE_SRC_DIR/mirte-install-scripts/config/code_server_config.yaml ~/.config/code-server/config.yaml" || true From f4ae6a0d2461a4b65408d7e6b9a6ece00379683f Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 11 Dec 2025 14:10:52 +0100 Subject: [PATCH 349/353] Add vscode install to web install check --- .github/workflows/test_install.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 44293c0..c03eeea 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -102,4 +102,5 @@ jobs: cd $MIRTE_SRC_DIR/mirte-install-scripts/ sudo -u mirte sed -i '/sudo systemctl/d' install_web.sh cd $MIRTE_SRC_DIR/mirte-install-scripts/ - sudo -u mirte /bin/bash -c "MIRTE_SRC_DIR=$MIRTE_SRC_DIR ./install_web.sh" \ No newline at end of file + sudo -u mirte /bin/bash -c "MIRTE_SRC_DIR=$MIRTE_SRC_DIR ./install_web.sh" + sudo -u mirte /bin/bash -c "MIRTE_SRC_DIR=$MIRTE_SRC_DIR ./install_vscode.sh" \ No newline at end of file From b8ba3de000072e66c4572e225e02a6466fee2614 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 21 Jan 2026 10:45:46 +0100 Subject: [PATCH 350/353] re-enable vscode --- install_vscode.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/install_vscode.sh b/install_vscode.sh index 4dffc2d..641dd5a 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -9,14 +9,15 @@ MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} # First part: # Broken for now, also the newer version from his repo: https://github.com/b01/dl-vscode-server -if false; then +if true; then cd $MIRTE_SRC_DIR || exit mkdir vscode || true cd vscode || exit - wget https://raw.githubusercontent.com/b01/dl-vscode-server/main/download-vs-code-server.sh - # wget https://gist.githubusercontent.com/b01/0a16b6645ab7921b0910603dfb85e4fb/raw/ea48d972a176b90b3956de59eb7a43da9be86ec5/download-vs-code-server.sh - chmod +x download-vs-code-server.sh - sudo -u mirte $MIRTE_SRC_DIR/vscode/download-vs-code-server.sh "linux" + ARCH="x64" + if [[ "$(uname -m)" == "aarch64" ]]; then + ARCH="arm64" + fi + curl -L https://raw.githubusercontent.com/b01/dl-vscode-server/main/download-vs-code.sh | bash -s -- "linux" $ARCH fi # Second part: mkdir -p $MIRTE_SRC_DIR/vscode || true From 81d324a6f4ffb6986776b773ffd53c3dea5da518 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 28 Jan 2026 11:11:53 +0100 Subject: [PATCH 351/353] set vscode install to fixed version --- install_vscode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_vscode.sh b/install_vscode.sh index 641dd5a..ba4fe60 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -17,7 +17,7 @@ if true; then if [[ "$(uname -m)" == "aarch64" ]]; then ARCH="arm64" fi - curl -L https://raw.githubusercontent.com/b01/dl-vscode-server/main/download-vs-code.sh | bash -s -- "linux" $ARCH + curl -L https://raw.githubusercontent.com/b01/dl-vscode-server/refs/tags/1.0.1/download-vs-code.sh | bash -s -- "linux" $ARCH fi # Second part: mkdir -p $MIRTE_SRC_DIR/vscode || true From 69de8483482985acc1ff52853b22d1e4b189959d Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 5 Feb 2026 17:06:03 +0100 Subject: [PATCH 352/353] Add 20s sleep for wifi 'fix' network_setup --- network_setup.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/network_setup.sh b/network_setup.sh index 97535a5..91b6edc 100755 --- a/network_setup.sh +++ b/network_setup.sh @@ -3,6 +3,8 @@ MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} ($MIRTE_SRC_DIR/mirte-install-scripts/services/mirte_auto_dhcp_eth.sh || true) & +sleep 20 # wait some time for wifi driver to not crash. + # wait for wlan0 to be up, with max 30 seconds TIMEOUT=30 NEXT_WAIT_TIME=0 From afff8163a9b5312e3a28483e6caca3dbfc7bcc86 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Thu, 5 Feb 2026 17:08:22 +0100 Subject: [PATCH 353/353] cleanup vscode install after re-enable --- install_vscode.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/install_vscode.sh b/install_vscode.sh index ba4fe60..9f4bb4e 100755 --- a/install_vscode.sh +++ b/install_vscode.sh @@ -7,18 +7,16 @@ MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte} # preloading as the robot (and computer) might not have internet access later # - 'vscode' website -# First part: -# Broken for now, also the newer version from his repo: https://github.com/b01/dl-vscode-server -if true; then - cd $MIRTE_SRC_DIR || exit - mkdir vscode || true - cd vscode || exit - ARCH="x64" - if [[ "$(uname -m)" == "aarch64" ]]; then - ARCH="arm64" - fi - curl -L https://raw.githubusercontent.com/b01/dl-vscode-server/refs/tags/1.0.1/download-vs-code.sh | bash -s -- "linux" $ARCH +# First part: https://github.com/b01/dl-vscode-server +cd $MIRTE_SRC_DIR || exit +mkdir vscode || true +cd vscode || exit +ARCH="x64" +if [[ "$(uname -m)" == "aarch64" ]]; then + ARCH="arm64" fi +curl -L https://raw.githubusercontent.com/b01/dl-vscode-server/refs/tags/1.0.1/download-vs-code.sh | bash -s -- "linux" $ARCH + # Second part: mkdir -p $MIRTE_SRC_DIR/vscode || true cd $MIRTE_SRC_DIR/vscode || exit