Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No connection with Static IP #4

Open
Cyb3rn0id opened this issue Feb 13, 2019 · 0 comments
Open

No connection with Static IP #4

Cyb3rn0id opened this issue Feb 13, 2019 · 0 comments

Comments

@Cyb3rn0id
Copy link

I'm gone mad using static IP: time is not retrieved. After a while I've discovered that if you want to use static IP, you must explicit also DNS in the wifi config:

#define USE_STATIC_IP
// data used for static IP configuration:
#ifdef USE_STATIC_IP
  IPAddress ip(192,168,1,38);		// ip address you want to assign to your board
  IPAddress gateway(192,168,1,1);	// router address
  IPAddress subnet(255,255,255,0);	// subnet mask
  IPAddress dns1(8,8,8,8); // dns 1
  IPAddress dns2(8,8,4,4);  // dns 2
#endif

// [...]

#ifdef USE_STATIC_IP
    WiFi.config(ip,gateway,subnet,dns1,dns2);
  #endif
  WiFi.begin(ssid, password);

I think It's better include this snippet in the example for ESP8266.
Thank you for the library: it's the simplest one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant