The LittleFS of the new Nano_RP2040_Connect board ( see New board ), using ISSI Flash chip, is currently not working with Arduino mbed_rp2040 core 2.4.1+
. Please downgrade to Arduino mbed_rp2040 core 2.3.1
Check RP2040 Connect board has faulty components in newest purchase #318 for more information of when and how the issue will be fixed.
The old board ( see Old board ), using Adesto Flash chip, is currently working with Arduino mbed_rp2040 core 2.4.1+
.
If you have used the full-fledge WiFiManager such as :
and have to write complicated callback functions to save custom parameters in SPIFFS/LittleFS/EEPROM, you'd appreciate the simplicity of this Light-Weight Credentials / WiFiManager.
This library is a Light Weight Credentials / WiFi Manager for WiFiNINA (WiFiNINA, WINC1500/WiFi101, etc.) modules/shields, specially designed to support Teensy, SAM DUE, SAMD21 (Nano-33 IoT, Itsy-Bitsy M0, etc), SAMD51 (Itsy-Bitsy M4, Metro M4, Grand Central M4, Feather M4 Express, etc.), STM32F (F1, F2, F3, F4, F7, Nucleo-144, etc.), nRF52 (Adafruit NRF52840_FEATHER, NRF52832_FEATHER, NRF52840_FEATHER_SENSE, NRF52840_ITSYBITSY, NRF52840_CIRCUITPLAY, NRF52840_CLUE, NRF52840_METRO, NRF52840_PCA10056, PARTICLE_XENON, NINA_B302_ublox, NINA_B112_ublox, etc.), RP2040-based (Nano RP2040 Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040), etc. boards running WiFiNINA modules/shields. with smaller memory (64+K bytes)
The AVR-family boards (UNO, Nano, etc.) are not supported as they don't have enough memory to run Config Portal WebServer.
This is a Credentials / WiFi Connection Manager, permitting the addition of custom parameters to be configured in Config Portal. The parameters then will be saved automatically, without the complicated callback functions to handle data saving / retrieving.
You can also specify DHCP HostName, static AP and STA IP. Use much less memory compared to full-fledge WiFiManager. Config Portal will be auto-adjusted to match the number of dynamic custom parameters. Credentials are saved in EEPROM, FlashStorage or DueFlashStorage.
The web configuration portal, served from the WiFiNINA modules/shields
is operating as an access point (AP) with configurable static IP address or use default IP Address of 192.168.4.1
New recent features:
The usage the new WiFiMulti_Generic library to help connect to the best of multi-WiFi APs, with auto-checking / auto-reconnecting features when WiFi connection is lost.
This WiFiManager_NINA_Lite library currently supports these following boards:
nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense, Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, NINA_B302_ublox, NINA_B112_ublox, etc.
SAMD21
SAMD51
SAM DUE
Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0)
STM32F/L/H/G/WB/MP1 boards (with 32+K Flash)
RP2040-based boards, such as Nano RP2040 Connect, using Arduino-mbed RP2040 core or Earle Philhower's arduino-pico core
RP2040-based boards, such as RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Arduino-mbed RP2040 core or Earle Philhower's arduino-pico core.
WiFiNINA_Generic library
WiFi101 library v0.16.1+
WiFiNINA_Generic library
Arduino IDE 1.8.19+
for Arduino. Arduino Core for STM32 v2.3.0+
for STM32 boards. Teensy core 1.57+
for Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0, LC) boardsArduino SAM DUE core 1.6.12+
for SAM DUE ARM Cortex-M3 boardsArduino SAMD core 1.8.13+
for SAMD ARM Cortex-M0+ boards. Adafruit SAMD core 1.7.11+
for SAMD ARM Cortex-M0+ and M4 boards (Nano 33 IoT, etc.). Seeeduino SAMD core 1.8.3+
for SAMD21/SAMD51 boards (XIAO M0, Wio Terminal, etc.). Adafruit nRF52 v1.3.0+
for nRF52 boards such as Adafruit NRF52840_FEATHER, NRF52832_FEATHER, NRF52840_FEATHER_SENSE, NRF52840_ITSYBITSY, NRF52840_CIRCUITPLAY, NRF52840_CLUE, NRF52840_METRO, NRF52840_PCA10056, PARTICLE_XENON, NINA_B302_ublox, etc. Arduino mbed_rp2040 core 3.4.1+
for Arduino (Use Arduino Board Manager) RP2040-based boards, such as Arduino Nano RP2040 Connect, RASPBERRY_PI_PICO, etc..
Earle Philhower's arduino-pico core v2.6.3+
for RP2040-based boards such as RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, etc. Functional-Vlpp library v1.0.2+
to use server's lambda function. To install. check WiFiNINA_Generic library v1.8.15-0+
. To install. check Modified WiFi101 Library v0.16.1+
if using WINC1500/WiFi101 shields (MKR1000, etc.).WiFiWebServer library v1.10.0+
. To install, check FlashStorage_SAMD library v1.3.2+
for SAMD21 and SAMD51 boards (ZERO, MKR, NANO_33_IOT, M0, M0 Pro, AdaFruit Itsy-Bitsy M4, etc.). FlashStorage_STM32 library v1.2.0+
for STM32F/L/H/G/WB/MP1 boards. To install. check DueFlashStorage library v1.0.0+
for SAM DUE. To install, check Adafruit's LittleFS/InternalFS
for nRF52DoubleResetDetector_Generic v1.8.1+
. To install, check WiFiMulti_Generic library v1.2.2+
to use WiFiMulti function. To install, check . NewThe best and easiest way is to use Arduino Library Manager
. Search for WiFiManager_NINA_Lite, then select / install the latest version.
You can also use this link for more detailed instructions.
WiFiManager_NINA_Lite-master.zip
.WiFiManager_NINA_Lite-master
directory WiFiManager_NINA_Lite-master
folder to Arduino libraries' directory such as ~/Arduino/libraries/
.To be able to compile, run and automatically detect and display BOARD_NAME on nRF52840/nRF52832 boards, you have to copy the whole nRF52 Packages_Patches directory into Adafruit nRF52 directory (~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0).
Supposing the Adafruit nRF52 version is 1.3.0. These files must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/platform.txt
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/boards.txt
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/cores/nRF5/Udp.h
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/cores/nRF5/Print.h
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/cores/nRF5/Print.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/variants/NINA_B302_ublox/variant.h
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/variants/NINA_B302_ublox/variant.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/variants/NINA_B112_ublox/variant.h
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/variants/NINA_B112_ublox/variant.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/cores/nRF5/Udp.h
Whenever a new version is installed, remember to copy these files into the new version directory. For example, new version is x.yy.z These files must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/platform.txt
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/boards.txt
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/cores/nRF5/Udp.h
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/cores/nRF5/Print.h
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/cores/nRF5/Print.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B302_ublox/variant.h
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B302_ublox/variant.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B112_ublox/variant.h
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B112_ublox/variant.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/cores/nRF5/Udp.h
To be able to compile and run on Teensy boards, you have to copy the files in Packages_Patches for Teensy directory into Teensy hardware directory (./arduino-1.8.19/hardware/teensy/avr/boards.txt).
Supposing the Arduino version is 1.8.19. These files must be copied into the directory:
./arduino-1.8.19/hardware/teensy/avr/boards.txt
./arduino-1.8.19/hardware/teensy/avr/cores/teensy/Stream.h
./arduino-1.8.19/hardware/teensy/avr/cores/teensy3/Stream.h
./arduino-1.8.19/hardware/teensy/avr/cores/teensy4/Stream.h
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz These files must be copied into the directory:
./arduino-x.yy.zz/hardware/teensy/avr/boards.txt
./arduino-x.yy.zz/hardware/teensy/avr/cores/teensy/Stream.h
./arduino-x.yy.zz/hardware/teensy/avr/cores/teensy3/Stream.h
./arduino-x.yy.zz/hardware/teensy/avr/cores/teensy4/Stream.h
To be able to compile and run on SAM DUE boards, you have to copy the whole SAM DUE directory into Arduino sam directory (~/.arduino15/packages/arduino/hardware/sam/1.6.12).
Supposing the Arduino SAM core version is 1.6.12. This file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/sam/1.6.12/platform.txt
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/sam/x.yy.zz/platform.txt
To be able to compile, run and automatically detect and display BOARD_NAME on Arduino SAMD (Nano-33-IoT, etc) boards, you have to copy the whole Arduino SAMD Packages_Patches directory into Arduino SAMD directory (~/.arduino15/packages/arduino/hardware/samd/1.8.13).
Supposing the Arduino SAMD version is 1.8.13. Now only one file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/samd/1.8.13/platform.txt
Whenever a new version is installed, remember to copy this files into the new version directory. For example, new version is x.yy.zz
This file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/samd/x.yy.zz/platform.txt
Supposing the Arduino SAMD version is 1.8.9. These files must be copied into the directory:
~/.arduino15/packages/arduino/hardware/samd/1.8.9/platform.txt
~/.arduino15/packages/arduino/hardware/samd/1.8.9/cores/arduino/Arduino.h
Whenever a new version is installed, remember to copy these files into the new version directory. For example, new version is x.yy.z
These files must be copied into the directory:
~/.arduino15/packages/arduino/hardware/samd/x.yy.z/platform.txt
~/.arduino15/packages/arduino/hardware/samd/x.yy.z/cores/arduino/Arduino.h
This is mandatory to fix the notorious Arduino SAMD compiler error. See Improve Arduino compatibility with the STL (min and max macro)
...\arm-none-eabi\include\c++\7.2.1\bits\stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
Whenever the above-mentioned compiler error issue is fixed with the new Arduino SAMD release, you don't need to copy the Arduino.h
file anymore.
To be able to compile, run and automatically detect and display BOARD_NAME on Adafruit SAMD (Itsy-Bitsy M4, etc) boards, you have to copy the whole Adafruit SAMD Packages_Patches directory into Adafruit samd directory (~/.arduino15/packages/adafruit/hardware/samd/1.7.11).
Supposing the Adafruit SAMD core version is 1.7.11. These files must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/samd/1.7.11/platform.txt
~/.arduino15/packages/adafruit/hardware/samd/1.7.11/cores/arduino/Print.h
~/.arduino15/packages/adafruit/hardware/samd/1.7.11/cores/arduino/Print.cpp
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz These files must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/samd/x.yy.zz/platform.txt
~/.arduino15/packages/adafruit/hardware/samd/x.yy.zz/cores/arduino/Print.h
~/.arduino15/packages/adafruit/hardware/samd/x.yy.zz/cores/arduino/Print.cpp
To be able to compile, run and automatically detect and display BOARD_NAME on Seeeduino SAMD (XIAO M0, Wio Terminal, etc) boards, you have to copy the whole Seeeduino SAMD Packages_Patches directory into Seeeduino samd directory (~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3).
Supposing the Seeeduino SAMD core version is 1.8.3. These files must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3/platform.txt
~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3/cores/arduino/Arduino.h
~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3/cores/arduino/Print.h
~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3/cores/arduino/Print.cpp
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz These files must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/platform.txt
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/cores/arduino/Arduino.h
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/cores/arduino/Print.h
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/cores/arduino/Print.cpp
To use LAN8720 on some STM32 boards
you have to copy the files stm32f4xx_hal_conf_default.h and stm32f7xx_hal_conf_default.h into STM32 stm32 directory (~/.arduino15/packages/STM32/hardware/stm32/2.3.0/system) to overwrite the old files.
Supposing the STM32 stm32 core version is 2.3.0. These files must be copied into the directory:
~/.arduino15/packages/STM32/hardware/stm32/2.3.0/system/STM32F4xx/stm32f4xx_hal_conf_default.h
for STM32F4.~/.arduino15/packages/STM32/hardware/stm32/2.3.0/system/STM32F7xx/stm32f7xx_hal_conf_default.h
for Nucleo-144 STM32F7.Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz, these files must be copied into the corresponding directory:
~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/system/STM32F4xx/stm32f4xx_hal_conf_default.h
To use Serial1 on some STM32 boards without Serial1 definition (Nucleo-144 NUCLEO_F767ZI, Nucleo-64 NUCLEO_L053R8, etc.) boards, you have to copy the files STM32 variant.h into STM32 stm32 directory (~/.arduino15/packages/STM32/hardware/stm32/2.3.0). You have to modify the files corresponding to your boards, this is just an illustration how to do.
Supposing the STM32 stm32 core version is 2.3.0. These files must be copied into the directory:
~/.arduino15/packages/STM32/hardware/stm32/2.3.0/variants/STM32F7xx/F765Z(G-I)T_F767Z(G-I)T_F777ZIT/NUCLEO_F767ZI/variant.h
for Nucleo-144 NUCLEO_F767ZI.~/.arduino15/packages/STM32/hardware/stm32/2.3.0/variants/STM32L0xx/L052R(6-8)T_L053R(6-8)T_L063R8T/NUCLEO_L053R8/variant.h
for Nucleo-64 NUCLEO_L053R8.Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz, these files must be copied into the corresponding directory:
~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/variants/STM32F7xx/F765Z(G-I)T_F767Z(G-I)T_F777ZIT/NUCLEO_F767ZI/variant.h
~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/variants/STM32L0xx/L052R(6-8)T_L053R(6-8)T_L063R8T/NUCLEO_L053R8/variant.h
To be able to automatically detect and display BOARD_NAME on RP2040-based boards (RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040, GENERIC_RP2040, etc) boards, you have to copy the file RP2040 platform.txt into rp2040 directory (~/.arduino15/packages/rp2040/hardware/rp2040/1.4.0).
Supposing the rp2040 core version is 1.4.0. This file must be copied into the directory:
~/.arduino15/packages/rp2040/hardware/rp2040/1.4.0/platform.txt
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
~/.arduino15/packages/rp2040/hardware/rp2040/x.yy.zz/platform.txt
With core after v1.5.0, this step is not necessary anymore thanks to the PR Add -DBOARD_NAME="{build.board}" #136.
Some libraries, such as Adafruit DHT-sensor-library, require the definition of microsecondsToClockCycles(). To be able to compile and run on RP2040-based boards, you have to copy the files in RP2040 Arduino.h into rp2040 directory (~/.arduino15/packages/rp2040/hardware/rp2040/1.4.0).
Supposing the rp2040 core version is 1.4.0. This file must be copied to replace:
~/.arduino15/packages/rp2040/hardware/rp2040/1.4.0/cores/rp2040/Arduino.h
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied to replace:
~/.arduino15/packages/rp2040/hardware/rp2040/x.yy.zz/cores/rp2040/Arduino.h
With core after v1.5.0, this step is not necessary anymore thanks to the PR Add defs for compatibility #142.
To be able to upload firmware to Portenta_H7 using Arduino IDE in Linux (Ubuntu, etc.), you have to copy the file portenta_post_install.sh into mbed_portenta directory (~/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/portenta_post_install.sh).
Then run the following command using sudo
$ cd ~/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1
$ chmod 755 portenta_post_install.sh
$ sudo ./portenta_post_install.sh
This will create the file /etc/udev/rules.d/49-portenta_h7.rules
as follows:
# Portenta H7 bootloader mode UDEV rules
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="035b", GROUP="plugdev", MODE="0666"
Supposing the ArduinoCore-mbed core version is 3.4.1. Now only one file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/portenta_post_install.sh
Whenever a new version is installed, remember to copy this files into the new version directory. For example, new version is x.yy.zz
This file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/mbed_portenta/x.yy.zz/portenta_post_install.sh
To avoid compile error relating to PROGMEM, you have to copy the file Realtek AmebaD core pgmspace.h into Realtek AmebaD directory (~/.arduino15/packages/realtek/hardware/AmebaD/3.1.4/cores/ambd/avr/pgmspace.h).
Supposing the Realtek AmebaD core version is 3.1.4. This file must be copied into the directory:
~/.arduino15/packages/realtek/hardware/AmebaD/3.1.4/cores/ambd/avr/pgmspace.h
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
~/.arduino15/packages/realtek/hardware/AmebaD/x.yy.zz/cores/ambd/avr/pgmspace.h
To avoid compile error relating to SAMD21/SAMD51, you have to copy the file ArduinoCore-fab-sam core pgmspace.h into ArduinoCore-fab-sam
samd directory (~/.arduino15/packages/Fab_SAM_Arduino/hardware/samd/1.9.0/boards.txt).
Supposing the ArduinoCore-fab-sam
samd core version is 1.9.0. This file must be copied into the directory:
~/.arduino15/packages/Fab_SAM_Arduino/hardware/samd/1.9.0/boards.txt
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
~/.arduino15/packages/Fab_SAM_Arduino/hardware/samd/x.yy.zz/boards.txt
To be able to compile, run and automatically detect and display BOARD_NAME on Seeeduino RP2040 (XIAO RP2040, Wio RP2040 Mini) boards, you have to copy the whole Seeeduino RP2040 Packages_Patches directory into Seeeduino samd directory (~/.arduino15/packages/Seeeduino/hardware/rp2040/2.7.2).
Supposing the Seeeduino RP2040 core version is 2.7.2. These files must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/rp2040/2.7.2/boards.txt
~/.arduino15/packages/Seeeduino/hardware/rp2040/2.7.2/variants/Seeed_XIAO_RP2040/pins_arduino.h
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz These files must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/boards.txt
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/variants/Seeed_XIAO_RP2040/pins_arduino.h
To be able to compile and run on Xiao nRF52840 boards, you have to copy the whole nRF52 1.0.0 directory into Seeeduino nRF52 directory (~/.arduino15/packages/Seeeduino/hardware/nrf52/1.0.0).
Supposing the Seeeduino nRF52 version is 1.0.0. These files must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/nrf52/1.0.0/platform.txt
~/.arduino15/packages/Seeeduino/hardware/nrf52/1.0.0/cores/nRF5/Print.h
~/.arduino15/packages/Seeeduino/hardware/nrf52/1.0.0/cores/nRF5/Print.cpp
~/.arduino15/packages/Seeeduino/hardware/nrf52/1.0.0/cores/nRF5/Udp.h
Whenever a new version is installed, remember to copy these files into the new version directory. For example, new version is x.yy.z These files must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/nrf52/x.yy.z/platform.txt
~/.arduino15/packages/Seeeduino/hardware/nrf52/x.yy.z/cores/nRF5/Print.h
~/.arduino15/packages/Seeeduino/hardware/nrf52/x.yy.z/cores/nRF5/Print.cpp
~/.arduino15/packages/Seeeduino/hardware/nrf52/x.yy.z/cores/nRF5/Udp.h
To avoid ltoa
, ultoa
and/or dtostrf
compiler error, just copy the following file into the Adafruit_MQTT_Library library
directory to overwrite the old file:
WiFiNINA module/shield
will start a WiFi configuration portal when powered up, but has no valid stored Credentials or can't connect to WiFi APs after a pre-determined time.WiFiNINA module/shield
will try to connect. If successful, the dynamic DHCP and/or configured static IP address will be displayed in the configuration portal. WiFiNINA module/shield
WiFi Config Portal network and Web Server will shutdown to return control to the sketch code.// Must be before #include <WiFiManager_NINA_Lite_SAMD.h>
// Start location in EEPROM to store config data. Default 0
// Config data Size, not including your custom data, currently is 84 bytes)
#define EEPROM_START 0
#include <WiFiManager_NINA_Lite_SAMD.h>
WiFiManager_NINA_Lite* WiFiManager_NINA;
#define USE_DYNAMIC_PARAMETERS true
/////////////// Start dynamic Credentials ///////////////
//Defined in <WiFiManager_NINA_Lite_Teensy.h>
/**************************************
#define MAX_ID_LEN 5
#define MAX_DISPLAY_NAME_LEN 16
typedef struct
{
char id [MAX_ID_LEN + 1];
char displayName [MAX_DISPLAY_NAME_LEN + 1];
char *pdata;
uint8_t maxlen;
} MenuItem;
**************************************/
#if USE_DYNAMIC_PARAMETERS
#define MAX_BLYNK_SERVER_LEN 34
#define MAX_BLYNK_TOKEN_LEN 34
char Blynk_Server1 [MAX_BLYNK_SERVER_LEN + 1] = "";
char Blynk_Token1 [MAX_BLYNK_TOKEN_LEN + 1] = "";
char Blynk_Server2 [MAX_BLYNK_SERVER_LEN + 1] = "";
char Blynk_Token2 [MAX_BLYNK_TOKEN_LEN + 1] = "";
#define MAX_BLYNK_PORT_LEN 6
char Blynk_Port [MAX_BLYNK_PORT_LEN + 1] = "";
#define MAX_MQTT_SERVER_LEN 34
char MQTT_Server [MAX_MQTT_SERVER_LEN + 1] = "";
MenuItem myMenuItems [] =
{
{ "sv1", "Blynk Server1", Blynk_Server1, MAX_BLYNK_SERVER_LEN },
{ "tk1", "Token1", Blynk_Token1, MAX_BLYNK_TOKEN_LEN },
{ "sv2", "Blynk Server2", Blynk_Server2, MAX_BLYNK_SERVER_LEN },
{ "tk2", "Token2", Blynk_Token2, MAX_BLYNK_TOKEN_LEN },
{ "prt", "Port", Blynk_Port, MAX_BLYNK_PORT_LEN },
{ "mqt", "MQTT Server", MQTT_Server, MAX_MQTT_SERVER_LEN },
};
uint16_t NUM_MENU_ITEMS = sizeof(myMenuItems) / sizeof(MenuItem); //MenuItemSize;
#else
MenuItem myMenuItems [] = {};
uint16_t NUM_MENU_ITEMS = 0;
#endif //USE_DYNAMIC_PARAMETERS
#define USE_DYNAMIC_PARAMETERS false
WiFiManager_NINA = new WiFiManager_NINA_Lite();
WiFiManager_NINA->begin();
WiFiManager_NINA->setConfigPortalChannel(newChannel);
WiFiManager_NINA->setConfigPortalChannel(0);
192.168.4.1
), callWiFiManager_NINA->setConfigPortalIP(IPAddress(xxx,xxx,xxx,xxx));
// Set customized DHCP HostName
WiFiManager_NINA->begin("SAMD-WiFiNINA-ABCDEF");
or just use the default Hostname, for example "SAMD-WiFiNINA-XXXXXX" for SAMD
//Or use default Hostname "SAMD-WiFiNINA-XXXXXX"
//WiFiManager_NINA->begin();
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}\
button{background-color:blue;color:white;line-height:2.4rem;font-size:1.2rem;width:100%;}fieldset{border-radius:0.3rem;margin:0px;}</style>";
...
WiFiManager_NINA->setCustomsStyle(NewCustomsStyle);
WiFiManager_NINA->setCustomsHeadElement("<style>html{filter: invert(10%);}</style>");
WiFiManager_NINA->setCORSHeader("Your Access-Control-Allow-Origin");
While in AP mode, connect to it using its SSID
(WIFININA_XXXXXX) / Password
("MyWIFININA_XXXXXX"), then open a browser to the Portal AP IP, default 192.168.4.1
, configure wifi then click Save. The Credentials / WiFi connection information will be saved in non-volatile memory. It will then autoconnect.
Once Credentials / WiFi network information is saved in the host non-volatile memory, it will try to autoconnect to WiFi every time it is started, without requiring any function calls in the sketch.
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
// Default is false (if not defined) => must input 2 sets of SSID/PWD
#define REQUIRE_ONE_SET_SSID_PW true
But it's always advisable to use and input both sets for reliability.
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
// Default is false (if not defined) => must input 2 sets of SSID/PWD
#define REQUIRE_ONE_SET_SSID_PW false
#define SCAN_WIFI_NETWORKS true
The manual input of SSIDs is default enabled, so that users can input arbitrary SSID, not only from the scanned list. This is for the sample use-cases in which users can input the known SSIDs of another place, then send the boards to that place. The boards can connect to WiFi without users entering Config Portal to re-configure.
// To disable manually input SSID, only from a scanned SSID lists
#define MANUAL_SSID_INPUT_ALLOWED false
This is for normal use-cases in which users can only select an SSID from a scanned list of SSIDs to avoid typo mistakes and/or security.
The maximum number of SSIDs in the list is seletable from 2 to 15. If invalid number of SSIDs is selected, the default number of 10 will be used.
// From 2-15
#define MAX_SSID_IN_LIST 8
To define max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
Default is 1 if not defined, and minimum is forced to be 1.
To use, uncomment in defines.h
.
Check retries block the main loop #18
#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
Default is no interval between reconnection WiFi times if lost WiFi. Max permitted interval will be 10mins.
Uncomment to use. Be careful, WiFi reconnection will be delayed if using this method.
Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
Check retries block the main loop #18
#define WIFI_RECON_INTERVAL 30000 // 30s
Default is true
. Just change to false
to Not using Board_Name
on Config_Portal
/////////////////////////////////////////////
// Optional, to use Board Name in Menu
#define USING_BOARD_NAME false
/////////////////////////////////////////////
In Configuration Portal Mode
, it starts an AP called WIFININA_XXXXXX
. Connect to it using the configurable password
you can define in the code. For example, MyWIFININA_XXXXXX
(see examples):
After you connected, please, go to http://192.168.4.1 or newly configured AP IP, you'll see this Main
page:
Enter your credentials,
then click Save
.
The WiFi Credentials will be saved and the board connect to the selected WiFi AP.
If you're already connected to a listed WiFi AP and don't want to change anything, just select Exit
from the Main
page to reboot the board and connect to the previously-stored AP. The WiFi Credentials are still intact.
See this example and modify as necessary
// Used mostly for development and debugging. FORCES default values to be loaded each run.
// Config Portal data input will be ignored and overridden by DEFAULT_CONFIG_DATA
bool LOAD_DEFAULT_CONFIG_DATA = true;
Config Portal data input will be override DEFAULT_CONFIG_DATA
// Used mostly once debugged. Assumes good data already saved in device.
// Config Portal data input will be override DEFAULT_CONFIG_DATA
bool LOAD_DEFAULT_CONFIG_DATA = false;
/// Start Default Config Data //////////////////
/*
#define SSID_MAX_LEN 32
//From v1.0.3, WPA2 passwords can be up to 63 characters long.
#define PASS_MAX_LEN 64
typedef struct
{
char wifi_ssid[SSID_MAX_LEN];
char wifi_pw [PASS_MAX_LEN];
} WiFi_Credentials;
#define NUM_WIFI_CREDENTIALS 2
// Configurable items besides fixed Header, just add board_name
#define NUM_CONFIGURABLE_ITEMS ( ( 2 * NUM_WIFI_CREDENTIALS ) + 1 )
////////////////
typedef struct Configuration
{
char header [16];
WiFi_Credentials WiFi_Creds [NUM_WIFI_CREDENTIALS];
char board_name [24];
int checkSum;
} WiFiNINA_Configuration;
*/
#define TO_LOAD_DEFAULT_CONFIG_DATA true
#if TO_LOAD_DEFAULT_CONFIG_DATA
// This feature is primarily used in development to force a known set of values as Config Data
// It will NOT force the Config Portal to activate. Use DRD or erase Config Data with Blynk.clearConfigData()
// Used mostly for development and debugging. FORCES default values to be loaded each run.
// Config Portal data input will be ignored and overridden by DEFAULT_CONFIG_DATA
//bool LOAD_DEFAULT_CONFIG_DATA = true;
// Used mostly once debugged. Assumes good data already saved in device.
// Config Portal data input will be override DEFAULT_CONFIG_DATA
bool LOAD_DEFAULT_CONFIG_DATA = false;
WiFiNINA_Configuration defaultConfig =
{
//char header[16], dummy, not used
"WIFININA",
// WiFi_Credentials WiFi_Creds [NUM_WIFI_CREDENTIALS];
// WiFi_Credentials.wifi_ssid and WiFi_Credentials.wifi_pw
"SSID1", "password1",
"SSID2", "password2",
//char board_name [24];
"Air-Control",
// terminate the list
//int checkSum, dummy, not used
0
/////////// End Default Config Data /////////////
};
#else
bool LOAD_DEFAULT_CONFIG_DATA = false;
WiFiNINA_Configuration defaultConfig;
#endif // TO_LOAD_DEFAULT_CONFIG_DATA
/////////// End Default Config Data /////////////
Example of Default dynamicParams
#ifndef dynamicParams_h
#define dynamicParams_h
#include "defines.h"
// USE_DYNAMIC_PARAMETERS defined in defined.h
/////////////// Start dynamic Credentials ///////////////
//Defined in <WiFiManager_NINA_Lite_SAMD.h>
/**************************************
#define MAX_ID_LEN 5
#define MAX_DISPLAY_NAME_LEN 16
typedef struct
{
char id [MAX_ID_LEN + 1];
char displayName [MAX_DISPLAY_NAME_LEN + 1];
char *pdata;
uint8_t maxlen;
} MenuItem;
**************************************/
#if USE_DYNAMIC_PARAMETERS
#define MAX_BLYNK_SERVER_LEN 34
#define MAX_BLYNK_TOKEN_LEN 34
char Blynk_Server1 [MAX_BLYNK_SERVER_LEN + 1] = "account.duckdns.org";
char Blynk_Token1 [MAX_BLYNK_TOKEN_LEN + 1] = "token1";
char Blynk_Server2 [MAX_BLYNK_SERVER_LEN + 1] = "account.ddns.net";
char Blynk_Token2 [MAX_BLYNK_TOKEN_LEN + 1] = "token2";
#define MAX_BLYNK_PORT_LEN 6
char Blynk_Port [MAX_BLYNK_PORT_LEN + 1] = "8080";
#define MAX_MQTT_SERVER_LEN 34
char MQTT_Server [MAX_MQTT_SERVER_LEN + 1] = "mqtt.duckdns.org";
MenuItem myMenuItems [] =
{
{ "sv1", "Blynk Server1", Blynk_Server1, MAX_BLYNK_SERVER_LEN },
{ "tk1", "Token1", Blynk_Token1, MAX_BLYNK_TOKEN_LEN },
{ "sv2", "Blynk Server2", Blynk_Server2, MAX_BLYNK_SERVER_LEN },
{ "tk2", "Token2", Blynk_Token2, MAX_BLYNK_TOKEN_LEN },
{ "prt", "Port", Blynk_Port, MAX_BLYNK_PORT_LEN },
{ "mqt", "MQTT Server", MQTT_Server, MAX_MQTT_SERVER_LEN },
};
uint16_t NUM_MENU_ITEMS = sizeof(myMenuItems) / sizeof(MenuItem); //MenuItemSize;
#else
MenuItem myMenuItems [] = {};
uint16_t NUM_MENU_ITEMS = 0;
#endif //USE_DYNAMIC_PARAMETERS
#endif //dynamicParams_h
#define USE_DYNAMIC_PARAMETERS false
or
/////////////// Start dynamic Credentials ///////////////
MenuItem myMenuItems [] = {};
uint16_t NUM_MENU_ITEMS = 0;
/////// // End dynamic Credentials ///////////
Please be noted that the following reserved names are already used in library:
"id" for WiFi SSID
"pw" for WiFi PW
"id1" for WiFi1 SSID
"pw1" for WiFi1 PW
"nm" for Board Name
This is the terminal output when running SAMD_WiFiNINA example on SAMD NANO_33_IOT:
Starting SAMD_WiFiNINA on SAMD NANO_33_IOT
WiFiManager_NINA_Lite v1.7.1
[WN] Hostname=SAMD-Master-Controller
Flag read = 0xffffffff
No doubleResetDetected
SetFlag write = 0xd0d01234
[WN] ======= Start Default Config Data =======
[WN] Hdr=WIFININA,SSID=SSID1,PW=password1
[WN] SSID1=SSID2,PW1=password2
[WN] BName=SAMD-Control
[WN] i=0,id=sv1,data=account.duckdns.org
[WN] i=1,id=tk1,data=token1
[WN] i=2,id=sv2,data=account.ddns.net
[WN] i=3,id=tk2,data=token2
[WN] i=4,id=pt,data=8080
[WN] i=5,id=mq,data=mqtt.duckdns.org
[WN] ChkCrR:CrCCsum=0xaf50,CrRCsum=0xffffffff
[WN] CCSum=0x1360,RCSum=0x0
[WN] Invalid Stored Dynamic Data. Load default from Sketch
[WN] SaveEEPROM,sz=1024,Datasz=0,CSum=0x109a
[WN] CrCCSum=0x1981
[WN] ======= Start Loaded Config Data =======
[WN] Hdr=WIFININA,SSID=SSID1,PW=password1
[WN] SSID1=SSID2,PW1=password2
[WN] BName=SAMD-Control
[WN] i=0,id=sv1,data=account.duckdns.org
[WN] i=1,id=tk1,data=token1
[WN] i=2,id=sv2,data=account.ddns.net
[WN] i=3,id=tk2,data=token2
[WN] i=4,id=pt,data=8080
[WN] i=5,id=mq,data=mqtt.duckdns.org
[WN] b:StayInCfgPortal:NoCfgDat
[WN] SSID=WIFININA_51F485,PW=MyWIFININA_51F485
[WN] IP=192.168.4.1,CH=10
WiFi-beginAP3: return1 = 7
WiFi-beginAP3: return2 = 7
C
Your stored Credentials :
Blynk Server1 = account.duckdns.org
Token1 = token1
Blynk Server2 = account.ddns.net
Token2 = token2
Port = 8080
MQTT Server = mqtt.duckdns.org
Stop doubleResetDetecting
ClearFlag write = 0xd0d04321
CCCCCCCCC
Start SAMD_WiFiNINA on SAMD NANO_33_IOT
WiFiManager_NINA_Lite v1.7.1
[WN] Hostname=SAMD-WIFININA51F485
[WN] CrCCSum=44880,CrRCSum=-1
[WN] CCSum=53040,RCSum=-1
[WN] InitEEPROM,sz=1024,Datasz=392
[WN] pdata=blank,len=34
[WN] pdata=blank,len=34
[WN] pdata=blank,len=34
[WN] pdata=blank,len=34
[WN] pdata=blank,len=6
[WN] pdata=blank,len=34
[WN] CrCCSum=3120
[WN] b:OpenPortal
[WN] SSID=WIFININA_B18D0F,PW=MyWIFININA_B18D0F
[WN] IP=192.168.4.1,CH=10
WiFi-beginAP3: return1 = 7
WiFi-beginAP3: return2 = 7
FYour stored Credentials :
Blynk Server1 = blank
Token1 = blank
Blynk Server2 = blank
Token2 = blank
Port = blank
MQTT Server = blank
CCCCCCCCC
[WN] h:sv1=BlynkServer1
[WN] h:tk1=Token1
[WN] h:sv2=BlynkServer2
[WN] h:tk2=Token2
[WN] h:pt=8080
[WN] h:mq=mqtt-server
[WN] h:UpdEEPROM
[WN] SaveEEPROM,sz=1024,Datasz=392,CSum=3612
[WN] pdata=BlynkServer1,len=34
[WN] pdata=Token1,len=34
[WN] pdata=BlynkServer2,len=34
[WN] pdata=Token2,len=34
[WN] pdata=8080,len=6
[WN] pdata=mqtt-server,len=34
[WN] CrCCSum=4880
[WN] h:Rst
Start SAMD_WiFiNINA on SAMD NANO_33_IOT
WiFiManager_NINA_Lite v1.7.1
[WN] Hostname=SAMD-Master-Controller
Flag read = 0xd0d04321
No doubleResetDetected
SetFlag write = 0xd0d01234
[WN] ======= Start Default Config Data =======
[WN] Hdr=WIFININA,SSID=SSID1,PW=password1
[WN] SSID1=SSID2,PW1=password2
[WN] BName=SAMD-Control
[WN] i=0,id=sv1,data=account.duckdns.org
[WN] i=1,id=tk1,data=token1
[WN] i=2,id=sv2,data=account.ddns.net
[WN] i=3,id=tk2,data=token2
[WN] i=4,id=pt,data=8080
[WN] i=5,id=mq,data=mqtt.duckdns.org
[WN] ChkCrR:CrCCsum=0x21ce,CrRCsum=0x21ce
[WN] CCSum=0x1246,RCSum=0x1246
[WN] CrCCsum=0x21ce,CrRCsum=0x21ce
[WN] Valid Stored Dynamic Data
[WN] ======= Start Stored Config Data =======
[WN] Hdr=WIFININA,SSID=HueNet1,PW=****
[WN] SSID1=HueNet2,PW1=****
[WN] BName=Air-Control
[WN] i=0,id=sv1,data=new_account.duckdns.org
[WN] i=1,id=tk1,data=new_token1
[WN] i=2,id=sv2,data=new_account.ddns.net
[WN] i=3,id=tk2,data=new_token2
[WN] i=4,id=pt,data=8080
[WN] i=5,id=mq,data=new_mqtt.duckdns.org
[WN] No WiFi. Trying to scan and reconnect
[WN] WiFi connected after time: 1
[WN] SSID:HueNet1,RSSI=-33
[WN] IP address:192.168.2.105
[WN] b:WOK
Stop doubleResetDetecting
ClearFlag write = 0xd0d04321
H
Your stored Credentials :
Blynk Server1 = new_account.duckdns.org
Token1 = new_token1
Blynk Server2 = new_account.ddns.net
Token2 = new_token2
Port = 8080
MQTT Server = new_mqtt.duckdns.org
HHHHHHHHHH HHHHHHHHHH HHHHHHHHHH HHHHHHHHHH HHHHHHHHHH HHHHHHHHHH HHHHHHHHHH HHHHHHHHHH
HHHHHHHHHH HHHHHHHHHH HHHHHHHHHH HHHHHHHHHH HHHHHHHHHH HHHHHHHHHH HHHHHHHHHH HHHHHHHHHH
[WN] r:Check&WLost <=== Lost primary WiFi
[WN] r:WLost.ReconW
[WN] No WiFi. Trying to scan and reconnect
[WN] WiFi connected after time: 1
[WN] SSID:HueNet2,RSSI=-50 <=== Connect secondary WiFi
[WN] IP address:192.168.2.111
[WN] r:WOK <=== Success
HHHHHHHHHH HHHHHHHHHH
Start SAMD_WiFiNINA on SAMD NANO_33_IOT
WiFiManager_NINA_Lite v1.7.1
[WN] Hostname=SAMD-Master-Controller
Flag read = 0xd0d04321
No doubleResetDetected
SetFlag write = 0xd0d01234
[WN] ======= Start Default Config Data =======
[WN] Hdr=WIFININA,SSID=SSID1,PW=password1
[WN] SSID1=SSID2,PW1=password2
[WN] BName=SAMD-Control
[WN] i=0,id=sv1,data=account.duckdns.org
[WN] i=1,id=tk1,data=token1
[WN] i=2,id=sv2,data=account.ddns.net
[WN] i=3,id=tk2,data=token2
[WN] i=4,id=pt,data=8080
[WN] i=5,id=mq,data=mqtt.duckdns.org
[WN] ChkCrR:CrCCsum=0x21ce,CrRCsum=0x21ce
[WN] CCSum=0x1246,RCSum=0x1246
[WN] CrCCsum=0x21ce,CrRCsum=0x21ce
[WN] Valid Stored Dynamic Data
[WN] ======= Start Stored Config Data =======
[WN] Hdr=WIFININA,SSID=HueNet1,PW=****
[WN] SSID1=HueNet2,PW1=****
[WN] BName=Air-Control
[WN] i=0,id=sv1,data=new_account.duckdns.org
[WN] i=1,id=tk1,data=new_token1
[WN] i=2,id=sv2,data=new_account.ddns.net
[WN] i=3,id=tk2,data=new_token2
[WN] i=4,id=pt,data=8080
[WN] i=5,id=mq,data=new_mqtt.duckdns.org
[WN] ConMultiWifi
[WN] con2WF:SSID=SSID,PW=password
[WN] Remaining retry_time=3
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
[WN] Remaining retry_time=2
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
[WN] Remaining retry_time=1
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
[WN] Failed using index=0, retry_time=0
[WN] con2WF:failed
[WN] b:NoW
[WN] SSID=WIFININA_51F485,PW=MyWIFININA_51F485
[WN] IP=192.168.4.1,CH=10
WiFi-beginAP3: return1 = 7
WiFi-beginAP3: return2 = 7
Stop doubleResetDetecting
ClearFlag write = 0xd0d04321
C
Your stored Credentials :
Blynk Server1 = new_account.duckdns.org
Token1 = new_token1
Blynk Server2 = new_account.ddns.net
Token2 = new_token2
Port = 8080
MQTT Server = new_mqtt.duckdns.org
CCCC
Start SAMD_WiFiNINA on SAMD NANO_33_IOT
WiFiManager_NINA_Lite v1.7.1
[WN] Hostname=SAMD-Master-Controller
Flag read = 0xd0d04321
No doubleResetDetected
SetFlag write = 0xd0d01234
[WN] ======= Start Default Config Data =======
[WN] Hdr=WIFININA,SSID=SSID1,PW=password1
[WN] SSID1=SSID2,PW1=password2
[WN] BName=SAMD-Control
[WN] i=0,id=sv1,data=account.duckdns.org
[WN] i=1,id=tk1,data=token1
[WN] i=2,id=sv2,data=account.ddns.net
[WN] i=3,id=tk2,data=token2
[WN] i=4,id=pt,data=8080
[WN] i=5,id=mq,data=mqtt.duckdns.org
[WN] ChkCrR:CrCCsum=0x21ce,CrRCsum=0x21ce
[WN] CCSum=0x1246,RCSum=0x1246
[WN] CrCCsum=0x21ce,CrRCsum=0x21ce
[WN] Valid Stored Dynamic Data
[WN] ======= Start Stored Config Data =======
[WN] Hdr=WIFININA,SSID=HueNet1,PW=****
[WN] SSID1=HueNet2,PW1=****
[WN] BName=Air-Control
[WN] i=0,id=sv1,data=new_account.duckdns.org
[WN] i=1,id=tk1,data=new_token1
[WN] i=2,id=sv2,data=new_account.ddns.net
[WN] i=3,id=tk2,data=new_token2
[WN] i=4,id=pt,data=8080
[WN] i=5,id=mq,data=new_mqtt.duckdns.org
[WN] WiFi connected after time: 1
[WN] SSID:HueNet1,RSSI=-20
[WN] IP address:192.168.2.105
[WN] b:WOK
Stop doubleResetDetecting
ClearFlag write = 0xd0d04321
H
Your stored Credentials :
Blynk Server1 = new_account.duckdns.org
Token1 = new_token1
Blynk Server2 = new_account.ddns.net
Token2 = new_token2
Port = 8080
MQTT Server = new_mqtt.duckdns.org
HHHHHHHHH HHHHHHHHHH
Start SAMD_WiFiNINA on SAMD NANO_33_IOT
WiFiManager_NINA_Lite v1.7.1
[WN] Hostname=SAMD-Master-Controller
Flag read = 0xd0d01234
doubleResetDetected
ClearFlag write = 0xd0d04321
[WN] Double Reset Detected
[WN] ======= Start Default Config Data =======
[WN] Hdr=WIFININA,SSID=SSID1,PW=password1
[WN] SSID1=SSID2,PW1=password2
[WN] BName=SAMD-Control
[WN] i=0,id=sv1,data=account.duckdns.org
[WN] i=1,id=tk1,data=token1
[WN] i=2,id=sv2,data=account.ddns.net
[WN] i=3,id=tk2,data=token2
[WN] i=4,id=pt,data=8080
[WN] i=5,id=mq,data=mqtt.duckdns.org
[WN] ChkCrR:CrCCsum=0x21ce,CrRCsum=0x21ce
[WN] CCSum=0x1246,RCSum=0x1246
[WN] CrCCsum=0x21ce,CrRCsum=0x21ce
[WN] Valid Stored Dynamic Data
[WN] ======= Start Stored Config Data =======
[WN] Hdr=WIFININA,SSID=HueNet1,PW=****
[WN] SSID1=HueNet2,PW1=****
[WN] BName=Air-Control
[WN] i=0,id=sv1,data=new_account.duckdns.org
[WN] i=1,id=tk1,data=new_token1
[WN] i=2,id=sv2,data=new_account.ddns.net
[WN] i=3,id=tk2,data=new_token2
[WN] i=4,id=pt,data=8080
[WN] i=5,id=mq,data=new_mqtt.duckdns.org
[WN] b:StayInCfgPortal:DRD
[WN] SSID=WIFININA_51F485,PW=MyWIFININA_51F485
[WN] IP=192.168.4.1,CH=10
WiFi-beginAP3: return1 = 7
WiFi-beginAP3: return2 = 7
C
Your stored Credentials :
Blynk Server1 = new_account.duckdns.org
Token1 = new_token1
Blynk Server2 = new_account.ddns.net
Token2 = new_token2
Port = 8080
MQTT Server = new_mqtt.duckdns.org
CCCCCC
This is the terminal output when running RP2040_WiFiNINA_MQTT example on MBED NANO_RP2040_CONNECT:
Starting RP2040_WiFiNINA_MQTT on MBED NANO_RP2040_CONNECT
WiFiManager_NINA_Lite v1.7.1
[WN] Hostname=RP2040-Master-Controller
LittleFS size (KB) = 64
LittleFS Mount OK
LittleFS Flag read = 0xd0d04321
Flag read = 0xd0d04321
No doubleResetDetected
Saving DOUBLERESETDETECTOR_FLAG to DRD file : 0xd0d01234
Saving DRD file OK
SetFlag write = 0xd0d01234
[WN] CCSum=0x1434,RCSum=0x1434
[WN] CrCCsum=0x1981,CrRCsum=0x0
[WN] Invalid Stored Dynamic Data. Load default from Sketch
[WN] Hdr=WIFININA,SSID=,PW=
[WN] SSID1=,PW1=
[WN] BName=
[WN] i=0,id=svr,data=io.adafruit.com
[WN] i=1,id=prt,data=1883
[WN] i=2,id=usr,data=private
[WN] i=3,id=key,data=private
[WN] i=4,id=pub,data=/feeds/Temperature
[WN] i=5,id=sub,data=/feeds/LED_Control
[WN] bg: isForcedConfigPortal = false
[WN] bg:Stay forever in CP:No ConfigDat
[WN] clearForcedCP
[WN] SaveCPFile
[WN] OK
[WN] SaveBkUpCPFile
[WN] OK
[WN] SSID=WIFININA_51F485,PW=MyWIFININA_51F485
[WN] IP=192.168.4.1,CH=9
C
Your stored Credentials :
AIO_SERVER = io.adafruit.com
AIO_SERVERPORT = 1883
aio_username = private
AIO_KEY = private
AIO_PUB_TOPIC = /feeds/Temperature
AIO_SUB_TOPIC = /feeds/LED_Control
Stop doubleResetDetecting
Saving to DRD file : 0xd0d04321
Saving DRD file OK
LittleFS Flag read = 0xd0d04321
ClearFlag write = 0xd0d04321
CCCCCC
Starting RP2040_WiFiNINA_MQTT on MBED NANO_RP2040_CONNECT
WiFiManager_NINA_Lite v1.7.1
[WN] Hostname=RP2040-Master-Controller
LittleFS size (KB) = 64
LittleFS Mount OK
LittleFS Flag read = 0xd0d04321
Flag read = 0xd0d04321
No doubleResetDetected
Saving DOUBLERESETDETECTOR_FLAG to DRD file : 0xd0d01234
Saving DRD file OK
SetFlag write = 0xd0d01234
[WN] CCSum=0x1434,RCSum=0x1434
[WN] CrCCsum=0x2236,CrRCsum=0x2236
[WN] Valid Stored Dynamic Data
[WN] ======= Start Stored Config Data =======
[WN] Hdr=WIFININA,SSID=HueNet1,PW=password
[WN] SSID1=HueNet2,PW1=password
[WN] BName=Nano-RP2040-Connect
[WN] i=0,id=svr,data=io.adafruit.com
[WN] i=1,id=prt,data=1883
[WN] i=2,id=usr,data=aio_username
[WN] i=3,id=key,data=aio_key i=4,id=pub,data=/feeds/Temperature
[WN] i=5,id=sub,data=/feeds/LED_Control
[WN] WiFi connected after time: 1
[WN] SSID:HueNet1,RSSI=-20
[WN] IP address:192.168.2.153
[WN] b:WOK
Stop doubleResetDetecting
Saving to DRD file : 0xd0d04321
Saving DRD file OK
LittleFS Flag read = 0xd0d04321
ClearFlag write = 0xd0d04321
Creating new WiFi client object OK
Creating new MQTT object OK
AIO_SERVER = io.adafruit.com, AIO_SERVERPORT = 1883
aio_username = aio_username, AIO_KEY = aio_key
Creating new MQTT_Pub_Topic, Temperature = aio_username/feeds/Temperature
Creating new Temperature object OK
Temperature MQTT_Pub_Topic = aio_username/feeds/Temperature
Creating new AIO_SUB_TOPIC, LED_Control = aio_username/feeds/LED_Control
Creating new LED_Control object OK
LED_Control AIO_SUB_TOPIC = aio_username/feeds/LED_Control
Connecting to WiFi MQTT (3 attempts)...
WiFi MQTT connection successful!
TW
Your stored Credentials :
AIO_SERVER = io.adafruit.com
AIO_SERVERPORT = 1883
aio_username = aio_username
AIO_KEY = aio_key
AIO_PUB_TOPIC = /feeds/Temperature
AIO_SUB_TOPIC = /feeds/LED_Control
TWTWTWTW TWTWTWTWTW TWTWTWTWTW TWTW
Debug is enabled by default on Serial. To disable, add at the beginning of sketch
/* Comment this out to disable prints and save space */
#define DEBUG_WIFI_WEBSERVER_PORT Serial
#define WIFININA_DEBUG_OUTPUT Serial
#define _WIFININA_LOGLEVEL_ 2
#define DRD_GENERIC_DEBUG true
If you get compilation errors, more often than not, you may need to install a newer version of the board's core, WiFiNINA module/shield
or this library version.
Sometimes, the library will only work if you update the WiFiNINA module/shield
core to the newer or older version because some function compatibility.
REQUIRE_ONE_SET_SSID_PW == true
LibraryPatches
for Adafruit_MQTT_Library to fix compiler error for RP2040-based and many other boards.WIFI_RECON_INTERVAL
FlashStorage_SAMD
FlashStorage_STM32
library for STM32__SAMD21E1xA__
, __SAMD21G1xA__
and __SAMD21J1xA__
reference
instead of value
Board_Name
in Config PortalCONFIG_MODE_LED
to be ON
when in Config Portal mode.isConfigMode()
to signal system is in Config Portal modeSubmit issues to: WiFiManager_NINA_Lite issues
collaborator, co-author/maintainer
of this library. With the impressive new introducing feature :
Enable scan of WiFi networks for selection in Configuration Portal
. Check PR for v1.3.0 - Enable scan of WiFi networks #10 leading to v1.3.0WIFI_RECON_INTERVAL
.CONFIG_MODE_LED
and function isConfigMode()
⭐️ Thor Johnson |
⭐️ Miguel Wisintainer |
Darvesh7 |
Pierluigi Colangeli |
⭐️⭐️ Michael H. "bizprof" |
tomtobback |
Magnus Nordlander |
nicogou |
If you want to contribute to this project:
Copyright 2020- Khoi Hoang, Michael H.