#need to save and restart crownset.conf for loading webcam (logi c270)

86 messages · Page 1 of 1 (latest)

fair crag
calm nimbus
#

Fix your tags #readme

obsidian burrow
#

I'm assuming the first is a successful load and the second a failure? Based on the file names this is the case. The second indicates that it can't bind to port 8080

#

So, when it fails to start, before restarting it. Provide the output of:

sudo netstat -ntlp
fair crag
calm nimbus
fair crag
#

ouch how i can put in code format ?

calm nimbus
#

Triple ` before and after the message

fair crag
# obsidian burrow So, when it fails to start, _before_ restarting it. Provide the output of: ```...
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      2879/ustreamer
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      2316/nginx: master
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      2498/systemd-resolv
tcp        0      0 0.0.0.0:7125            0.0.0.0:*               LISTEN      1984/python
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2321/sshd: /usr/sbi
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      3315/sshd: pi@pts/1
tcp6       0      0 :::22                   :::*                    LISTEN      2321/sshd: /usr/sbi
tcp6       0      0 ::1:6010                :::*                    LISTEN      3315/sshd: pi@pts/1````
#

thanks

obsidian burrow
#

that says there's an existing ustreamer process on 8080

calm nimbus
fair crag
#

after actualy my cam work, I'm going to repeat this after reboot printer

#
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      2315/nginx: master
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      2497/systemd-resolv
tcp        0      0 0.0.0.0:7125            0.0.0.0:*               LISTEN      1994/python
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2323/sshd: /usr/sbi
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      2621/sshd: pi@pts/1
tcp6       0      0 :::22                   :::*                    LISTEN      2323/sshd: /usr/sbi
tcp6       0      0 ::1:6010                :::*                    LISTEN      2621/sshd: pi@pts/1
#

not the same when reboot printer nginx = network error ? 😆 @calm nimbus @obsidian burrow

obsidian burrow
#

can we get the corresponding crowsnest log

fair crag
#
[07/10/23 23:39:49] crowsnest: DEBUG: ustreamer [cam logic270]: -- ERROR [18.009      main] -- Can't bind HTTP on [127.0.0.1]:8080: Success
[07/10/23 23:39:49] crowsnest: ERROR: Start of ustreamer [cam logic270] failed!
[07/10/23 23:39:51] crowsnest:  ... Done!
#

the problem seems to come from this no ? (getaddrinfo)

obsidian burrow
#

I believe it is starting too fast

#

before the network has started and thus it's not able to do address resolution

#

looking for a clean way to fix it

#

can you provide the output of:

systemctl cat crowsnest.service
fair crag
#

ok i see ...

fair crag
# obsidian burrow I believe it is starting too fast
# /etc/systemd/system/crowsnest.service
#### crowsnest - A webcam Service for multiple Cams and Stream Services.
####
#### Written by Stephan Wendel aka KwadFan <[email protected]>
#### Copyright 2021 - 2022
#### https://github.com/mainsail-crew/crowsnest
####
#### This File is distributed under GPLv3
####

[Unit]
Description=crowsnest - Multi Webcam/Streamer Control Deamon
Documentation=https://github.com/mainsail-crew/crowsnest
After=udev.service network-online.target nss-lookup.target
Wants=udev.service network-online.target
Before=nginx.service
StartLimitBurst=10
StartLimitIntervalSec=180

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
User=pi
RemainAfterExit=Yes
WorkingDirectory=/home/pi/crowsnest
EnvironmentFile=/home/pi/printer_data/systemd/crowsnest.env
ExecStart=/usr/local/bin/crowsnest $CROWSNEST_ARGS
Restart=on-failure
RestartSec=5
obsidian burrow
#

these lines should ensure that networking has started:

After=udev.service network-online.target nss-lookup.target
Wants=udev.service network-online.target
#

I have something for you to try

fair crag
#

so that's not where the problem lies, ouch

obsidian burrow
#

we'll create what is known as an override for the systemd service definition.

sudo systemctl edit crowsnest.service

Then in the top section add this:

### Editing /etc/systemd/system/crowsnest.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file

[Service]
ExecStartPre=/bin/sleep 30

### Lines below this comment will be discarded
fair crag
obsidian burrow
#

this will create a 30 second delay in starting crowsnest... should be more than enough time for anything that is slow starting

#

if this works, the amount of delay can be reduced

fair crag
obsidian burrow
#

You shouldn't get a permission denied if you started the command with SUDO

fair crag
#

i reeboot printer and cam don't start enough

obsidian burrow
#

Yes that should be correct. You can verify that it created the file correctly with:

systemctl cat crowsnest.service
fair crag
obsidian burrow
#

can you provide the full output?

#

and the output of:

ls -l /etc/systemd/system/
ls -l /etc/systemd/system/crowsnest.service.d
fair crag
#

yes

#

thath long

#

first : ```pi@speeder-pad:~$ systemctl cat crowsnest.service

/etc/systemd/system/crowsnest.service

crowsnest - A webcam Service for multiple Cams and Stream Services.

Written by Stephan Wendel aka KwadFan [email protected]

Copyright 2021 - 2022

https://github.com/mainsail-crew/crowsnest

This File is distributed under GPLv3

[Unit]
Description=crowsnest - Multi Webcam/Streamer Control Deamon
Documentation=https://github.com/mainsail-crew/crowsnest
After=udev.service network-online.target nss-lookup.target
Wants=udev.service network-online.target
Before=nginx.service
StartLimitBurst=10
StartLimitIntervalSec=180

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
User=pi
RemainAfterExit=Yes
WorkingDirectory=/home/pi/crowsnest

pi@speeder-pad:~$ sudo systemctl edit crowsnest.service
Editing "/etc/systemd/system/crowsnest.service.d/override.conf" canceled: temporary file is empty.
pi@speeder-pad:~$ systemctl cat crowsnest.service

/etc/systemd/system/crowsnest.service

crowsnest - A webcam Service for multiple Cams and Stream Services.

Written by Stephan Wendel aka KwadFan [email protected]

Copyright 2021 - 2022

https://github.com/mainsail-crew/crowsnest

This File is distributed under GPLv3

[Unit]
Description=crowsnest - Multi Webcam/Streamer Control Deamon
Documentation=https://github.com/mainsail-crew/crowsnest
After=udev.service network-online.target nss-lookup.target
Wants=udev.service network-online.target
Before=nginx.service
StartLimitBurst=10
StartLimitIntervalSec=180

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
User=pi
RemainAfterExit=Yes
WorkingDirectory=/home/pi/crowsnest
lines 1-27

obsidian burrow
#

"/etc/systemd/system/crowsnest.service.d/override.conf" canceled: temporary file is empty.

#

seems the file didn't get written to

fair crag
#
-rw-r--r-- 1 root root  381 Jan 10 20:54 KlipperScreen.service
lrwxrwxrwx 1 root root    9 Oct 19  2022 ModemManager -> /dev/null
-rwxr-xr-x 1 root root   97 Feb 27  2022 bt-attach.service
-rw-r--r-- 1 root root  826 Jul 10 22:07 crowsnest.service
drwxr-xr-x 2 root root 1024 Jul 11 17:50 crowsnest.service.d
lrwxrwxrwx 1 root root   42 Feb 27  2022 dbus-fi.w1.wpa_supplicant1.service -> /lib/systemd/system/wpa_supplicant.service
lrwxrwxrwx 1 root root   40 Feb 27  2022 dbus-org.freedesktop.Avahi.service -> /lib/systemd/system/avahi-daemon.service
lrwxrwxrwx 1 root root   44 Feb 27  2022 dbus-org.freedesktop.resolve1.service -> /lib/systemd/system/systemd-resolved.service
lrwxrwxrwx 1 root root   45 Feb 27  2022 dbus-org.freedesktop.timesync1.service -> /lib/systemd/system/systemd-timesyncd.service
drwxr-xr-x 2 root root 1024 Aug 19  2021 default.target.wants
drwxr-xr-x 2 root root 1024 Feb 27  2022 getty.target.wants
drwxr-xr-x 2 root root 1024 Oct 19  2022 graphical.target.wants
-rw-r--r-- 1 root root  403 Jan 10 20:19 klipper.service
-rw-r--r-- 1 root root  392 Jun 26 18:03 moonraker-obico.service
-rw-r--r-- 1 root root  462 Jan 10 20:38 moonraker.service
drwxr-xr-x 2 root root 1024 Jun 26 18:03 multi-user.target.wants
drwxr-xr-x 2 root root 1024 Feb 27  2022 paths.target.wants
drwxr-xr-x 2 root root 1024 Oct 19  2022 sockets.target.wants
lrwxrwxrwx 1 root root   31 Feb 27  2022 sshd.service -> /lib/systemd/system/ssh.service
drwxr-xr-x 2 root root 1024 Feb 27  2022 sysinit.target.wants
-rw-r--r-- 1 root root  365 Jul 30  2022 timelapse.service
drwxr-xr-x 2 root root 1024 Feb 27  2022 timers.target.wants
obsidian burrow
#

not sure how you're getting all those files (various override.conf variants) with this method.

#

when the editor opens, add the two lines, and select either ^O or ^X and leave the file name as it should already be:

/etc/systemd/system/crowsnest.service.d/override.conf

fair crag
#

i think i do it many time, the time to undesrstand nano

obsidian burrow
#

shouldn't matter, the file name doesn't change

fair crag
obsidian burrow
#

doesn't matter, they aren't being seen, systemd looks for very specific files in very specific places

#

and looking closer at the nano title I see where the other filenames have come from, they are the temporary file from previous edits that were presumably aborted

fair crag
#
Type=simple
User=pi
RemainAfterExit=Yes
WorkingDirectory=/home/pi/crowsnest
EnvironmentFile=/home/pi/printer_data/systemd/crowsnest.env
ExecStart=/usr/local/bin/crowsnest $CROWSNEST_ARGS
Restart=on-failure```
#

this section seems to have changed

#

when i do it on nano terminal i have this

obsidian burrow
#

I don't think it's changed, you probably never saw the full output before, it displays a screen at a time and you have to press SPACE or ENTER to get more

#

or have a tall terminal

#

if you want to see all lines without paging:

systemctl --no-pager cat crowsnest.service
fair crag
#

thath because my terminal was on little page

obsidian burrow
#

that seems to have the 30 sleep in the override now

#

reboot and see what happens

fair crag
#

yes, that no serious if they have same comand more than one time ?

obsidian burrow
#

I only see it once

#
pi@speeder-pad:~$ systemctl cat crowsnest.service
# /etc/systemd/system/crowsnest.service
#### crowsnest - A webcam Service for multiple Cams and Stream Services.
####
#### Written by Stephan Wendel aka KwadFan <[email protected]>
#### Copyright 2021 - 2022
#### https://github.com/mainsail-crew/crowsnest
####
#### This File is distributed under GPLv3
####

[Unit]
Description=crowsnest - Multi Webcam/Streamer Control Deamon
Documentation=https://github.com/mainsail-crew/crowsnest
After=udev.service network-online.target nss-lookup.target
Wants=udev.service network-online.target
Before=nginx.service
StartLimitBurst=10
StartLimitIntervalSec=180

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
User=pi
RemainAfterExit=Yes
WorkingDirectory=/home/pi/crowsnest
EnvironmentFile=/home/pi/printer_data/systemd/crowsnest.env
ExecStart=/usr/local/bin/crowsnest $CROWSNEST_ARGS
Restart=on-failure
RestartSec=5

# /etc/systemd/system/crowsnest.service.d/override.conf
[Service]
ExecStartPre=/bin/sleep 30
#

last three lines

fair crag
#

ok thath me, i saw wrong

#

tath work !

obsidian burrow
#

now if the 30 seconds is too long to wait (which I can understand why it would be) you can lower the number

fair crag
#

ok just repeat opération with lower time ?

obsidian burrow
#

you'll probably find that something like 2 to 5 works fine

#

yes

fair crag
#

cool i test it

fair crag
obsidian burrow
#

perfect!

#

glad I could help

fair crag
#

yes realy cool, many thanks or "un grand merci"

obsidian burrow
#

genetics say I'm 70% French 🤷‍♂️

fair crag
#

another question for the comunity i need to close post ?

obsidian burrow
#

would be good, yes