diff --git a/os/forklift/forklift-pallet-version b/os/forklift/forklift-pallet-version index 4a27619a0..a21a484d4 100644 --- a/os/forklift/forklift-pallet-version +++ b/os/forklift/forklift-pallet-version @@ -1 +1 @@ -a4ec796 +3776e964ba612ea88edb9afc92969c165735afff diff --git a/os/python-hardware-controller/etc/systemd/system/planktoscope-org.segmenter.service b/os/python-hardware-controller/etc/systemd/system/planktoscope-org.segmenter.service new file mode 100644 index 000000000..baf1f7000 --- /dev/null +++ b/os/python-hardware-controller/etc/systemd/system/planktoscope-org.segmenter.service @@ -0,0 +1,19 @@ +[Unit] +Description=Run the PlanktoScope segmenter +# Wait for Forklift to bring up mosquitto, in case the segmenter needs to start after mosquitto +Wants=forklift-apply.service +After=forklift-apply.service +# Start after Node-RED so that Node-RED can catch all MQTT messages emitted at startup +After=nodered.service + +[Service] +Type=simple +Environment=HOME=/home/pi +Environment=SEGMENTER_PIPELINE_SUBTRACT_CONSECUTIVE_MASKS=true +WorkingDirectory=/home/pi/PlanktoScope/segmenter +ExecStart=/home/pi/.local/bin/poetry run python -u main.py +User=pi +Group=pi + +[Install] +WantedBy=multi-user.target diff --git a/os/python-hardware-controller/install.sh b/os/python-hardware-controller/install.sh index dd4daba77..1eee20951 100755 --- a/os/python-hardware-controller/install.sh +++ b/os/python-hardware-controller/install.sh @@ -18,7 +18,7 @@ pipx install poetry==2.1.3 pipx ensurepath PATH="$PATH:/home/pi/.local/bin" -# Set up the hardware controllers +# Set up the hardware controller sudo -E apt-get install -y --no-install-recommends -o Dpkg::Progress-Fancy=0 \ i2c-tools libopenjp2-7 python3-picamera2 poetry --directory "$HOME/PlanktoScope/controller" install \ @@ -26,3 +26,10 @@ poetry --directory "$HOME/PlanktoScope/controller" install \ file="/etc/systemd/system/planktoscope-org.controller.service" sudo cp "$config_files_root$file" "$file" sudo systemctl enable "planktoscope-org.controller.service" + +# Set up the segmenter +poetry --directory "$HOME/PlanktoScope/segmenter" install \ + --compile +file="/etc/systemd/system/planktoscope-org.segmenter.service" +sudo cp "$config_files_root$file" "$file" +sudo systemctl enable "planktoscope-org.segmenter.service" diff --git a/segmenter/README.md b/segmenter/README.md index 6456606f5..e88ed9ea0 100644 --- a/segmenter/README.md +++ b/segmenter/README.md @@ -22,13 +22,10 @@ Install all dependencies including development tooling: poetry install --with dev ``` -Start controller for development: +Start segmenter for development: ```sh -docker ps -# copy the container id of the segmenter -docker stop - +sudo systemctl stop planktoscope-org.segmenter.service poetry run python -u main.py # make changes and restart ``` @@ -51,7 +48,7 @@ We recommand using [https://code.visualstudio.com/docs/remote/ssh](https://code. To use this project, you'll need: -- Python >= 3.9 +- Python >= 3.11.2 - Poetry 2.1.3 ## Licensing diff --git a/segmenter/apt-packages b/segmenter/apt-packages index c5d47e117..8e67f18d4 100644 --- a/segmenter/apt-packages +++ b/segmenter/apt-packages @@ -1,6 +1,3 @@ -# numpy/scipy dependencies -libatomic1 - # opencv dependencies libopenjp2-7 libavcodec59