Skip to content

Commit e2204e8

Browse files
committed
WiFi.disconnect() should not reset static IP. config(0) should.
1 parent 639d731 commit e2204e8

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

ArduinoNetAPIDev.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ TODO
162162

163163
Method [`disconnect`](https://www.arduino.cc/reference/en/libraries/wifi/wifi.disconnect/) in WiFi libraries leaves the WiFi network.
164164

165+
`disconnect()` should not clear static IP settings. Next `begin` should use the same static IP configuration if `config` was not used to change or clear static IP.
166+
165167
### setHostname (DHCP)
166168

167169
Method [`setHostname`](https://www.arduino.cc/reference/en/libraries/wifinina/wifi.sethostname/) provides a way to set the hostname sent with the DHCP request. In some WiFi libraries this name is used for the locally started AP too.
@@ -182,6 +184,8 @@ config(IPAddress local_ip, IPAddress dns_server = IP_ALL_ZERO, IPAddress gateway
182184

183185
For static IP configuration user must specify the local IP address. The rest of the settings is optional and the library will use default values: DNS and gateway as .1 IP address in the same network and net mask 255.255.255.0.
184186

187+
`WiFi.config(INADDR_NONE)` should clear static IP configuration and set use of DHCP on next 'begin'.
188+
185189
For unifying the API, Ethernet libraries should use `config` too.
186190

187191
### setDNS (optional)

ArduinoNetLibsTestReport.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ pull requests:
3535
With listed pull request applied, remaining issues are
3636

3737
* WiFi.h doesn't include WiFiClient.h
38-
* after using static IP, DHCP is not possible. The problem in the ESP32 WiFi library used in the firmware ([PR](https://github.com/espressif/arduino-esp32/pull/8848)).
3938
* hostname is not sent with DHCP request
4039

4140
pull requests:
@@ -45,7 +44,10 @@ pull requests:
4544

4645
### WiFiEspAT
4746

48-
As the WiFiEspAT library is maintained by the author of this document, all problems discovered with the tests were solved. Only issue is the reversed macAddress and BSSID for compatibility with Arduino WiFi libraries.
47+
Issues:
48+
49+
* WiFi.disconnect() clears static IP
50+
* reversed macAddress and BSSID for compatibility with Arduino WiFi libraries.
4951

5052

5153
## Ethernet
@@ -154,10 +156,11 @@ With listed pull requests applied, remaining issues are
154156
* hostname is not sent with DHCP request
155157
* doesn't have WiFi.h
156158
* does scan in `begin` and only joins the network if it is in the scan result
159+
* static IP change ignored after first `begin`
157160

158161
pull requests:
159162

160-
* [`config` ignored](https://github.com/arduino/ArduinoCore-renesas/pull/179)
163+
* [can't set static IP](https://github.com/arduino/ArduinoCore-renesas/pull/179)
161164
* [reversed MAC](https://github.com/arduino/ArduinoCore-renesas/pull/184)
162165

163166
### C33 Ethernet

0 commit comments

Comments
 (0)