Why raspberry pi go offline after few hours or days

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
Dave47
Posts: 136
Joined: Thursday 19 July 2018 14:36
Target OS: -
Domoticz version: 2023.1
Contact:

Why raspberry pi go offline after few hours or days

Post by Dave47 »

Hi,

I have Rasberry pi with Domoticz on it.
After few hours or days my Rasberry Pi go completly offline.

What i do is turn the power off and on from the raspberry.
Sometimes it work than.
I usually have to do the same with the router.

Then i can go in ssl to the rasberry with the wifi ip adres.
The Lan connection is not always ready.

Domoticz doesn't work yet.

I still have to restart Domitcz with: sudo service domoticz.sh restart

Is this a router problem or what can we try?

Is there maybe a script to start Domoticz automatically?
How can we solve the connection problem from the PI?

We have Rasbian Buster version 10 on the Pi
willemd
Posts: 740
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Why raspberry pi go offline after few hours or days

Post by willemd »

Sounds like a networking issue, not a Domoticz issue.

You normally have access via WIFI and LAN?
When the Pi is offline, are both WIFI and LAN connection failing?
Can you ping the Pi then?

What if you don't reset the PI but only the router?
What if you bring the PI and router closer together?

Is this the only router in your network?

You can set up MONIT to monitor and restart Domoticz, but if it is a networking problem then this will not solve your problem.
https://www.domoticz.com/wiki/Monitoring_domoticz
Dave47
Posts: 136
Joined: Thursday 19 July 2018 14:36
Target OS: -
Domoticz version: 2023.1
Contact:

Re: Why raspberry pi go offline after few hours or days

Post by Dave47 »

We have 2 routers. The second is only accesspoint and i need for ip camera.
The lan connecties is coming from router/modem 1 with static lease for lan.
I have setup a lan and wifi connection. Sometimes wifi is ok and sometimes the lan. Both is most of the time.
In router 1 ip wifi and lan is static.
The wifi ssid radio signal is from accespoint/router 2 but the ip from 1.
Raspberry pi is close to router 2.
Maybe the wire from router 1 to router2 is the problem?
With other devices no problem

Restart domoticz was the first problem. When i make a reboot for the pi is always have to do a restart for domoticz.
lost
Posts: 699
Joined: Thursday 10 November 2016 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Why raspberry pi go offline after few hours or days

Post by lost »

Dave47 wrote: Tuesday 08 November 2022 19:34 Restart domoticz was the first problem. When i make a reboot for the pi is always have to do a restart for domoticz.
Having to manually restart Domoticz after a reboot is IMO the usual issue with lack of RTC on raspberries... Domoticz start must be delayed after NTP is available. Otherwise a domoticz timeout/watchdog triggers at restart. Search forum/wiki for solutions.

Also advise you to setup domoticz to log in a file & check /var/log/syslog (+ .1, .2.gz etc logrotated files, ; you can use zcat/zmore/zgrep instead of cat/more/grep to see/search for errors in older gz compressed files), to understand better if your first issue is really linked with Domoticz/PI (enough power? SD storage dying?) or network related: A few checks on routers (there must be a setup interface?) may also help.

Not clear also if your PI connection is wired or wifi? If wired, you may try unplug/replug connector to see if this brings network back?

For such permanent connection, wifi is IMO not advised... If this is wireless issues, you may monitor PI or AP (if some logging available, my Microtik offers lots of information but that's not the case for more consumer market brands): If you see many deauth, you may have a script kiddie in your neighborhood! Would be an easy way to silent your IP cams for someone willing to get in, also: Some portable devices sending continuous deauth to anything wifi connected in range are quite common nowadays.

My own PI uptime with Domoticz must be over 2 months now (due to last kernel update)... Probably the same for most users here.
willemd
Posts: 740
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Why raspberry pi go offline after few hours or days

Post by willemd »

Dave47 wrote: Tuesday 08 November 2022 19:34 We have 2 routers. The second is only accesspoint and i need for ip camera.
The lan connecties is coming from router/modem 1 with static lease for lan.
I have setup a lan and wifi connection. Sometimes wifi is ok and sometimes the lan. Both is most of the time.
In router 1 ip wifi and lan is static.
The wifi ssid radio signal is from accespoint/router 2 but the ip from 1.
Raspberry pi is close to router 2.
Maybe the wire from router 1 to router2 is the problem?
With other devices no problem

Restart domoticz was the first problem. When i make a reboot for the pi is always have to do a restart for domoticz.
I had a similar setup and the same problem. Never found out why, but from the moment I forced the raspberry to connect to the main router the networking problems were gone. If the raspberry connected to the second access point then at a certain point the connection was lost.
lost
Posts: 699
Joined: Thursday 10 November 2016 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Why raspberry pi go offline after few hours or days

Post by lost »

willemd wrote: Thursday 10 November 2022 14:42 I had a similar setup and the same problem. Never found out why, but from the moment I forced the raspberry to connect to the main router the networking problems were gone. If the raspberry connected to the second access point then at a certain point the connection was lost.
Networking Problems:
https://xkcd.com/2259/

:lol: :x
Dave47
Posts: 136
Joined: Thursday 19 July 2018 14:36
Target OS: -
Domoticz version: 2023.1
Contact:

Re: Why raspberry pi go offline after few hours or days

Post by Dave47 »

Hallo Willemd. How didi you forced the Raspberry to connect with the main router? Did you connect with wifi in the beginning on router 2 or LAN?
Is the connection on the main a LAN connection?
willemd
Posts: 740
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Why raspberry pi go offline after few hours or days

Post by willemd »

Dave47 wrote: Friday 18 November 2022 13:02 Hallo Willemd. How didi you forced the Raspberry to connect with the main router? Did you connect with wifi in the beginning on router 2 or LAN?
Is the connection on the main a LAN connection?
Initially both the network SSID of the main router and the SSID of the second access point were defined in the wpa_supplicant configuration file on the raaspberry. To force the main router connection I just removed the definition of the second access point.
FlyingDomotic
Posts: 463
Joined: Saturday 27 February 2016 0:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: Why raspberry pi go offline after few hours or days

Post by FlyingDomotic »

Did you tried to have a look at /var/log/syslog after the crash/disconnection, to see what happened before you restart it? If disk/SSD was not the issue, main reason is probably written here.

If this is a disk issue, you can still have a proof forwarding your syslog message to another machine with a syslog server, as network will stay up (but new connections will probably be refused).

As other said, you should avoid Wifi, especially if a wired connection is available. And effectively, unless you need to restart RPi by your own, it generally stays on for months.
Dave47
Posts: 136
Joined: Thursday 19 July 2018 14:36
Target OS: -
Domoticz version: 2023.1
Contact:

Re: Why raspberry pi go offline after few hours or days

Post by Dave47 »

If this is a disk issue, you can still have a proof forwarding your syslog message to another machine with a syslog server, as network will stay up (but new connections will probably be refused).
I have no other machine. But how can you do this?
Is the reason to see whether this is a disk problem or not?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest