One ESP two network settings

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

One ESP two network settings

#1 Post by Sasch600xt » 12 Nov 2021, 21:00

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
"the flat earth society has members all around the globe"

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: One ESP two network settings

#2 Post by Ath » 12 Nov 2021, 21:21

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? :))
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8642
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: One ESP two network settings

#3 Post by TD-er » 12 Nov 2021, 21:27

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.

User avatar
Sasch600xt
Normal user
Posts: 164
Joined: 10 Sep 2018, 16:37

Re: One ESP two network settings

#4 Post by Sasch600xt » 14 Nov 2021, 23:58

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
"the flat earth society has members all around the globe"

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests