Page 1 of 1

One ESP two network settings

Posted: 12 Nov 2021, 21:00
by Sasch600xt
Hello all :)

sure there is a fallback network but i work with fixed IPs and subnet/DNS.

So i have an ESP in my Car connected to my mobil router in the car.

Where my car is parked, there is also my home wifi in range.

So i would love to switch off the router in my car, while my car is at home.
For that reason the ESP would have to connect to my home wifi with different ip settings.
is there a way to do so ?

in best case i also would have a solution to change the controller settings (Home Assistant (openHAB) MQTT)
to another ip and port

Thank you for your help :)
Sascha

Re: One ESP two network settings

Posted: 12 Nov 2021, 21:21
by Ath
I think that toying with these commands can get you in the right direction:
- IP
- Gateway
- Subnet
to change the network settings from one to the other could be helpful
And of course 'Save' to store the settings

Adding a second MQTT controller setup and using the 'ControllerEnable' and 'ControllerDisable' commands, again with an optional 'Save', should be the hint to get you going ;)

You might want to define some events in rules and a trigger like a button or two, to switch 'location'
NB: All commands can be found here: https://espeasy.readthedocs.io/en/lates ... mmand.html (but that you already knew, right? :))

Re: One ESP two network settings

Posted: 12 Nov 2021, 21:27
by TD-er
You could have 2 controller definitions, one per IP.
Using rules you could then turn a controller off and turn on the other one.
Using the ping plugin you could check which one is reachable and act on it in the rules via an event.

Theoretically you could also set the IP using a command, but I'm not sure yet what would be a good way to switch between IP configurations.
Why not using dhcp in your car and house network? That would remove the need for such a complex change of fixed IPs.

Re: One ESP two network settings

Posted: 14 Nov 2021, 23:58
by Sasch600xt
Thank you for your answeres.

yes, i guess i give DHCP a try. It would make it a lot more easy :)

Have a great day
Sascha