Arduino Library 2.25.2

Date: 25 April 2022
Component: Arduino Library
Release Note: Add ESP32 WebConfig, Fix secure ESP8266 connections with WebConfig, and improve OTA stability.

Additional Information

2.25.2

  • Fix Compiling on WiFi devices without WiFi.begin() support after adding the WebConfig compatibility on ESP32.
  • Fix PORTENTA H7 compiling issue: does not implement WiFi.begin(SSID).

2.25.1

  • Fix ESP32 WebConfig issue (showing captive portal even if it was configured previously)
  • Improve ESP8266 NTP sync to be more fault-tolerant
  • THINGER_NTP_SERVER can be #defined to configure NTP server (defaults to pool.ntp.org)
  • THINGER_NTP_TIMEOUT can be #defined to configure NTP timeout.

2.25.0

1 Like

Hello @alvarolb

I believe you identify an “intermittent bug” when using ThingerESP8266WebConfig.h.

The bug occurs intermittently (there are successful attempts and failure = “intermittent bug”) after registering the SSID and password of the Router/Modem. The problem causes the ESP8266 to restart. The “curious” is that after restart, everything works fine, the bug does not appear. It only occurs intermittently after registering the SSID and password of the Router/Modem.

As far as I could trace, the “intermittent bug” occurs right after the [NTP_SYN] Current time (UTC): message. It probably occurs in client_.connect(get_host(), THINGER_SSL_PORT); (LINK) .

See the 3 logs below. Log 1 and 2 report (rst cause:2) and log 3 (rst cause:4)
1)

11:57:31.278 > *wm:[2] <- HTTP WiFi save  
11:57:31.310 > *wm:[2] processing save 
11:57:33.310 > *wm:[2] Connecting as wifi client... 
11:57:33.316 > *wm:[2] setSTAConfig static ip not set, skipping
11:57:33.322 > *wm:[1] Connecting to NEW AP: XXXXXXXXXXX
11:57:33.428 > *wm:[1] connectTimeout not set, ESP waitForConnectResult... 
11:57:38.640 > *wm:[2] Connection result: WL_CONNECTED
11:57:38.646 > *wm:[1] Connect to new AP [SUCCESS] 
11:57:38.652 > *wm:[1] Got IP Address:
11:57:38.652 > *wm:[1] 192.168.1.21
11:57:38.652 > *wm:[2] shutdownConfigPortal
11:57:38.657 > *wm:[2] restoring usermode STA
11:57:39.650 > *wm:[2] wifi status: WL_CONNECTED
11:57:39.656 > *wm:[2] wifi mode: STA
11:57:39.656 > *wm:[2] configportal closed
11:57:39.662 > *wm:[1] config portal exiting
11:57:39.662 > [_CONFIG] Updating Device Info...
11:57:39.721 > [_CONFIG] Done!
11:57:39.727 > [NETWORK] Connected!
11:57:39.727 > Thinger State Listener: NETWORK_CONNECTED
11:57:39.766 > [_SOCKET] Connecting to XXXXXX.aws.thinger.io:25202...
11:57:39.772 > [_SOCKET] Using secure TLS/SSL connection: yes
11:57:39.780 > Thinger State Listener: SOCKET_CONNECTING
11:57:39.823 > [NTP_SYN] Waiting for NTP time sync from: pool.ntp.org
11:57:40.333 > [NTP_SYN] Current time (UTC): Sun Aug  7 14:57:41 2022
11:57:40.503 > 
11:57:40.509 > User exception (panic/abort/assert)
11:57:40.509 > --------------- CUT HERE FOR EXCEPTION DECODER ---------------
11:57:40.515 >
11:57:40.515 > Unhandled C++ exception: OOM
11:57:40.518 >
11:57:40.518 > >>>stack>>>
11:57:40.518 >
11:57:40.518 > ctx: cont
11:57:40.521 > sp: 3ffffda0 end: 3fffffc0 offset: 0000
11:57:40.525 > 3ffffda0:  4020ee12 3fff6134 3fff08ba 00000020
11:57:40.530 > 3ffffdb0:  000000fe 00000000 00000000 00000000
11:57:40.534 > 3ffffdc0:  00000000 00000000 00000000 00000001  
11:57:40.535 > 3ffffdd0:  00007fff 00000000 3fff454c 3ffe88ce
11:57:40.539 > 3ffffde0:  00000000 4020f941 00000c08 4021ce3e
11:57:40.548 > 3ffffdf0:  00000000 4020f941 00000020 4021ce5d
11:57:40.548 > 3ffffe00:  c014c00a c031c02d 00000c08 4021c65c  
11:57:40.553 > 3ffffe10:  c02ac026 3ffffe30 3fff1814 4020f941
11:57:40.562 > 3ffffe20:  00000000 00000000 3fff1814 4020fa94
11:57:40.566 > 3ffffe30:  00000000 c00dc003 3fff000a 4020f61c  
11:57:40.567 > 3ffffe40:  00000000 00000000 00000d60 3ffe88ce
11:57:40.571 > 3ffffe50:  00000000 3fff453c 3fff1814 4020fe55
11:57:40.575 > 3ffffe60:  00000078 3fff0934 00000001 4021c858
11:57:40.580 > 3ffffe70:  00000000 00000000 00006272 4021cf66  
11:57:40.584 > 3ffffe80:  00000000 3fff6134 3fff1814 4020ee12
11:57:40.593 > 3ffffe90:  3fff591c 3ffe8878 3fff0764 3fff08cc
11:57:40.594 > 3ffffea0:  00006272 3ffe88ce 3fff1814 3fff08cc  
11:57:40.598 > 3ffffeb0:  00006272 3ffe88ce 3fff1814 4020ffe1
11:57:40.603 > 3ffffec0:  40222f50 f7ab5136 40222f50 f7ab5136
11:57:40.612 > 3ffffed0:  3fffdad0 3fff1814 3fff0350 40220dc2  
11:57:40.612 > 3ffffee0:  3fffdad0 3fff1814 3fff0350 4020684e
11:57:40.621 > 3ffffef0:  3fffdad0 00000001 3fff0350 4020a2a2
11:57:40.626 > 3fffff00:  00000001 0000000a 3fff0764 4021a218
11:57:40.630 > 3fffff10:  00000001 3fff0350 3fff0764 4021a23c  
11:57:40.631 > 3fffff20:  00000001 3fff0350 3fff0764 40205a32
11:57:40.639 > 3fffff30:  00000001 3ffe88fb 3fff0764 3fff08cc
11:57:40.639 > 3fffff40:  3fffdad0 00000001 3fff0350 4020a3b8  
11:57:40.648 > 3fffff50:  000020cb 00000000 3fff0350 4020a5ea
11:57:40.653 > 3fffff60:  030b1578 2fd08d8f 00000000 734b1c4a
11:57:40.653 > 3fffff70:  000020cb 00000001 3fff0374 4020b4d9  
11:57:40.662 > 3fffff80:  00000000 00000000 40221268 3fff08cc
11:57:40.662 > 3fffff90:  3fffdad0 00000000 3fff0350 4020ae3e
11:57:40.667 > 3fffffa0:  3fffdad0 00000000 3fff08b8 4021c978
11:57:40.677 > 3fffffb0:  feefeffe feefeffe 3ffe8668 40100221  
11:57:40.677 > <<<stack<<<
11:57:40.677 >
11:57:40.683 > last failed alloc call: 4020F941(3080)
11:57:40.683 >
11:57:40.683 > --------------- CUT HERE FOR EXCEPTION DECODER ---------------
11:57:40.688 >
11:57:40.688 > last failed alloc caller: 0x4020f941
11:57:40.705 > 
11:57:40.706 >  ets Jan  8 2013,rst cause:2, boot mode:(3,6)
11:57:40.706 >
11:57:40.706 > load 0x4010f000, len 3460, room 16
11:57:40.715 > tail 4
11:57:40.716 > chksum 0xcc
11:57:40.716 > load 0x3fff20b8, len 40, room 4
11:57:40.716 > tail 4
11:57:40.716 > chksum 0xc9
11:57:40.719 > csum 0xc9
11:57:40.719 > v000848e0
11:57:40.719 > ~ld
16:03:29.732 > *wm:[2] <- HTTP WiFi save  
16:03:29.751 > *wm:[2] processing save 
16:03:31.749 > *wm:[2] Connecting as wifi client... 
16:03:31.755 > *wm:[2] setSTAConfig static ip not set, skipping
16:03:31.766 > *wm:[1] Connecting to NEW AP: XXXXXXXXX
16:03:31.868 > *wm:[1] connectTimeout not set, ESP waitForConnectResult... 
16:03:36.503 > *wm:[2] Connection result: WL_CONNECTED
16:03:36.509 > *wm:[1] Connect to new AP [SUCCESS]
16:03:36.515 > *wm:[1] Got IP Address:
16:03:36.515 > *wm:[1] 192.168.1.100
16:03:36.515 > *wm:[2] shutdownConfigPortal 
16:03:36.520 > *wm:[2] restoring usermode STA
16:03:37.513 > *wm:[2] wifi status: WL_CONNECTED
16:03:37.519 > *wm:[2] wifi mode: STA
16:03:37.519 > *wm:[2] configportal closed
16:03:37.524 > *wm:[1] config portal exiting
16:03:37.524 > [_CONFIG] Updating Device Info...
16:03:37.603 > [_CONFIG] Done!
16:03:37.604 > [NETWORK] Connected!
16:03:37.604 > Thinger State Listener: NETWORK_CONNECTED
16:03:37.643 > [_SOCKET] Connecting to XXXXXXX.aws.thinger.io:25202...
16:03:37.651 > [_SOCKET] Using secure TLS/SSL connection: yes
16:03:37.656 > Thinger State Listener: SOCKET_CONNECTING
16:03:37.703 > [NTP_SYN] Waiting for NTP time sync from: pool.ntp.org
16:03:38.204 > [NTP_SYN] Current time (UTC): Sat Aug 20 19:03:38 2022
16:03:38.367 > 
16:03:38.368 > User exception (panic/abort/assert)
16:03:38.368 > --------------- CUT HERE FOR EXCEPTION DECODER ---------------
16:03:38.373 >
16:03:38.373 > Unhandled C++ exception: OOM
16:03:38.376 >
16:03:38.376 > >>>stack>>>
16:03:38.376 >
16:03:38.376 > ctx: cont
16:03:38.380 > sp: 3ffffd60 end: 3fffffc0 offset: 0000
16:03:38.380 > 3ffffd60:  3fff11dc 3fff0edc 000000ff 00000000
16:03:38.389 > 3ffffd70:  000000fe 00000000 00000000 00000000  
16:03:38.393 > 3ffffd80:  00000000 00000000 00000000 00000001
16:03:38.397 > 3ffffd90:  3fff1578 00000000 3fff1584 00000000
16:03:38.398 > 3ffffda0:  00000000 4021627a 00000c08 4022772e  
16:03:38.402 > 3ffffdb0:  00000000 00000020 00000c08 4022774d
16:03:38.411 > 3ffffdc0:  3fff604c 4021627a 00000c08 40226e62
16:03:38.412 > 3ffffdd0:  3ffffde0 3ffffe2c 3ffffe24 4021627a
16:03:38.416 > 3ffffde0:  cca8cca9 00000000 3fff1afc 40216482  
16:03:38.425 > 3ffffdf0:  c0afc0ae c027c023 c028c024 c013c009
16:03:38.425 > 3ffffe00:  c014c00a c031c02d c032c02e 00000000
16:03:38.434 > 3ffffe10:  c02ac026 c00ec004 c00fc005 009d009c  
16:03:38.435 > 3ffffe20:  c09dc09c c0a1c0a0 003d003c 0035002f
16:03:38.443 > 3ffffe30:  c012c008 c00dc003 0000000a 40226e43
16:03:38.443 > 3ffffe40:  00000000 3ffffedc 3ffffed4 3fff4c3c  
16:03:38.452 > 3ffffe50:  00000000 00000000 3fff1afc 402169b4
16:03:38.457 > 3ffffe60:  3fff0ed8 00000000 00000000 40241a87
16:03:38.461 > 3ffffe70:  007a1200 3fff1afc 00000040 4023d0e6
16:03:38.461 > 3ffffe80:  007a1200 e8fa359a 00000000 00000000  
16:03:38.470 > 3ffffe90:  00000000 00000000 00000000 00000000
16:03:38.475 > 3ffffea0:  40105fad 0a696df5 3fff0c30 00000000
16:03:38.479 > 3ffffeb0:  3ffef920 3fff0c30 00000001 00000000  
16:03:38.484 > 3ffffec0:  00000000 00000000 00000000 00000000
16:03:38.484 > 3ffffed0:  00000000 3ffffedc 00000000 4022784a
16:03:38.488 > 3ffffee0:  3ffe8d90 3fff1afc 3fff5d84 40214d06  
16:03:38.493 > 3ffffef0:  3fffff20 3fff0a5c 3ffe8af8 3fff0bc8
16:03:38.498 > 3fffff00:  00006272 3fff1afc 3ffe8d90 3fff0bc8
16:03:38.502 > 3fffff10:  00006272 3fff1afc 3ffe8d90 40216c60
16:03:38.507 > 3fffff20:  4022e95c f7ab5136 4022e95c f7ab5136  
16:03:38.511 > 3fffff30:  3fff61b4 3fff0634 3fff0a5c 40206c30
16:03:38.520 > 3fffff40:  6301300a 00000000 00000003 4020f394
16:03:38.521 > 3fffff50:  3fffdad0 00000001 3fff0634 40209e31  
16:03:38.525 > 3fffff60:  3fffdad0 00000001 3fff0634 4020dfb5
16:03:38.534 > 3fffff70:  00000000 feefeffe feefeffe feefeffe
16:03:38.535 > 3fffff80:  3ffffec0 feefeffe feefeffe feefeffe  
16:03:38.539 > 3fffff90:  3fffdad0 00000000 3ffe8674 4020efec
16:03:38.543 > 3fffffa0:  3fffdad0 00000000 3ffe8674 402271e6
16:03:38.548 > 3fffffb0:  feefeffe feefeffe feefeffe 40100411
16:03:38.554 > <<<stack<<<
16:03:38.554 >
16:03:38.559 > last failed alloc call: 4021627A(3080)
16:03:38.559 >
16:03:38.559 > --------------- CUT HERE FOR EXCEPTION DECODER ---------------
16:03:38.565 >
16:03:38.565 > last failed alloc caller: 0x4021627a
16:03:38.576 > 
16:03:38.583 >  ets Jan  8 2013,rst cause:2, boot mode:(3,6)
16:03:38.583 >
16:03:38.583 > load 0x4010f000, len 3460, room 16 
16:03:38.587 > tail 4
16:03:38.592 > chksum 0xcc
16:03:38.592 > load 0x3fff20b8, len 40, room 4
16:03:38.592 > tail 4
16:03:38.592 > chksum 0xc9
16:03:38.596 > csum 0xc9
16:03:38.596 > v00090910
16:03:38.596 > ~ld
15:45:24.845 > *wm:[2] <- HTTP WiFi save  
15:45:24.872 > *wm:[2] processing save 
15:45:26.871 > *wm:[2] Connecting as wifi client... 
15:45:26.876 > *wm:[2] setSTAConfig static ip not set, skipping
15:45:26.881 > *wm:[1] Connecting to NEW AP: XXXXXXXX_AP
15:45:26.989 > *wm:[1] connectTimeout not set, ESP waitForConnectResult... 
15:45:31.512 > *wm:[2] Connection result: WL_CONNECTED
15:45:31.518 > *wm:[1] Connect to new AP [SUCCESS]
15:45:31.523 > *wm:[1] Got IP Address:
15:45:31.523 > *wm:[1] 192.168.1.100
15:45:31.523 > *wm:[2] shutdownConfigPortal
15:45:31.529 > *wm:[2] restoring usermode STA
15:45:32.521 > *wm:[2] wifi status: WL_CONNECTED
15:45:32.527 > *wm:[2] wifi mode: STA
15:45:32.527 > *wm:[2] configportal closed
15:45:32.532 > *wm:[1] config portal exiting
15:45:32.532 > [_CONFIG] Updating Device Info...
15:45:32.605 > [_CONFIG] Done!
15:45:32.612 > [NETWORK] Connected!
15:45:32.612 > Thinger State Listener: NETWORK_CONNECTED
15:45:32.650 > [_SOCKET] Connecting to XXXXXXX.aws.thinger.io:25202...
15:45:32.670 > [_SOCKET] Using secure TLS/SSL connection: yes
15:45:32.670 > Thinger State Listener: SOCKET_CONNECTING
15:45:32.709 > [NTP_SYN] Waiting for NTP time sync from: pool.ntp.org
15:45:33.212 > [NTP_SYN] Current time (UTC): Sat Aug 20 18:45:33 2022
15:45:48.379 > [_SOCKET] Error while connecting!
15:45:48.384 > Thinger State Listener: SOCKET_CONNECTION_ERROR
15:45:48.418 > AVISO: Contagem de erros para Restart ESP N: 1/40
15:45:53.421 > [_SOCKET] Connecting to XXXXX.aws.thinger.io:25202...
15:45:53.427 > [_SOCKET] Using secure TLS/SSL connection: yes
15:45:53.433 > Thinger State Listener: SOCKET_CONNECTING
15:45:53.480 > [NTP_SYN] Current time (UTC): Sat Aug 20 18:45:53 2022
15:46:08.728 > [_SOCKET] Error while connecting!
15:46:08.729 > Thinger State Listener: SOCKET_CONNECTION_ERROR
15:46:08.763 > AVISO: Contagem de erros para Restart ESP N: 2/40
15:46:13.764 > COMANDO: LED - Ticker N: 1
15:46:21.529 > 
15:46:21.529 >  ets Jan  8 2013,rst cause:4, boot mode:(3,6)
15:46:21.529 >
15:46:21.529 > wdt reset
15:46:21.529 > load 0x4010f000, len 3460, room 16
15:46:21.535 > tail 4
15:46:21.540 > chksum 0xcc
15:46:21.540 > load 0x3fff20b8, len 40, room 4
15:46:21.540 > tail 4
15:46:21.540 > chksum 0xc9
15:46:21.544 > csum 0xc9
15:46:21.544 > v00090910
15:46:21.544 > ~ld

Is it the watchdog that is triggering the restart, considering the time to establish the connection?
image

NOTE: When re-examining log 1 and 2, I saw that the difference between the Serial.print “[NTP_SYN] Current time” and the error/reset is around 160 ms. So maybe it’s not WatDog, but some error/bug in the connection between the device and the Thinger Server. Maybe something related to the date and time obtained from the NTP and the communication with the Server (eg response sent by the Thinger Server that cannot be properly handled on the device)… Just some speculations.

It would be fantastic if the next version allowed array uplink, as mentioned in this thread:

My GSM device currently sends 1 sensor reading every 10 minutes (1 uplink). If I needed to increase the frequency to 5 reads every 10 minutes, I would have to do 5 uplinks. But it would be unfeasible, due to data consumption (the GSM plan only has 20Mb).

With this implement, it would be possible to send the 5 readings every 10 minutes (with only 1 uplink) through a single array, without exhausting the 20 Mb GSM plan.

How to change the WEB Portal of WifiManager in ThingerWebConfig.h by inserting code in setup()?

I tried to put the code (Ex: Hide the INFO Menu Button) in setup() to change the Menu in the WEB Portal that WifiManager, but it didn’t work.
I only managed to change the source code of the Arduino-Thinger library (image below).
Is there a way to do this, inserting the source code in setup(), because I didn’t want to change the source code of the Arduino-Thinger library, or the WifiManager?
Examples of how to change the WifiManager Menu at this (LINK)