Closed stormbard closed 2 years ago
I suggest you post to https://community.octoprint.org/ It might depend on which camera you are using and I have no way of testing it here on my end without the hardware.
Posted there. Forgot to mention I am using the Raspberry Pi Camera v2.
Ok, closing since its not an OctoPi installation
I think this is an issue in OctoPi as the webcamd service is packaged with the OS. Instead of installing it to an SD card it is netbooted. I took the octopi image file and then extracted it out onto my PXE server and configured the Pi to boot from that. If a service is going to depend on a config file it should make sure it is there before starting. Due to the parallel nature of systemd boot process that gets more complicated but it can be handled.
I added the following ExecStartPre=/usr/bin/test -f /boot/octopi.txt
to /etc/systemd/system/webcamd.service
under the [Service]
section and that has resolved my issue. Full edited unit file below.
[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
ExecStartPre=/usr/bin/test -f /boot/octopi.txt
ExecStart=/root/bin/webcamd
Restart=always
Type=forking
RestartSec=1
[Install]
WantedBy=multi-user.target
Ok, If you want to add better features to OctoPi that is a different matter. I hope you understand though that I can't really support OctoPi components that are ripped out of the image and placed somewhere else.
Would you like to add a PR to the line ExecStartPre=/usr/bin/test -f /boot/octopi.txt
?
What were you doing?
Trying to setup Raspberry Pi Camera and the settings in that file are not being used. If I wait until the system is up and then restart the webcamd service the settings in octopi.txt are used.
I netboot my RPi4. Since octopi.txt lives on the boot partition which is mounted; I can only assume, after webcamd starts the settings aren't used.
sudo systemctl restart webcamd
and setting in file are usedWhat did you expect to happen?
Webcam settings in octopi.txt to be used when starting up.
What happened instead?
Default settings were used instead at boot and had to manually restart webcamd to get the desired ones.
Did the same happen when running OctoPrint in safe mode?
Yes, same thing happened when I booted with OctoPrint safe mode enabled.
Version of OctoPi
Printer model & used firmware incl. version
N/A
Screenshot(s)/video(s) showing the problem:
Attached is the octopi.txt and webcamd log file. In the log file the first start of webcamd is on boot and the second is after I manually restarted it.
webcamd.log octopi.txt
I have read the FAQ.