From b6b7f3623aa59021513693596537543b725aff04 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 31 Jan 2021 16:01:04 +0200 Subject: [PATCH 01/85] Increment version to 1.0.0, I think it's about time --- src/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config b/src/config index bd3acbef..4a1cc5de 100755 --- a/src/config +++ b/src/config @@ -1,4 +1,4 @@ export DIST_NAME=OctoPi -export DIST_VERSION=0.18.0 +export DIST_VERSION=1.0.0 export MODULES="base(raspicam, network, disable-services(octopi), password-for-sudo)" From ca2840ced1dc6ae398e4c693927a4527514b042a Mon Sep 17 00:00:00 2001 From: Thomas Rose Date: Thu, 11 Feb 2021 15:59:32 +0100 Subject: [PATCH 02/85] Delete octopi-network.txt Remove unused long overdue legacy-file --- src/modules/octopi/filesystem/boot/octopi-network.txt | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 src/modules/octopi/filesystem/boot/octopi-network.txt diff --git a/src/modules/octopi/filesystem/boot/octopi-network.txt b/src/modules/octopi/filesystem/boot/octopi-network.txt deleted file mode 100644 index 85c4c0b1..00000000 --- a/src/modules/octopi/filesystem/boot/octopi-network.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Using this file to configure your network connection is no longer supported. -# -# Please use octopi-wpa-supplicant.txt instead. From 61e0f4984f7ed1dabdca89cf1903674d4c5d0419 Mon Sep 17 00:00:00 2001 From: Thomas Rose Date: Thu, 11 Feb 2021 16:05:50 +0100 Subject: [PATCH 03/85] Small fixes for Ubuntu-Variant Make small changes to HAProxy and webcamd-config to make the Ubuntu-Variant start working - running with interface, normal webcam working (HLS not tested) --- .../filesystem/root/etc/haproxy/haproxy.cfg | 49 +++++++++++++++++++ .../root/etc/systemd/system/webcamd.service | 15 ++++++ 2 files changed, 64 insertions(+) create mode 100644 src/variants/ubuntu_arm64/filesystem/root/etc/haproxy/haproxy.cfg create mode 100644 src/variants/ubuntu_arm64/filesystem/root/etc/systemd/system/webcamd.service diff --git a/src/variants/ubuntu_arm64/filesystem/root/etc/haproxy/haproxy.cfg b/src/variants/ubuntu_arm64/filesystem/root/etc/haproxy/haproxy.cfg new file mode 100644 index 00000000..8ef4d164 --- /dev/null +++ b/src/variants/ubuntu_arm64/filesystem/root/etc/haproxy/haproxy.cfg @@ -0,0 +1,49 @@ +global + maxconn 4096 + user haproxy + group haproxy + log /dev/log local1 debug + tune.ssl.default-dh-param 2048 + +defaults + log global + mode http + compression algo gzip + option httplog + option dontlognull + retries 3 + option redispatch + option http-server-close + option forwardfor + maxconn 2000 + timeout connect 5s + timeout client 15min + timeout server 15min + +frontend public + bind :::80 v4v6 + bind :::443 v4v6 ssl crt /etc/ssl/snakeoil.pem + option forwardfor except 127.0.0.1 + use_backend webcam if { path_beg /webcam/ } + use_backend webcam_hls if { path_beg /hls/ } + use_backend webcam_hls if { path_beg /jpeg/ } + default_backend octoprint + +backend octoprint + acl needs_scheme req.hdr_cnt(X-Scheme) eq 0 + + http-request replace-path ^([^\ :]*)\ /(.*) \1\ /\2 + http-request add-header X-Scheme https if needs_scheme { ssl_fc } + http-request add-header X-Scheme http if needs_scheme !{ ssl_fc } + option forwardfor + server octoprint1 127.0.0.1:5000 + errorfile 503 /etc/haproxy/errors/503-no-octoprint.http + +backend webcam + http-request replace-path /webcam/(.*) /\1 + server webcam1 127.0.0.1:8080 + errorfile 503 /etc/haproxy/errors/503-no-webcam.http + +backend webcam_hls + server webcam_hls_1 127.0.0.1:28126 + errorfile 503 /etc/haproxy/errors/503-no-webcam-hls.http diff --git a/src/variants/ubuntu_arm64/filesystem/root/etc/systemd/system/webcamd.service b/src/variants/ubuntu_arm64/filesystem/root/etc/systemd/system/webcamd.service new file mode 100644 index 00000000..bd5feb53 --- /dev/null +++ b/src/variants/ubuntu_arm64/filesystem/root/etc/systemd/system/webcamd.service @@ -0,0 +1,15 @@ +[Unit] +Description=the OctoPi webcam daemon with the user specified config +# ConditionPathExists=/etc/octopi_streamer/mjpeg + +[Service] +WorkingDirectory=/root/bin +StandardOutput=append:/var/log/webcamd.log +StandardError=append:/var/log/webcamd.log +ExecStart=/root/bin/webcamd +Restart=always +Type=forking +RestartSec=1 + +[Install] +WantedBy=multi-user.target From 3214fe2cf5228a7ea2193726c3aefaa9e2dfe7e1 Mon Sep 17 00:00:00 2001 From: Thomas Rose Date: Thu, 11 Feb 2021 16:05:58 +0100 Subject: [PATCH 04/85] Revert "Delete octopi-network.txt" This reverts commit ca2840ced1dc6ae398e4c693927a4527514b042a. --- src/modules/octopi/filesystem/boot/octopi-network.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/modules/octopi/filesystem/boot/octopi-network.txt diff --git a/src/modules/octopi/filesystem/boot/octopi-network.txt b/src/modules/octopi/filesystem/boot/octopi-network.txt new file mode 100644 index 00000000..85c4c0b1 --- /dev/null +++ b/src/modules/octopi/filesystem/boot/octopi-network.txt @@ -0,0 +1,3 @@ +# Using this file to configure your network connection is no longer supported. +# +# Please use octopi-wpa-supplicant.txt instead. From 5d08be9d487834470d2d64a3e1b770d5466781f5 Mon Sep 17 00:00:00 2001 From: Thomas Rose Date: Thu, 11 Feb 2021 16:11:14 +0100 Subject: [PATCH 05/85] Update post_chroot_script Unpack filesystem changes for ubuntu --- src/variants/ubuntu_arm64/post_chroot_script | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/variants/ubuntu_arm64/post_chroot_script b/src/variants/ubuntu_arm64/post_chroot_script index ff0ed505..d699ad28 100644 --- a/src/variants/ubuntu_arm64/post_chroot_script +++ b/src/variants/ubuntu_arm64/post_chroot_script @@ -7,6 +7,8 @@ export LC_ALL=C source /common.sh install_cleanup_trap +# Unpack the filesystem changes for the variant +unpack /filesystem/root / # add-apt-repository ppa:ubuntu-raspi2/ppa -y apt-get update From d7e5121251b733878e4f52e31a8c9fe10c581b5e Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Mon, 22 Feb 2021 15:17:30 +0200 Subject: [PATCH 06/85] Add rpi.gpio-common https://github.com/guysoft/OctoPi/issues/711#issuecomment-783320975 --- src/variants/ubuntu_arm64/post_chroot_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/variants/ubuntu_arm64/post_chroot_script b/src/variants/ubuntu_arm64/post_chroot_script index d699ad28..918c8bc9 100644 --- a/src/variants/ubuntu_arm64/post_chroot_script +++ b/src/variants/ubuntu_arm64/post_chroot_script @@ -12,6 +12,6 @@ unpack /filesystem/root / # add-apt-repository ppa:ubuntu-raspi2/ppa -y apt-get update -apt-get -y --force-yes install libraspberrypi-bin +apt-get -y --force-yes install libraspberrypi-bin rpi.gpio-common apt-get clean apt-get autoremove -y From 8e9fa779ec7a9f82015281fa420773cc86f2fa8d Mon Sep 17 00:00:00 2001 From: Willmac16 Date: Sun, 28 Feb 2021 10:02:34 -0800 Subject: [PATCH 07/85] Compatibility for ws281x on Ubuntu 64 (#724) * Compatibility for ws281x on Ubuntu 64 * full paths for ws281x compatibility changes * remove the file touch --- .../filesystem/root/etc/udev/rules.d/50-spi.rules | 1 + src/variants/ubuntu_arm64/post_chroot_script | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 src/variants/ubuntu_arm64/filesystem/root/etc/udev/rules.d/50-spi.rules diff --git a/src/variants/ubuntu_arm64/filesystem/root/etc/udev/rules.d/50-spi.rules b/src/variants/ubuntu_arm64/filesystem/root/etc/udev/rules.d/50-spi.rules new file mode 100644 index 00000000..c7d5c8b1 --- /dev/null +++ b/src/variants/ubuntu_arm64/filesystem/root/etc/udev/rules.d/50-spi.rules @@ -0,0 +1 @@ +SUBSYSTEM=="spidev", GROUP="spi", MODE="0660" diff --git a/src/variants/ubuntu_arm64/post_chroot_script b/src/variants/ubuntu_arm64/post_chroot_script index 918c8bc9..b6c0ac89 100644 --- a/src/variants/ubuntu_arm64/post_chroot_script +++ b/src/variants/ubuntu_arm64/post_chroot_script @@ -15,3 +15,8 @@ apt-get update apt-get -y --force-yes install libraspberrypi-bin rpi.gpio-common apt-get clean apt-get autoremove -y + +# Compatibility for ws281x +sudo ln /boot/config-5.8.0-1006-raspi /boot/config.txt +sudo groupadd spi +sudo adduser pi spi From 8e02c9dca6fdba2f5fccf1676a2c158402bcb066 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Tue, 9 Mar 2021 12:08:53 +0200 Subject: [PATCH 08/85] Revert "Compatibility for ws281x on Ubuntu 64 (#724)" This reverts commit 8e9fa779ec7a9f82015281fa420773cc86f2fa8d. --- .../filesystem/root/etc/udev/rules.d/50-spi.rules | 1 - src/variants/ubuntu_arm64/post_chroot_script | 5 ----- 2 files changed, 6 deletions(-) delete mode 100644 src/variants/ubuntu_arm64/filesystem/root/etc/udev/rules.d/50-spi.rules diff --git a/src/variants/ubuntu_arm64/filesystem/root/etc/udev/rules.d/50-spi.rules b/src/variants/ubuntu_arm64/filesystem/root/etc/udev/rules.d/50-spi.rules deleted file mode 100644 index c7d5c8b1..00000000 --- a/src/variants/ubuntu_arm64/filesystem/root/etc/udev/rules.d/50-spi.rules +++ /dev/null @@ -1 +0,0 @@ -SUBSYSTEM=="spidev", GROUP="spi", MODE="0660" diff --git a/src/variants/ubuntu_arm64/post_chroot_script b/src/variants/ubuntu_arm64/post_chroot_script index b6c0ac89..918c8bc9 100644 --- a/src/variants/ubuntu_arm64/post_chroot_script +++ b/src/variants/ubuntu_arm64/post_chroot_script @@ -15,8 +15,3 @@ apt-get update apt-get -y --force-yes install libraspberrypi-bin rpi.gpio-common apt-get clean apt-get autoremove -y - -# Compatibility for ws281x -sudo ln /boot/config-5.8.0-1006-raspi /boot/config.txt -sudo groupadd spi -sudo adduser pi spi From ca3dbfb5758d6b85bb7d9c6ac9b8db4a81da949d Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Thu, 11 Mar 2021 12:08:37 +0200 Subject: [PATCH 09/85] Add rpi-imager compatible file https://github.com/raspberrypi/rpi-imager/issues/162 --- media/rpi-imager-OctoPi.png | Bin 0 -> 12860 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 media/rpi-imager-OctoPi.png diff --git a/media/rpi-imager-OctoPi.png b/media/rpi-imager-OctoPi.png new file mode 100644 index 0000000000000000000000000000000000000000..ac7388695cf586758462275abe325dfc5dc4567b GIT binary patch literal 12860 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 a6Z{80o*0GGKAEQg0000 Date: Sun, 14 Mar 2021 21:36:59 +0100 Subject: [PATCH 10/85] Add a network monitoring for wifi connections --- src/modules/octopi/filesystem/boot/octopi.txt | 10 +++++++ .../etc/systemd/system/networkcheck.service | 8 ++++++ .../etc/systemd/system/networkcheck.timer | 10 +++++++ .../root/usr/local/bin/networkcheck | 28 +++++++++++++++++++ src/modules/octopi/start_chroot_script | 4 +++ 5 files changed, 60 insertions(+) create mode 100644 src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.service create mode 100644 src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.timer create mode 100755 src/modules/octopi/filesystem/root/usr/local/bin/networkcheck diff --git a/src/modules/octopi/filesystem/boot/octopi.txt b/src/modules/octopi/filesystem/boot/octopi.txt index bc015399..c842c6b4 100644 --- a/src/modules/octopi/filesystem/boot/octopi.txt +++ b/src/modules/octopi/filesystem/boot/octopi.txt @@ -76,6 +76,16 @@ #camera_http_webroot="./www-octopi" #camera_http_options="-n" +# Configuration of network monitoring +# +# This enables network monitoring for wifi connections with a simple ping test. +# If connection terminates by variable reasons system tries to restart the wifi connection to reestablish a connection. +# The connection test is done every minute. +# By default it is disabled (0 = off / 1 = on) +# dstination_host can be an ip address or a hostname (for hostname ensure dns resosultion is working correctly) +enable_network_monitor=0 +destination_host=192.168.1.1 + ### EXPERIMENTAL # Support for different streamer types. # diff --git a/src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.service b/src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.service new file mode 100644 index 00000000..ec4a008e --- /dev/null +++ b/src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.service @@ -0,0 +1,8 @@ +[Unit] + Description=Network Monitor + ConditionPathExists=/usr/local/bin/networkcheck + +[Service] + User=root + Type=simple + ExecStart=/usr/local/bin/networkcheck & diff --git a/src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.timer b/src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.timer new file mode 100644 index 00000000..940694fe --- /dev/null +++ b/src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.timer @@ -0,0 +1,10 @@ +[Unit] + Description=Network Monitor Trigger (every 1 minutes) + After=network.target + +[Timer] + OnCalendar=*-*-* *:*:00 + AccuracySec=1s + +[Install] + WantedBy=timers.target diff --git a/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck b/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck new file mode 100755 index 00000000..0ab1f406 --- /dev/null +++ b/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck @@ -0,0 +1,28 @@ +#!/bin/bash + +source /boot/octopi.txt + +if [ $enable_network_monitor == 1 ] && [ "$destination_host" != "" ]; then + + if [ -f /boot/octopi-wpa-supplicant.txt ]; then # check if config file exists + input="/boot/octopi-wpa-supplicant.txt" + while IFS= read -r line; do # read config file line by line + if [[ $line =~ ^network=.* ]]; then # check if we have a network config if a line starts with "network=" + echo "network config found..." + ping -c4 $destination_host > /dev/null # check if destination is reachable - possible by default the router + if [ $? != 0 ]; then + echo "Destination not reachable - reconfigure interface..." + sudo wpa_cli -i wlan0 reconfigure # reconfigure network to trigger reconnect + sudo dhclient -v # ensure connection will be established by refresh dhcp lease + echo "Reconnect done." + exit 0 # if we detect multiple network configs exit after 1st one - one reconnect is enough :-) + else + echo "Destination reachable - no action needed." + exit 0 # destination reached - exit loop + fi + fi + done < "$input" + fi +else + echo "Network monitoring not enabled." +fi diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 6398aea4..915f13d1 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -258,6 +258,10 @@ fi systemctl_if_exists enable ffmpeg_hls.service +### Network monitoring + +systemctl_if_exists enable networkcheck.timer + #cleanup apt-get clean apt-get autoremove -y From ba1750c1d560749d3e997b194f3609cf6ddb5f62 Mon Sep 17 00:00:00 2001 From: hawkeyexp Date: Tue, 16 Mar 2021 03:52:10 +0100 Subject: [PATCH 11/85] Add avrdude for firmware flashing --- src/modules/octopi/start_chroot_script | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 915f13d1..eed1e5e5 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -262,6 +262,11 @@ systemctl_if_exists enable ffmpeg_hls.service systemctl_if_exists enable networkcheck.timer +### Firmare flashing + +echo "--- Installing avrdude" +apt-get -y install avrdude + #cleanup apt-get clean apt-get autoremove -y From 4e64f6886953382b336043b46541f6e3dc8971f2 Mon Sep 17 00:00:00 2001 From: Jamie Date: Sun, 21 Mar 2021 18:18:46 -0500 Subject: [PATCH 12/85] Fix problem where cmake fails to detect compiler Found this fix while examining why v1pi was failing to build. Apparently current cmake (3.16) fails with the GLOB operation and it sounds like it's related to this issue https://gitlab.kitware.com/cmake/cmake/-/issues/20568 According to that thread, this is a consequence of an update within 3.15, and (probably) fixed sometime before 3.19. --- src/modules/octopi/start_chroot_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index eed1e5e5..c9037645 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -33,7 +33,7 @@ echo "removing:" $remove_extra apt-get remove -y --purge $remove_extra apt-get autoremove -y -apt-get -y --force-yes install python3 python3-virtualenv python3-dev git screen subversion cmake avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base +apt-get -y --force-yes install python3 python3-virtualenv python3-dev git screen subversion cmake=3.13.4-1 cmake-data=3.13.4-1 avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base echo " - Reinstall iputils-ping" apt-get install --reinstall iputils-ping From 73735b8f12eafd0e7de8f1de5aef4b7551e6bf2b Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 4 Apr 2021 13:39:53 +0300 Subject: [PATCH 13/85] Fix build on Ubuntu arm64 #731 --- src/modules/octopi/start_chroot_script | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index c9037645..38d3f69e 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -33,7 +33,12 @@ echo "removing:" $remove_extra apt-get remove -y --purge $remove_extra apt-get autoremove -y -apt-get -y --force-yes install python3 python3-virtualenv python3-dev git screen subversion cmake=3.13.4-1 cmake-data=3.13.4-1 avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base +if [ "${BASE_DISTRO}" == "ubuntu" ]; then + apt-get -y --force-yes install python3 python3-virtualenv python3-dev git screen subversion cmake cmake-data avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base +else + apt-get -y --force-yes install python3 python3-virtualenv python3-dev git screen subversion cmake=3.13.4-1 cmake-data=3.13.4-1 avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base +fi + echo " - Reinstall iputils-ping" apt-get install --reinstall iputils-ping From 3595898c11c6bd8a017202434ba5c9651e37dea2 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Thu, 17 Jun 2021 13:46:15 +0300 Subject: [PATCH 14/85] Enlarge build root so there is enough space --- src/config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/config b/src/config index 4a1cc5de..60299236 100755 --- a/src/config +++ b/src/config @@ -2,3 +2,5 @@ export DIST_NAME=OctoPi export DIST_VERSION=1.0.0 export MODULES="base(raspicam, network, disable-services(octopi), password-for-sudo)" +export BASE_IMAGE_ENLARGEROOT=2000 +export BASE_IMAGE_RESIZEROOT=200 From 1a00e6ec9b586760080f456c5ff4692749581b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 29 Jun 2021 14:38:12 +0200 Subject: [PATCH 15/85] =?UTF-8?q?=F0=9F=90=9B=20Restore=20120s=20daemon=20?= =?UTF-8?q?loop=20behaviour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We wait for our child processes to complete, reset our "currently run cameras" array, then wait 2min and loop. Closes #740 --- .../octopi/filesystem/home/root/bin/webcamd | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/src/modules/octopi/filesystem/home/root/bin/webcamd b/src/modules/octopi/filesystem/home/root/bin/webcamd index effdfbe2..c372e142 100755 --- a/src/modules/octopi/filesystem/home/root/bin/webcamd +++ b/src/modules/octopi/filesystem/home/root/bin/webcamd @@ -104,6 +104,14 @@ function cleanup() { exit 0 } +# waits for our child processes +function awaitChildren() { + local pids=$(jobs -pr) + for pid in $pids; do + wait $pid + done +} + # says goodbye when the script shuts down function goodbye() { # say goodbye @@ -237,6 +245,7 @@ while true; do camera_http_webroot="${array_camera_http_webroot[${i}]}" camera_http_options="${array_camera_http_options[${i}]}" brokenfps_usb_devices="${array_camera_brokenfps_usb_devices[${i}]}" + if [[ ${camera_usb_device} ]] && { [[ "usb" == ${scan_mode} ]] || [[ "auto" == ${scan_mode} ]]; }; then # usb device is explicitly set in options usb_device_path=`readlink -f ${camera_usb_device}` @@ -253,6 +262,7 @@ while true; do startUsb "$usb_device_path" continue fi + elif [[ -z ${camera_usb_device} ]] && { [[ "usb-auto" == ${scan_mode} ]] || [[ "auto" == ${scan_mode} ]]; }; then for video_device in "${video_devices[@]}"; do if [[ "raspi" != "$video_device" ]]; then @@ -271,6 +281,7 @@ while true; do continue fi fi + if [[ "raspi" == ${scan_mode} ]] || [[ "auto" == ${scan_mode} ]]; then video_device="raspi" if containsString "$video_device" "${array_camera_device[@]}"; then @@ -290,14 +301,19 @@ while true; do fi done done + array_assigned_device=( ${array_camera_device[*]} ) if [[ ${#array_camera[@]} -eq ${#array_assigned_device[@]} ]]; then - echo "Done bring up all configured video device" - exit 0 - else - echo "Scan again in two minutes" - sleep 120 & - sleep_pid=$! - wait ${sleep_pid} + echo "Done bringing up all configured video devices" + awaitChildren + + # reset array_camera_device to empty + array_camera_device=() + for cam in ${array_camera[@]}; do + array_camera_device+=("") + done fi + + echo "Scanning again in two minutes" + sleep 120 done From 3dc1381937922f59fe46c9ddd75d1a6278841b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 29 Jun 2021 14:38:43 +0200 Subject: [PATCH 16/85] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20some=20typos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/octopi/filesystem/home/root/bin/webcamd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/octopi/filesystem/home/root/bin/webcamd b/src/modules/octopi/filesystem/home/root/bin/webcamd index c372e142..2af5a790 100755 --- a/src/modules/octopi/filesystem/home/root/bin/webcamd +++ b/src/modules/octopi/filesystem/home/root/bin/webcamd @@ -73,7 +73,7 @@ for cfg_file in ${cfg_files[@]}; do echo "raspi options: $camera_raspi_options" echo "http options: -w $camera_http_webroot $camera_http_options" echo "" - echo "Explicitly USB device: $extracted_device" + echo "Explicitly set USB device: $extracted_device" echo "-----------------------------------------------" echo "" @@ -251,7 +251,7 @@ while true; do usb_device_path=`readlink -f ${camera_usb_device}` if containsString "$usb_device_path" "${array_camera_device[@]}"; then if [[ "auto" != ${scan_mode} ]]; then - array_camera_device[${i}]="alredy_in_use" + array_camera_device[${i}]="already_in_use" echo "config file='$camera_config':Video device already in use." continue fi @@ -286,7 +286,7 @@ while true; do video_device="raspi" if containsString "$video_device" "${array_camera_device[@]}"; then if [[ "auto" != ${scan_mode} ]]; then - array_camera_device[${i}]="alredy_in_use" + array_camera_device[${i}]="already_in_use" echo "config file='$camera_config':RasPiCam device already in use." fi elif containsString "$video_device" "${video_devices[@]}"; then From 8d1e000b549ee8aaba2aa4a6af6ef4ed87d56f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 29 Jun 2021 14:39:29 +0200 Subject: [PATCH 17/85] =?UTF-8?q?=F0=9F=90=9B=20Fix=20handling=20of=20non-?= =?UTF-8?q?usb=20v4l2=20devices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They don't have a vid and pid, so don't try to format those as hex. --- .../octopi/filesystem/home/root/bin/webcamd | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/modules/octopi/filesystem/home/root/bin/webcamd b/src/modules/octopi/filesystem/home/root/bin/webcamd index 2af5a790..4aded2e0 100755 --- a/src/modules/octopi/filesystem/home/root/bin/webcamd +++ b/src/modules/octopi/filesystem/home/root/bin/webcamd @@ -189,19 +189,22 @@ function startUsb { product=`cat $uevent_file | grep PRODUCT | cut -d"=" -f2` vid=`echo $product | cut -d"/" -f1` pid=`echo $product | cut -d"/" -f2` - vidpid=`printf "%04x:%04x" "0x$vid" "0x$pid"` - - # ... then look if it is in our list of known broken-fps-devices and if so remove - # the -f parameter from the options (if it's in there, else that's just a no-op) - for identifier in ${brokenfps_usb_devices[@]}; - do - if [ "$vidpid" = "$identifier" ]; then - echo - echo "Camera model $vidpid is known to not work with -f parameter, stripping it out" - echo - options=`echo $options | sed -e "s/\(\s\+\|^\)-f\s\+[0-9]\+//g"` - fi - done + + if [[ -n "$vid" && -n "$pid" ]]; then + vidpid=`printf "%04x:%04x" "0x$vid" "0x$pid"` + + # ... then look if it is in our list of known broken-fps-devices and if so remove + # the -f parameter from the options (if it's in there, else that's just a no-op) + for identifier in ${brokenfps_usb_devices[@]}; + do + if [ "$vidpid" = "$identifier" ]; then + echo + echo "Camera model $vidpid is known to not work with -f parameter, stripping it out" + echo + options=`echo $options | sed -e "s/\(\s\+\|^\)-f\s\+[0-9]\+//g"` + fi + done + fi fi logger -s "Starting USB webcam" From edfa3653d8a18de9bf4dc5dffecb4a92ff96bace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 29 Jun 2021 14:42:33 +0200 Subject: [PATCH 18/85] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20more=20typos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/octopi/filesystem/home/root/bin/webcamd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/octopi/filesystem/home/root/bin/webcamd b/src/modules/octopi/filesystem/home/root/bin/webcamd index 4aded2e0..8a01a40f 100755 --- a/src/modules/octopi/filesystem/home/root/bin/webcamd +++ b/src/modules/octopi/filesystem/home/root/bin/webcamd @@ -261,7 +261,7 @@ while true; do elif containsString "$usb_device_path" "${video_devices[@]}"; then array_camera_device[${i}]="$usb_device_path" # explicitly set usb device was found in video_devices array, start usb with the found device - echo "config file='$camera_config':USB device was set in options and found in devices, start MJPG-streamer with the configured USB video device: $usb_device_path" + echo "config file='$camera_config':USB device was set in options and found in devices, starting MJPG-streamer with the configured USB video device: $usb_device_path" startUsb "$usb_device_path" continue fi @@ -274,7 +274,7 @@ while true; do else array_camera_device[${i}]="$video_device" # device is not set explicitly in options, start usb with first found usb camera as the device - echo "config file='$camera_config':USB device was not set in options, start MJPG-streamer with the first found video device: ${video_device}" + echo "config file='$camera_config':USB device was not set in options, starting MJPG-streamer with the first found video device: ${video_device}" startUsb "${video_device}" break fi @@ -294,7 +294,7 @@ while true; do fi elif containsString "$video_device" "${video_devices[@]}"; then array_camera_device[${i}]="$video_device" - echo "config file='$camera_config':Start MJPG-streamer with video device: ${video_device}" + echo "config file='$camera_config':Starting MJPG-streamer with video device: ${video_device}" startRaspi sleep 30 & sleep_pid=$! From 8c9bd970e93064bfe49aae1e9fa72c112d4738ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 29 Jun 2021 15:42:17 +0200 Subject: [PATCH 19/85] =?UTF-8?q?=F0=9F=90=9B=20Add=20haproxy.cfg=20for=20?= =?UTF-8?q?2.x=20versions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build will check which one is installed and only enable the correct one. See also #711 --- .../haproxy/{haproxy.cfg => haproxy.1.x.cfg} | 0 .../root/etc/haproxy/haproxy.2.x.cfg | 49 +++++++++++++++++++ src/modules/octopi/start_chroot_script | 9 ++++ 3 files changed, 58 insertions(+) rename src/modules/octopi/filesystem/root/etc/haproxy/{haproxy.cfg => haproxy.1.x.cfg} (100%) create mode 100644 src/modules/octopi/filesystem/root/etc/haproxy/haproxy.2.x.cfg diff --git a/src/modules/octopi/filesystem/root/etc/haproxy/haproxy.cfg b/src/modules/octopi/filesystem/root/etc/haproxy/haproxy.1.x.cfg similarity index 100% rename from src/modules/octopi/filesystem/root/etc/haproxy/haproxy.cfg rename to src/modules/octopi/filesystem/root/etc/haproxy/haproxy.1.x.cfg diff --git a/src/modules/octopi/filesystem/root/etc/haproxy/haproxy.2.x.cfg b/src/modules/octopi/filesystem/root/etc/haproxy/haproxy.2.x.cfg new file mode 100644 index 00000000..8ef4d164 --- /dev/null +++ b/src/modules/octopi/filesystem/root/etc/haproxy/haproxy.2.x.cfg @@ -0,0 +1,49 @@ +global + maxconn 4096 + user haproxy + group haproxy + log /dev/log local1 debug + tune.ssl.default-dh-param 2048 + +defaults + log global + mode http + compression algo gzip + option httplog + option dontlognull + retries 3 + option redispatch + option http-server-close + option forwardfor + maxconn 2000 + timeout connect 5s + timeout client 15min + timeout server 15min + +frontend public + bind :::80 v4v6 + bind :::443 v4v6 ssl crt /etc/ssl/snakeoil.pem + option forwardfor except 127.0.0.1 + use_backend webcam if { path_beg /webcam/ } + use_backend webcam_hls if { path_beg /hls/ } + use_backend webcam_hls if { path_beg /jpeg/ } + default_backend octoprint + +backend octoprint + acl needs_scheme req.hdr_cnt(X-Scheme) eq 0 + + http-request replace-path ^([^\ :]*)\ /(.*) \1\ /\2 + http-request add-header X-Scheme https if needs_scheme { ssl_fc } + http-request add-header X-Scheme http if needs_scheme !{ ssl_fc } + option forwardfor + server octoprint1 127.0.0.1:5000 + errorfile 503 /etc/haproxy/errors/503-no-octoprint.http + +backend webcam + http-request replace-path /webcam/(.*) /\1 + server webcam1 127.0.0.1:8080 + errorfile 503 /etc/haproxy/errors/503-no-webcam.http + +backend webcam_hls + server webcam_hls_1 127.0.0.1:28126 + errorfile 503 /etc/haproxy/errors/503-no-webcam-hls.http diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 38d3f69e..1b905a8e 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -227,6 +227,15 @@ fi if [ "$OCTOPI_INCLUDE_HAPROXY" == "yes" ] then systemctl_if_exists enable gencert.service + + haproxy_version=$(dpkg -s haproxy | grep '^Version:' | awk '{print $2}') + if [[ $haproxy_version = 2.* ]]; then + mv /etc/haproxy/haproxy.2.x.cfg /etc/haproxy/haproxy.cfg + rm /etc/haproxy/haproxy.1.x.cfg + else + mv /etc/haproxy/haproxy.1.x.cfg /etc/haproxy/haproxy.cfg + rm /etc/haproxy/haproxy.2.x.cfg + fi else # let's remove the configs for system services we don't need rm /etc/systemd/system/gencert.service From 9e473f14ad5e04c9dd6e5f4f4373860a26d25e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 2 Jul 2021 18:02:23 +0200 Subject: [PATCH 20/85] =?UTF-8?q?=F0=9F=90=9B=20Remove=20mjpg-streamer=20f?= =?UTF-8?q?rom=20pi=20home?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's executed as root so it shouldn't live in a user directory (potential for abuse w/ image access). Move it to /opt/mjpg-streamer, include symlink at old location for backwards compatibility. --- src/modules/octopi/config | 5 +-- .../octopi/filesystem/home/root/bin/webcamd | 2 +- src/modules/octopi/start_chroot_script | 42 ++++++++++++------- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/src/modules/octopi/config b/src/modules/octopi/config index e9f3d064..43871615 100755 --- a/src/modules/octopi/config +++ b/src/modules/octopi/config @@ -12,10 +12,7 @@ [ -n "$OCTOPI_INCLUDE_CURAENGINE" ] || OCTOPI_INCLUDE_CURAENGINE=no # mjpg streamer -[ -n "$OCTOPI_MJPGSTREAMER_REPO_SHIP" ] || OCTOPI_MJPGSTREAMER_REPO_SHIP=https://github.com/jacksonliam/mjpg-streamer.git -[ -n "$OCTOPI_MJPGSTREAMER_REPO_BUILD" ] || OCTOPI_MJPGSTREAMER_REPO_BUILD= -[ -n "$OCTOPI_MJPGSTREAMER_REPO_BRANCH" ] || OCTOPI_MJPGSTREAMER_REPO_BRANCH=master -[ -n "$OCTOPI_MJPGSTREAMER_REPO_DEPTH" ] || OCTOPI_MJPGSTREAMER_REPO_DEPTH=1 +[ -n "$OCTOPI_MJPGSTREAMER_ARCHIVE" ] || OCTOPI_MJPGSTREAMER_ARCHIVE=https://github.com/jacksonliam/mjpg-streamer/archive/master.zip [ -n "$OCTOPI_INCLUDE_MJPGSTREAMER" ] || OCTOPI_INCLUDE_MJPGSTREAMER=yes # FFMPEG HLS diff --git a/src/modules/octopi/filesystem/home/root/bin/webcamd b/src/modules/octopi/filesystem/home/root/bin/webcamd index 8a01a40f..f2c6dfb1 100755 --- a/src/modules/octopi/filesystem/home/root/bin/webcamd +++ b/src/modules/octopi/filesystem/home/root/bin/webcamd @@ -11,7 +11,7 @@ ### computer. ### ######################################################################## -MJPGSTREAMER_HOME=/home/pi/mjpg-streamer +MJPGSTREAMER_HOME=/opt/mjpg-streamer MJPGSTREAMER_INPUT_USB="input_uvc.so" MJPGSTREAMER_INPUT_RASPICAM="input_raspicam.so" diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 1b905a8e..e57442aa 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -59,7 +59,8 @@ pushd /home/"${BASE_USER}" #mjpg-streamer if [ "$OCTOPI_INCLUDE_MJPGSTREAMER" == "yes" ] then - echo "--- Installing mjpg-streamer" + install_dir=/opt/mjpg-streamer + echo "--- Installing mjpg-streamer to $install_dir" if [ $( is_in_apt libjpeg62-turbo-dev ) -eq 1 ]; then apt-get -y --force-yes install libjpeg62-turbo-dev elif [ $( is_in_apt libjpeg8-dev ) -eq 1 ]; then @@ -67,26 +68,35 @@ pushd /home/"${BASE_USER}" fi apt-get -y --force-yes --no-install-recommends install imagemagick ffmpeg libv4l-dev - gitclone OCTOPI_MJPGSTREAMER_REPO mjpg-streamer - pushd mjpg-streamer - mv mjpg-streamer-experimental/* . + wget $OCTOPI_MJPGSTREAMER_ARCHIVE -O mjpg-streamer.zip + unzip mjpg-streamer.zip + rm mjpg-streamer.zip + + pushd mjpg-streamer-master/mjpg-streamer-experimental # As said in Makefile, it is just a wrapper around CMake. # To apply -j option, we have to unwrap it. - MJPG_STREAMER_BUILD_DIR=_build - [ -d ${MJPG_STREAMER_BUILD_DIR} ] || (mkdir ${MJPG_STREAMER_BUILD_DIR} && \ - chown "${BASE_USER}:${BASE_USER}" ${MJPG_STREAMER_BUILD_DIR}) - [ -f ${MJPG_STREAMER_BUILD_DIR}/Makefile ] || (cd ${MJPG_STREAMER_BUILD_DIR} && \ - sudo -u "${BASE_USER}" cmake -DCMAKE${MJPG_STREAMER_BUILD_DIR}_TYPE=Release ..) + build_dir=_build + mkdir -p $build_dir + pushd $build_dir + cmake -DCMAKE_BUILD_TYPE=Release .. + popd + + make -j $(nproc) -C $build_dir - sudo -u "${BASE_USER}" make -j $(nproc) -C ${MJPG_STREAMER_BUILD_DIR} + mkdir -p $install_dir - sudo -u "${BASE_USER}" cp ${MJPG_STREAMER_BUILD_DIR}/mjpg_streamer . - sudo -u "${BASE_USER}" find ${MJPG_STREAMER_BUILD_DIR} -name "*.so" -type f -exec cp {} . \; + install -m 755 $build_dir/mjpg_streamer $install_dir + find $build_dir -name "*.so" -type f -exec install -m 644 {} $install_dir \; + + # copy bundled web folder + cp -a -r ./www $install_dir + chmod 755 $install_dir/www + chmod -R 644 $install_dir/www # create our custom web folder and add a minimal index.html to it - sudo -u "${BASE_USER}" mkdir www-octopi - pushd www-octopi + mkdir $install_dir/www-octopi + pushd $install_dir/www-octopi cat <> index.html mjpg_streamer test page @@ -101,6 +111,10 @@ pushd /home/"${BASE_USER}" EOT popd popd + rm -rf mjpg-streamer-master + + # symlink for backwards compatibility + sudo -u "${BASE_USER}" ln -s $install_dir /home/"${BASE_USER}"/mjpg-streamer fi # FFMPEG HLS From d36f1599cabca70d3aa21f6d0e481a0630f01d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 2 Jul 2021 18:12:25 +0200 Subject: [PATCH 21/85] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Install=20OctoPrint?= =?UTF-8?q?=20from=20PyPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/octopi/config | 3 +-- src/modules/octopi/start_chroot_script | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/octopi/config b/src/modules/octopi/config index e9f3d064..c9474d1f 100755 --- a/src/modules/octopi/config +++ b/src/modules/octopi/config @@ -2,8 +2,7 @@ # All our config settings must start with OCTOPI_ # OctoPrint archive -[ -n "$OCTOPI_OCTOPRINT_ARCHIVE" ] || OCTOPI_OCTOPRINT_ARCHIVE=$(wget -q -O - https://api.github.com/repos/foosel/OctoPrint/releases/latest | grep "zipball_url" | cut -d : -f 2,3 | tr -d \" | tr -d ,) -[ -n "$OCTOPI_OCTOPRINT_REPO_SHIP" ] || OCTOPI_OCTOPRINT_REPO_SHIP=https://github.com/foosel/OctoPrint.git +[ -n "$OCTOPI_OCTOPRINT_PACKAGE" ] || OCTOPI_OCTOPRINT_PACKAGE="OctoPrint" [ -n "$OCTOPI_INCLUDE_OCTOPRINT" ] || OCTOPI_INCLUDE_OCTOPRINT=yes # CuraEngine archive & version diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 1b905a8e..bed1ed93 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -53,7 +53,7 @@ pushd /home/"${BASE_USER}" if [ "$OCTOPI_INCLUDE_OCTOPRINT" == "yes" ] then echo "--- Installing OctoPrint" - PIP_DEFAULT_TIMEOUT=60 sudo -u "${BASE_USER}" /home/"${BASE_USER}"/oprint/bin/pip install $OCTOPI_OCTOPRINT_ARCHIVE + PIP_DEFAULT_TIMEOUT=60 sudo -u "${BASE_USER}" /home/"${BASE_USER}"/oprint/bin/pip install $OCTOPI_OCTOPRINT_PACKAGE fi #mjpg-streamer From ccda0a601b5dc4e53e320f9ca383c389d229392c Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 18 Jul 2021 15:30:31 +0300 Subject: [PATCH 22/85] Add another mirror --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 6091ecc9..36afc154 100644 --- a/README.rst +++ b/README.rst @@ -19,6 +19,8 @@ Download the latest stable build via this button: Official mirror is `here `_ +Second mirror is `here `_ + Nightly builds are available `here `_ 64bit Nightly builds are available `here `_ From 6deaa22a71bc1b648652b50c3be2f4d743b27e54 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 18 Jul 2021 15:31:05 +0300 Subject: [PATCH 23/85] Update url --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 36afc154..790ae3bf 100644 --- a/README.rst +++ b/README.rst @@ -19,7 +19,7 @@ Download the latest stable build via this button: Official mirror is `here `_ -Second mirror is `here `_ +Second mirror is `here `_ Nightly builds are available `here `_ From 55228f05d288e6f307cf5abda323dd918e2b148a Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Mon, 19 Jul 2021 19:05:54 +0300 Subject: [PATCH 24/85] Add missing unzip for ubuntu needed by #743 --- src/modules/octopi/start_chroot_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index ac6ca0dd..647eac6f 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -34,7 +34,7 @@ apt-get remove -y --purge $remove_extra apt-get autoremove -y if [ "${BASE_DISTRO}" == "ubuntu" ]; then - apt-get -y --force-yes install python3 python3-virtualenv python3-dev git screen subversion cmake cmake-data avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base + apt-get -y --force-yes install python3 python3-virtualenv python3-dev git screen subversion cmake cmake-data avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base unzip else apt-get -y --force-yes install python3 python3-virtualenv python3-dev git screen subversion cmake=3.13.4-1 cmake-data=3.13.4-1 avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base fi From 9bec6e6ad9dc61fe188c0e3d842d3d30ad656584 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Mon, 26 Jul 2021 12:59:04 +0300 Subject: [PATCH 25/85] Fix build for Ubuntu 20.04 64bit, use libjpeg8-dev --- src/modules/octopi/start_chroot_script | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 647eac6f..65eb08e7 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -61,10 +61,14 @@ pushd /home/"${BASE_USER}" then install_dir=/opt/mjpg-streamer echo "--- Installing mjpg-streamer to $install_dir" - if [ $( is_in_apt libjpeg62-turbo-dev ) -eq 1 ]; then - apt-get -y --force-yes install libjpeg62-turbo-dev - elif [ $( is_in_apt libjpeg8-dev ) -eq 1 ]; then - apt-get -y --force-yes install libjpeg8-dev + if [ "${BASE_DISTRO}" == "ubuntu" ]; then + apt-get -y --allow-downgrades --allow-remove-essential --allow-change-held-packages install libjpeg8-dev + else + if [ $( is_in_apt libjpeg62-turbo-dev ) -eq 1 ]; then + apt-get -y --force-yes install libjpeg62-turbo-dev + elif [ $( is_in_apt libjpeg8-dev ) -eq 1 ]; then + apt-get -y --force-yes install libjpeg8-dev + fi fi apt-get -y --force-yes --no-install-recommends install imagemagick ffmpeg libv4l-dev From 55344968198c4ebcf22599835069837feb82c659 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Tue, 27 Jul 2021 00:25:59 +0300 Subject: [PATCH 26/85] Fixes #746 --- src/modules/octopi/start_chroot_script | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 65eb08e7..4d37aa25 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -25,6 +25,11 @@ WEBCAM_USER=webcam unpack /filesystem/home/pi /home/"${BASE_USER}" "${BASE_USER}" unpack /filesystem/home/root /root root unpack /filesystem/boot /boot + +if [ "${BASE_DISTRO}" == "ubuntu" ]; then + ln -s /boot/firmware/octopi.txt /boot/octopi.txt +fi + apt-get update # in case we are building from a regular raspbian image instead of the lite one... From 64c7f714f207e84d5011b365464d25c91ccac30e Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Mon, 9 Aug 2021 14:11:38 +0300 Subject: [PATCH 27/85] Revert fix for https://github.com/guysoft/OctoPi/issues/746#issuecomment-894783149 --- src/modules/octopi/start_chroot_script | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 4d37aa25..7c07a273 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -26,10 +26,6 @@ unpack /filesystem/home/pi /home/"${BASE_USER}" "${BASE_USER}" unpack /filesystem/home/root /root root unpack /filesystem/boot /boot -if [ "${BASE_DISTRO}" == "ubuntu" ]; then - ln -s /boot/firmware/octopi.txt /boot/octopi.txt -fi - apt-get update # in case we are building from a regular raspbian image instead of the lite one... From 1249100b5cf4b205426d509182efbd602c577145 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Thu, 9 Sep 2021 02:49:15 +0300 Subject: [PATCH 28/85] Add fix for #508 https://github.com/guysoft/OctoPi/issues/508#issuecomment-914501732 --- .../root/etc/network/if-up.d/powersave_off | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 src/modules/octopi/filesystem/root/etc/network/if-up.d/powersave_off diff --git a/src/modules/octopi/filesystem/root/etc/network/if-up.d/powersave_off b/src/modules/octopi/filesystem/root/etc/network/if-up.d/powersave_off new file mode 100755 index 00000000..9801cf33 --- /dev/null +++ b/src/modules/octopi/filesystem/root/etc/network/if-up.d/powersave_off @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +# Don't bother for loopback +if [ "$IFACE" = lo ]; then + exit 0 +fi + +# Only run from ifup. +if [ "$MODE" != start ]; then + exit 0 +fi + +# Only run once +if [ "$ADDRFAM" != meta ]; then + exit 0 +fi + +/usr/sbin/iw dev wlan0 set power_save off + +exit 0 + From 588373dbb3a2c2ca554041e37152c5282f4cce57 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Thu, 23 Sep 2021 12:50:03 +0300 Subject: [PATCH 29/85] Remove request for HTTPS mirror, we got one donated :) --- README.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.rst b/README.rst index 790ae3bf..d3d46c6e 100644 --- a/README.rst +++ b/README.rst @@ -25,8 +25,6 @@ Nightly builds are available `here `_ -We recently had to move to building location, donations for somewhere with HTTPS would be great. - How to use it? -------------- From b1f84495640c76cd23a633ed4e7a359b1c3faf2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Stra=C3=9Fburger?= Date: Sun, 7 Nov 2021 22:15:01 +0100 Subject: [PATCH 30/85] :zap: when using hls camera streamer, generate frame snapshot only once a second --- .../filesystem/root/etc/systemd/system/ffmpeg_hls.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/octopi/filesystem/root/etc/systemd/system/ffmpeg_hls.service b/src/modules/octopi/filesystem/root/etc/systemd/system/ffmpeg_hls.service index 15a8da25..2b15d8d8 100644 --- a/src/modules/octopi/filesystem/root/etc/systemd/system/ffmpeg_hls.service +++ b/src/modules/octopi/filesystem/root/etc/systemd/system/ffmpeg_hls.service @@ -25,7 +25,7 @@ ExecStart=/usr/bin/sudo -u webcam \ -pix_fmt yuv420p \ \ -c:v mjpeg -q:v 0 \ - -f image2 -update 1 -atomic_writing 1 \ + -f image2 -r 1 -update 1 -atomic_writing 1 \ /run/webcam/jpeg/frame.jpg \ \ -c:v h264_omx -profile:v high \ From 24be793acac49682a4f9ed81315f5840ae20abac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 9 Nov 2021 22:05:28 +0100 Subject: [PATCH 31/85] cmake-3.13.4 is no more --- src/modules/octopi/start_chroot_script | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 7c07a273..0e01800c 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -34,12 +34,7 @@ echo "removing:" $remove_extra apt-get remove -y --purge $remove_extra apt-get autoremove -y -if [ "${BASE_DISTRO}" == "ubuntu" ]; then - apt-get -y --force-yes install python3 python3-virtualenv python3-dev git screen subversion cmake cmake-data avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base unzip -else - apt-get -y --force-yes install python3 python3-virtualenv python3-dev git screen subversion cmake=3.13.4-1 cmake-data=3.13.4-1 avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base -fi - +apt-get -y --force-yes install python3 python3-virtualenv python3-dev git screen subversion cmake cmake-data avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base unzip echo " - Reinstall iputils-ping" apt-get install --reinstall iputils-ping From 4a4c353d661a86a447665ce172a31857ec320905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 9 Nov 2021 22:06:29 +0100 Subject: [PATCH 32/85] wiringpi is no more --- src/modules/octopi/config | 3 --- src/modules/octopi/start_chroot_script | 6 ------ 2 files changed, 9 deletions(-) diff --git a/src/modules/octopi/config b/src/modules/octopi/config index 5064055e..b39f19a3 100755 --- a/src/modules/octopi/config +++ b/src/modules/octopi/config @@ -20,9 +20,6 @@ # HAProxy [ -n "$OCTOPI_INCLUDE_HAPROXY" ] || OCTOPI_INCLUDE_HAPROXY=yes -# WiringPi -[ -n "$OCTOPI_INCLUDE_WIRINGPI" ] || OCTOPI_INCLUDE_WIRINGPI=yes - # yq [ -n "$OCTOPI_YQ_DOWNLOAD" ] || OCTOPI_YQ_DOWNLOAD=$(wget -q -O - https://api.github.com/repos/mikefarah/yq/releases/latest | grep "browser_download_url" | grep "yq_linux_arm" | cut -d : -f 2,3 | tr -d \" | tr -d ,) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 0e01800c..11b981bc 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -149,12 +149,6 @@ EOT rm /etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/certs/ssl-cert-snakeoil.pem fi - if [ "$OCTOPI_INCLUDE_WIRINGPI" == "yes" ] - then - echo "--- Installing WiringPi" - apt-get -y install wiringpi - fi - # fetch current yq build and install to /usr/local/bin wget -O yq $OCTOPI_YQ_DOWNLOAD && chmod +x yq && mv yq /usr/local/bin From df10e6d33c3ea0d122065a030fbea2dcb78be0aa Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Mon, 17 Jan 2022 18:02:47 +0200 Subject: [PATCH 33/85] Add repository_dispatch option --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 09781709..97238fb2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,7 @@ name: Build Image -on: +on: + repository_dispatch: push: schedule: - cron: '0 0 * * *' @@ -62,4 +63,4 @@ jobs: if: github.event_name == 'schedule' with: name: ${{ steps.copy.outputs.image }} - path: ${{ steps.copy.outputs.image }}.img \ No newline at end of file + path: ${{ steps.copy.outputs.image }}.img From 7e151c0f47d4b9720f9a2973040cd8ebc1e33da5 Mon Sep 17 00:00:00 2001 From: PowerWiesel <11167590+PowerWiesel@users.noreply.github.com> Date: Wed, 26 Jan 2022 11:51:50 +0100 Subject: [PATCH 34/85] picam-bullseye-fix mjpg-streamer doesn't work anymore with the new picam stack on bullseye based images - using the old stack for now. --- src/modules/octopi/start_chroot_script | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 11b981bc..6247a7ba 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -270,6 +270,11 @@ systemctl_if_exists enable streamer_select.service if [ "$OCTOPI_INCLUDE_MJPGSTREAMER" == "yes" ] then systemctl_if_exists enable webcamd.service +### use legacy camera stack on bullseye for now + if grep "camera_auto_detect=1" /boot/config.txt + then + sed -i "s/camera_auto_detect=1/camera_auto_detect=0/g" /boot/config.txt + fi else rm /etc/logrotate.d/webcamd rm /etc/systemd/system/webcamd.service From 70d256b24985cbf3c9adf8f4141a572cd9f15a8c Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Fri, 4 Feb 2022 13:36:13 +0200 Subject: [PATCH 35/85] Add rpi-imager values --- src/config | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/config b/src/config index 60299236..506f300e 100755 --- a/src/config +++ b/src/config @@ -2,5 +2,10 @@ export DIST_NAME=OctoPi export DIST_VERSION=1.0.0 export MODULES="base(raspicam, network, disable-services(octopi), password-for-sudo)" +export RPI_IMAGER_NAME="${DIST_NAME} version ${DIST_VERSION}" +export RPI_IMAGER_DESCRIPTION="A Raspberry Pi distribution for 3D printers. Ships OctoPrint out-of-the-box." +export RPI_IMAGER_ICON="https://raw.githubusercontent.com/guysoft/OctoPi/devel/media/rpi-imager-OctoPi.png" + + export BASE_IMAGE_ENLARGEROOT=2000 export BASE_IMAGE_RESIZEROOT=200 From aeca7ca63c91644615a3e72e58e1bb74d12a0df3 Mon Sep 17 00:00:00 2001 From: Flip Date: Tue, 8 Feb 2022 21:48:18 +0100 Subject: [PATCH 36/85] Set systemd Type to simple instead of forking --- .../octopi/filesystem/root/etc/systemd/system/webcamd.service | 2 +- .../filesystem/root/etc/systemd/system/webcamd.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/octopi/filesystem/root/etc/systemd/system/webcamd.service b/src/modules/octopi/filesystem/root/etc/systemd/system/webcamd.service index ea494e40..451d2377 100644 --- a/src/modules/octopi/filesystem/root/etc/systemd/system/webcamd.service +++ b/src/modules/octopi/filesystem/root/etc/systemd/system/webcamd.service @@ -8,7 +8,7 @@ StandardOutput=append:/var/log/webcamd.log StandardError=append:/var/log/webcamd.log ExecStart=/root/bin/webcamd Restart=always -Type=forking +Type=simple RestartSec=1 [Install] diff --git a/src/variants/ubuntu_arm64/filesystem/root/etc/systemd/system/webcamd.service b/src/variants/ubuntu_arm64/filesystem/root/etc/systemd/system/webcamd.service index bd5feb53..5154d6e8 100644 --- a/src/variants/ubuntu_arm64/filesystem/root/etc/systemd/system/webcamd.service +++ b/src/variants/ubuntu_arm64/filesystem/root/etc/systemd/system/webcamd.service @@ -8,7 +8,7 @@ StandardOutput=append:/var/log/webcamd.log StandardError=append:/var/log/webcamd.log ExecStart=/root/bin/webcamd Restart=always -Type=forking +Type=simple RestartSec=1 [Install] From 1843700621516a2fcb9e6c45971ff5f3539b35b1 Mon Sep 17 00:00:00 2001 From: Sadetdin EYILI Date: Fri, 25 Feb 2022 23:55:12 +0100 Subject: [PATCH 37/85] Fix typo in octopi.txt --- src/modules/octopi/filesystem/boot/octopi.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/octopi/filesystem/boot/octopi.txt b/src/modules/octopi/filesystem/boot/octopi.txt index c842c6b4..24cc430e 100644 --- a/src/modules/octopi/filesystem/boot/octopi.txt +++ b/src/modules/octopi/filesystem/boot/octopi.txt @@ -82,7 +82,7 @@ # If connection terminates by variable reasons system tries to restart the wifi connection to reestablish a connection. # The connection test is done every minute. # By default it is disabled (0 = off / 1 = on) -# dstination_host can be an ip address or a hostname (for hostname ensure dns resosultion is working correctly) +# destination_host can be an ip address or a hostname (for hostname ensure dns resosultion is working correctly) enable_network_monitor=0 destination_host=192.168.1.1 From 9bee5f088ea46d30d7a21859844598bc5ad24de3 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 27 Feb 2022 13:50:43 +0200 Subject: [PATCH 38/85] Add rpi imager 64bit to title on 64bit builds --- src/variants/ubuntu_arm64/config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/variants/ubuntu_arm64/config b/src/variants/ubuntu_arm64/config index 5fa90462..1f54aa96 100755 --- a/src/variants/ubuntu_arm64/config +++ b/src/variants/ubuntu_arm64/config @@ -6,3 +6,5 @@ export BASE_ZIP_IMG=`ls -t $BASE_IMAGE_PATH/*-{ubuntu}-*-arm64-*.xz | head -n 1` export BASE_IGNORE_VARIANT_NAME=yes export BASE_USER=pi export BASE_USER_PASSWORD=raspberry +export RPI_IMAGER_NAME="${DIST_NAME} version ${DIST_VERSION} 64bit" + From 017b75869185fc71030100e2fef0ffd9fbe28633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 2 Mar 2022 19:01:02 +0100 Subject: [PATCH 39/85] Install vcgencmd and fix user permission on Ubuntu The 64bit images are currently lacking vcgencmd, meaning that the PiSupport plugin can't check for undervoltage and overheat situations and will complain about this in the latest version as well, see feedback in #770. This should fix it by installing the package containing vcgencmd and making sure the base user is added to the video group as well. I was not able to test this in a build since I could not find documentation on which base image exactly to use and how to precisely run the 64bit build, but based on user feedback it should hopefully work. Still, please test in a build before merging. --- src/modules/octopi/start_chroot_script | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 11b981bc..4a2438c6 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -158,6 +158,12 @@ popd usermod -a -G tty "${BASE_USER}" usermod -a -G dialout "${BASE_USER}" +# If building against Ubuntu, make sure vcgencmd is available and pi has the rights to use it +if [ "${BASE_DISTRO}" == "ubuntu" ]; then + apt-get -y --force-yes install libraspberrypi-bin + usermod -a -G video "${BASE_USER}" +fi + # store octopi commit used to build this image echo "$OCTOPI_COMMIT" > /etc/octopi_commit From 6fd716b415f53036cc36f9d40c816c7470534c18 Mon Sep 17 00:00:00 2001 From: Willem Date: Mon, 28 Mar 2022 18:37:35 +0000 Subject: [PATCH 40/85] Fix HAProxy warning on wrong timeout abrreviation --- .../octopi/filesystem/root/etc/haproxy/haproxy.2.x.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/octopi/filesystem/root/etc/haproxy/haproxy.2.x.cfg b/src/modules/octopi/filesystem/root/etc/haproxy/haproxy.2.x.cfg index 8ef4d164..b9c30185 100644 --- a/src/modules/octopi/filesystem/root/etc/haproxy/haproxy.2.x.cfg +++ b/src/modules/octopi/filesystem/root/etc/haproxy/haproxy.2.x.cfg @@ -17,8 +17,8 @@ defaults option forwardfor maxconn 2000 timeout connect 5s - timeout client 15min - timeout server 15min + timeout client 15m + timeout server 15m frontend public bind :::80 v4v6 From c8045f46959aefe27e43a2ac6a46ad32b8fefec2 Mon Sep 17 00:00:00 2001 From: Timofei Korostelev Date: Sun, 10 Jul 2022 23:07:16 -0700 Subject: [PATCH 41/85] Building FFmpeg from source for HLS. Using V4L2 M2M encoder. --- .../etc/systemd/system/ffmpeg_hls.service | 6 +-- src/modules/octopi/start_chroot_script | 41 +++++++++++++++---- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/src/modules/octopi/filesystem/root/etc/systemd/system/ffmpeg_hls.service b/src/modules/octopi/filesystem/root/etc/systemd/system/ffmpeg_hls.service index 2b15d8d8..3a1f463b 100644 --- a/src/modules/octopi/filesystem/root/etc/systemd/system/ffmpeg_hls.service +++ b/src/modules/octopi/filesystem/root/etc/systemd/system/ffmpeg_hls.service @@ -18,7 +18,7 @@ ExecStartPre=/bin/chown -R webcam:webcam /run/webcam ExecStartPre=/bin/chmod -R 0755 /run/webcam ExecStart=/usr/bin/sudo -u webcam \ - /usr/bin/ffmpeg \ + /opt/ffmpeg-hls/ffmpeg \ \ -framerate 30 -video_size 640x480 \ -i /dev/video0 \ @@ -28,7 +28,7 @@ ExecStart=/usr/bin/sudo -u webcam \ -f image2 -r 1 -update 1 -atomic_writing 1 \ /run/webcam/jpeg/frame.jpg \ \ - -c:v h264_omx -profile:v high \ + -c:v h264_v4l2m2m -level:v 4.0 \ -b:v 1264k -flags +cgop \ -g 30 -keyint_min 30 \ \ @@ -40,7 +40,7 @@ ExecStart=/usr/bin/sudo -u webcam \ \ -vf scale=-1:240 \ \ - -c:v h264_omx -profile:v high \ + -c:v h264_v4l2m2m -level:v 4.0 \ -b:v 240k -flags +cgop \ -g 30 -keyint_min 30 \ \ diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 7c3b03f6..91e08e98 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -11,7 +11,7 @@ export LC_ALL=C source /common.sh -if [ -n "$OCTOPI_APTMIRROR" ]; +if [ -n "$OCTOPI_APTMIRROR" ]; then echo "Switching apt mirror in /etc/apt/sources.list to $OCTOPI_APTMIRROR" cp /etc/apt/sources.list /etc/apt/sources.list.backup @@ -19,6 +19,8 @@ then fi WEBCAM_USER=webcam +FFMPEG_HLS_COMMIT=c6fdbe26ef30fff817581e5ed6e078d96111248a +FFMPEG_HLS_DIR=/opt/ffmpeg-hls ### Script #### @@ -66,7 +68,7 @@ pushd /home/"${BASE_USER}" apt-get -y --force-yes install libjpeg8-dev fi fi - + apt-get -y --force-yes --no-install-recommends install imagemagick ffmpeg libv4l-dev wget $OCTOPI_MJPGSTREAMER_ARCHIVE -O mjpg-streamer.zip @@ -120,11 +122,32 @@ EOT # FFMPEG HLS if [ "$OCTOPI_INCLUDE_FFMPEG_HLS" == "yes" ] then - apt-get install -y --force-yes --no-install-recommends ffmpeg nginx + apt-get install -y --force-yes --no-install-recommends nginx + + FFMPEG_BUILD_DIR=$(mktemp -d) + pushd ${FFMPEG_BUILD_DIR} + FFMPEG_ARCHIVE=ffmpeg.tar.gz + wget https://api.github.com/repos/FFmpeg/FFmpeg/tarball/${FFMPEG_COMMIT} -O ${FFMPEG_ARCHIVE} + tar xvzf ${FFMPEG_ARCHIVE} + cd FFmpeg* + ./configure \ + --disable-doc \ + --disable-htmlpages \ + --disable-manpages \ + --disable-podpages \ + --disable-txtpages \ + --disable-ffplay \ + --disable-ffprobe + make -j$(nproc) + mkdir -p ${FFMPEG_HLS_DIR} + cp ffmpeg ${FFMPEG_HLS_DIR} + popd + rm -r ${FFMPEG_BUILD_DIR} + useradd ${WEBCAM_USER} usermod -aG video ${WEBCAM_USER} fi - + #CuraEngine if [ "$OCTOPI_INCLUDE_CURAENGINE" == "yes" ] then @@ -151,7 +174,7 @@ EOT # fetch current yq build and install to /usr/local/bin wget -O yq $OCTOPI_YQ_DOWNLOAD && chmod +x yq && mv yq /usr/local/bin - + popd #Make sure user pi / ${BASE_USER} has access to serial ports @@ -197,13 +220,13 @@ do done for ip in $(hostname -I); -do +do echo " http://$ip" done echo echo "https is also available, with a self-signed certificate." -echo +echo echo "------------------------------------------------------------" echo EOT @@ -276,7 +299,7 @@ systemctl_if_exists enable streamer_select.service if [ "$OCTOPI_INCLUDE_MJPGSTREAMER" == "yes" ] then systemctl_if_exists enable webcamd.service -### use legacy camera stack on bullseye for now +### use legacy camera stack on bullseye for now if grep "camera_auto_detect=1" /boot/config.txt then sed -i "s/camera_auto_detect=1/camera_auto_detect=0/g" /boot/config.txt @@ -304,7 +327,7 @@ apt-get -y install avrdude apt-get clean apt-get autoremove -y -if [ -n "$OCTOPI_APTMIRROR" ]; +if [ -n "$OCTOPI_APTMIRROR" ]; then echo "Reverting /etc/apt/sources.list" mv /etc/apt/sources.list.backup /etc/apt/sources.list From 7d57995e41fa2f1bb5e637cb7431578c69650397 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Fri, 15 Jul 2022 13:48:51 +0300 Subject: [PATCH 42/85] Add raspios_arm64 variant #785 --- src/variants/rpios_arm64/config | 7 +++ .../filesystem/root/etc/haproxy/haproxy.cfg | 49 +++++++++++++++++++ .../root/etc/systemd/system/webcamd.service | 15 ++++++ src/variants/rpios_arm64/post_chroot_script | 17 +++++++ 4 files changed, 88 insertions(+) create mode 100755 src/variants/rpios_arm64/config create mode 100644 src/variants/rpios_arm64/filesystem/root/etc/haproxy/haproxy.cfg create mode 100644 src/variants/rpios_arm64/filesystem/root/etc/systemd/system/webcamd.service create mode 100644 src/variants/rpios_arm64/post_chroot_script diff --git a/src/variants/rpios_arm64/config b/src/variants/rpios_arm64/config new file mode 100755 index 00000000..bbc234f2 --- /dev/null +++ b/src/variants/rpios_arm64/config @@ -0,0 +1,7 @@ +export BASE_ARCH=aarch64 +export BASE_DISTRO=raspios64 +export BASE_IMAGE_PATH=${DIST_PATH}/image-rpios_arm64 +# export BASE_ZIP_IMG=`ls -t $BASE_IMAGE_PATH/*-{ubuntu}-*-arm64-*.xz | head -n 1` +export BASE_IGNORE_VARIANT_NAME=yes +export BASE_USER=pi +export BASE_USER_PASSWORD=raspberry diff --git a/src/variants/rpios_arm64/filesystem/root/etc/haproxy/haproxy.cfg b/src/variants/rpios_arm64/filesystem/root/etc/haproxy/haproxy.cfg new file mode 100644 index 00000000..8ef4d164 --- /dev/null +++ b/src/variants/rpios_arm64/filesystem/root/etc/haproxy/haproxy.cfg @@ -0,0 +1,49 @@ +global + maxconn 4096 + user haproxy + group haproxy + log /dev/log local1 debug + tune.ssl.default-dh-param 2048 + +defaults + log global + mode http + compression algo gzip + option httplog + option dontlognull + retries 3 + option redispatch + option http-server-close + option forwardfor + maxconn 2000 + timeout connect 5s + timeout client 15min + timeout server 15min + +frontend public + bind :::80 v4v6 + bind :::443 v4v6 ssl crt /etc/ssl/snakeoil.pem + option forwardfor except 127.0.0.1 + use_backend webcam if { path_beg /webcam/ } + use_backend webcam_hls if { path_beg /hls/ } + use_backend webcam_hls if { path_beg /jpeg/ } + default_backend octoprint + +backend octoprint + acl needs_scheme req.hdr_cnt(X-Scheme) eq 0 + + http-request replace-path ^([^\ :]*)\ /(.*) \1\ /\2 + http-request add-header X-Scheme https if needs_scheme { ssl_fc } + http-request add-header X-Scheme http if needs_scheme !{ ssl_fc } + option forwardfor + server octoprint1 127.0.0.1:5000 + errorfile 503 /etc/haproxy/errors/503-no-octoprint.http + +backend webcam + http-request replace-path /webcam/(.*) /\1 + server webcam1 127.0.0.1:8080 + errorfile 503 /etc/haproxy/errors/503-no-webcam.http + +backend webcam_hls + server webcam_hls_1 127.0.0.1:28126 + errorfile 503 /etc/haproxy/errors/503-no-webcam-hls.http diff --git a/src/variants/rpios_arm64/filesystem/root/etc/systemd/system/webcamd.service b/src/variants/rpios_arm64/filesystem/root/etc/systemd/system/webcamd.service new file mode 100644 index 00000000..bd5feb53 --- /dev/null +++ b/src/variants/rpios_arm64/filesystem/root/etc/systemd/system/webcamd.service @@ -0,0 +1,15 @@ +[Unit] +Description=the OctoPi webcam daemon with the user specified config +# ConditionPathExists=/etc/octopi_streamer/mjpeg + +[Service] +WorkingDirectory=/root/bin +StandardOutput=append:/var/log/webcamd.log +StandardError=append:/var/log/webcamd.log +ExecStart=/root/bin/webcamd +Restart=always +Type=forking +RestartSec=1 + +[Install] +WantedBy=multi-user.target diff --git a/src/variants/rpios_arm64/post_chroot_script b/src/variants/rpios_arm64/post_chroot_script new file mode 100644 index 00000000..918c8bc9 --- /dev/null +++ b/src/variants/rpios_arm64/post_chroot_script @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -x +set -e + +export LC_ALL=C + +source /common.sh +install_cleanup_trap + +# Unpack the filesystem changes for the variant +unpack /filesystem/root / + +# add-apt-repository ppa:ubuntu-raspi2/ppa -y +apt-get update +apt-get -y --force-yes install libraspberrypi-bin rpi.gpio-common +apt-get clean +apt-get autoremove -y From 86f398c133e78e8023047a94ea343379ea4b1549 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 17 Jul 2022 01:28:28 +0300 Subject: [PATCH 43/85] Update README, add README for rpios_arm64 variant image location #785 --- src/image-rpios_arm64/README | 5 +++++ src/image/README | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 src/image-rpios_arm64/README diff --git a/src/image-rpios_arm64/README b/src/image-rpios_arm64/README new file mode 100644 index 00000000..63a2c46b --- /dev/null +++ b/src/image-rpios_arm64/README @@ -0,0 +1,5 @@ +Place zipped Raspberry Pi OS image here for the arm64 variant. Or any other variant you want to build/ + +If not otherwise specified, the build script will always use the most +recent zip file matching the file name pattern "*-raspbian.zip" or "*-rpios.zip" or "*-rpios.xz" located +here. diff --git a/src/image/README b/src/image/README index a536aca2..4203497c 100644 --- a/src/image/README +++ b/src/image/README @@ -1,5 +1,5 @@ Place zipped Raspberry Pi OS image here. Or any other variant you want to build/ If not otherwise specified, the build script will always use the most -recent zip file matching the file name pattern "*-raspbian.zip" or "*-rpios.zip" located +recent zip file matching the file name pattern "*-raspbian.zip" or "*-rpios.zip" or "*-rpios.xz" located here. From ec90e9a892710ee59652970c68b9aea14029e77e Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 17 Jul 2022 10:31:39 +0300 Subject: [PATCH 44/85] Fix building for armv7 on a arm64 kernel adn 32bit userspace #784 Fixes #787 --- src/modules/octopi/start_chroot_script | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 91e08e98..87bb5151 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -124,6 +124,11 @@ EOT then apt-get install -y --force-yes --no-install-recommends nginx + ARCH=arm + if [ "${BASE_ARCH}" == "aarch64"]; then + ARCH=aarch64 + fi + FFMPEG_BUILD_DIR=$(mktemp -d) pushd ${FFMPEG_BUILD_DIR} FFMPEG_ARCHIVE=ffmpeg.tar.gz @@ -131,6 +136,7 @@ EOT tar xvzf ${FFMPEG_ARCHIVE} cd FFmpeg* ./configure \ + --arch="${ARCH}" \ --disable-doc \ --disable-htmlpages \ --disable-manpages \ From 1d6d81f75f4384708e49ca67c0a3097d5bc28583 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Wed, 27 Jul 2022 00:02:23 +0300 Subject: [PATCH 45/85] Export ffmpeg HLS so we can place it as a pre-built binary later on #784 --- src/modules/octopi/start_chroot_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 87bb5151..db72e43d 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -146,7 +146,7 @@ EOT --disable-ffprobe make -j$(nproc) mkdir -p ${FFMPEG_HLS_DIR} - cp ffmpeg ${FFMPEG_HLS_DIR} + copy_and_export ffmpeg-hls-"${ARCH}" ffmpeg "${FFMPEG_HLS_DIR}" popd rm -r ${FFMPEG_BUILD_DIR} From 1e5e8eaa61e0360954a0a3d709592ce20f9e6762 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Wed, 3 Aug 2022 15:26:57 +0300 Subject: [PATCH 46/85] Fix typo --- src/modules/octopi/start_chroot_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index db72e43d..56f43b60 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -125,7 +125,7 @@ EOT apt-get install -y --force-yes --no-install-recommends nginx ARCH=arm - if [ "${BASE_ARCH}" == "aarch64"]; then + if [ "${BASE_ARCH}" == "aarch64" ]; then ARCH=aarch64 fi From 9105292c71d52121f3b76148c09b31ca2ceee668 Mon Sep 17 00:00:00 2001 From: Charlie Powell <31997505+cp2004@users.noreply.github.com> Date: Sun, 14 Aug 2022 17:32:20 +0100 Subject: [PATCH 47/85] Ensure webcamd service type is simple, not forking See #788 --- .../filesystem/root/etc/systemd/system/webcamd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/variants/rpios_arm64/filesystem/root/etc/systemd/system/webcamd.service b/src/variants/rpios_arm64/filesystem/root/etc/systemd/system/webcamd.service index bd5feb53..5154d6e8 100644 --- a/src/variants/rpios_arm64/filesystem/root/etc/systemd/system/webcamd.service +++ b/src/variants/rpios_arm64/filesystem/root/etc/systemd/system/webcamd.service @@ -8,7 +8,7 @@ StandardOutput=append:/var/log/webcamd.log StandardError=append:/var/log/webcamd.log ExecStart=/root/bin/webcamd Restart=always -Type=forking +Type=simple RestartSec=1 [Install] From fc82f1202f5c818f855a4cdb22a7bb2ec3a1f95e Mon Sep 17 00:00:00 2001 From: Charlie Powell <31997505+cp2004@users.noreply.github.com> Date: Sun, 14 Aug 2022 17:43:49 +0100 Subject: [PATCH 48/85] Fix vcgencmd get_camera output matching with libcamera --- src/modules/octopi/filesystem/home/root/bin/webcamd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/octopi/filesystem/home/root/bin/webcamd b/src/modules/octopi/filesystem/home/root/bin/webcamd index f2c6dfb1..89d5d96a 100755 --- a/src/modules/octopi/filesystem/home/root/bin/webcamd +++ b/src/modules/octopi/filesystem/home/root/bin/webcamd @@ -227,7 +227,9 @@ while true; do video_devices=($(find /dev -regextype sed -regex '\/dev/video[0-9]\+' | sort 2> /dev/null)) # add list of raspi camera into an array - if [ "`vcgencmd get_camera`" = "supported=1 detected=1" ]; then + vcgencmd_regex="supported=1 detected=1.*" + # Example output matching: supported=1 detected=1, libcamera interfaces=0 + if [[ "`vcgencmd get_camera`" =~ $vcgencmd_regex ]]; then video_devices+=( "raspi" ) fi From e5fc9bfb10a5de518459a16f3b7bfb23778c3b5e Mon Sep 17 00:00:00 2001 From: Charlie Powell <31997505+cp2004@users.noreply.github.com> Date: Sun, 14 Aug 2022 18:29:41 +0100 Subject: [PATCH 49/85] Add userfix script to allow changing usernames --- .../octopi/filesystem/home/root/bin/user-fix | 53 +++++++++++++++++++ .../root/etc/systemd/system/user-fix.service | 18 +++++++ src/modules/octopi/start_chroot_script | 9 ++++ 3 files changed, 80 insertions(+) create mode 100755 src/modules/octopi/filesystem/home/root/bin/user-fix create mode 100644 src/modules/octopi/filesystem/root/etc/systemd/system/user-fix.service diff --git a/src/modules/octopi/filesystem/home/root/bin/user-fix b/src/modules/octopi/filesystem/home/root/bin/user-fix new file mode 100755 index 00000000..09735c9e --- /dev/null +++ b/src/modules/octopi/filesystem/home/root/bin/user-fix @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +# Written by Gina Häußge originally at https://github.com/OctoPrint/OctoPi-UpToDate/blob/e70ccdaf0cd4ef4adfaa3f9b6b288fb6bfda116a/scripts/files/user-fix + +set -e + +USERID=1000 +FIRSTUSER=`getent passwd $USERID | cut -d: -f1` +FIRSTUSERHOME=`getent passwd $USERID | cut -d: -f6` + +CURRENT=`grep User= /etc/systemd/system/octoprint.service | cut -d= -f2` + +if [ "$CURRENT" = "pi" -a "$FIRSTUSER" != "pi" ]; then + # if we get here it means that the first user was renamed but we haven't yet + # updated all of OctoPi's files that depend on that name, so let's do that now + + # first we need to figure out if we can use the new user name in systemd files + # directly or if we need to use the UID - we do that by checking if the + # escaped name differes from the plain name, if so something is non ASCII + # and the UID is the safer bet + FIRSTUSERESC=`systemd-escape "$FIRSTUSER"` + if [ "$FIRSTUSER" != "$FIRSTUSERESC" ]; then + SERVICEUSER=$USERID + else + SERVICEUSER=$FIRSTUSER + fi + + # fix OctoPrint service file + echo "Fixing service file" + sed -i "s!User=pi!User=$SERVICEUSER!g" /etc/systemd/system/octoprint.service + sed -i "s!ExecStart=/home/pi/!ExecStart=$FIRSTUSERHOME/!g" /etc/systemd/system/octoprint.service + systemctl daemon-reload + + # fix sudoers files + echo "Fixing sudoers" + sed -i "s!^pi!$FIRSTUSER!g" /etc/sudoers.d/octoprint-service + sed -i "s!^pi!$FIRSTUSER!g" /etc/sudoers.d/octoprint-shutdown + + # fix scripts + echo "Fixing scripts" + sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" $FIRSTUSERHOME/scripts/add-octoprint-checkout + sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" $FIRSTUSERHOME/scripts/welcome + sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" $FIRSTUSERHOME/.bashrc + sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" /root/bin/webcamd + + # fix virtualenv + echo "Fixing paths in virtual environment" + cd $FIRSTUSERHOME/oprint + sudo -u $FIRSTUSER $FIRSTUSERHOME/.local/bin/virtualenv-tools --update-path $FIRSTUSERHOME/oprint + + # finally, reboot for all of this to actually take affect + echo "Adjusted scripts to new user, restarting services..." + systemctl reboot +fi \ No newline at end of file diff --git a/src/modules/octopi/filesystem/root/etc/systemd/system/user-fix.service b/src/modules/octopi/filesystem/root/etc/systemd/system/user-fix.service new file mode 100644 index 00000000..b95981ca --- /dev/null +++ b/src/modules/octopi/filesystem/root/etc/systemd/system/user-fix.service @@ -0,0 +1,18 @@ +# Written by Gina Häußge originally at https://github.com/OctoPrint/OctoPi-UpToDate/blob/e70ccdaf0cd4ef4adfaa3f9b6b288fb6bfda116a/scripts/files/user-fix.service +[Unit] +Description=Ensure that user name changes are applied as needed + +DefaultDependencies=no + +Before=network-pre.target +Wants=network-pre.target + +After=local-fs.target +Wants=local-fs.target + +[Service] +Type=oneshot +ExecStart=/root/bin/user-fix + +[Install] +WantedBy=multi-user.target diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 56f43b60..d78f49e6 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -329,6 +329,15 @@ systemctl_if_exists enable networkcheck.timer echo "--- Installing avrdude" apt-get -y install avrdude +### User-fixing +# Users can change their username easily via the Raspberry Pi imager, which breaks some of OctoPi's scripts +# we need to install virtualenv-tools3, so let's get pip and that +apt install -y python3-pip +sudo -u pi pip3 install --user virtualenv-tools3 + +systemctl_if_exists enable user-fix.service + + #cleanup apt-get clean apt-get autoremove -y From 5ec881b5988911880b2896af5d765098c760c16a Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Thu, 27 Oct 2022 16:54:12 +0300 Subject: [PATCH 50/85] Add 64-bit in to name of generated rpi-imaer snipplet --- src/variants/rpios_arm64/config | 1 + 1 file changed, 1 insertion(+) diff --git a/src/variants/rpios_arm64/config b/src/variants/rpios_arm64/config index bbc234f2..36278105 100755 --- a/src/variants/rpios_arm64/config +++ b/src/variants/rpios_arm64/config @@ -5,3 +5,4 @@ export BASE_IMAGE_PATH=${DIST_PATH}/image-rpios_arm64 export BASE_IGNORE_VARIANT_NAME=yes export BASE_USER=pi export BASE_USER_PASSWORD=raspberry +export RPI_IMAGER_NAME="${DIST_NAME} version ${DIST_VERSION} 64-bit" From 7a8b80b0bb4b1a1ca7c0c8357c3f0698ff68e31c Mon Sep 17 00:00:00 2001 From: TheRaf974 Date: Sun, 11 Dec 2022 21:35:27 +0100 Subject: [PATCH 51/85] New method to Disable Wifi Power management (and avoid automatic reactivation) Remove network\if-up.d\powersave_off Replaced it by a systemd daemon: wifi_powersave@.service Credit : [Ingo on StackExchange](https://raspberrypi.stackexchange.com/questions/96606/make-iw-wlan0-set-power-save-off-permanent) --- .../root/etc/network/if-up.d/powersave_off | 23 ------------------- .../systemd/system/wifi_powersave@.service | 11 +++++++++ src/modules/octopi/start_chroot_script | 4 ++++ 3 files changed, 15 insertions(+), 23 deletions(-) delete mode 100755 src/modules/octopi/filesystem/root/etc/network/if-up.d/powersave_off create mode 100644 src/modules/octopi/filesystem/root/etc/systemd/system/wifi_powersave@.service diff --git a/src/modules/octopi/filesystem/root/etc/network/if-up.d/powersave_off b/src/modules/octopi/filesystem/root/etc/network/if-up.d/powersave_off deleted file mode 100755 index 9801cf33..00000000 --- a/src/modules/octopi/filesystem/root/etc/network/if-up.d/powersave_off +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -set -e - -# Don't bother for loopback -if [ "$IFACE" = lo ]; then - exit 0 -fi - -# Only run from ifup. -if [ "$MODE" != start ]; then - exit 0 -fi - -# Only run once -if [ "$ADDRFAM" != meta ]; then - exit 0 -fi - -/usr/sbin/iw dev wlan0 set power_save off - -exit 0 - diff --git a/src/modules/octopi/filesystem/root/etc/systemd/system/wifi_powersave@.service b/src/modules/octopi/filesystem/root/etc/systemd/system/wifi_powersave@.service new file mode 100644 index 00000000..bed5fb8d --- /dev/null +++ b/src/modules/octopi/filesystem/root/etc/systemd/system/wifi_powersave@.service @@ -0,0 +1,11 @@ +[Unit] +Description=Set WiFi power save %i +After=sys-subsystem-net-devices-wlan0.device + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/sbin/iw dev wlan0 set power_save %i + +[Install] +WantedBy=sys-subsystem-net-devices-wlan0.device diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index d78f49e6..020d8ff1 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -320,6 +320,10 @@ fi systemctl_if_exists enable ffmpeg_hls.service +### Disable Wifi Power management + +systemctl_if_exists enable wifi_powersave@off.service + ### Network monitoring systemctl_if_exists enable networkcheck.timer From 481c839a16b12c79e2ddce98de3e2dbc60529d83 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Wed, 8 Feb 2023 21:19:25 +0200 Subject: [PATCH 52/85] Add Requirements for smoother build process fixes https://github.com/guysoft/FullPageOS/issues/452 --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index d3d46c6e..3f8ff6ce 100644 --- a/README.rst +++ b/README.rst @@ -68,6 +68,7 @@ Requirements #. Bash #. git #. sudo (the script itself calls it, running as root without sudo won't work) +#. jq (part of CustomPiOS dependencies) Build OctoPi From within OctoPi / Raspbian / Debian / Ubuntu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 56286e8c05c621b0f74a097d9a01af0f8aeefe9f Mon Sep 17 00:00:00 2001 From: Cory Charlton Date: Sun, 12 Feb 2023 12:54:59 -0800 Subject: [PATCH 53/85] Fix network monitoring script (#805) * Add failure condition if monitoring is enabled but configuration is not found * Check `/etc/wpa_supplicant/wpa_supplicant.conf` for a network configuration --- .../root/usr/local/bin/networkcheck | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck b/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck index 0ab1f406..a39d5fa4 100755 --- a/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck +++ b/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck @@ -23,6 +23,29 @@ if [ $enable_network_monitor == 1 ] && [ "$destination_host" != "" ]; then fi done < "$input" fi + + if [ -f /etc/wpa_supplicant/wpa_supplicant.conf ]; then # check if config file exists + input="/etc/wpa_supplicant/wpa_supplicant.conf" + while IFS= read -r line; do # read config file line by line + if [[ $line =~ ^network=.* ]]; then # check if we have a network config if a line starts with "network=" + echo "network config found..." + ping -c4 $destination_host > /dev/null # check if destination is reachable - possible by default the router + if [ $? != 0 ]; then + echo "Destination not reachable - reconfigure interface..." + sudo wpa_cli -i wlan0 reconfigure # reconfigure network to trigger reconnect + sudo dhclient -v # ensure connection will be established by refresh dhcp lease + echo "Reconnect done." + exit 0 # if we detect multiple network configs exit after 1st one - one reconnect is enough :-) + else + echo "Destination reachable - no action needed." + exit 0 # destination reached - exit loop + fi + fi + done < "$input" + fi + + echo "Network configuration not found" + exit 1 else echo "Network monitoring not enabled." fi From e3db25e41b1a3c2d6485b3e945982de6cfd0870b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 21 Feb 2023 17:33:52 +0100 Subject: [PATCH 54/85] Remove raspicam references from octopi.txt (#808) As wished for in #796 I'll add this to the OctoPi-UpToDate build so it will be already done in the images offered on OctoPrint's download page and on the Raspberry Pi imager, so there's IMHO no need for a RC4 for this. --- src/modules/octopi/filesystem/boot/octopi.txt | 23 ++----------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/modules/octopi/filesystem/boot/octopi.txt b/src/modules/octopi/filesystem/boot/octopi.txt index 24cc430e..2411171d 100644 --- a/src/modules/octopi/filesystem/boot/octopi.txt +++ b/src/modules/octopi/filesystem/boot/octopi.txt @@ -4,16 +4,8 @@ ### MacOSX users: If you use Textedit to edit this file make sure to use ### "plain text format" and "disable smart quotes" in "Textedit > Preferences" -### Configure which camera to use -# -# Available options are: -# - auto: tries first usb webcam, if that's not available tries raspi cam -# - usb: only tries usb webcam -# - raspi: only tries raspi cam -# -# Defaults to auto -# -#camera="auto" +### Heads-up: The "input_raspi" input module of mjpg-streamer is no longer supported. +### Raspicam support is now available on the "input_uvc" module. ### Additional options to supply to MJPG Streamer for the USB camera # @@ -51,17 +43,6 @@ # #additional_brokenfps_usb_devices=() -### Additional options to supply to MJPG Streamer for the RasPi Cam -# -# See https://faq.octoprint.org/mjpg-streamer-config for available options. -# -# NOTE: Newer raspi cam modules are reporting as usb devices causing these -# options to be ignored. Set `camera="raspi"` to avoid these issues. -# -# Defaults to 10fps -# -#camera_raspi_options="-fps 10" - ### Configuration of camera HTTP output # # Usually you should NOT need to change this at all! Only touch if you From 087a1992d8f6c314c3f35158b4fa920dcb8e062a Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Tue, 21 Feb 2023 23:39:57 +0200 Subject: [PATCH 55/85] Increment version to 1.1.0 --- src/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config b/src/config index 506f300e..f6c967a3 100755 --- a/src/config +++ b/src/config @@ -1,5 +1,5 @@ export DIST_NAME=OctoPi -export DIST_VERSION=1.0.0 +export DIST_VERSION=1.1.0 export MODULES="base(raspicam, network, disable-services(octopi), password-for-sudo)" export RPI_IMAGER_NAME="${DIST_NAME} version ${DIST_VERSION}" From 7cd39e723e421bc0000aa4d3ed883d02b5ebd69b Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Mon, 13 Mar 2023 14:22:45 +0200 Subject: [PATCH 56/85] Make the folder visibale for people so they dont get confused #813 --- src/image-armbian/README | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/image-armbian/README diff --git a/src/image-armbian/README b/src/image-armbian/README new file mode 100644 index 00000000..a75e65a5 --- /dev/null +++ b/src/image-armbian/README @@ -0,0 +1,8 @@ +Place zipped armbian images here. + + +This folder is used in the armbian build variant. + +Not that if not otherwise specified in the variant, the build script will always use the most +recent zip file matching the file name pattern "*-raspbian.zip" or "*-rpios.zip" or "*-rpios.xz" located +here. From 63690a7129eebb847ed296b5f4965b1236a91fea Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Tue, 14 Mar 2023 10:50:33 +0200 Subject: [PATCH 57/85] Fix build in armbian #813 --- src/modules/octopi/start_chroot_script | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 020d8ff1..2d51662c 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -336,10 +336,11 @@ apt-get -y install avrdude ### User-fixing # Users can change their username easily via the Raspberry Pi imager, which breaks some of OctoPi's scripts # we need to install virtualenv-tools3, so let's get pip and that -apt install -y python3-pip -sudo -u pi pip3 install --user virtualenv-tools3 - -systemctl_if_exists enable user-fix.service +if [ "${BASE_DISTRO}" == "raspbian" ] || [ "${BASE_DISTRO}" == "raspios64" ] || [ "${BASE_DISTRO}" == "raspios" ]; then + apt install -y python3-pip + sudo -u pi pip3 install --user virtualenv-tools3 + systemctl_if_exists enable user-fix.service +fi #cleanup From c46568f667a3c50cb968bc1680d2771ac41e1a14 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 11 Jun 2023 17:42:50 +0300 Subject: [PATCH 58/85] Remove camera ID 046d:0825 Fixes #759 --- src/modules/octopi/filesystem/home/root/bin/webcamd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/octopi/filesystem/home/root/bin/webcamd b/src/modules/octopi/filesystem/home/root/bin/webcamd index 89d5d96a..6185a368 100755 --- a/src/modules/octopi/filesystem/home/root/bin/webcamd +++ b/src/modules/octopi/filesystem/home/root/bin/webcamd @@ -15,7 +15,7 @@ MJPGSTREAMER_HOME=/opt/mjpg-streamer MJPGSTREAMER_INPUT_USB="input_uvc.so" MJPGSTREAMER_INPUT_RASPICAM="input_raspicam.so" -brokenfps_usb_devices=("046d:082b" "1908:2310" "0458:708c" "0458:6006" "1e4e:0102" "0471:0311" "038f:6001" "046d:0804" "046d:0825" "046d:0994" "0ac8:3450") +brokenfps_usb_devices=("046d:082b" "1908:2310" "0458:708c" "0458:6006" "1e4e:0102" "0471:0311" "038f:6001" "046d:0804" "046d:0994" "0ac8:3450") config_dir="/boot/octopi.conf.d" From 8fddf76901d79ce1903953aa75b006b6b9606e9e Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Tue, 3 Oct 2023 16:29:09 +0300 Subject: [PATCH 59/85] Fix arm64 build and apt-get deprecated message --- src/modules/octopi/start_chroot_script | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 2d51662c..f0103a78 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -36,7 +36,7 @@ echo "removing:" $remove_extra apt-get remove -y --purge $remove_extra apt-get autoremove -y -apt-get -y --force-yes install python3 python3-virtualenv python3-dev git screen subversion cmake cmake-data avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base unzip +apt-get -y --allow-change-held-packages install python3 python3-virtualenv python3-dev git screen subversion cmake cmake-data avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base unzip echo " - Reinstall iputils-ping" apt-get install --reinstall iputils-ping @@ -63,13 +63,13 @@ pushd /home/"${BASE_USER}" apt-get -y --allow-downgrades --allow-remove-essential --allow-change-held-packages install libjpeg8-dev else if [ $( is_in_apt libjpeg62-turbo-dev ) -eq 1 ]; then - apt-get -y --force-yes install libjpeg62-turbo-dev + apt-get -y --allow-change-held-packages install libjpeg62-turbo-dev elif [ $( is_in_apt libjpeg8-dev ) -eq 1 ]; then - apt-get -y --force-yes install libjpeg8-dev + apt-get -y --allow-change-held-packages install libjpeg8-dev fi fi - apt-get -y --force-yes --no-install-recommends install imagemagick ffmpeg libv4l-dev + apt-get -y --allow-change-held-packages --no-install-recommends install imagemagick ffmpeg libv4l-dev wget $OCTOPI_MJPGSTREAMER_ARCHIVE -O mjpg-streamer.zip unzip mjpg-streamer.zip @@ -122,7 +122,7 @@ EOT # FFMPEG HLS if [ "$OCTOPI_INCLUDE_FFMPEG_HLS" == "yes" ] then - apt-get install -y --force-yes --no-install-recommends nginx + apt-get install -y --allow-change-held-packages --no-install-recommends nginx ARCH=arm if [ "${BASE_ARCH}" == "aarch64" ]; then @@ -174,7 +174,7 @@ EOT if [ "$OCTOPI_INCLUDE_HAPROXY" == "yes" ] then echo "--- Installing haproxy" - apt-get -y --force-yes install ssl-cert haproxy + DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y --allow-change-held-packages install ssl-cert haproxy rm /etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/certs/ssl-cert-snakeoil.pem fi @@ -189,7 +189,7 @@ usermod -a -G dialout "${BASE_USER}" # If building against Ubuntu, make sure vcgencmd is available and pi has the rights to use it if [ "${BASE_DISTRO}" == "ubuntu" ]; then - apt-get -y --force-yes install libraspberrypi-bin + apt-get -y --allow-change-held-packages install libraspberrypi-bin usermod -a -G video "${BASE_USER}" fi From 0e211ef9ca22c20fa617e6d0127f05d396943e74 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 22 Oct 2023 22:03:14 +0300 Subject: [PATCH 60/85] Fix build on bookworm, might also fix #813 --- src/modules/octopi/start_chroot_script | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index f0103a78..31abae0a 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -337,8 +337,8 @@ apt-get -y install avrdude # Users can change their username easily via the Raspberry Pi imager, which breaks some of OctoPi's scripts # we need to install virtualenv-tools3, so let's get pip and that if [ "${BASE_DISTRO}" == "raspbian" ] || [ "${BASE_DISTRO}" == "raspios64" ] || [ "${BASE_DISTRO}" == "raspios" ]; then - apt install -y python3-pip - sudo -u pi pip3 install --user virtualenv-tools3 + apt install -y python3-pip python3-virtualenv + # sudo -u pi pip3 install --user virtualenv-tools3 systemctl_if_exists enable user-fix.service fi From 15ceae90829cb0c7712b375a45d221e2bf72a91f Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Mon, 27 Nov 2023 22:48:55 +0200 Subject: [PATCH 61/85] Make install of iputils-ping non-interactive --- src/modules/octopi/start_chroot_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 31abae0a..0c054008 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -39,7 +39,7 @@ apt-get autoremove -y apt-get -y --allow-change-held-packages install python3 python3-virtualenv python3-dev git screen subversion cmake cmake-data avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base unzip echo " - Reinstall iputils-ping" -apt-get install --reinstall iputils-ping +apt-get -y --force-yes install --reinstall iputils-ping pushd /home/"${BASE_USER}" From 844603da47b14d6c807320b7b2b6474d0de781c5 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Wed, 13 Dec 2023 11:16:13 +0200 Subject: [PATCH 62/85] Check also for arm64 on ffmpeg build --- src/modules/octopi/start_chroot_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 0c054008..a0dd15f3 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -125,7 +125,7 @@ EOT apt-get install -y --allow-change-held-packages --no-install-recommends nginx ARCH=arm - if [ "${BASE_ARCH}" == "aarch64" ]; then + if [ "${BASE_ARCH}" == "aarch64" ] || [ "${BASE_ARCH}" == "arm64" ]; then ARCH=aarch64 fi From cebc1b5efddc517f12306f9f9a50d7d4653bc960 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Tue, 16 Jan 2024 07:46:08 +0200 Subject: [PATCH 63/85] Try to workaround bookworm new mountpoint #824 #823 --- src/modules/octopi/start_chroot_script | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index a0dd15f3..137af19e 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -27,6 +27,7 @@ FFMPEG_HLS_DIR=/opt/ffmpeg-hls unpack /filesystem/home/pi /home/"${BASE_USER}" "${BASE_USER}" unpack /filesystem/home/root /root root unpack /filesystem/boot /boot +ln -s /boot/firmware/octopi.txt /boot apt-get update From 4c7283100475675c0f84c5e829b610837911f3a9 Mon Sep 17 00:00:00 2001 From: Tall-Paul Date: Tue, 27 Feb 2024 11:46:52 +0000 Subject: [PATCH 64/85] Update README.rst I got an error building on a fresh install of Debian, jq wasn't present. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 3f8ff6ce..4eb79370 100644 --- a/README.rst +++ b/README.rst @@ -77,7 +77,7 @@ OctoPi can be built from Debian, Ubuntu, Raspbian, or even OctoPi. Build requires about 2.5 GB of free space available. You can build it by issuing the following commands:: - sudo apt-get install gawk util-linux qemu-user-static git p7zip-full python3 + sudo apt-get install gawk util-linux qemu-user-static git p7zip-full python3 jq git clone https://github.com/guysoft/CustomPiOS.git git clone https://github.com/guysoft/OctoPi.git From 47bd800238911cdcd6fe77b9593837b6597308fa Mon Sep 17 00:00:00 2001 From: as-kholin Date: Sun, 19 May 2024 09:47:34 -0500 Subject: [PATCH 65/85] Update Octoprint Systemd Service to fall back to System CA bundle Octoprint, because it does not specify a CA bundle anywhere, falls back to the default Python CA bundle. This prevents a user from adding a trusted CA, and being able to use that for connections from Octoprint. This change lets Octoprint fall back to use the Debian/Raspbian default CA bundle - so that users can update the CA certificates for the OS (and not have to find other options to figure out how to separately change Python's CA cert bundle. --- .../octopi/filesystem/root/etc/systemd/system/octoprint.service | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/octopi/filesystem/root/etc/systemd/system/octoprint.service b/src/modules/octopi/filesystem/root/etc/systemd/system/octoprint.service index 191f4e05..07217a3f 100644 --- a/src/modules/octopi/filesystem/root/etc/systemd/system/octoprint.service +++ b/src/modules/octopi/filesystem/root/etc/systemd/system/octoprint.service @@ -6,6 +6,7 @@ Wants=network.online.target [Service] Environment="HOST=127.0.0.1" Environment="PORT=5000" +Environment="REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt" Type=simple User=pi ExecStart=/home/pi/oprint/bin/octoprint serve --host=${HOST} --port=${PORT} From 6ead80f4ee8e31fd76c8b86a5adb784895906859 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Fri, 31 May 2024 22:50:04 +0300 Subject: [PATCH 66/85] Fix symlink for bookworm #823 --- src/modules/octopi/start_chroot_script | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 137af19e..300b457a 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -26,8 +26,7 @@ FFMPEG_HLS_DIR=/opt/ffmpeg-hls unpack /filesystem/home/pi /home/"${BASE_USER}" "${BASE_USER}" unpack /filesystem/home/root /root root -unpack /filesystem/boot /boot -ln -s /boot/firmware/octopi.txt /boot +unpack /filesystem/boot /boot/firmware apt-get update From f9d2444085c7cd01afa61962455a92ce5c8faf23 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sat, 1 Jun 2024 23:58:30 +0300 Subject: [PATCH 67/85] Add raspberry pi imager nightly channel repo command --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index 4eb79370..a5404e00 100644 --- a/README.rst +++ b/README.rst @@ -25,6 +25,10 @@ Nightly builds are available `here `_ +You can also access the nightly builds raspberrypi imager channel by running:: + + rpi-imager --repo https://unofficialpi.org/rpi-imager/rpi-imager-octopi.json + How to use it? -------------- From 5809c96e4215440fec697ec631555b50f525dba3 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 2 Jun 2024 00:00:31 +0300 Subject: [PATCH 68/85] Also add second mirror rpi imager nightly repo command --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index a5404e00..78b0bd49 100644 --- a/README.rst +++ b/README.rst @@ -29,6 +29,10 @@ You can also access the nightly builds raspberrypi imager channel by running:: rpi-imager --repo https://unofficialpi.org/rpi-imager/rpi-imager-octopi.json +or for second mirror:: + + rpi-imager --repo https://octopi.gnethomelinux.com/rpi-imager/rpi-imager-octopi.json + How to use it? -------------- From 370549c68dd0ff197b9517356cdae191b4be2510 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Tue, 16 Jul 2024 10:10:31 +0300 Subject: [PATCH 69/85] Fix webcam to work with /boot/firmware/octopi.txt path #823 https://github.com/guysoft/CustomPiOS/issues/220 --- .../filesystem/home/root/bin/streamer_select | 6 +++- .../octopi/filesystem/home/root/bin/webcamd | 34 +++++++++++-------- .../root/etc/init.d/change_hostname | 8 ++++- .../root/etc/init.d/change_password | 8 ++++- .../root/usr/local/bin/networkcheck | 6 +++- 5 files changed, 44 insertions(+), 18 deletions(-) diff --git a/src/modules/octopi/filesystem/home/root/bin/streamer_select b/src/modules/octopi/filesystem/home/root/bin/streamer_select index 9d965140..3b6662af 100755 --- a/src/modules/octopi/filesystem/home/root/bin/streamer_select +++ b/src/modules/octopi/filesystem/home/root/bin/streamer_select @@ -3,7 +3,11 @@ # Exit on any error. set -e +CONFIG_FILE=/boot/firmware/octopi.txt +# Fallback for older images +if [ ! -f "${CONFIG_FILE}" ] && [ -f "/boot/octopi.txt" ]; then CONFIG_FILE=/boot/octopi.txt +fi MJPEG_TYPE=mjpeg HLS_TYPE=hls MJPEG_SERVICE=webcamd.service @@ -29,4 +33,4 @@ elif [ "${camera_streamer}" = "${HLS_TYPE}" ]; then else echo "Streamer type '${camera_streamer}' is not supported." exit 1 -fi \ No newline at end of file +fi diff --git a/src/modules/octopi/filesystem/home/root/bin/webcamd b/src/modules/octopi/filesystem/home/root/bin/webcamd index 6185a368..b05f3958 100755 --- a/src/modules/octopi/filesystem/home/root/bin/webcamd +++ b/src/modules/octopi/filesystem/home/root/bin/webcamd @@ -1,29 +1,35 @@ #!/bin/bash -######################################################################## -### DO NOT EDIT THIS FILE TO CHANGE THE CONFIG!!! ### -### ---------------------------------------------------------------- ### -### There is no need to edit this file for changing resolution, ### -### frame rates or any other mjpg-streamer parameters. Please edit ### -### /boot/octopi.txt instead - that's what it's there for! You can ### -### even do this with your Pi powered down by directly accessing the ### -### file when using the SD card as thumb drive in your regular ### -### computer. ### -######################################################################## +############################################################################### +### DO NOT EDIT THIS FILE TO CHANGE THE CONFIG!!! ### +### ----------------------------------------------------------------------- ### +### There is no need to edit this file for changing resolution, ### +### frame rates or any other mjpg-streamer parameters. Please edit ### +### /boot/firmware/octopi.txt instead - that's what it's there for! You can ### +### even do this with your Pi powered down by directly accessing the ### +### file when using the SD card as thumb drive in your regular ### +### computer. ### +############################################################################### MJPGSTREAMER_HOME=/opt/mjpg-streamer MJPGSTREAMER_INPUT_USB="input_uvc.so" MJPGSTREAMER_INPUT_RASPICAM="input_raspicam.so" +CONFIG_FILE=/boot/firmware/octopi.txt +# Fallback for older images +if [ ! -f "${CONFIG_FILE}" ] && [ -f "/boot/octopi.txt" ]; then +CONFIG_FILE=/boot/octopi.txt +fi + brokenfps_usb_devices=("046d:082b" "1908:2310" "0458:708c" "0458:6006" "1e4e:0102" "0471:0311" "038f:6001" "046d:0804" "046d:0994" "0ac8:3450") -config_dir="/boot/octopi.conf.d" +config_dir="${CONFIG_FILE}/octopi.conf.d" echo "Starting up webcamDaemon..." echo "" cfg_files=() -cfg_files+=/boot/octopi.txt +cfg_files+="${CONFIG_FILE}" if [[ -d ${config_dir} ]]; then cfg_files+=( `ls ${config_dir}/*.txt` ) fi @@ -41,7 +47,7 @@ array_assigned_device=() echo "--- Configuration: ----------------------------" for cfg_file in ${cfg_files[@]}; do - # init configuration - DO NOT EDIT, USE /boot/octopi.conf.d/*.txt INSTEAD! + # init configuration - DO NOT EDIT, USE /boot/firmware/octopi.conf.d/*.txt INSTEAD! camera="auto" camera_usb_options="-r 640x480 -f 10" camera_raspi_options="-fps 10" @@ -54,7 +60,7 @@ for cfg_file in ${cfg_files[@]}; do fi usb_options="$camera_usb_options" - # if webcam device is explicitly given in /boot/octopi.txt, save the path of the device + # if webcam device is explicitly given in /boot/firmware/octopi.txt, save the path of the device # to a variable and remove its parameter from usb_options extracted_device=`echo $usb_options | sed 's@.*-d \(/dev/\(video[0-9]\+\|v4l/[^ ]*\)\).*@\1@'` if [ "$extracted_device" != "$usb_options" ] diff --git a/src/modules/octopi/filesystem/root/etc/init.d/change_hostname b/src/modules/octopi/filesystem/root/etc/init.d/change_hostname index 7c5ef568..2eb943d0 100755 --- a/src/modules/octopi/filesystem/root/etc/init.d/change_hostname +++ b/src/modules/octopi/filesystem/root/etc/init.d/change_hostname @@ -11,8 +11,14 @@ . /lib/lsb/init-functions +BOOT_FOLDER=/boot/firmware +# Fallback for older images +if [ ! -f "${CONFIG_FILE}" ] && [ -f "/boot/octopi.txt" ]; then +BOOT_FOLDER=/boot +fi + do_start () { - text_file="/boot/octopi-hostname.txt" + text_file="${BOOT_FOLDER}/octopi-hostname.txt" if [ ! -f "$text_file" ] then exit 0 diff --git a/src/modules/octopi/filesystem/root/etc/init.d/change_password b/src/modules/octopi/filesystem/root/etc/init.d/change_password index 851d3e2b..bcd60409 100755 --- a/src/modules/octopi/filesystem/root/etc/init.d/change_password +++ b/src/modules/octopi/filesystem/root/etc/init.d/change_password @@ -11,8 +11,14 @@ . /lib/lsb/init-functions +BOOT_FOLDER=/boot/firmware +# Fallback for older images +if [ ! -f "${CONFIG_FILE}" ] && [ -f "/boot/octopi.txt" ]; then +BOOT_FOLDER=/boot +fi + do_start () { - text_file="/boot/octopi-password.txt" + text_file="${BOOT_FOLDER}/octopi-password.txt" if [ ! -f "$text_file" ] then exit 0 diff --git a/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck b/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck index a39d5fa4..1ae2b994 100755 --- a/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck +++ b/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck @@ -1,6 +1,10 @@ #!/bin/bash +CONFIG_FILE=/boot/firmware/octopi.txt +# Fallback for older images +if [ ! -f "${CONFIG_FILE}" ] && [ -f "/boot/octopi.txt" ]; then +CONFIG_FILE=/boot/octopi.txt -source /boot/octopi.txt +source "${CONFIG_FILE}" if [ $enable_network_monitor == 1 ] && [ "$destination_host" != "" ]; then From dd5c32edcd18742abde217bc3e62b43ce7dd5485 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Wed, 17 Jul 2024 09:18:33 +0300 Subject: [PATCH 70/85] Move octoprint python virtualenv to /opt/custompios/oprint and add a symlink --- .../filesystem/home/pi/OctoPrint/README.txt | 2 +- .../octopi/filesystem/home/root/bin/user-fix | 19 +++---------------- .../root/etc/systemd/system/octoprint.service | 4 ++-- .../octopi}/scripts/add-octoprint-checkout | 6 +++--- .../opt/octopi}/scripts/install-desktop | 0 .../pi => root/opt/octopi}/scripts/safemode | 0 .../pi => root/opt/octopi}/scripts/welcome | 2 +- src/modules/octopi/start_chroot_script | 15 +++++++++++---- 8 files changed, 21 insertions(+), 27 deletions(-) rename src/modules/octopi/filesystem/{home/pi => root/opt/octopi}/scripts/add-octoprint-checkout (91%) rename src/modules/octopi/filesystem/{home/pi => root/opt/octopi}/scripts/install-desktop (100%) rename src/modules/octopi/filesystem/{home/pi => root/opt/octopi}/scripts/safemode (100%) rename src/modules/octopi/filesystem/{home/pi => root/opt/octopi}/scripts/welcome (88%) diff --git a/src/modules/octopi/filesystem/home/pi/OctoPrint/README.txt b/src/modules/octopi/filesystem/home/pi/OctoPrint/README.txt index 4214bd8f..48cf310b 100644 --- a/src/modules/octopi/filesystem/home/pi/OctoPrint/README.txt +++ b/src/modules/octopi/filesystem/home/pi/OctoPrint/README.txt @@ -4,4 +4,4 @@ so OctoPi no longer goes that route either. Feel free to manually create a git clone though if you need it (e.g. for branch based updates or on board development): - ~/scripts/add-octoprint-checkout + /opt/octopi/scripts/add-octoprint-checkout diff --git a/src/modules/octopi/filesystem/home/root/bin/user-fix b/src/modules/octopi/filesystem/home/root/bin/user-fix index 09735c9e..356dfc9d 100755 --- a/src/modules/octopi/filesystem/home/root/bin/user-fix +++ b/src/modules/octopi/filesystem/home/root/bin/user-fix @@ -7,7 +7,7 @@ USERID=1000 FIRSTUSER=`getent passwd $USERID | cut -d: -f1` FIRSTUSERHOME=`getent passwd $USERID | cut -d: -f6` -CURRENT=`grep User= /etc/systemd/system/octoprint.service | cut -d= -f2` +CURRENT=$(grep "ALL\=NOPASSWD" /etc/sudoers.d/octoprint-service | cut -d\ -f1) if [ "$CURRENT" = "pi" -a "$FIRSTUSER" != "pi" ]; then # if we get here it means that the first user was renamed but we haven't yet @@ -24,12 +24,6 @@ if [ "$CURRENT" = "pi" -a "$FIRSTUSER" != "pi" ]; then SERVICEUSER=$FIRSTUSER fi - # fix OctoPrint service file - echo "Fixing service file" - sed -i "s!User=pi!User=$SERVICEUSER!g" /etc/systemd/system/octoprint.service - sed -i "s!ExecStart=/home/pi/!ExecStart=$FIRSTUSERHOME/!g" /etc/systemd/system/octoprint.service - systemctl daemon-reload - # fix sudoers files echo "Fixing sudoers" sed -i "s!^pi!$FIRSTUSER!g" /etc/sudoers.d/octoprint-service @@ -37,17 +31,10 @@ if [ "$CURRENT" = "pi" -a "$FIRSTUSER" != "pi" ]; then # fix scripts echo "Fixing scripts" - sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" $FIRSTUSERHOME/scripts/add-octoprint-checkout - sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" $FIRSTUSERHOME/scripts/welcome - sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" $FIRSTUSERHOME/.bashrc + sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" /opt/octopi/scripts/add-octoprint-checkout sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" /root/bin/webcamd - # fix virtualenv - echo "Fixing paths in virtual environment" - cd $FIRSTUSERHOME/oprint - sudo -u $FIRSTUSER $FIRSTUSERHOME/.local/bin/virtualenv-tools --update-path $FIRSTUSERHOME/oprint - # finally, reboot for all of this to actually take affect echo "Adjusted scripts to new user, restarting services..." systemctl reboot -fi \ No newline at end of file +fi diff --git a/src/modules/octopi/filesystem/root/etc/systemd/system/octoprint.service b/src/modules/octopi/filesystem/root/etc/systemd/system/octoprint.service index 07217a3f..656ce446 100644 --- a/src/modules/octopi/filesystem/root/etc/systemd/system/octoprint.service +++ b/src/modules/octopi/filesystem/root/etc/systemd/system/octoprint.service @@ -8,8 +8,8 @@ Environment="HOST=127.0.0.1" Environment="PORT=5000" Environment="REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt" Type=simple -User=pi -ExecStart=/home/pi/oprint/bin/octoprint serve --host=${HOST} --port=${PORT} +User=1000 +ExecStart=/opt/octopi/oprint/bin/octoprint serve --host=${HOST} --port=${PORT} [Install] WantedBy=multi-user.target diff --git a/src/modules/octopi/filesystem/home/pi/scripts/add-octoprint-checkout b/src/modules/octopi/filesystem/root/opt/octopi/scripts/add-octoprint-checkout similarity index 91% rename from src/modules/octopi/filesystem/home/pi/scripts/add-octoprint-checkout rename to src/modules/octopi/filesystem/root/opt/octopi/scripts/add-octoprint-checkout index 8a87651b..d5cfbd7b 100755 --- a/src/modules/octopi/filesystem/home/pi/scripts/add-octoprint-checkout +++ b/src/modules/octopi/filesystem/root/opt/octopi/scripts/add-octoprint-checkout @@ -1,7 +1,7 @@ #!/bin/bash - -OCTOPRINT_FOLDER=/home/pi/OctoPrint -OCTOPRINT_CONFIG=/home/pi/.octoprint/config.yaml +USER_NAME=$(id -nu 1000)' +OCTOPRINT_FOLDER=/home/"${USER_NAME}"/OctoPrint +OCTOPRINT_CONFIG=/home/"${USER_NAME}"/.octoprint/config.yaml if [ "${PWD}" == "${OCTOPRINT_FOLDER}" ]; then echo "Error: you are in the folder: "${OCTOPRINT_FOLDER} diff --git a/src/modules/octopi/filesystem/home/pi/scripts/install-desktop b/src/modules/octopi/filesystem/root/opt/octopi/scripts/install-desktop similarity index 100% rename from src/modules/octopi/filesystem/home/pi/scripts/install-desktop rename to src/modules/octopi/filesystem/root/opt/octopi/scripts/install-desktop diff --git a/src/modules/octopi/filesystem/home/pi/scripts/safemode b/src/modules/octopi/filesystem/root/opt/octopi/scripts/safemode similarity index 100% rename from src/modules/octopi/filesystem/home/pi/scripts/safemode rename to src/modules/octopi/filesystem/root/opt/octopi/scripts/safemode diff --git a/src/modules/octopi/filesystem/home/pi/scripts/welcome b/src/modules/octopi/filesystem/root/opt/octopi/scripts/welcome similarity index 88% rename from src/modules/octopi/filesystem/home/pi/scripts/welcome rename to src/modules/octopi/filesystem/root/opt/octopi/scripts/welcome index 46af4349..e5c748e9 100755 --- a/src/modules/octopi/filesystem/home/pi/scripts/welcome +++ b/src/modules/octopi/filesystem/root/opt/octopi/scripts/welcome @@ -2,7 +2,7 @@ _NAME=$(hostname) _IP=$(hostname -I) -_OCTOPRINT_VERSION=$(/home/pi/oprint/bin/python -c "from octoprint._version import get_versions; print(get_versions()['version'])" || echo "unknown") +_OCTOPRINT_VERSION=$(/opt/octopi/oprint/bin/python -c "from octoprint._version import get_versions; print(get_versions()['version'])" || echo "unknown") _OCTOPI_VERSION=$(cat /etc/octopi_version || echo "unknown") echo diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 300b457a..3deb069b 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -41,17 +41,24 @@ apt-get -y --allow-change-held-packages install python3 python3-virtualenv pytho echo " - Reinstall iputils-ping" apt-get -y --force-yes install --reinstall iputils-ping -pushd /home/"${BASE_USER}" +# Path is hardcoded systemd service, this is not configurable +OCTOPI_OPT_FOLDER=/opt/octopi +mkdir -p "${OCTOPI_OPT_FOLDER}" +chown "${BASE_USER}":"${BASE_USER}" "${OCTOPI_OPT_FOLDER}" +OCTOPI_OCTOPRINT_FOLDER="${OCTOPI_OPT_FOLDER}"/oprint +ln -s "${OCTOPI_OCTOPRINT_FOLDER}" /home/"${BASE_USER}"/oprint +PIP="${OCTOPI_OCTOPRINT_FOLDER}"/bin/pip +pushd "${OCTOPI_OPT_FOLDER}" # build virtualenv sudo -u "${BASE_USER}" python3 -m virtualenv --python=python3 oprint - sudo -u "${BASE_USER}" /home/"${BASE_USER}"/oprint/bin/pip install --upgrade pip + sudo -u "${BASE_USER}" "${PIP}" install --upgrade pip # OctoPrint if [ "$OCTOPI_INCLUDE_OCTOPRINT" == "yes" ] then echo "--- Installing OctoPrint" - PIP_DEFAULT_TIMEOUT=60 sudo -u "${BASE_USER}" /home/"${BASE_USER}"/oprint/bin/pip install $OCTOPI_OCTOPRINT_PACKAGE + PIP_DEFAULT_TIMEOUT=60 sudo -u "${BASE_USER}" "${PIP}" install $OCTOPI_OCTOPRINT_PACKAGE fi #mjpg-streamer @@ -240,7 +247,7 @@ EOT echo 'exit 0' >> /etc/rc.local # add a longer welcome text to ~pi/.bashrc / ~${BASE_USER}/.bashrc -echo "source /home/${BASE_USER}/scripts/welcome" >> /home/${BASE_USER}/.bashrc +echo "source /opt/octopi/scripts/welcome" >> /home/${BASE_USER}/.bashrc #unpack root in the end, so etc file are not overwritten, might need to add two roots int he future unpack /filesystem/root / From 702965084d83c7dc6eb2a19e5aae655775138585 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Tue, 16 Jul 2024 10:10:31 +0300 Subject: [PATCH 71/85] Fix webcam to work with /boot/firmware/octopi.txt path #823 https://github.com/guysoft/CustomPiOS/issues/220 --- .../filesystem/home/root/bin/streamer_select | 6 +++- .../octopi/filesystem/home/root/bin/webcamd | 34 +++++++++++-------- .../root/etc/init.d/change_hostname | 8 ++++- .../root/etc/init.d/change_password | 8 ++++- .../root/usr/local/bin/networkcheck | 6 +++- 5 files changed, 44 insertions(+), 18 deletions(-) diff --git a/src/modules/octopi/filesystem/home/root/bin/streamer_select b/src/modules/octopi/filesystem/home/root/bin/streamer_select index 9d965140..3b6662af 100755 --- a/src/modules/octopi/filesystem/home/root/bin/streamer_select +++ b/src/modules/octopi/filesystem/home/root/bin/streamer_select @@ -3,7 +3,11 @@ # Exit on any error. set -e +CONFIG_FILE=/boot/firmware/octopi.txt +# Fallback for older images +if [ ! -f "${CONFIG_FILE}" ] && [ -f "/boot/octopi.txt" ]; then CONFIG_FILE=/boot/octopi.txt +fi MJPEG_TYPE=mjpeg HLS_TYPE=hls MJPEG_SERVICE=webcamd.service @@ -29,4 +33,4 @@ elif [ "${camera_streamer}" = "${HLS_TYPE}" ]; then else echo "Streamer type '${camera_streamer}' is not supported." exit 1 -fi \ No newline at end of file +fi diff --git a/src/modules/octopi/filesystem/home/root/bin/webcamd b/src/modules/octopi/filesystem/home/root/bin/webcamd index 6185a368..b05f3958 100755 --- a/src/modules/octopi/filesystem/home/root/bin/webcamd +++ b/src/modules/octopi/filesystem/home/root/bin/webcamd @@ -1,29 +1,35 @@ #!/bin/bash -######################################################################## -### DO NOT EDIT THIS FILE TO CHANGE THE CONFIG!!! ### -### ---------------------------------------------------------------- ### -### There is no need to edit this file for changing resolution, ### -### frame rates or any other mjpg-streamer parameters. Please edit ### -### /boot/octopi.txt instead - that's what it's there for! You can ### -### even do this with your Pi powered down by directly accessing the ### -### file when using the SD card as thumb drive in your regular ### -### computer. ### -######################################################################## +############################################################################### +### DO NOT EDIT THIS FILE TO CHANGE THE CONFIG!!! ### +### ----------------------------------------------------------------------- ### +### There is no need to edit this file for changing resolution, ### +### frame rates or any other mjpg-streamer parameters. Please edit ### +### /boot/firmware/octopi.txt instead - that's what it's there for! You can ### +### even do this with your Pi powered down by directly accessing the ### +### file when using the SD card as thumb drive in your regular ### +### computer. ### +############################################################################### MJPGSTREAMER_HOME=/opt/mjpg-streamer MJPGSTREAMER_INPUT_USB="input_uvc.so" MJPGSTREAMER_INPUT_RASPICAM="input_raspicam.so" +CONFIG_FILE=/boot/firmware/octopi.txt +# Fallback for older images +if [ ! -f "${CONFIG_FILE}" ] && [ -f "/boot/octopi.txt" ]; then +CONFIG_FILE=/boot/octopi.txt +fi + brokenfps_usb_devices=("046d:082b" "1908:2310" "0458:708c" "0458:6006" "1e4e:0102" "0471:0311" "038f:6001" "046d:0804" "046d:0994" "0ac8:3450") -config_dir="/boot/octopi.conf.d" +config_dir="${CONFIG_FILE}/octopi.conf.d" echo "Starting up webcamDaemon..." echo "" cfg_files=() -cfg_files+=/boot/octopi.txt +cfg_files+="${CONFIG_FILE}" if [[ -d ${config_dir} ]]; then cfg_files+=( `ls ${config_dir}/*.txt` ) fi @@ -41,7 +47,7 @@ array_assigned_device=() echo "--- Configuration: ----------------------------" for cfg_file in ${cfg_files[@]}; do - # init configuration - DO NOT EDIT, USE /boot/octopi.conf.d/*.txt INSTEAD! + # init configuration - DO NOT EDIT, USE /boot/firmware/octopi.conf.d/*.txt INSTEAD! camera="auto" camera_usb_options="-r 640x480 -f 10" camera_raspi_options="-fps 10" @@ -54,7 +60,7 @@ for cfg_file in ${cfg_files[@]}; do fi usb_options="$camera_usb_options" - # if webcam device is explicitly given in /boot/octopi.txt, save the path of the device + # if webcam device is explicitly given in /boot/firmware/octopi.txt, save the path of the device # to a variable and remove its parameter from usb_options extracted_device=`echo $usb_options | sed 's@.*-d \(/dev/\(video[0-9]\+\|v4l/[^ ]*\)\).*@\1@'` if [ "$extracted_device" != "$usb_options" ] diff --git a/src/modules/octopi/filesystem/root/etc/init.d/change_hostname b/src/modules/octopi/filesystem/root/etc/init.d/change_hostname index 7c5ef568..2eb943d0 100755 --- a/src/modules/octopi/filesystem/root/etc/init.d/change_hostname +++ b/src/modules/octopi/filesystem/root/etc/init.d/change_hostname @@ -11,8 +11,14 @@ . /lib/lsb/init-functions +BOOT_FOLDER=/boot/firmware +# Fallback for older images +if [ ! -f "${CONFIG_FILE}" ] && [ -f "/boot/octopi.txt" ]; then +BOOT_FOLDER=/boot +fi + do_start () { - text_file="/boot/octopi-hostname.txt" + text_file="${BOOT_FOLDER}/octopi-hostname.txt" if [ ! -f "$text_file" ] then exit 0 diff --git a/src/modules/octopi/filesystem/root/etc/init.d/change_password b/src/modules/octopi/filesystem/root/etc/init.d/change_password index 851d3e2b..bcd60409 100755 --- a/src/modules/octopi/filesystem/root/etc/init.d/change_password +++ b/src/modules/octopi/filesystem/root/etc/init.d/change_password @@ -11,8 +11,14 @@ . /lib/lsb/init-functions +BOOT_FOLDER=/boot/firmware +# Fallback for older images +if [ ! -f "${CONFIG_FILE}" ] && [ -f "/boot/octopi.txt" ]; then +BOOT_FOLDER=/boot +fi + do_start () { - text_file="/boot/octopi-password.txt" + text_file="${BOOT_FOLDER}/octopi-password.txt" if [ ! -f "$text_file" ] then exit 0 diff --git a/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck b/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck index a39d5fa4..1ae2b994 100755 --- a/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck +++ b/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck @@ -1,6 +1,10 @@ #!/bin/bash +CONFIG_FILE=/boot/firmware/octopi.txt +# Fallback for older images +if [ ! -f "${CONFIG_FILE}" ] && [ -f "/boot/octopi.txt" ]; then +CONFIG_FILE=/boot/octopi.txt -source /boot/octopi.txt +source "${CONFIG_FILE}" if [ $enable_network_monitor == 1 ] && [ "$destination_host" != "" ]; then From e62bada2c4e91372ace724f7839ab61e34bfb824 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Wed, 17 Jul 2024 09:18:33 +0300 Subject: [PATCH 72/85] Move octoprint python virtualenv to /opt/custompios/oprint and add a symlink --- .../filesystem/home/pi/OctoPrint/README.txt | 2 +- .../octopi/filesystem/home/root/bin/user-fix | 19 +++---------------- .../root/etc/systemd/system/octoprint.service | 4 ++-- .../octopi}/scripts/add-octoprint-checkout | 6 +++--- .../opt/octopi}/scripts/install-desktop | 0 .../pi => root/opt/octopi}/scripts/safemode | 0 .../pi => root/opt/octopi}/scripts/welcome | 2 +- src/modules/octopi/start_chroot_script | 15 +++++++++++---- 8 files changed, 21 insertions(+), 27 deletions(-) rename src/modules/octopi/filesystem/{home/pi => root/opt/octopi}/scripts/add-octoprint-checkout (91%) rename src/modules/octopi/filesystem/{home/pi => root/opt/octopi}/scripts/install-desktop (100%) rename src/modules/octopi/filesystem/{home/pi => root/opt/octopi}/scripts/safemode (100%) rename src/modules/octopi/filesystem/{home/pi => root/opt/octopi}/scripts/welcome (88%) diff --git a/src/modules/octopi/filesystem/home/pi/OctoPrint/README.txt b/src/modules/octopi/filesystem/home/pi/OctoPrint/README.txt index 4214bd8f..48cf310b 100644 --- a/src/modules/octopi/filesystem/home/pi/OctoPrint/README.txt +++ b/src/modules/octopi/filesystem/home/pi/OctoPrint/README.txt @@ -4,4 +4,4 @@ so OctoPi no longer goes that route either. Feel free to manually create a git clone though if you need it (e.g. for branch based updates or on board development): - ~/scripts/add-octoprint-checkout + /opt/octopi/scripts/add-octoprint-checkout diff --git a/src/modules/octopi/filesystem/home/root/bin/user-fix b/src/modules/octopi/filesystem/home/root/bin/user-fix index 09735c9e..356dfc9d 100755 --- a/src/modules/octopi/filesystem/home/root/bin/user-fix +++ b/src/modules/octopi/filesystem/home/root/bin/user-fix @@ -7,7 +7,7 @@ USERID=1000 FIRSTUSER=`getent passwd $USERID | cut -d: -f1` FIRSTUSERHOME=`getent passwd $USERID | cut -d: -f6` -CURRENT=`grep User= /etc/systemd/system/octoprint.service | cut -d= -f2` +CURRENT=$(grep "ALL\=NOPASSWD" /etc/sudoers.d/octoprint-service | cut -d\ -f1) if [ "$CURRENT" = "pi" -a "$FIRSTUSER" != "pi" ]; then # if we get here it means that the first user was renamed but we haven't yet @@ -24,12 +24,6 @@ if [ "$CURRENT" = "pi" -a "$FIRSTUSER" != "pi" ]; then SERVICEUSER=$FIRSTUSER fi - # fix OctoPrint service file - echo "Fixing service file" - sed -i "s!User=pi!User=$SERVICEUSER!g" /etc/systemd/system/octoprint.service - sed -i "s!ExecStart=/home/pi/!ExecStart=$FIRSTUSERHOME/!g" /etc/systemd/system/octoprint.service - systemctl daemon-reload - # fix sudoers files echo "Fixing sudoers" sed -i "s!^pi!$FIRSTUSER!g" /etc/sudoers.d/octoprint-service @@ -37,17 +31,10 @@ if [ "$CURRENT" = "pi" -a "$FIRSTUSER" != "pi" ]; then # fix scripts echo "Fixing scripts" - sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" $FIRSTUSERHOME/scripts/add-octoprint-checkout - sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" $FIRSTUSERHOME/scripts/welcome - sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" $FIRSTUSERHOME/.bashrc + sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" /opt/octopi/scripts/add-octoprint-checkout sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" /root/bin/webcamd - # fix virtualenv - echo "Fixing paths in virtual environment" - cd $FIRSTUSERHOME/oprint - sudo -u $FIRSTUSER $FIRSTUSERHOME/.local/bin/virtualenv-tools --update-path $FIRSTUSERHOME/oprint - # finally, reboot for all of this to actually take affect echo "Adjusted scripts to new user, restarting services..." systemctl reboot -fi \ No newline at end of file +fi diff --git a/src/modules/octopi/filesystem/root/etc/systemd/system/octoprint.service b/src/modules/octopi/filesystem/root/etc/systemd/system/octoprint.service index 07217a3f..656ce446 100644 --- a/src/modules/octopi/filesystem/root/etc/systemd/system/octoprint.service +++ b/src/modules/octopi/filesystem/root/etc/systemd/system/octoprint.service @@ -8,8 +8,8 @@ Environment="HOST=127.0.0.1" Environment="PORT=5000" Environment="REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt" Type=simple -User=pi -ExecStart=/home/pi/oprint/bin/octoprint serve --host=${HOST} --port=${PORT} +User=1000 +ExecStart=/opt/octopi/oprint/bin/octoprint serve --host=${HOST} --port=${PORT} [Install] WantedBy=multi-user.target diff --git a/src/modules/octopi/filesystem/home/pi/scripts/add-octoprint-checkout b/src/modules/octopi/filesystem/root/opt/octopi/scripts/add-octoprint-checkout similarity index 91% rename from src/modules/octopi/filesystem/home/pi/scripts/add-octoprint-checkout rename to src/modules/octopi/filesystem/root/opt/octopi/scripts/add-octoprint-checkout index 8a87651b..d5cfbd7b 100755 --- a/src/modules/octopi/filesystem/home/pi/scripts/add-octoprint-checkout +++ b/src/modules/octopi/filesystem/root/opt/octopi/scripts/add-octoprint-checkout @@ -1,7 +1,7 @@ #!/bin/bash - -OCTOPRINT_FOLDER=/home/pi/OctoPrint -OCTOPRINT_CONFIG=/home/pi/.octoprint/config.yaml +USER_NAME=$(id -nu 1000)' +OCTOPRINT_FOLDER=/home/"${USER_NAME}"/OctoPrint +OCTOPRINT_CONFIG=/home/"${USER_NAME}"/.octoprint/config.yaml if [ "${PWD}" == "${OCTOPRINT_FOLDER}" ]; then echo "Error: you are in the folder: "${OCTOPRINT_FOLDER} diff --git a/src/modules/octopi/filesystem/home/pi/scripts/install-desktop b/src/modules/octopi/filesystem/root/opt/octopi/scripts/install-desktop similarity index 100% rename from src/modules/octopi/filesystem/home/pi/scripts/install-desktop rename to src/modules/octopi/filesystem/root/opt/octopi/scripts/install-desktop diff --git a/src/modules/octopi/filesystem/home/pi/scripts/safemode b/src/modules/octopi/filesystem/root/opt/octopi/scripts/safemode similarity index 100% rename from src/modules/octopi/filesystem/home/pi/scripts/safemode rename to src/modules/octopi/filesystem/root/opt/octopi/scripts/safemode diff --git a/src/modules/octopi/filesystem/home/pi/scripts/welcome b/src/modules/octopi/filesystem/root/opt/octopi/scripts/welcome similarity index 88% rename from src/modules/octopi/filesystem/home/pi/scripts/welcome rename to src/modules/octopi/filesystem/root/opt/octopi/scripts/welcome index 46af4349..e5c748e9 100755 --- a/src/modules/octopi/filesystem/home/pi/scripts/welcome +++ b/src/modules/octopi/filesystem/root/opt/octopi/scripts/welcome @@ -2,7 +2,7 @@ _NAME=$(hostname) _IP=$(hostname -I) -_OCTOPRINT_VERSION=$(/home/pi/oprint/bin/python -c "from octoprint._version import get_versions; print(get_versions()['version'])" || echo "unknown") +_OCTOPRINT_VERSION=$(/opt/octopi/oprint/bin/python -c "from octoprint._version import get_versions; print(get_versions()['version'])" || echo "unknown") _OCTOPI_VERSION=$(cat /etc/octopi_version || echo "unknown") echo diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 300b457a..3deb069b 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -41,17 +41,24 @@ apt-get -y --allow-change-held-packages install python3 python3-virtualenv pytho echo " - Reinstall iputils-ping" apt-get -y --force-yes install --reinstall iputils-ping -pushd /home/"${BASE_USER}" +# Path is hardcoded systemd service, this is not configurable +OCTOPI_OPT_FOLDER=/opt/octopi +mkdir -p "${OCTOPI_OPT_FOLDER}" +chown "${BASE_USER}":"${BASE_USER}" "${OCTOPI_OPT_FOLDER}" +OCTOPI_OCTOPRINT_FOLDER="${OCTOPI_OPT_FOLDER}"/oprint +ln -s "${OCTOPI_OCTOPRINT_FOLDER}" /home/"${BASE_USER}"/oprint +PIP="${OCTOPI_OCTOPRINT_FOLDER}"/bin/pip +pushd "${OCTOPI_OPT_FOLDER}" # build virtualenv sudo -u "${BASE_USER}" python3 -m virtualenv --python=python3 oprint - sudo -u "${BASE_USER}" /home/"${BASE_USER}"/oprint/bin/pip install --upgrade pip + sudo -u "${BASE_USER}" "${PIP}" install --upgrade pip # OctoPrint if [ "$OCTOPI_INCLUDE_OCTOPRINT" == "yes" ] then echo "--- Installing OctoPrint" - PIP_DEFAULT_TIMEOUT=60 sudo -u "${BASE_USER}" /home/"${BASE_USER}"/oprint/bin/pip install $OCTOPI_OCTOPRINT_PACKAGE + PIP_DEFAULT_TIMEOUT=60 sudo -u "${BASE_USER}" "${PIP}" install $OCTOPI_OCTOPRINT_PACKAGE fi #mjpg-streamer @@ -240,7 +247,7 @@ EOT echo 'exit 0' >> /etc/rc.local # add a longer welcome text to ~pi/.bashrc / ~${BASE_USER}/.bashrc -echo "source /home/${BASE_USER}/scripts/welcome" >> /home/${BASE_USER}/.bashrc +echo "source /opt/octopi/scripts/welcome" >> /home/${BASE_USER}/.bashrc #unpack root in the end, so etc file are not overwritten, might need to add two roots int he future unpack /filesystem/root / From 0cf9e406c3454d399ef24adf19919571003801fa Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Tue, 5 Nov 2024 16:59:15 +0200 Subject: [PATCH 73/85] Update github action upload version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97238fb2..75b9eb1c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,7 +59,7 @@ jobs: echo "::set-output name=image::$IMAGE" # artifact upload will take care of zipping for us - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 if: github.event_name == 'schedule' with: name: ${{ steps.copy.outputs.image }} From c4946585c374eaa4b78ab7b0a4963247b2c84cac Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Tue, 5 Nov 2024 17:17:47 +0200 Subject: [PATCH 74/85] Add python3-git dependency for CustomPiOS v2 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 75b9eb1c..045ddc35 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: - name: Install Dependencies run: | sudo apt update - sudo apt install coreutils p7zip-full qemu-user-static + sudo apt install coreutils p7zip-full qemu-user-static python3-git - name: Checkout CustomPiOS uses: actions/checkout@v2 From 7312c72ada6014e74a6a75e58db419d037865fe8 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sat, 14 Dec 2024 22:45:37 +0200 Subject: [PATCH 75/85] Update to use wifi.nmconnection which is the current wifi setting file --- src/modules/octopi/filesystem/boot/octopi-network.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/octopi/filesystem/boot/octopi-network.txt b/src/modules/octopi/filesystem/boot/octopi-network.txt index 85c4c0b1..7df0ba02 100644 --- a/src/modules/octopi/filesystem/boot/octopi-network.txt +++ b/src/modules/octopi/filesystem/boot/octopi-network.txt @@ -1,3 +1,3 @@ # Using this file to configure your network connection is no longer supported. # -# Please use octopi-wpa-supplicant.txt instead. +# Please use wifi.nmconnection instead. From df10e1ee63d445f44ca25d14d7425c07cc7a5aa4 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sat, 14 Dec 2024 22:50:32 +0200 Subject: [PATCH 76/85] Use apt_update_skip --- src/modules/octopi/start_chroot_script | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 3deb069b..84bf3634 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -28,8 +28,7 @@ unpack /filesystem/home/pi /home/"${BASE_USER}" "${BASE_USER}" unpack /filesystem/home/root /root root unpack /filesystem/boot /boot/firmware -apt-get update - +apt_update_skip # in case we are building from a regular raspbian image instead of the lite one... remove_extra=$(remove_if_installed scratch squeak-plugins-scratch squeak-vm wolfram-engine python-minecraftpi minecraft-pi sonic-pi oracle-java8-jdk bluej libreoffice-common libreoffice-core freepats greenfoot nodered) echo "removing:" $remove_extra From 252e4f10b31a4251687213b1b4770a5e2c5845aa Mon Sep 17 00:00:00 2001 From: david-forster10 Date: Sun, 29 Dec 2024 14:10:35 +0000 Subject: [PATCH 77/85] Adding missing if closing statement Service is continually failing for an "unexpected end of file" error, adding in a missing if closing to resolve error --- src/modules/octopi/filesystem/root/usr/local/bin/networkcheck | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck b/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck index 1ae2b994..234f9557 100755 --- a/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck +++ b/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck @@ -2,7 +2,8 @@ CONFIG_FILE=/boot/firmware/octopi.txt # Fallback for older images if [ ! -f "${CONFIG_FILE}" ] && [ -f "/boot/octopi.txt" ]; then -CONFIG_FILE=/boot/octopi.txt + CONFIG_FILE=/boot/octopi.txt +fi source "${CONFIG_FILE}" From 430a00eba263cc31c92638b9a2676509956fb366 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 26 Jan 2025 11:06:41 +0200 Subject: [PATCH 78/85] Update path to install-desktop https://github.com/guysoft/OctoPi/issues/842#issuecomment-2614284882 See https://github.com/guysoft/OctoPi/issues/842#issuecomment-2614284882 --- src/modules/octopi/filesystem/root/opt/octopi/scripts/welcome | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/octopi/filesystem/root/opt/octopi/scripts/welcome b/src/modules/octopi/filesystem/root/opt/octopi/scripts/welcome index e5c748e9..7bc503ca 100755 --- a/src/modules/octopi/filesystem/root/opt/octopi/scripts/welcome +++ b/src/modules/octopi/filesystem/root/opt/octopi/scripts/welcome @@ -34,7 +34,7 @@ then echo "required for running OctoPrint. If you want a desktop environment you can " echo "install it via" echo - echo " sudo /home/pi/scripts/install-desktop" + echo " sudo /opt/octopi/scripts/install-desktop" fi echo "------------------------------------------------------------------------------" From 0625f339b8b53f27882f4468d938a1ac797b8923 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 26 Jan 2025 11:09:04 +0200 Subject: [PATCH 79/85] Update comment --- src/modules/octopi/start_chroot_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 84bf3634..a7e17d28 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -215,7 +215,7 @@ sed -i "s@secure_path=\"@secure_path=\"/root/bin:@g" /etc/sudoers chmod +x /root/bin/git # add some "How To" info to boot output -# Note, this code is also in /filesystem/home/pi/scripts/ +# Note, this code is also in /filesystem/root/opt/octopi/scripts sed -i 's@exit 0@@' /etc/rc.local cat <<'EOT' >> /etc/rc.local From ea5d502bff7936ffabbf8f1cab54ab9fd26ab929 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 2 Feb 2025 22:39:22 +0200 Subject: [PATCH 80/85] Revert "Add a network monitoring for wifi connections" https://github.com/guysoft/OctoPi/issues/842#issuecomment-2609315390 reverts 432e02f625bf07775cb7e8bb5bde819e45300c22 --- src/modules/octopi/filesystem/boot/octopi.txt | 10 ---- .../etc/systemd/system/networkcheck.service | 8 --- .../etc/systemd/system/networkcheck.timer | 10 ---- .../root/usr/local/bin/networkcheck | 56 ------------------- src/modules/octopi/start_chroot_script | 4 -- 5 files changed, 88 deletions(-) delete mode 100644 src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.service delete mode 100644 src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.timer delete mode 100755 src/modules/octopi/filesystem/root/usr/local/bin/networkcheck diff --git a/src/modules/octopi/filesystem/boot/octopi.txt b/src/modules/octopi/filesystem/boot/octopi.txt index 2411171d..bf348dcc 100644 --- a/src/modules/octopi/filesystem/boot/octopi.txt +++ b/src/modules/octopi/filesystem/boot/octopi.txt @@ -57,16 +57,6 @@ #camera_http_webroot="./www-octopi" #camera_http_options="-n" -# Configuration of network monitoring -# -# This enables network monitoring for wifi connections with a simple ping test. -# If connection terminates by variable reasons system tries to restart the wifi connection to reestablish a connection. -# The connection test is done every minute. -# By default it is disabled (0 = off / 1 = on) -# destination_host can be an ip address or a hostname (for hostname ensure dns resosultion is working correctly) -enable_network_monitor=0 -destination_host=192.168.1.1 - ### EXPERIMENTAL # Support for different streamer types. # diff --git a/src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.service b/src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.service deleted file mode 100644 index ec4a008e..00000000 --- a/src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] - Description=Network Monitor - ConditionPathExists=/usr/local/bin/networkcheck - -[Service] - User=root - Type=simple - ExecStart=/usr/local/bin/networkcheck & diff --git a/src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.timer b/src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.timer deleted file mode 100644 index 940694fe..00000000 --- a/src/modules/octopi/filesystem/root/etc/systemd/system/networkcheck.timer +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] - Description=Network Monitor Trigger (every 1 minutes) - After=network.target - -[Timer] - OnCalendar=*-*-* *:*:00 - AccuracySec=1s - -[Install] - WantedBy=timers.target diff --git a/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck b/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck deleted file mode 100755 index 234f9557..00000000 --- a/src/modules/octopi/filesystem/root/usr/local/bin/networkcheck +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -CONFIG_FILE=/boot/firmware/octopi.txt -# Fallback for older images -if [ ! -f "${CONFIG_FILE}" ] && [ -f "/boot/octopi.txt" ]; then - CONFIG_FILE=/boot/octopi.txt -fi - -source "${CONFIG_FILE}" - -if [ $enable_network_monitor == 1 ] && [ "$destination_host" != "" ]; then - - if [ -f /boot/octopi-wpa-supplicant.txt ]; then # check if config file exists - input="/boot/octopi-wpa-supplicant.txt" - while IFS= read -r line; do # read config file line by line - if [[ $line =~ ^network=.* ]]; then # check if we have a network config if a line starts with "network=" - echo "network config found..." - ping -c4 $destination_host > /dev/null # check if destination is reachable - possible by default the router - if [ $? != 0 ]; then - echo "Destination not reachable - reconfigure interface..." - sudo wpa_cli -i wlan0 reconfigure # reconfigure network to trigger reconnect - sudo dhclient -v # ensure connection will be established by refresh dhcp lease - echo "Reconnect done." - exit 0 # if we detect multiple network configs exit after 1st one - one reconnect is enough :-) - else - echo "Destination reachable - no action needed." - exit 0 # destination reached - exit loop - fi - fi - done < "$input" - fi - - if [ -f /etc/wpa_supplicant/wpa_supplicant.conf ]; then # check if config file exists - input="/etc/wpa_supplicant/wpa_supplicant.conf" - while IFS= read -r line; do # read config file line by line - if [[ $line =~ ^network=.* ]]; then # check if we have a network config if a line starts with "network=" - echo "network config found..." - ping -c4 $destination_host > /dev/null # check if destination is reachable - possible by default the router - if [ $? != 0 ]; then - echo "Destination not reachable - reconfigure interface..." - sudo wpa_cli -i wlan0 reconfigure # reconfigure network to trigger reconnect - sudo dhclient -v # ensure connection will be established by refresh dhcp lease - echo "Reconnect done." - exit 0 # if we detect multiple network configs exit after 1st one - one reconnect is enough :-) - else - echo "Destination reachable - no action needed." - exit 0 # destination reached - exit loop - fi - fi - done < "$input" - fi - - echo "Network configuration not found" - exit 1 -else - echo "Network monitoring not enabled." -fi diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index a7e17d28..b1679d42 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -330,10 +330,6 @@ systemctl_if_exists enable ffmpeg_hls.service systemctl_if_exists enable wifi_powersave@off.service -### Network monitoring - -systemctl_if_exists enable networkcheck.timer - ### Firmare flashing echo "--- Installing avrdude" From d51ea4f172571a591683cf42e51b92850ccc230c Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 23 Feb 2025 16:55:34 +0200 Subject: [PATCH 81/85] Update raspbian.org old url to rpi os. Also mention le potato --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 78b0bd49..bf82efc4 100644 --- a/README.rst +++ b/README.rst @@ -7,7 +7,7 @@ OctoPi A `Raspberry Pi `_ distribution for 3d printers. It includes the `OctoPrint `_ host software for 3d printers out of the box and `mjpg-streamer with RaspiCam support `_ for live viewing of prints and timelapse video creation. -This repository contains the source script to generate the distribution out of an existing `Raspbian `_ distro image. +This repository contains the source script to generate the distribution out of an existing `Raspberry Pi OS `_ distro image or `Le Potato AML-S905X-CC `_ (currenly in beta). Where to get it? ---------------- From 2f27bdfb3d4ca88888f153f23b0d4902ec747815 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Sun, 23 Feb 2025 21:44:10 +0200 Subject: [PATCH 82/85] Fix links to https and raspian links fixes #845 --- README.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index bf82efc4..4b702234 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ OctoPi .. :scale: 50 % .. :alt: OctoPi logo -A `Raspberry Pi `_ distribution for 3d printers. It includes the `OctoPrint `_ host software for 3d printers out of the box and `mjpg-streamer with RaspiCam support `_ for live viewing of prints and timelapse video creation. +A `Raspberry Pi `_ distribution for 3d printers. It includes the `OctoPrint `_ host software for 3d printers out of the box and `mjpg-streamer with RaspiCam support `_ for live viewing of prints and timelapse video creation. This repository contains the source script to generate the distribution out of an existing `Raspberry Pi OS `_ distro image or `Le Potato AML-S905X-CC `_ (currenly in beta). @@ -21,9 +21,9 @@ Official mirror is `here `_ Second mirror is `here `_ -Nightly builds are available `here `_ +Nightly builds are available `here `_ -64bit Nightly builds are available `here `_ +64bit Nightly builds are available `here `_ You can also access the nightly builds raspberrypi imager channel by running:: @@ -59,8 +59,8 @@ If a USB webcam or the Raspberry Pi camera is detected, MJPG-streamer will be st Features -------- -* `OctoPrint `_ host software for 3d printers out of the box -* `Raspbian `_ tweaked for maximum performance for printing out of the box +* `OctoPrint `_ host software for 3d printers out of the box +* `Raspberry Pi OS `_ tweaked for maximum performance for printing out of the box * `mjpg-streamer with RaspiCam support `_ for live viewing of prints and timelapse video creation. Developing @@ -69,19 +69,19 @@ Developing Requirements ~~~~~~~~~~~~ -#. `qemu-arm-static `_ +#. `qemu-arm-static `_ #. `CustomPiOS `_ -#. Downloaded `Raspbian `_ image. +#. Downloaded `Raspberry Pi OS `_ image. #. root privileges for chroot #. Bash #. git #. sudo (the script itself calls it, running as root without sudo won't work) #. jq (part of CustomPiOS dependencies) -Build OctoPi From within OctoPi / Raspbian / Debian / Ubuntu +Build OctoPi From within OctoPi / Raspberry Pi OS / Debian / Ubuntu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -OctoPi can be built from Debian, Ubuntu, Raspbian, or even OctoPi. +OctoPi can be built from Debian, Ubuntu, Raspberry Pi OS, or even OctoPi. Build requires about 2.5 GB of free space available. You can build it by issuing the following commands:: @@ -148,7 +148,7 @@ To build a variant on the machine simply run:: Usage ~~~~~ -#. If needed, override existing config settings by creating a new file ``src/config.local``. You can override all settings found in ``src/modules/octopi/config``. If you need to override the path to the Raspbian image to use for building OctoPi, override the path to be used in ``ZIP_IMG``. By default the most recent file matching ``*-raspbian.zip`` found in ``src/image`` will be used. +#. If needed, override existing config settings by creating a new file ``src/config.local``. You can override all settings found in ``src/modules/octopi/config``. If you need to override the path to the Raspberry Pi OS image to use for building OctoPi, override the path to be used in ``ZIP_IMG``. By default the most recent file matching ``*-raspios*.xz`` found in ``src/image`` will be used. #. Run ``src/build_dist`` as root. #. The final image will be created at the ``src/workspace`` From bf506863e3b8d7c5fc7b7e1026aa25c5dd33931a Mon Sep 17 00:00:00 2001 From: jneilliii Date: Thu, 27 Feb 2025 19:25:52 -0500 Subject: [PATCH 83/85] switch to modern OS dependencies for latest numpy versions --- src/modules/octopi/start_chroot_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index b1679d42..4c594815 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -35,7 +35,7 @@ echo "removing:" $remove_extra apt-get remove -y --purge $remove_extra apt-get autoremove -y -apt-get -y --allow-change-held-packages install python3 python3-virtualenv python3-dev git screen subversion cmake cmake-data avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev libatlas3-base unzip +apt-get -y --allow-change-held-packages install python3 python3-virtualenv python3-dev git screen subversion cmake cmake-data avahi-daemon libavahi-compat-libdnssd1 libffi-dev libssl-dev unzip libopenblas0-pthread libgfortran5 echo " - Reinstall iputils-ping" apt-get -y --force-yes install --reinstall iputils-ping From 18a668228acc02d74931ad401a86262a35a43a57 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Wed, 19 Mar 2025 00:35:26 +0200 Subject: [PATCH 84/85] Disable hard-coded mirror --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 045ddc35..8deaf620 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,9 +37,9 @@ jobs: cd repository/src ../../CustomPiOS/src/update-custompios-paths - - name: Force apt mirror to work around intermittent mirror hiccups - run: | - echo "OCTOPI_APTMIRROR=http://mirror.us.leaseweb.net/raspbian/raspbian" > repository/src/config.local + # - name: Force apt mirror to work around intermittent mirror hiccups + # run: | + # echo "OCTOPI_APTMIRROR=http://mirror.us.leaseweb.net/raspbian/raspbian" > repository/src/config.local - name: Build Image run: | From a21b8665f9baaea6b1b97fbc37a0bc04ec923787 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Thu, 27 Mar 2025 14:21:33 +0200 Subject: [PATCH 85/85] Update that network file to edit is wifi.nmconnection --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 4b702234..5da3f5cd 100644 --- a/README.rst +++ b/README.rst @@ -37,7 +37,7 @@ How to use it? -------------- #. Unzip the image and install it to an sd card `like any other Raspberry Pi image `_ -#. Configure your WiFi by editing ``octopi-wpa-supplicant.txt`` on the root of the flashed card when using it like a thumb drive +#. Configure your WiFi by editing ``wifi.nmconnection`` on the root of the flashed card when using it like a thumb drive #. Boot the Pi from the card #. Log into your Pi via SSH (it is located at ``octopi.local`` `if your computer supports bonjour `_ or the IP address assigned by your router), default username is "pi", default password is "raspberry". Run ``sudo raspi-config``. Once that is open: