Raspberry pi 4 openhabian
openHAB 3.4.0 Build #3029
I’m trying to understand how Openhab deals with networking issues, specifically, I am hoping it relies on the wpa_supplicant for prioritization of Wifi SSIDs.
Basically what I want to do is have the system fail over to Wifi when the Ethernet disconnects … and it does this pretty well already, however, in testing it seems that it does not pick up the changes to the wpa_supplicant until the system is rebooted. I have used sudo service networking restart as well as sudo ifconfig wlan0 down … sudo ifconfig wlan0 up to try to get it to see the changes. This is also the same if I make changes to the Wifi configuration through the openhabian-config tool (and it says the system must be rebooted).
So the question: is there any way to get the system to see the changes to the wpa_supplicant without rebooting?
Serious? This does not make sense.
This, by design, isn’t even something you would be trying on high-powered data center equipment, and even less so on a Raspi.
You cannot have one layer 2 network replace another one so you would be getting a different IP, and you would need to “inject” that everywhere into all running applications. That just doesn’t won’t work.
Serious, this is an attempt doomed to fail. Get your Ethernet stable and you’re set.
Actually this is done all the time. Not sure what you are referring to. It works beautifully now. This issue I am seeking help on is how to getting the system to accept the changes to the supplicant without doing a reboot.
Not sure why you would think having a standby L2 network is not done, when it is very typical. The two interfaces have different MAC addresses so clearly they would need different IP addresses.
The use case I am referring to has nothing to with “getting my Ethernet stable”. I am working on the case of a power failure where my Ethernet network and therefore Cable provided internet goes down. It will failover to a wifi network that has a cellular connection to the internet.
The statement of having to inject the new IP address into the running applications is wrong. I am using a local DNS record (such as openhabian.local) which works beautifully well when the failover occurs.
Thanks. But it is actually working very well as I describe. When my ethernet cable is unplugged, the Rasp PI switches over to Wifi and I can then access it at openhabian.local (with a different IP address of course). So it is working as I would expect.
The issue for this thread has nothing to do with the tangent you took … I am trying to find out how to get the system to accept the changes to the wpa_supplicant without reb0oting (because its a hassle to reboot for other reasons that are related to Openhab but that has been discussed on other threads.)
You are referring to the fixed IP addresses that are hard coded in the bindings. And, yes, those can’t change (and wont) … so the fail over network has to use the same subnet, and have those devices reserved at the same fixed IP addresses. Haven’t seen an issue with doing that.
To clarify, there are several use cases for having a backup wifi for the system, the main one I am thinking about now is to alert me in the event of a power failure. Obviously in a power failure, many devices won’t be operational but some will. Specifically the battery operated devices on the Zigbee and Zwave networks. Managing the system will be extremely limited but having the ability for Openhab to gain access to a cell network to send out a notification seems like a useful case. Additionally, being able to log into the device remotely some management of devices might make sense. Finding out if there is motion or door activity etc is an obvious one. If the failover network is in a different subnet, obviously all the hard coded addresses are meaningless. But if the power is out, vs the xfinity network is out, there would be different outcomes.
Edit: before someone asks: Yes, the openhab system is on a UPS.
Yes, adding a UPS to the router is definitely a good approach.
This thread was/is not meant to explore ways to solve that issue … I am specifically asking about the Openhab system and if it prevents changes to the Wifi / Ethernet settings until after a reboot and if there is a way around that. There are good reasons to not have the changes take immediate affect (like shooting yourself in the foot with the network changing and making openhab unaccessible. ) … but I was hoping there was some approach I am not aware of.
As I said, I am not trying to design the solution for that I am investigating how to change the WPA_Supplicant without rebooting Openhab.
What I am experimenting with as a solution is to have a cellphone act as a hotspot, have the Openhab know the SSID (perhaps with SSID priortization in the supplicant) and then have that wlan interface become active (it should) when the ethernet interface goes down. Obviously all the devices are on the UPS. And yes, I could have the router on the UPS, but at this point I do not. There are two main cases: 1) Power fails, 2) The Xfnitity cable network is out. In both cases I am trying to retain access to Openhab and still have Openhab send notifications.
I don‘t think this will solve your problem with cable network not being available. I you want to still access openHAB from outside, you are either using myopenHAB or a VPN or anything else. As your external IP will change when switching from cable network to celular, you will have to restart those as well.