I already setup Mosquito. I need to run MQTT when the router goes down during a break out and my Pi have a battery backup. Is there a way to connect to the server locally? Is there any way to do it ?
The rapsberry has a built-in wifi card. You can google and configure it to act as access point. Preferably with the same name and password as your main router. Then you can (auto)enable it and all your devices will be online again…
But let me ask you this… OK, I get it, you have a battery for your raspberry… If you have a power loss and your router goes down, then how will your other devices retain power?
A lot of people tried that and have no luck. Seems like Hass Io doesn’t have this feature built in. My devices is just some temperature sensor that run on battery. I need to collect data during the breakout session. Is there anyway to let home assistant connect to the Mosquito broker locally?
It’s already connecting locally.
Why not just keep your router on a battery backup?
Ah, Sorry… I didnt know you are using HASS.io.
If the broker is on the same machine, then all you have to do is use the ip 127.0.0.1 instead of 192.168…1x.x
As for the connectivity of the other devices, I dont think I can help much. You need an interface to connect to… If you router doesnt work, then your raspberry must do the thing… you have to figure it out… Maybe use a usb stick…?
This won’t always work with Docker (which is how hassio is running). Each container is it’s own “machine” and localhost refers to itself. MQTT is a separate “machine” than HA.
Thats good to know. Thank you!
No worries about other devices, they use Zigbee protocol and works without internet. Thanks for the help !
My broker is Mosquitto on a separate Pi. MyHassIO Pi, my Broker Pi, and the router are all on battery backup. Power fails are rarely an issue here.