Skip to content

Commit 86df629

Browse files
Merge pull request #28 from ayushsharma82/dev
v1.2.1
2 parents 8c0c609 + b8a3c6c commit 86df629

File tree

7 files changed

+804
-755
lines changed

7 files changed

+804
-755
lines changed

.github/workflows/ci.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,12 @@ jobs:
4646
- name: CI Pico W | RP2040+W
4747
core: rp2040:rp2040
4848
board: rp2040:rp2040:rpipicow
49-
# index_url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
50-
index_url: https://github.com/earlephilhower/arduino-pico/releases/download/4.4.3/package_rp2040_index.json
49+
index_url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
5150

5251
- name: CI Pico 2W | RP2350+W
5352
core: rp2040:rp2040
5453
board: rp2040:rp2040:rpipico2w
55-
# index_url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
56-
index_url: https://github.com/earlephilhower/arduino-pico/releases/download/4.4.3/package_rp2040_index.json
54+
index_url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
5755

5856
steps:
5957
- name: Checkout
@@ -83,10 +81,10 @@ jobs:
8381

8482
- name: Install RPAsyncTCP (RP2040)
8583
if: ${{ matrix.core == 'rp2040:rp2040' }}
86-
run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/ayushsharma82/RPAsyncTCP#v1.3.0
84+
run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/ayushsharma82/RPAsyncTCP#v1.3.1
8785

8886
- name: Install ESPAsyncWebServer
89-
run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/ESP32Async/ESPAsyncWebServer#v3.7.1
87+
run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/ESP32Async/ESPAsyncWebServer#v3.7.2
9088

9189
- name: Install ArduinoJson
9290
run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/bblanchon/ArduinoJson#v7.3.0

library.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
{
2020
"owner": "bblanchon",
2121
"name": "ArduinoJson",
22-
"version": "^7.3.0",
22+
"version": "^7.3.1",
2323
"platforms": ["espressif8266", "espressif32", "raspberrypi"]
2424
},
2525
{
2626
"owner": "ESP32Async",
2727
"name": "ESPAsyncWebServer",
28-
"version": "^3.7.1",
28+
"version": "^3.7.2",
2929
"platforms": ["espressif8266", "espressif32", "raspberrypi"]
3030
},
3131
{
@@ -35,7 +35,7 @@
3535
"platforms": ["espressif8266", "raspberrypi"]
3636
}
3737
],
38-
"version": "1.2.0",
38+
"version": "1.2.1",
3939
"frameworks": "arduino",
4040
"platforms": ["espressif32", "raspberrypi"]
4141
}

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=NetWizard
2-
version=1.2.0
2+
version=1.2.1
33
author=Ayush Sharma
44
category=Communication
55
maintainer=Ayush Sharma <[email protected]>

platformio.ini

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ build_flags =
55
-D CONFIG_ARDUHAL_LOG_COLORS
66
-D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
77
lib_deps =
8-
bblanchon/ArduinoJson@^7.3.0
9-
ESP32Async/ESPAsyncWebServer@^3.7.1
8+
bblanchon/ArduinoJson@^7.3.1
9+
ESP32Async/ESPAsyncWebServer@^3.7.2
1010
upload_protocol = esptool
1111
monitor_speed = 115200
1212
monitor_filters = esp32_exception_decoder, log2file
@@ -39,7 +39,7 @@ framework = arduino
3939
board_build.core = earlephilhower
4040
lib_deps =
4141
vshymanskyy/Preferences@^2.1.0
42-
ayushsharma82/RPAsyncTCP@^1.3.0
42+
ayushsharma82/RPAsyncTCP@^1.3.1
4343
${env.lib_deps}
4444
lib_ignore =
4545
lwIP_ESPHost
@@ -51,7 +51,7 @@ framework = arduino
5151
board_build.core = earlephilhower
5252
lib_deps =
5353
vshymanskyy/Preferences@^2.1.0
54-
ayushsharma82/RPAsyncTCP@^1.3.0
54+
ayushsharma82/RPAsyncTCP@^1.3.1
5555
${env.lib_deps}
5656
lib_ignore =
5757
lwIP_ESPHost
@@ -81,7 +81,7 @@ framework = arduino
8181
board_build.core = earlephilhower
8282
lib_deps =
8383
vshymanskyy/Preferences@^2.1.0
84-
ayushsharma82/RPAsyncTCP@^1.3.0
84+
ayushsharma82/RPAsyncTCP@^1.3.1
8585
${env.lib_deps}
8686
lib_ignore =
8787
lwIP_ESPHost
@@ -93,7 +93,7 @@ framework = arduino
9393
board_build.core = earlephilhower
9494
lib_deps =
9595
vshymanskyy/Preferences@^2.1.0
96-
ayushsharma82/RPAsyncTCP@^1.3.0
96+
ayushsharma82/RPAsyncTCP@^1.3.1
9797
${env.lib_deps}
9898
lib_ignore =
9999
lwIP_ESPHost

src/NetWizard.cpp

+16-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ void NetWizard::autoConnect(const char* ssid, const char* password) {
8585
NETWIZARD_DEBUG_MSG("Connecting to saved credentials\n");
8686
NETWIZARD_DEBUG_MSG("SSID: " + _nw.sta.ssid + " \n");
8787
Serial.printf("Connecting to %s, %s\n", _nw.sta.ssid.c_str(), _nw.sta.password.c_str());
88-
// Credentials loaded successfully
88+
// Set hostname
89+
if (_nw.hostname != "") {
90+
WiFi.setHostname(_nw.hostname.c_str());
91+
}
8992
WiFi.mode(WIFI_STA);
9093
WiFi.persistent(false);
9194
_connect(_nw.sta.ssid.c_str(), _nw.sta.password.c_str(), true);
@@ -111,6 +114,10 @@ void NetWizard::autoConnect(const char* ssid, const char* password) {
111114
|| _nw.status == NetWizardConnectionStatus::CONNECTION_FAILED
112115
) {
113116
NETWIZARD_DEBUG_MSG("Trying to connect again...\n");
117+
// Set hostname
118+
if (_nw.hostname != "") {
119+
WiFi.setHostname(_nw.hostname.c_str());
120+
}
114121
WiFi.mode(WIFI_STA);
115122
WiFi.persistent(false);
116123
_connect(_nw.sta.ssid.c_str(), _nw.sta.password.c_str(), true);
@@ -417,8 +424,6 @@ void NetWizard::_connect(const char* ssid, const char* password, bool autoreconn
417424
WiFi.setAutoReconnect(true);
418425
}
419426
#endif
420-
// Set hostname
421-
WiFi.setHostname(_nw.hostname.c_str());
422427
// Connect to WiFi
423428
WiFi.begin(ssid, password);
424429
_nw.status = NetWizardConnectionStatus::CONNECTING;
@@ -1092,6 +1097,10 @@ void NetWizard::_stopHTTP() {
10921097
}
10931098

10941099
void NetWizard::_startPortal() {
1100+
// Set hostname
1101+
if (_nw.hostname != "") {
1102+
WiFi.setHostname(_nw.hostname.c_str());
1103+
}
10951104
WiFi.mode(WIFI_AP_STA);
10961105
WiFi.persistent(false);
10971106
if (this->isConfigured()) {
@@ -1156,6 +1165,10 @@ void NetWizard::_stopPortal() {
11561165
WiFi.softAPdisconnect(true);
11571166
if (this->isConfigured()) {
11581167
NETWIZARD_DEBUG_MSG("Connecting to configured connection\n");
1168+
// Set hostname
1169+
if (_nw.hostname != "") {
1170+
WiFi.setHostname(_nw.hostname.c_str());
1171+
}
11591172
WiFi.mode(WIFI_STA);
11601173
WiFi.persistent(false);
11611174
_connect(_nw.sta.ssid.c_str(), _nw.sta.password.c_str(), true);

0 commit comments

Comments
 (0)