A forum for everything that Kinda Works YouTube.com/ItKindaWorks
You are not logged in.
Pages: 1
Hi,
can we Code fixed an ip address onto the ESP-01 instead of Obtain IP automatically?
Thanks and best regards,
Stu
Offline
At the moment ESPHelper doesn't support fixed IP addresses but I could take a look into it. I have a feeling though that the ESP wifi library doesn't have that built in (although that might be outdated info from a long time ago so I could be totally wrong).
Creator of ItKindaWorks
Offline
Thank you so much for yr prompt replied. I am thinking fixed that thru the router to fixed the IP for a particular ESP-01. But how or code that we could easily retrieve the mac address on each individual ESP-01?
Offline
Ah ok yeah you can always do it via the router and DHCP. To get the MAC address of the ESP you can use "Serial.println(WiFi.macAddress());"
If you put that print statement in your setup code it will print out the MAC address which you can use to configure your router.
Creator of ItKindaWorks
Offline
While you can issue a fixed IP from the dhcp server it will not be any gains from it aside from a fixed IP. the arduino is still needs to request and receive the IP even though it will be the same thus burning up cycles/time
The below works for me.
IPAddress ip(192, 168, 11, 23);
IPAddress gateway(192, 168, 11, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress dns(192, 168, 11, 1);
WiFi.config(ip, dns, gateway, subnet);
WiFi.begin(WIFI_AP, WIFI_PASSWORD);
This works on a esp8266 on my network.
Offline
Thanks a lot bro... it works fine for me now....
Offline
Pages: 1