-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] TSD fails to control webcam service on Arch ALARM #164
Comments
Thank you so much for this detailed bug report. Did you receive the premium streaming after the workaround was implemented? The premium streaming is very specific to Raspbian. So if the workaround won't make the premium streaming work on Arch Linux, the right fix is to make sure we don't try to start the premium streaming unless we are sure the OS is Raspbian. |
I don't think the premium streaming is working, unfortunately, however this may have more to do with my use of Python 3.10 than anything else. The plugin status page reports "Webcam streaming: Premium (compatibility)," however I can't see the webcam when not printing and I am getting the basic 1 frame every ten seconds or so. I'm not sure if this is related to Arch ALARM itself or just to my particular configuration, but (I believe) the relevant log lines are these:
Additionally, I get a whole bunch of the following errors while printing. This is almost certainly a Python 3.10 issue. Just adding it here for context:
It would probably be more helpful if someone else with an ALARM setup, but who is running an older version of Python, could check and see if they are able to use Premium streaming with this workaround. |
So I believe the right fix is change the code to test if TSD is running in a Raspbian and if not, disable the premium streaming (janus) altogether. @encetamasb Is this is something you can do? The |
Steps to reproduce the behavior:
OS: Arch Linux ALARM - 5.15.32-3-rpi-ARCH
The Problem
The TSD plugin attempts to stop/start the webcam service using
sudo service webcamd stop/start
, which is not a command that exists on Arch Linux. This is handled by the following lines of code:https://github.com/TheSpaghettiDetective/OctoPrint-TheSpaghettiDetective/blob/379fd59f017e2efcf491e52ac54c5c797e2337f8/octoprint_thespaghettidetective/webcam_stream.py#L141
https://github.com/TheSpaghettiDetective/OctoPrint-TheSpaghettiDetective/blob/379fd59f017e2efcf491e52ac54c5c797e2337f8/octoprint_thespaghettidetective/webcam_stream.py#L188
https://github.com/TheSpaghettiDetective/OctoPrint-TheSpaghettiDetective/blob/379fd59f017e2efcf491e52ac54c5c797e2337f8/octoprint_thespaghettidetective/webcam_stream.py#L308
Everything seems to work just fine when running the webcam stream separately, so this is not a critical issue. It does mean that TSD has no control over starting / stopping the webcam stream though.
It looks like
uname()
is already pulled inget_tags()
, which could be used to check for Arch Linux:I believe '-ARCH' in the version is unique to Arch Linux. When I have time to set up a fork of TSD I may attempt a PR for this.
In the meantime...
The Workaround
The main point of filing this issue is to share a workaround for any other ALARM users out there. The following works for me:
Step 1
Create
/etc/systemd/system/webcamd.service
, or rename existing webcam service to "webcamd.service"E.g.,
~$ cat /etc/systemd/system/webcamd.service
Step 2
Create
/usr/sbin/service
~$ sudo touch /usr/sbin/service
~$ sudo chmod +x /usr/sbin/service
This is just a shell script that maps from
service ACTION UNIT
tosystemctl UNIT ACTION
, e.g.,Step 3
TSD (or Octoprint? Not sure...) appears to install a sudoers config file at
/etc/sudoers.d/octoprint-service
, with the following content:~$ cat /etc/sudoers.d/octoprint-service
So if your Octoprint instance runs under the user 'pi' you can skip this step.
If not, you'll need to add these commands to your
sudoers
file. For example, if Octoprint runs under groupoctoprint
:Step 4
Restart your Pi and make sure the errors are gone.
The text was updated successfully, but these errors were encountered: