Skip to content

Commit 5f85798

Browse files
committed
softAPConfig fails with "DHCPS Set Netmask Failed! 0x5001" #9069
See: espressif/arduino-esp32#9069
1 parent 6960eb8 commit 5f85798

File tree

1 file changed

+15
-24
lines changed

1 file changed

+15
-24
lines changed

src/main.cpp

+15-24
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,27 @@
88
#endif
99
#endif
1010

11-
#define COL 12
12-
#define ROW 4
13-
14-
String str;
15-
float myfloat[COL][ROW];
16-
int idx;
1711

12+
#include <IPAddress.h>
13+
#include <WiFiGeneric.h>
14+
#include <WiFi.h>
1815

1916
void setup() {
20-
idx = 0;
2117
Serial.begin(115200);
22-
for (int i = 0; i < COL; ++i) {
23-
for (int j = 0; j < ROW; ++j) {
24-
++idx;
25-
myfloat[i][j] = 1.0f * idx;
26-
}
27-
}
18+
Serial.setDebugOutput(true);
19+
20+
21+
IPAddress apIP(192,168,4,1);
22+
IPAddress gwIP(192,168,4,1);
23+
IPAddress subnet(255,255,255,0);
24+
25+
WiFi.softAPConfig(apIP, gwIP, subnet);
26+
27+
28+
29+
2830
}
2931

3032
void loop() {
31-
++idx;
32-
if (idx >= (COL*ROW)) {
33-
idx = 0;
34-
}
35-
36-
str = myfloat[idx / ROW][idx % ROW];
37-
Serial.print(F("str: '"));
38-
Serial.print(str);
39-
Serial.print(F("' '"));
40-
Serial.print(String(myfloat[idx / ROW][idx % ROW], 2));
41-
Serial.println('\'');
4233
delay(1000);
4334
}

0 commit comments

Comments
 (0)