tzapu/WiFiManager

๐Ÿšง Development Release

tablatronix opened this issue ยท 19 comments

Development is now merged into master
https://github.com/tzapu/WiFiManager/

#499

README NOT FULLY UPDATED

  • Create docs for changes, new features functions and known issues

TLDR

  • Works (mostly) the same
  • No Docs, Source is documentation ATM, especially all public methods
  • DEV/ondemand example has pretty much everything
  • Debug level is set very high, change it via WM_DEBUG_LEVEL or _debugLevel in source
  • There are some experimental options for testing issues that are forever ongoing in esp lib
  • all html and strings and in string_en.h and progmem

Development Overview

Added Public Methods

setConfigPortalBlocking
setShowStaticFields
setCaptivePortalEnable
setRestorePersistent
setCaptivePortalClientCheck
setWebPortalClientCheck
startWebPortal
stopWebPortal
process
disconnect
erase
debugSoftAPConfig
debugPlatformInfo
setScanDispPerc
setHostname
setMenu(menu_page_t[])
setWiFiAutoReconnect
setSTAStaticIPConfig(..,dns)
setShowDnsFields
getLastConxResult
getWLStatusString
getModeString
getWiFiIsSaved
setShowInfoErase
setEnableConfigPortal
setCountry
setClass
htmleEtities
getWiFiPass
getWiFiSSID
setWiFiAPChannel
setWiFiAPHidden
setParamsPage
setCleanConnect
setHttpPort
getConfigPortalActive
getWebPortalActive

WiFiManagerParameter

WiFiManagerParameter(id,label)
WiFiManagerParameter.setValue(value,length)
getParameters
getParametersCount

Constructors

WiFiManager(Stream& consolePort)

define/build flags

โ—๏ธ Defines cannot be set in user sketches, can be used in build_flags
#include <rom/rtc.h> // esp32 info page will show last reset reasons if this file is included
WM_MDNS // use MDNS
WM_FIXERASECONFIG // use erase flash fix, esp8266 2.4.0
WM_ERASE_NVS // esp32 erase(true) will erase NVS
WM_DEBUG_LEVEL // set debug level 0-4
WM_DEBUG_PORT // set debug port eg. Serial1

callbacks

setAPCallback // after ap has started
setWebServerCallback // after webserver is setup
setConfigResetCallback // reset settings
setSaveParamsCallback // after save params from params menu or wifi config
setPreSaveConfigCallback // before saving wifi creds

Changes

  • ESP32 support
  • complete refactor of strings strings_en.h
  • adds new tokens for wifiscan, and some classes (left , invert icons, MSG color)
  • adds status callout panel default, primary, special colors
  • adds tons of info on info page, and erase capability
  • adds signal icons, replaces percentage ( has hover titles )
  • adds labels to all inputs (replaces placeholders)
  • all html ( and eventually all strings except debug) moved to strings_en.h
  • added additional debugging, compressed debug lines, debuglevels
  • persistent disabled, and restored via de/con-stuctor (uses setRestorePersistent)
  • should retain all user modes including AP, should not overwrite or persist user modes or configs,even STA (storeSTAmode) (BUGGY)
  • โš ๏ธ return values may have changed depending on portal abort, or timeout ( portalTimeoutResult,portalAbortResult)
  • params memory is auto allocated by increment of WIFI_MANAGER_MAX_PARAMS(5) when exceeded, user no longer needs to specify this at all.
  • addparameter now returns bool, and it returns false if param ID is not alphanum [0-9,A-Z,a-z,_]
  • param field ids allow {I} token to use param_n instead of string in case someones wants to change this due to i18n or character issues
  • provides #DEFINE FIXERASECONFIG to help deal with esp8266/Arduino#3635
  • failure reason reporting on portal
  • set esp8266 sta hostname, esp32 sta+ap hostname ( DHCP client id)
  • pass in debug stream in constructor WiFiManager(Stream& consolePort)
  • you can force ip fields off with setShow_X_fields(false) if you set _disableIpFields=true
  • param menu/page (setup) added to separate params from wifi page, handled automatically by setMenu
  • set custom root menu
  • disable configportal on autoconnect
  • wm parameters init is now protected, allowing child classes, example included
  • wifiscans are precached and async for faster page loads, refresh forces rescan
  • adds esp32 gettemperature ( currently commented out, useful for relative measurement only )
  • Set AP Channel
  • Set AP Hidden
  • Change Http Port
  • โš ๏ธ setAPCallback has moved to after startap

Very good,
for the esp32 merge i think it is fundamental and, at least for me, it work very well.
Merge it in the lib will help to have new test/opinion.

  • adds signal icons, replaces percentage ( has hover titles )

On this change i do not agree, imho have the percentage is better than a simple icons whit only 4 graphic step, and on mobile lcd you cannot click for see the percentage number.
It is a very important signal, example for decide the post orientation of the Esp on a critical position far away from the wifi-router, sometimes you have very little wifi signsl, and recover 5 or 10% will make the difference.

You should add a public function that the user can use on the .ino sketch for decide himself witch type of data he need ?

I repeat, imho it is a very important info that the user should be decide whitout change the lib code.

  • include <rom/rtc.h> to get esp32 info to show reset reasons
  • remove esp32 autoconnect workaround ( fixed in core )
    #664

left define in to reenable, if anyone needs something like that or similar

Refactor of examples currently in progress !
They might be messy for a bit

Has anyone tried WiFiManager with an ESP8285 ?

I have one I have not tested yet

  • test ESP8285

To give a little background.
I am using the Arduino1.8.5 IDE on Win7-64 bit.
The code has been compiled for an NodeMCU Lolin v3 and works properly.
I have a ESP8285 m3 board that I have been working with and have interfaces an I2C OLED display and an I2C RTC chip.
I then compile the same demo programs as the NodeMCU, but the 8285 does not what too connect to any of my devices, ( DEL laptop, iPhone or Samsung tablet) as the NodeMCU has done.
Here is a screen shot of the IDE Tools configuration.
esp8285 m3
Please let me know if you see anything I missed.
Thank You for your time.

What does serial debug say?

After loading the program, the serial monitor shows:
autoconnect
My iPhone and tablet shows the ESP8822174 as an access point, but neither are able to connect.
The above serial monitor does not change when attempting a connection.

maybe turn on esp debugging,
so you are not able to join the ap at all?
what about the esp8266 softap example

please create a new issue for this also

Locked this issue, this is for documentation only

Known Issues/Outstanding Design

  • Since autoconnect and startcp can be non blocking now, return results may be inconsistent with old code, ensure this is cleaned up and ocncise

  • You can now skip wifi and save other params, wifi will be ignored, also this will alter return results as true was for connected status previously

  • save callbacks are not called if not changing wifi, unless shouldbreakafterconfig is set, this needs to be cleaned up in to a legacy handling and new handling consitancy

  • save wifi and save param can be split now, wifi still retains ip inputs, setup custom params, there is no user selection here, improve where user wants params, fix up callbacks to make it clear where user is getting data back from. savewifi, saveparam, etc

  • WM is NO longer persistent unless you save, atm I am reducing confusion by forcing STA mode on because that is how legacy worked, by design or not, it is what users are used to. Clarify how users want this to function, users now are responsible for user code and modes, wm can restore user modes back when starting and stopping configportal without touching their flash confgs. So if wifi was off, or ap, it will go back and they will wonder why their wifi is not on or why there is an ap when they reboot ???

  • Documentation is non existent, I might work with doxygen to get some basic generated from my doc blocks, all public functions are documented fairly well. Source is Docs for now.

  • DEV/ondemand example is used as my poor mans unit test, it has almost all functionality added to it and maintained.

  • Examples need to be cleaned up, I want them cleaned up into useful functions also, for example MQTT, with api token, durations, etc. littlefs

  • spiffs is replaced by littlefs, update examples as such

  • users still want customization, almost anything can be customized in strings.h, but maybe we can add a header and footer callout for easy code only dynamic changes.

  • reduce code bloat by wrapping features in a #ifdef , make features optional, advanced info page has alot of info folks might not need, advanced testing page, gpio toggle?ota form? api ?

Release v2.0.3-apha Development Is available in arduino library manager
https://github.com/tzapu/WiFiManager/releases/tag/2.0.3-alpha

Development branch is now master

  • merge development into master
  • delete development branch