I have a problem and I hope that anyone can help me with it. I am setting up a home automation system, where the different devices communicate via MQTT. There is no stationary router in the house as I am using my mobile phone as a hotspot. So basically when I’m out, there is no Internet in the house.
Installing, setting up and configuring the Raspberry is done over the phones hotspot and works fine. However, as soon as I turn of the hotspot, MQTT does not work anymore.
Is there any way that that could be fixed? Googling it brought only basic explanations about how to set up MQTT unfortunately.
thank you for your help. I think I left out an important point here: I have the Raspberry connected to a switch via a cat-6 cable. My sensors are either: A: connected to that switch via cat-6 as well, or B: connected via Zigbee (zigbee2mqtt using Slaesh’s CC2652RB stick).
So I was wondering what I had to do to keep them functioning after I switched off the Wifi.
I’m not sure what is stopping them continuing in that case, but if the devices are using mDNS rather than IP addresses, that would cause problems with no DNS server on the network.
Perhaps try setting up Pi-Hole as a DNS and DHCP server? That’s just a guess, though: I’d still recommend keeping things “standard” by installing a real router.
that goes into the direction of what I was thinking… My idea was to:
Set up Raspberry via Wifi (copying “my-network” with the Wifi-Credentials into “ROOT\CONFIG\network\my-network” before the first start)
Installing Zigbee2MQTT and Mosquitto and setting it up
SOMEHOW tell the Raspberry to act as a router from now on → see below
Changing the Wifi-Password. From then on the Raspberry should work completely offline. If I want to update, I’d have to change the Wifi-password again and the Raspberry would immediately come back online.
I don’t have enough experience of this to advise further, sorry. Why are you so keen not to have a router, though? I would have thought you could find an old ISP-supplied one for almost no money — if it’s not connecting to the internet, you don’t have any security or performance concerns: all of the point-to-point traffic will be via your switch.
I have something that looks exactly like that: https://www.ebay.de/itm/353495044374 . If I understand you correctly, the difference between mine and yours is, that your’s will take care of giving an IP to all devices connected?
Yes, that’s correct. You might find that the bigger routers draw more power than a small router plus your existing switch though.
10-port MikroTik that draws 6W (I’m only suggesting them as they are relatively well-regarded “proper” routers as opposed to consumer ones that can be… variable in quality). This one has gigabit ports.
8-port D-Link at 7.5W here, only 10/100Mbps if that matters.
I might have missed something, but why not configuring the RPI as a dhcp on the wired network?
The RPI could as well act as a router between the WiFI/hotspot and the wired network.
I will look into these! However, maybe I found a different solution where I’m a bit more versatile on the components I’d need. See my next post, replying to koying.
If that’s correct, maybe there is a way to - as you suggested - also configure the RPI as a DHCP on the wired network. Then my Arduinos would be able to communicate via Ethernet, and I could put a tablet on the wall which would connect to the Wifi-Network that the Raspberry created. Would that work?
The routing part will be trickier, as I don’t think there is any addon for that.
You might take the linuxhint page as a reference.
Start at the “Configuring the Firewall and Enable Packet Forwarding”. Whatever comes before would be provided by Hassio and the addon.
I was thinking of “almost never” connecting the Raspberry to the internet after the initial setup. So I thought, that Add-on would allow me to wirelessly connect a tablet to the Raspberry for the dashboard. However, there should be 2 ways of doing this though:
Have the Raspberry create a Wifi-Network, and connect to that with the tablet
Have the Tablet create a Wifi-Network (without internet), and set up the Raspberry to connect to that
The Advantage of #2 would be, that I could easily “give” internet to the Raspberry if I wanted to update anything: I just had to disable the Wifi on the “Wifi-without-internet-tablet” and open up a Wifi with my phone with the same credentials…