Problems with my home assistant's wifi connection using a mobile wifi router

I’ve HA installed on a Raspberry Pi 4B and connecting via wifi to a mobile router (I have 2 routers, one Huawey and one Netgear and the same problems on both, meaning it seams not to be a problem with the router).
This is what happens: after some time of normal operation, after a reboot it can happens that HA is no more accessible: connecting to it (directly via IP address or via Nabucasa remote access) the message is address unreachable. I can see HA connected to the router (I see it has an IP address assigned) but I’m not able to connect to it.
When this happens the strange thing is that on my phone or laptop connected to the same router/wifi, Internet is not available anymore and after some time the connection to the router is dropped.
What I did is to connect the Raspberry to the router with a cable an then … HA is available again via IP address on both interfaces, wifi and ethernet (with 2 different addresses of course) and also via Nabucasa.
Looking at the sensor.local_ip it show the wifi IP address but the trafic seams to go trough the ethernet interface (the sensor.network_in_eth0 is increasing)
If I remove the cable, the connection via wifi is not working anymore.

I’m running core-2021.8.5 and OS 6.1

Can someone help me troubleshooting this? I’m not a network specialist and I’m lost.
Thanks
Stefano

Are you running a static IP or using static mapping from the router (if it is available)? If not you probably should.

Ditto for setting a static IP. I would recommend that plus connecting over ethernet, if at all possible.

If you need to stick to wifi, it might be the PI turning off wifi to save power.

Hi,
thanks for the answer.
I need to connect to the raspberry via wifi because, in my configuration, I cannot use a cable connection.
I don’t think that the problem is related to the power save because it was running for more than a month before. The issue started after a core update.

Stefano

Hi,
I’m not using static IP and I’m now trying this.
I’m modifying the settings in Supervisor - Host Settings - wlan0 : with the actual set-up (raspberry connected with cable to the router) I see the wlan0 IPv4 is disabled (strange because I’m able to connect to the wlan0 IP) and eth0 IPv4 is set to DHCP.
If I try to change it to static for wlan0, after the save, it still disabled.
Should I change it in another way?

I think you would normally set a static IP address in the router. If you go to the device settings there should be an option to do this, though obviously it varies depending on the router you have.

I was able to define static IP address … but the issue stay the same: when I remove the cable, the wifi connection is not working anymore.

Now I have a new strange behaviour: I have a second raspberry and I put the SD card in it.
After restart, HA is available via wifi on the static IP address I defined without the need to connect the cable!!
I was very happy and I then did some changes in the configuration file (not related to the network settings), I restarted HA to reload the configuration … and I had the same problem: HA not reachable anymore.
I switched back to the first Raspberry, started HA … and wifi working again!!

I’m really lost :frowning:

if you defined a static mapping in your router that should have been based on the mac address. The wifi and ethernet mac addresses will be different. I would expect you to lose connection on wifi when the router and pi reconnect.

Have you run ifconfig -a on the pi to see what you mac addresses are?

Hi, the mapping is defined in HA (the router doesn’t allow me to do it) therefore the mac address is always the right one (checked also with ifconfig).

New findings: defining the static IP didn’t help. The problem still persist.
I checked again with both routers I have and it is not related to the router.

I’m now investigating if the ConBeeII I’m using could create some problem (I saw some topic regarding this)

At the end, moving the ConBee II chanel away from the one used by my wifi, moving the ConBee II stick from a USB 3 to a USB 2 port, seems to have solved my problem.

1 Like