Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ jobs:
- name: CI Pico W | RP2040+W
core: rp2040:rp2040
board: rp2040:rp2040:rpipicow
# index_url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
index_url: https://github.com/earlephilhower/arduino-pico/releases/download/4.4.3/package_rp2040_index.json
index_url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

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

steps:
- name: Checkout
Expand Down Expand Up @@ -83,10 +81,10 @@ jobs:

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

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

- name: Install ArduinoJson
run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/bblanchon/ArduinoJson#v7.3.0
Expand Down
6 changes: 3 additions & 3 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
{
"owner": "bblanchon",
"name": "ArduinoJson",
"version": "^7.3.0",
"version": "^7.3.1",
"platforms": ["espressif8266", "espressif32", "raspberrypi"]
},
{
"owner": "ESP32Async",
"name": "ESPAsyncWebServer",
"version": "^3.7.1",
"version": "^3.7.2",
"platforms": ["espressif8266", "espressif32", "raspberrypi"]
},
{
Expand All @@ -35,7 +35,7 @@
"platforms": ["espressif8266", "raspberrypi"]
}
],
"version": "1.2.0",
"version": "1.2.1",
"frameworks": "arduino",
"platforms": ["espressif32", "raspberrypi"]
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=NetWizard
version=1.2.0
version=1.2.1
author=Ayush Sharma
category=Communication
maintainer=Ayush Sharma <asrocks5@gmail.com>
Expand Down
12 changes: 6 additions & 6 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ build_flags =
-D CONFIG_ARDUHAL_LOG_COLORS
-D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
lib_deps =
bblanchon/ArduinoJson@^7.3.0
ESP32Async/ESPAsyncWebServer@^3.7.1
bblanchon/ArduinoJson@^7.3.1
ESP32Async/ESPAsyncWebServer@^3.7.2
upload_protocol = esptool
monitor_speed = 115200
monitor_filters = esp32_exception_decoder, log2file
Expand Down Expand Up @@ -39,7 +39,7 @@ framework = arduino
board_build.core = earlephilhower
lib_deps =
vshymanskyy/Preferences@^2.1.0
ayushsharma82/RPAsyncTCP@^1.3.0
ayushsharma82/RPAsyncTCP@^1.3.1
${env.lib_deps}
lib_ignore =
lwIP_ESPHost
Expand All @@ -51,7 +51,7 @@ framework = arduino
board_build.core = earlephilhower
lib_deps =
vshymanskyy/Preferences@^2.1.0
ayushsharma82/RPAsyncTCP@^1.3.0
ayushsharma82/RPAsyncTCP@^1.3.1
${env.lib_deps}
lib_ignore =
lwIP_ESPHost
Expand Down Expand Up @@ -81,7 +81,7 @@ framework = arduino
board_build.core = earlephilhower
lib_deps =
vshymanskyy/Preferences@^2.1.0
ayushsharma82/RPAsyncTCP@^1.3.0
ayushsharma82/RPAsyncTCP@^1.3.1
${env.lib_deps}
lib_ignore =
lwIP_ESPHost
Expand All @@ -93,7 +93,7 @@ framework = arduino
board_build.core = earlephilhower
lib_deps =
vshymanskyy/Preferences@^2.1.0
ayushsharma82/RPAsyncTCP@^1.3.0
ayushsharma82/RPAsyncTCP@^1.3.1
${env.lib_deps}
lib_ignore =
lwIP_ESPHost
19 changes: 16 additions & 3 deletions src/NetWizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ void NetWizard::autoConnect(const char* ssid, const char* password) {
NETWIZARD_DEBUG_MSG("Connecting to saved credentials\n");
NETWIZARD_DEBUG_MSG("SSID: " + _nw.sta.ssid + " \n");
Serial.printf("Connecting to %s, %s\n", _nw.sta.ssid.c_str(), _nw.sta.password.c_str());
// Credentials loaded successfully
// Set hostname
if (_nw.hostname != "") {
WiFi.setHostname(_nw.hostname.c_str());
}
WiFi.mode(WIFI_STA);
WiFi.persistent(false);
_connect(_nw.sta.ssid.c_str(), _nw.sta.password.c_str(), true);
Expand All @@ -111,6 +114,10 @@ void NetWizard::autoConnect(const char* ssid, const char* password) {
|| _nw.status == NetWizardConnectionStatus::CONNECTION_FAILED
) {
NETWIZARD_DEBUG_MSG("Trying to connect again...\n");
// Set hostname
if (_nw.hostname != "") {
WiFi.setHostname(_nw.hostname.c_str());
}
WiFi.mode(WIFI_STA);
WiFi.persistent(false);
_connect(_nw.sta.ssid.c_str(), _nw.sta.password.c_str(), true);
Expand Down Expand Up @@ -417,8 +424,6 @@ void NetWizard::_connect(const char* ssid, const char* password, bool autoreconn
WiFi.setAutoReconnect(true);
}
#endif
// Set hostname
WiFi.setHostname(_nw.hostname.c_str());
// Connect to WiFi
WiFi.begin(ssid, password);
_nw.status = NetWizardConnectionStatus::CONNECTING;
Expand Down Expand Up @@ -1092,6 +1097,10 @@ void NetWizard::_stopHTTP() {
}

void NetWizard::_startPortal() {
// Set hostname
if (_nw.hostname != "") {
WiFi.setHostname(_nw.hostname.c_str());
}
WiFi.mode(WIFI_AP_STA);
WiFi.persistent(false);
if (this->isConfigured()) {
Expand Down Expand Up @@ -1156,6 +1165,10 @@ void NetWizard::_stopPortal() {
WiFi.softAPdisconnect(true);
if (this->isConfigured()) {
NETWIZARD_DEBUG_MSG("Connecting to configured connection\n");
// Set hostname
if (_nw.hostname != "") {
WiFi.setHostname(_nw.hostname.c_str());
}
WiFi.mode(WIFI_STA);
WiFi.persistent(false);
_connect(_nw.sta.ssid.c_str(), _nw.sta.password.c_str(), true);
Expand Down
Loading