<< return to Vizycam.com

Reconnecting after wifi disconnect?

My wifi router restarts every day at 5AM.
It seems that Vizy wasn’t able to reconnect to it, and started a Wifi hotspot instead, I have to restart it via a physical button.

Is there any way to add some kind of a timeout so that Vizy would wait for some 2 minutes before attempting to reconnect to the wifi network?

Jul 10 05:00:52 vizy NetworkManager[446]: <info>  [1657447252.3254] manager: NetworkManager state is now DISCONNECTED
Jul 10 05:00:52 vizy NetworkManager[446]: <warn>  [1657447252.3352] device (wlan0): Activation: failed for connection 'homewifi'
Jul 10 05:00:52 vizy NetworkManager[446]: <info>  [1657447252.3546] device (wlan0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Jul 10 05:00:52 vizy NetworkManager[446]: <info>  [1657447252.4232] dhcp4 (wlan0): canceled DHCP transaction, DHCP client pid 1078
Jul 10 05:00:52 vizy NetworkManager[446]: <info>  [1657447252.4233] dhcp4 (wlan0): state changed bound -> done
Jul 10 05:00:52 vizy NetworkManager[446]: <info>  [1657447252.9629] device (wlan0): set-hw-addr: set MAC address to xx:xx:xx:xx:xx:xx (scanning)
Jul 10 05:00:52 vizy NetworkManager[446]: <info>  [1657447252.9747] dns-mgr: Removing DNS information from /sbin/resolvconf
Jul 10 05:00:53 vizy NetworkManager[446]: <info>  [1657447253.1714] device (wlan0): supplicant interface state: scanning -> inactive
Jul 10 05:00:53 vizy NetworkManager[446]: <info>  [1657447253.2729] device (wlan0): supplicant interface state: inactive -> disabled
Jul 10 05:00:53 vizy NetworkManager[446]: <info>  [1657447253.2731] device (wlan0): supplicant interface state: disabled -> inactive
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.0751] policy: auto-activating connection 'vizy-1234' (xxxxxx-xxx-xxx-xxx-xxxxxxx)
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.0770] device (wlan0): Activation: starting connection 'vizy-1234' (xxxxxx-xxx-xxx-xxx-xxxxxxx)
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.0791] device (wlan0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.0817] manager: NetworkManager state is now CONNECTING
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.6380] device (wlan0): set-hw-addr: reset MAC address to E4:5F:01:70:47:04 (preserve)
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.6600] device (wlan0): supplicant interface state: inactive -> disabled
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.6604] device (wlan0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.6612] device (wlan0): Activation: (wifi) access point 'vizy-1234' has security, but secrets are required.
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.6612] device (wlan0): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.6683] device (wlan0): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.6753] device (wlan0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.6805] device (wlan0): Activation: (wifi) connection 'vizy-1234' has security, and secrets exist.  No new secrets needed.
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.6810] Config: added 'ssid' value 'vizy-1234'
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.6810] Config: added 'mode' value '2'
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.6811] Config: added 'frequency' value '2412'
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.6811] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256'
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.6811] Config: added 'psk' value '<hidden>'
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.7512] device (wlan0): supplicant interface state: disabled -> inactive
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.8674] device (wlan0): supplicant interface state: inactive -> completed
Jul 10 05:00:56 vizy NetworkManager[446]: <info>  [1657447256.8676] device (wlan0): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Started Wi-Fi Hotspot "vizy-1234"

Hmm, I wonder if it would be simpler to restart the vizy-server at 5:05 am. If you restart the vizy-server, it will force a reconnect to your router.

You could set up a cron job.

sudo systemctl restart vizy-server

There are probably lots of ways to work around this though.

Edward

that’s what I ended up doing :slight_smile:
thank you!

I’ve been monitoring Vizy’s behavior for the last few days, with this crontab task (not sure if related, however), Vizy would not start up sometimes, or hang (maybe).

Where could I look for the logs that could point me in the right direction?

Hello,
Try running this:

sudo journalctl -f --unit vizy-server

It will show you any errors that have been encountered.

Edward

thank you.
It doesn’t really show any errors, does it?

-- Logs begin at Thu 2019-02-14 03:11:59 MST. --
Jul 25 10:19:22 vizy sudo[1720]:       pi : TTY=pts/2 ; PWD=/home/pi/vizy ; USER=root ; COMMAND=/usr/bin/journalctl -e -f --unit Vizy-server
Jul 25 10:19:22 vizy sudo[1720]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jul 25 10:19:26 vizy sudo[1720]: pam_unix(sudo:session): session closed for user root
Jul 25 10:22:59 vizy sudo[1731]:       pi : TTY=pts/2 ; PWD=/home/pi/vizy ; USER=root ; COMMAND=/usr/bin/journalctl -e -f --unit vizy-server
Jul 25 10:22:59 vizy sudo[1731]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jul 25 10:23:07 vizy sudo[1731]: pam_unix(sudo:session): session closed for user root
Jul 25 21:57:49 vizy sudo[2824]:     root : TTY=pts/3 ; PWD=/home/pi/vizy ; USER=pi ; COMMAND=/usr/bin/bash
Jul 25 21:57:49 vizy sudo[2824]: pam_unix(sudo:session): session opened for user pi by (uid=0)
Jul 25 21:59:06 vizy sudo[2829]:       pi : TTY=pts/3 ; PWD=/home/pi/vizy ; USER=root ; COMMAND=/usr/bin/journalctl -f --unit vizy-server
Jul 25 21:59:06 vizy sudo[2829]: pam_unix(sudo:session): session opened for user root by (uid=0)

Hello,
journalctl will only display the logs for that boot cycle. If you could somehow see the log after the behavior occurs (within the same boot cycle), you will see the error(s) (if any).

There’s a way to change things such that it retains logs from previous boots, but there are some plusses and minuses to doing this.

Edward