Skip to content

No connection with Static IP #4

@Cyb3rn0id

Description

@Cyb3rn0id

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions