Library for WIFI and MQTT ?

Dear All,

i'm looking for a library which enables me to setup the AP (wifi) and MQTT (broker) parameters at start.

I found the WifiMQTTmanager library, but it's buggy, connects to the AP and disconnects...

The WiFimanager does the job for connecting to an AP, but no MQTT parameters.

Anyone aware of a good library to have both setups at the beginning?

Thx in advance.

If you are using

  1. ESP32/EP3266
  1. Other boards (SAMD, STM32, SAM-DUE, nRF52, Teensy, etc.) with Generic WiFi (WiFiNINA, ESP8266/ESP32-AT, WiFi101, etc)
  1. Other boards (SAMD, STM32, SAM-DUE, nRF52, Teensy, etc.) with WiFiNINA or WiFi101

Lolin Nodemcu v3?

Lolin Nodemcu v3 is ESP8266

  1. ESP32/EP3266
    Library to use ESP_WiFiManager_Lite
    Example to try ESP_WiFi_MQTT
/home/paulo/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/sdk/include -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/sdk/lwip2/include -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/sdk/libc/xtensa-lx106-elf/include -I/tmp/arduino_build_409351/core -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -ffunction-sections -fdata-sections -fno-exceptions -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_NODEMCU\"" -DLED_BUILTIN=2 -DFLASHMODE_DIO -DESP8266 -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266 -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/variants/nodemcu -I/home/paulo/Arduino/Projects/libraries/ESP_WiFiManager_Lite-main/src -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266WiFi/src -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266WebServer/src -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/LittleFS/src -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/DNSServer/src /tmp/arduino_build_409351/sketch/ESP_WiFi_MQTT.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
In file included from /tmp/arduino_build_409351/sketch/defines.h:75:0,
Alternatives for ESP_MultiResetDetector.h: []
                 from /home/paulo/Arduino/libraries/ESP_WiFiManager_Lite-main/examples/ESP_WiFi_MQTT/ESP_WiFi_MQTT.ino:36:
/home/paulo/Arduino/Projects/libraries/ESP_WiFiManager_Lite-main/src/ESP_WiFiManager_Lite.h:169:98: fatal error: ESP_MultiResetDetector.h: No such file or directory
ResolveLibrary(ESP_MultiResetDetector.h)
   #include <ESP_MultiResetDetector.h>      //https://github.com/khoih-prog/ESP_MultiResetDetector
  -> candidates: []                                                                                                  ^

compilation terminated.
Bibliothek ESP_WiFiManager_Lite-main in Version 1.2.0 im Ordner: /home/paulo/Arduino/Projects/libraries/ESP_WiFiManager_Lite-main  wird verwendet
Bibliothek ESP8266WiFi in Version 1.0 im Ordner: /home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266WiFi  wird verwendet
Bibliothek ESP8266WebServer in Version 1.0 im Ordner: /home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266WebServer  wird verwendet
Bibliothek LittleFS in Version 0.1.0 im Ordner: /home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/LittleFS  wird verwendet
Bibliothek DNSServer in Version 1.1.1 im Ordner: /home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/DNSServer  wird verwendet
exit status 1
Fehler beim Kompilieren für das Board NodeMCU 1.0 (ESP-12E Module).

The basic steps to do first is to install the dependent libraries

Check Prerequisites

Starting ESP_WiFi_MQTT using LittleFS on ESP8266_GENERIC
ESP_WiFiManager_Lite v1.2.0
ESP_MultiResetDetector v1.1.1
LittleFS Flag read = 0xFFFD0002
multiResetDetectorFlag = 0xFFFD0002
lowerBytes = 0x0002, upperBytes = 0x0002
No multiResetDetected, number of times = 2
LittleFS Flag read = 0xFFFD0002
Saving config file...
Saving config file OK
[WML] 
stConf:SSID=ESP_5D249D,PW=MyESP_5D249D
[WML] IP=192.168.4.1,ch=2
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

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Exception (3):
epc1=0x4000bf64 epc2=0x00000000 epc3=0x00000000 excvaddr=0x40247553 depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3ffffc20 end: 3fffffc0 offset: 0190
3ffffdb0:  3fff14fd 00000000 40247553 4020e7ab  
3ffffdc0:  3ffef284 3ffefc74 3fff0974 40206ba5  
3ffffdd0:  00000001 3ffefc74 3ffffe00 4020e500  
3ffffde0:  3ffef284 80fffe00 3fff0974 4020e5c4  
3ffffdf0:  00000001 3ffe92da 3fff0974 402094c3  
3ffffe00:  756c6100 00000065 80000000 00000430  
3ffffe10:  000018b4 ffffffff 00000000 4020f6c0  
3ffffe20:  00001c50 0000038a 0000038a 40100737  
3ffffe30:  000018b4 ffffffff 3ffefe1c 00000001  
3ffffe40:  3ffefd24 3ffefc98 00000020 401009bf  
3ffffe50:  3fff0694 3ffefc98 402053e8 00000001  
3ffffe60:  3ffefd24 3ffefc00 3ffffefc 8020e5a5  
3ffffe70:  00000000 3ffefc98 80fefc74 00000001  
3ffffe80:  3ffeff60 3ffffed0 00000000 4020ee14  
3ffffe90:  3ffffef0 3ffffef0 3ffffed0 40207420  
3ffffea0:  00000001 00000001 3ffefd5c 40209568  
3ffffeb0:  3ffffef0 3ffefcb4 3ffefd5c 401000e1  
3ffffec0:  3ffefd5c 3ffefcb4 3ffefd5c 40207458  
3ffffed0:  3ffe0000 80000000 80fe0000 00000038  
3ffffee0:  3ffefd5c 3ffefcb4 3ffefc74 40208ebe  
3ffffef0:  0054002f 00000010 81ffff80 3fff1400  
3fffff00:  0000008f 80005054 000018ae 3ffef2d0  
3fffff10:  3ffefcb4 00000000 4bc6a7f0 00000001  
3fffff20:  00000001 3ffefd5c 40100286 5e76c8b4  
3fffff30:  00000000 3ffefe1c 3ffefc74 3ffef2d0  
3fffff40:  00000001 3ffefc98 3ffefc74 402095f7  
3fffff50:  40211f80 00000000 00001388 47ae147a  
3fffff60:  00000000 3ffefe1c 40100200 ef5c28f5  
3fffff70:  3fffdad0 3fff069c 3fff0974 402096da  
3fffff80:  00000000 00000000 00000001 40100198  
3fffff90:  3fffdad0 00000000 3ffef290 4020978a  
3fffffa0:  feefeffe feefeffe 3ffef290 4020f7d8  
3fffffb0:  feefeffe feefeffe 3ffe865c 40100c85  
<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 3584, room 16 
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld

I am using PubSubClient.
It is compatible for ESP8266, ESP32, Arduino + Ethernet (Wiznet W5100 / W5500 or ENC28J60 aswell).
So one library for all microcontrollers that I am using :slight_smile:

@pw44

It's much better that you installed the libraries correctly. The problems can be either bad / weak power or the bad board.

You can try

  1. to select NodeMCU 1.0 (ESP12-E Module) instead of ESP8266_GENERIC to see if it's better.
  2. to remove all the external wirings, but the USB / power

I just tested here using the same Lolin NodeMCU V3, with both NodeMCU 1.0 (ESP12-E Module) and ESP8266_GENERIC and all is OK.

Only you can solve this issue. Sorry can't help any further.

@martinius96

For boards using Ethernet (W5x00, ENC28J60, etc), it's better to use Ethernet_Manager Library

Have a look at

  1. Examples
  2. How-it-works

The usage are very similar among those libraries.

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