SvenVD / rpisurv

Raspberry Pi surveillance
https://community.rpisurv.net
GNU General Public License v2.0
609 stars 101 forks source link

rpi 3 using wifi starting rpisurv before actually connected to wifi #43

Closed si458 closed 6 years ago

si458 commented 6 years ago

when using the latest raspbian on RPI 3 AND using WiFi,

it appears the rpisurv is starting before the pi has actually connected to the network by wifi

i have used raspi-config to say WAIT UNTIL NETWORK CONNECTED

but its having no affect?

SvenVD commented 6 years ago

Do you still have the wired connection plugged in? Rpisurv start the moment there at least one network device which is up

si458 commented 6 years ago

its wireless only, no lan cable plugged in :(

SvenVD commented 6 years ago

Can you try:

systemctl enable systemd-networkd-wait-online.service

si458 commented 6 years ago

Sorry for delay

pi@raspberrypi:~ $ systemctl enable systemd-networkd-wait-online.service Failed to enable unit: The name org.freedesktop.PolicyKit1 was not provided by any .service files pi@raspberrypi:~ $

si458 commented 6 years ago

Sorry ignore that forgot to use sudo

That enabled the service but after reboot it still loads before the network and says all streams are not available

si458 commented 6 years ago

Pi@raspberrypi:~ $ sudo systemctl enable systemd-networkd-wait-online.service Created symlink /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service → /lib/systemd/system/systemd-networkd-wait-online.service. pi@raspberrypi:~ $

Jmtyra commented 6 years ago

I had a similar issue with rpisurv loading before the network was ready, wired only in my situation. Enabling systemd-networkd-wait-online.service did not resolve the issue.

Editing the /usr/bin/rpisurv file and adding /bin/sleep 10 resolved the issue in my case. This provided enough of a delay for the network to be active. Resulting rpisurv file:

2017-12-19 20_06_33-sighthound-dmz - vmware remote console

SvenVD commented 6 years ago

I can not reproduce the issue. Could you try to

Wants=network-online.target

to the systemd file and reboot

` cat /etc/systemd/system/rpisurv.service [Unit] Description=Rpisurv Raspberry Pi Surveillance After=network-online.target Wants=network-online.target

[Service] Type=simple ExecStart=/usr/bin/rpisurv KillMode=control-group Restart=on-failure

[Install] WantedBy=multi-user.target `

Jmtyra commented 6 years ago

My current systemd file already has these lines in place.

Edit: Perhaps it's due to my network configuration? Normally this RPi is on a separate network without DHCP, but for troubleshooting/updates/etc it is then physically moved to a different network which does have DHCP enabled. Ergo my /etc/dhcpcd.conf file is as follows:

image

SvenVD commented 6 years ago

I run rpisurv (rpi 2) on dhcp but wired. I do not see any issues with dhcp configured.

Jmtyra commented 6 years ago

Might be something unique with my setup. Thank you for looking into this issue. :)

si458 commented 6 years ago

I can not reproduce the issue. Could you try to

Wants=network-online.target

to the systemd file and reboot

` cat /etc/systemd/system/rpisurv.service [Unit] Description=Rpisurv Raspberry Pi Surveillance After=network-online.target Wants=network-online.target

[Service] Type=simple ExecStart=/usr/bin/rpisurv KillMode=control-group Restart=on-failure

[Install] WantedBy=multi-user.target `

Hi,

so after not doing anything on surveillance tasks for awhile, im back to surveillance tasks again

and i started having this issue again, however adding the line 'Wants=network-online.target' fixed my issue!

can you update the service file to include this line as it might help others :)