How to call an api on esp8266 using static ip setting

hellow everyone i am new there and i need help i am stuck somewhere need some guidance from all of you here is my code
Api_Based_Alarm_Light_v1.0.4.ino (2.1 KB)
this works fine at all when i try to assign static ip it fails to call api responce is only -1
error code for time out someone please help...
static ip code is
Api_Based_Alarm_Light_v1.0.4_using_static_ip.ino (2.5 KB)

thanks

Please post code in line using code tags. Can’t see it on mobile device and few people will actually take the time to download whatever you attached and open it.

If you have not done so yet, do yourself a favour and please read How to get the best out of this forum and post accordingly (including code tags and necessary documentation for your ask).

It would be interesting to know for example how you « call » the static IP, what’s your network topology, where do you see the -1 etc

Remember never post pictures of text - better to post the text in code tags.

IPAddress staticIP(192,168,0,117);
IPAddress gateway(192,168,1,1);
IPAddress subnet(255,255,0,0);

My guess is that, even though 192.168.x.x is traditionally, a "Class B" (65535 node) network, your router is probably configured to use "192.168.1.x" as a "Class C" (255 node) network. That would put your chosen address: 192.168.0.117, outside the router's subnet. Try 192.168.1.117:

IPAddress staticIP(192,168,1,117);
IPAddress gateway(192,168,1,1);
IPAddress subnet(255,255,255,0);

thanks alot all of u ... my problem is solved.. issue is in my network settings as you people guide me thanks alot..

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.