homieiot / homie-esp8266

💡 ESP8266 framework for Homie, a lightweight MQTT convention for the IoT
http://homieiot.github.io/homie-esp8266
MIT License
1.36k stars 308 forks source link

Static IP after AP config? #209

Closed cingolanifede closed 7 years ago

cingolanifede commented 7 years ago

Hi, is there any way to set up a static ip after the AP config? The router usually gives the same ip address, but if the router gives the esp8266 a new ip, can i configure homie to use the first ip that was given to it? I am using an app and after I set the config I store the ip in a database and the I use it to comunicate with the esp device. Thanks.

rigorm commented 7 years ago

Could you just set a DHCP static IP distribution list based on the ESP's MAC address ? that would be the easiest way --------- Original Message --------- Subject: [marvinroger/homie-esp8266] Static IP after AP config? (#209) From: "cingolanifede" notifications@github.com Date: 11/8/16 8:00 am To: "marvinroger/homie-esp8266" homie-esp8266@noreply.github.com

Hi, is there any way to set up a static ip after the AP config? The router usually gives the same ip address, but if the router gives the esp8266 a new ip, can i configure homie to use the first ip that was given to it? I am using an app and after I set the config I store the ip in a database and the I use it to comunicate with the esp device. Thanks.

You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

euphi commented 7 years ago

There are many routers that don't support this. I have one of these, too and thinking about setting up an DHCP server on my home server that also runs mosquitto and openhab.

However, I don't see the need to do this for homie nodes (I do have the need for other devices, e.g. the printer), because homie works fine with variable IP address.

cingolanifede commented 7 years ago

Thanks for your replies. I solved using the rigorm way. I get the MAC address an then I use the ARP table and get the ip so I can comunicate with the esp. I close this issue #209. Thanks again.