Search code examples
nodemcuarduino-esp8266

Static Ip For nodemcu(esp8266) without using code


I am using nodemcu(esp8266) microcontroller when it is connected to wifi it gets local ip which is dynamic i know how to set static ip using code but when i do that i am not able to send the request to my hosted website.So how i can do that thing.


Solution

  • So you can do it by reserving an IP to your specific device. Find the "DHCP Reservation" setting from your router's control panel. This could also be "DHCP Static Lease" or etc.

    You will be able to provide requested IP address to your device so you need to declare your device's "MAC address" also.

    You can get your esp8266 MAC address like below :

    String clientMac = "";
    unsigned char mac[6];
    WiFi.macAddress(mac);