Raspberry Pi occasionally not available

All,

sorry for the rookie question…

I am running OH 2.5 M4-1 on a Raspberry Pi 3 with wired network on openhabian.

Sometimes (few times a year) I don’t get a connection to the rasp - neither by console nore webGUI.
In that case it’s not responding to ping either.

So, what is the best way to completele restart the network by OH?

So the RaspBerryPi is disconnected from the network if I get you right.

I don’t know where you from and about your setup.
I know it’s a pi3 with LAN. But are you using an SD Card or SSD?
Do other devices in your network have problems?
Are there power outages happening where you live?
Does the RaspBerryPi have a good power supply?

There are so many options what is happening it’s impossible to say from this point on.
You need to provide more information :slight_smile:

Cheers,
Elias

One cannot know what state the machine is in so OH might work or not at that stage. So restarting it wouldn’t work, eventually.
Either way, the only reasonable solution is to find out what’s causing that outage.
Prime candidates are your SD card to eventually get corrupted and an insufficient power supply (in case of undervoltage, RPis will power down the USB chip first which is where Ethernet is connected).

Thanks for your help.

I am using a SSD because in the past with SD-card it was a mess with corruption issues.
When I check the network, I usually have all other devices online (approx. 15 - both cabled and wireless).

It’s not caused by power outages.

@mstormi I actually not know the state of the system - that’s a good point
I am just guessing that it’s about the network.
Unfortunately I don’t have a display nor keyboard connected to restart the raspi properly (just a power cycle is an option).
Fortunately it just happens rarely.

Shouldn’t USB and Ethernet be separate Phys?

In RPi3, they’re powered by the same chip. Check for undervoltage messages in syslog.

Did not find any appearance of Under-voltage in my syslogs, but I will look for it whenever I get this issue again.

Just in case:
If this happens again and my Raspi does not get a connection to my Router, I guess this would work to check, whether the network of the raspi had issues!?
executeCommandLine("sudo /etc/init.d/networking restart", 5000)

Oh you want to write a rule which checks if the PI internally can ping the router and if not restart networking.

Exactly.

EDIT:
I am actually preparing the raspi for a powerbank supporting it in case of a power failure (our neigbors just had one) - so if the network is down, OH considers, that there might be a power failure (anything but the raspi due to the powerbank support).
So the first step would be a network restart after some minutes (in case the network of the raspi itself has an issue).
If this does not help and the battery comes to an end I would like to shutdown the raspi.