Saturday , 7 December 2019
Breaking News
Home > Tutorials > Arduino Tutorials > How to Assign Static IP to WeMos ESP8266

How to Assign Static IP to WeMos ESP8266

Assalam-o-Alaikum!

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 = “http://192.168.8.100”;

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 www.facebook.com/tolamangali

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Ad Test