WiFiManager_Portenta_H7_Lite Library

WiFiManager_Portenta_H7_Lite library GitHub release
How To Install Using Arduino Library Manager


Features

If you have used the full-fledge WiFiManager such as :

  1. Tzapu WiFiManager
  2. Ken Taylor WiFiManager
  3. Khoi Hoang ESP_WiFiManager

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 Portenta_H7 built-in WiFi (Murata) modules/shields, specially designed to support Portenta_H7 running on M7 core.

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 LittleFS, shared with DoubleResetDetector_Generic library.

The web configuration portal, served from the Generic WiFi 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:

  • MultiWiFi feature for configuring/auto(re)connecting Portenta WiFi shields to the available MultiWiFi APs at runtime.
  • DoubleDetectDetector feature to force Config Portal when double reset is detected within predetermined time, default 10s.
  • Powerful-yet-simple-to-use feature to enable adding dynamic custom parameters from sketch and input using the same Config Portal. Config Portal will be auto-adjusted to match the number of dynamic parameters.
  • Optional default Credentials as well as Dynamic parameters to be optionally autoloaded into Config Portal to use or change instead of manually input.
  • Dynamic custom parameters to be saved automatically in non-volatile LittleeFS memory.
  • Configurable Config Portal Title to be either BoardName or default undistinguishable names.
  • Examples are designed to separate Credentials / Defines / Dynamic Params / Code so that you can change Credentials / Dynamic Params quickly for each device.
  • Control Config Portal from software or Virtual Switches
  • To permit autoreset after configurable timeout if DRD/MRD or non-persistent forced-CP
  • Use new Portenta_H7 LittleFS features
  • Scan WiFi networks for selection in Configuration Portal

Currently supported Boards

This WiFiManager_Portenta_H7_Lite library currently supports these following boards:

  1. Portenta_H7 boards such as Portenta_H7 Rev2 ABX00042, etc., using ArduinoCore-mbed mbed_portenta core

Currently supported WiFi shields/modules

  1. Portenta_H7 built-in Murata WiFi


Changelog

Initial Release v1.4.0

  1. Add support to Portenta_H7 boards, using ArduinoCore-mbed mbed_portenta core
  2. Update Packages' Patches
  3. Add LibraryPatches for Adafruit_MQTT_Library to fix compiler error for Portenta_H7 and many other boards.
  4. Bump version to v1.4.0 to sync with WiFiManager_Generic_Lite library

Examples

  1. Portenta_H7_WiFi
  2. Portenta_H7_WiFi_MQTT

Debug Terminal Output Samples

1. Portenta_H7_WiFi_MQTT on Portenta_H7

This is the terminal output when running Portenta_H7_WiFi_MQTT example on Portenta_H7:

1.1 Open Config Portal

Start Portenta_H7_WiFi_MQTT on PORTENTA_H7_M7 with Portenta_H7 WiFi
WiFiManager_Portenta_H7_Lite v1.4.0
[WG] Hostname=Portenta-MQTT
Flash Size: (KB) = 2048.00
FlashIAP Start Address: = 0x80A0000
LittleFS size (KB) = 1280.00
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
[WG] Invalid Stored WiFi Config Data
[WG] bg: isForcedConfigPortal = false
[WG] bg:Stay forever in CP:No ConfigDat
[WG] clearForcedCP
[WG] SaveCPFile 
[WG] OK
[WG] SSID=WIFI_GENERIC_51F485,PW=MyWIFI_GENERIC_51F485
[WG] IP=192.168.4.1,CH=9
Stop doubleResetDetecting
Saving to DRD file : 0xd0d04321
Saving DRD file OK
LittleFS Flag read = 0xd0d04321
ClearFlag write = 0xd0d04321
N
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
NNNN NNNNN NNNNN NNNNN NNNNN NNNNN NNNNN NN

1.2 Got valid Credential from Config Portal, then connected to WiFi and AIO MQTT

Start Portenta_H7_WiFi_MQTT on PORTENTA_H7_M7 with Portenta_H7 WiFi
WiFiManager_Portenta_H7_Lite v1.4.0
[WG] Hostname=Portenta-MQTT
Flash Size: (KB) = 2048.00
FlashIAP Start Address: = 0x80A0000
LittleFS size (KB) = 1280.00
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
[WG] CCSum=0x160c,RCSum=0x160c
[WG] CrCCsum=0x2236,CrRCsum=0x2236
[WG] Valid Stored Dynamic Data
[WG] ======= Start Stored Config Data =======
[WG] Hdr=PORTENTA-H7-WIFI,SSID=HueNet1,PW=12345678
[WG] SSID1=HueNet2,PW1=12345678
[WG] BName=Portenta_H7_MQTT
[WG] i=0,id=svr,data=io.adafruit.com
[WG] i=1,id=prt,data=1883
[WG] i=2,id=usr,data=user_name
[WG] i=3,id=key,data=aio_key
[WG] i=4,id=pub,data=/feeds/Temperature
[WG] i=5,id=sub,data=/feeds/LED_Control
[WG] con2WF:SSID=HueNet1,PW=12345678
[WG] con2WF:OK
[WG] IP=192.168.2.130
[WG] SSID=HueNet1,RSSI=-44
[WG] IP=192.168.2.130
[WG] 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 = user_name, AIO_KEY = aio_key
Creating new MQTT_Pub_Topic,  Temperature = user_name/feeds/Temperature
Creating new Temperature object OK
Temperature MQTT_Pub_Topic = user_name/feeds/Temperature
Creating new AIO_SUB_TOPIC, LED_Control = user_name/feeds/LED_Control
Creating new LED_Control object OK
LED_Control AIO_SUB_TOPIC = user_name/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 = user_name
AIO_KEY = aio_key
AIO_PUB_TOPIC = /feeds/Temperature
AIO_SUB_TOPIC = /feeds/LED_Control
TWTWTWTW TWTWTW
2 Likes

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.