Friday , 9 June 2023
Breaking News
Home > Tutorials > Arduino Tutorials > How to Assign Static IP to WeMos ESP8266

How to Assign Static IP to WeMos ESP8266


How are you friends, hope you will be fine. Today we are going to discuss on Static IP in WeMos. You will be able to assign static IP to WeMos after reading this tutorial. So let’s start.

Friends as you know that WeMos is used to connect via WiFi and it can also be access by the IP. You can create static HTML pages within the WeMos and then through IP you can access that HTML Static pages, but there is a problem, WeMos try to assign IP that is nearly available. But it is not real problem, you can assign static IP to WeMos and then can access it remotely. Here is the code:-

Please change following values as per your system configuaration

  • const char* ssid = “Password lyna hay”;
  • const char* pwd = “Google@007”;
  • const char* host = “”;

In line number 6, 7 and 8. Also change following values

  // Static IP details…
  IPAddress ip(192, 168, 8, 109);
  IPAddress gateway(192, 168, 8, 249);
  IPAddress subnet(255, 255, 255, 0);
  IPAddress dns(192, 168, 1, 249);
at line number 21, 22, 23, 24 and 25.
Now open your serial monitor and upload the code. After a few minute you will see some data on serial monitor something like this:
as you can see in this picture that I have received the IP that I set it into code. Now access this IP you will see this page that we coded into sketch.
Hope you understand everything, if not, please feel free to comment. See you in next tutorial.

About Muhammad Faryad

Muhammad Faryad is a professional web application developer. He has been working for 5 years in ICE786 Technologies Pvt. Ltd as a Senior Programmer and Developer. You can contact him on facebook at

Leave a Reply

Ad Test

%d bloggers like this: