Closed vergoossen closed 3 years ago
You could insert between row 10 and 11 of support.cpp something similar as:
IPAddress ip(192, 168, 178, 125);
IPAddress gateway(192, 168, 178, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress dns(192, 168, 178, 1);
WiFi.config(ip, dns, gateway, subnet);
Please find some docu related to WiFi.config() here
edit: the order in WiFi.config is wrong here, see this comment
Thankyou. And is it possible to put ip/gateway/dns in support.h? When i try myself i get 'IPAddress' does not name a type
I believe it is not possible to assign a value to a variable from type IPAddress in support.h. If you are interested in details have a look into IPAddress.cpp#L38.
btw: There was a typo in my example above. The right order for WiFi.config is
bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = (uint32_t)0x00000000, IPAddress dns2 = (uint32_t)0x00000000);
according to the ESP8266WiFiSTA.h.
Hi,
Can you make it possible to set a static ipaddress for the device? I tried some things myself, but they fail. Im not familiar with arduinoide...