Blynk & WiFiManager for Mega/SAMD/SAM-DUE,Teensy/STM32, RP2040-based boards, etc. using WiFiNINA

How To Install Using Arduino Library Manager

New Releases v1.0.0

  1. This release of very-easy-to-use will help you to eliminate hardcoding your Wifi and Blynk credentials for Mega/Teensy boards running WiFiNINA shields, and updating/reflashing every time when you need to change them.
  2. Configuration data are stored in configurable location in EEPROM.
  3. When WiFi and/or Blynk connection is lost, the WM will try auto-reconnect.
  4. Config Portal Static IP address, Name and Password.
  5. Static IP address, Gateway, Subnet Mask.
  6. Currently support AVR Mega and SAMD (ZERO, MKR, NANO_33_IOT, M0, M0 Pro, AdaFruit CIRCUITPLAYGROUND_EXPRESS, etc.) boards
  7. Enhance GUI.

To help you to eliminate hardcoding your Wifi and Blynk credentials for Mega/Teensy boards running WiFiNINA modules/shields, and updating/reflashing every time when you need to change them. Configuration data are saved in configurable location in EEPROM/Flash.

So, how it works?

If it cannot connect to the Blynk server in 30 seconds, it will switch to Configuration Mode. You will see your built-in LED turned ON. In Configuration Mode, it starts a configurable access point, default called Teensy4_XXXXXX, SAMD_XXXXXX, DUE_XXXXXX,Mega_XXXXXX or STM32_XXXXXX. Connect to it using password MyTeensy4_XXXXXX, MySAMD_XXXXXX, MyDUE_XXXXXX, MyMega_XXXXXX or MySTM32_XXXXXX.

After you connected, please, go to http://192.168.4.1 or the AP IP you specified.

Enter your credentials : WiFi SSID/Password, Blynk Server, Port and Token, Board Name and dynamic custom parameters (MQTT credentials in the example)

Then click Save. After you restarted, you will see your built-in LED turned OFF. That means, it connected to your Blynk server successfully.

The following is the sample terminal output when running example SAMD_WiFiNINA

  1. No Config Data => Config Portal
Start Blynk_WiFiNINA_WM using WiFiNINA_Shield on SAMD NANO_33_IOT
Start Blynk_WM
[16286] RFC925 Hostname = SAMD-WiFiNINA
[16287] CrCCSum=2244,CrRCSum=0
[16288] CCSum=0,RCSsum=0
[16288] InitEEPROM,sz=1024,Datasz=336
[16288] pdata=,len=34
[16288] pdata=,len=6
[16289] pdata=,len=34
[16289] pdata=D_WiFiNINA,len=34
[16289] pdata=,len=34
[16289] pdata=,len=34
[16291] CrCCSum=3599
[16291] b:Nodat.Stay
[17052] stConf:SSID=SAMD_NINA_51F485,PW=MySAMD_NINA_51F485,IP=192.168.120.1
  1. Config Data Ready => Run
Start Blynk_WiFiNINA_WM using WiFiNINA_Shield on SAMD NANO_33_IOT
Start Blynk_WM
[19387] RFC925 Hostname = SAMD-WiFiNINA
[19388] CrCCSum=6368,CrRCSum=6368
[19389] CCSum=7055,RCSsum=7055
[19389] Hdr=SHD_WiFiNINA,SSID=HueNet1,PW=****
[19389] Svr=account.duckdns.org,Prt=8080,Tok=****
[19389] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on NANO_33_IOT

[19390] con2WF:start
[20151] con2WF:millis=761
[20151] WiFiNINA Firmware Version: 1.3.0
[20151] Con2:HueNet1
[23346] IP:192.168.2.139
[23346] con2WF:OK
[23346] IP = 192.168.2.139, GW = 192.168.2.1, SN = 255.255.0.0
[23347] b:WOK.TryB
[23348] BlynkArduinoClient.connect: Connecting to account.duckdns.org:8080
[23468] Ready (ping: 6ms).
[23468] Free RAM: 24167
[23539] b:WBOK
BBBBBBBBBB BBBBBBBBBB BBBBBBBBBB BBBBBBBBBB

Updated June 1st 2021

Major Releases v1.1.0

  1. Add support to RP2040-based boards, such as RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Earle Philhower’s arduino-pico v1.6.2+ core.
  2. Add support to RP2040-based boards, such as Nano_RP2040_Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Arduino-mbed RP2040 v2.1.0+ core.
  3. Enable scan of WiFi networks for selection in Configuration Portal. Check PR for v1.3.0 - Enable scan of WiFi networks #10. Now you can select optional SCAN_WIFI_NETWORKS, MANUAL_SSID_INPUT_ALLOWED to be able to manually input SSID, not only from a scanned SSID lists and MAX_SSID_IN_LIST (from 2-6 for ESP8266-AT or 2-15 for other)
  4. Use more efficient FlashStorage_SAMD v1.1.0 and FlashStorage_STM32 v1.1.0
  5. Add functions to control Config Portal from software or Virtual Switches. Check How to trigger a Config Portal from code #25
  6. Configurable Customs HTML Headers, including Customs Style, Customs Head Elements, CORS Header.
  7. Fix MultiWiFi connection bug. Check SAMD MultiWiFi issues when first WiFi SSID configured in CP is invalid or not available #6
  8. Fix invalid “blank” or NULL Config Data treated as Valid. Check WiFiManager connection attempt to unconfigured (“blank”) SSID after restart on SAMD #8
  9. Permit optionally inputting one set of WiFi SSID/PWD by using REQUIRE_ONE_SET_SSID_PW == true
  10. Enforce WiFi Password minimum length of 8 chars
  11. Enhance MultiWiFi connection logic
  12. Minor enhancement to not display garbage when data is invalid
  13. Tested with new Arduino Core for STM32 v2.0.0 and add support to new STM32L5 boards
  14. Optimize code.
  15. Update examples
  16. Update `Packages’ Patches
  17. Fix compiler warnings.

Debug Terminal Output

Start RP2040_WiFiNINA_WM using WiFiNINA_Shield on MBED NANO_RP2040_CONNECT
Blynk_WiFiNINA_WM v1.1.0
DoubleResetDetector_Generic v1.3.0
Start Blynk_WM
[WN] Hostname=nRF52-WiFiNINA
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=0x3361,RCSum=0x3361
[WN] CrCCsum=0x219f,CrRCsum=0x219f
[WN] Valid Stored Dynamic Data
[WN] ======= Start Stored Config Data =======
[1236] Hdr=SHD_WiFiNINA,BrdName=SAMD_WiFiNINA
[1236] SSID=HueNet1,PW=password
[1236] SSID1=HueNet,PW1=password
[1237] Server=192.168.2.112,Token=token
[1237] Server1=account.duckdns.org,Token1=token1
[1238] Port=8080
[1238] ======= End Config Data =======
[WN] i=0,id=mqtt,data=new-mqtt-server
[WN] i=1,id=mqpt,data=1883
[WN] i=2,id=user,data=new-mqtt-username
[WN] i=3,id=mqpw,data=new-mqtt-password
[WN] i=4,id=subs,data=new-mqtt-SubTopic
[WN] i=5,id=pubs,data=new-mqtt-PubTopic
[1241] ======= End Dynamic Data =======
[WN] con2WF:SSID=HueNet1,PW=password
[WN] con2WF:OK
[WN] IP=192.168.2.153
[4819] IP = 192.168.2.153, GW = 192.168.2.1, SN = 255.255.255.0
[4822] b:WOK.TryB
[4823] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on MBED NANO_RP2040_CONNECT

[4824] BlynkArduinoClient.connect: Connecting to 192.168.2.112:8080
[4854] Ready (ping: 17ms).
[4924] Con2BlynkServer=192.168.2.112,Token=token
[4924] b:WBOK
B
Your stored Credentials :
MQTT Server = new-mqtt-server
Port = 1883
MQTT UserName = new-mqtt-username
MQTT PWD = new-mqtt-password
Subs Topics = new-mqtt-SubTopic
Pubs Topics = new-mqtt-PubTopic
Stop doubleResetDetecting
Saving to DRD file : 0xd0d04321
Saving DRD file OK
LittleFS Flag read = 0xd0d04321
ClearFlag write = 0xd0d04321
BB
2 Likes

Updated June 9th 2021

Releases v1.1.1

  1. Add Blynk library Patches for MBED RP2040-based (Nano_RP2040_Connect, etc.) boards

For more info, check Arduino nano rp2040 with Blynk

Hi, does this update also work with blynk 2.0?