Device is offline

Hi!

I’m running Screenly OSE (latest release) in balenaCloud and love it but quite often it seems as if my different Pi’s (RPi 3 & RPi 4) loose their wifi connections and cant be reached. balenaCloud just reports that they are offline.

This happens at two different locations (have 2 Pi’s at each location, running two different LANs and routers).

They keep showing the assets so I guess it has something to do with the wifi-connection.

Any known problems or ideas on how to solve this?

Hmm… while i have not dealt with this issue on the balena OS, I do encounter that if the signal is too low, or whatever other reason causes the Pi to lose WiFi connectivity, unless networkmanager is functioning properly, it doesn’t really reconnect unless you have some script running every so often that pings google or something and if it succeeds then great, but if it doesn’t, it restarts the networking service thus restarting the wifi connection.

This is the script I use on the non-balena Pi’s:
__

#!/bin/bash
#start script
ping -c2 8.8.8.8 >/dev/null

if [ $? != 0 ]
then
  sudo systemctl restart networking.service;sleep 5;sudo systemctl restart screenly-viewer.service
fi
#end script

Basically you create that script/file and make it executable, and add it as a crontab and it’s one of the few things you can do for wifi connectivity related issues… but, can you give more details in terms of the network environment, have you checked how good the signal is? can you run the command on console

iwconfig

And check what it is reporting?

Also, have you read this with regards to the way balena does it:
https://www.balena.io/docs/reference/OS/network/2.x/#checking-connectivity

Since my pi zero that is running balena is just 20 feet from the WiFi router, I’ve never had it randomly disconnect, I would have to test with a Pi3 and latest balena…

Hi @ealmonte32

Thanks for the script!