-->
Page 1 of 1

Static IP of ESP8266 not recognised by router

PostPosted: Tue Apr 26, 2016 12:03 pm
by FOXD
Hi all,
wondering if anyone else has this problem- letting the router assign an ip automatically (using wifi.sta.config("SSID","PW") works well for my esp8266-01, (I can use it as a web server and see it on my routers list of devices on the network) but when I want to change it to a static IP address (using wifi.sta.setip({ip="",netmask="",gateway=IPROUTER}) ) even though I can still access the web server with the static IP fine, the router doesn't see the esp8266-01 anymore. Any ideas?

I've checked that i'm not just looking at a list of dhcp devices on the router( changing my phone to a static IP showed up in the list).

At the moment this means I can only communicate with a home automation server as long as I don't have a reset of the esp8266 (e.g. a reassigned IP address from the router) so not ideal..

Re: Static IP of ESP8266 not recognised by router

PostPosted: Wed Apr 27, 2016 7:41 am
by eduperez
I would first make sure of what are you seeing in the router: it can be the list of DHCP clients, or the list of WiFi clients.

Anyway, as a general rule, I would always advice to fix the IP address on the DHCP server, assigning a static IP address to the MAC address of each device, instead of configuring each device.

Re: Static IP of ESP8266 not recognised by router

PostPosted: Wed Apr 27, 2016 12:22 pm
by FOXD
eduperez wrote:I would first make sure of what are you seeing in the router: it can be the list of DHCP clients, or the list of WiFi clients.

Anyway, as a general rule, I would always advice to fix the IP address on the DHCP server, assigning a static IP address to the MAC address of each device, instead of configuring each device.


Hi, I have checked your first point and that the list I am seeing is definitely of ALL devices on the network.

I also tried to set up the second, and the router is still assigning me whatever IP it wants to(this function works for my other devices on the network).

Is it possible that this is related to the MAC address of the ESP then? Does the router see the MAC address of the ESP, or does this have to be explicitly set in code?

Re: Static IP of ESP8266 not recognised by router

PostPosted: Thu Apr 28, 2016 9:26 am
by eduperez
If you can see all devices, wired and wireless, with static or dynamic IP address, you must be seeing the ARP table. It is possible that a device does not show there, unless there has been some traffic from/to such device; after connecting the ESP to the network, do a ping to it from another device, then consult the ARP table.

Definitively, the router needs to receive the MAC address from the ESP; otherwise, it would be unable to assign an IP address to it. Are you sure you are using the correct MAC address from the ESP?