Date : 06/08/2021
Component : Arduino Library
Release Note : Fix compiling error & improved IoT connection security
Additional Information
Fix compiling error on newer ESP8266 core
Added CA root certificates for secure TLS connection
Now ESP8266 & ESP32 verify TLS connections by default both for community & private instances
Deprecated _VALIDATE_SSL_CERTIFICATE_
definition, now default TLS verification can be disabled with THINGER_INSECURE_SSL
Update ESP32 example to remove the use of BUILTIN_LED which caused compiling errors
Update ESP8266 WifiManager to support new secure connections
Library Repository
1 Like
1118
August 9, 2021, 2:37am
2
[NETWORK] Connecting to network Donghee
[NETWORK] Connected to WiFi!
[NETWORK] Getting IP Address…
[NETWORK] Got IP Address: 192.168.43.44
[NETWORK] Connected!
[_SOCKET] Connecting to iot.thinger.io:25202 …
[_SOCKET] Using secure TLS/SSL connection: yes
[_SOCKET] Error while connecting!
[_SOCKET] Connecting to iot.thinger.io:25202 …
[_SOCKET] Using secure TLS/SSL connection: yes
[_SOCKET] Error while connecting!
I have this error what i do? please help
Hi, what device are you using?
Hi, just tested it and it is woking fine out of the box
Arduino 1.8.15
Thinger library version 2.17.0
ESP8266 3.0.2
Sample code
#define _DEBUG_
#include <ThingerESP8266.h>
#define USERNAME "alvarolb"
#define DEVICE_ID "ESP8266"
#define DEVICE_CREDENTIAL "XXXXX"
#define SSID "TP-LINK_XYZ"
#define SSID_PASSWORD "XXXXX"
ThingerESP8266 thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
void setup() {
Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);
thing.add_wifi(SSID, SSID_PASSWORD);
thing["led"] << digitalPin(LED_BUILTIN);
thing["millis"] >> outputValue(millis());
}
void loop() {
thing.handle();
}
Result:
[NETWORK] Connected to WiFi!
[NETWORK] Getting IP Address...
[NETWORK] Got IP Address: 192.168.1.62
[NETWORK] Connected!
[_SOCKET] Connecting to iot.thinger.io:25202...
[_SOCKET] Using secure TLS/SSL connection: yes
[_SOCKET] Connected!
[THINGER] Authenticating. User: alvarolb Device: ESP8266
[THINGER] Writing bytes: 35 [OK]
[THINGER] Authenticated
Can I see your code?
Can I see a ping result from your machine to iot.thinger.io
?
And the ping result? Thanks!
1118
August 10, 2021, 5:51am
10
I’m sorry. I didn’t understand.
Isn’t ping 25202 in the picture above?
Hi, I mean a ping from your computer terminal, to see where the domain is resolving, i.e.,
ega
August 10, 2021, 6:07pm
12
This wifi network (the one you are using), has security policies? Because I was thinking that maybe the device is behind a firewall or something that blocks the outbound connection to the cloud server port.
You may try sharing wifi from your cell phone, mobile carriers usually does not block and allows the connection without issues.
If the device connects from cell phone shared wifi and cannot by the local wifi network, the issue is with the local network.
Hope this helps.
1118
August 11, 2021, 11:41pm
13
OK, let me check. Thank you.
I have the same problem. I informed this post and attached images. . I can only establish a connection if I put “#define DISABLE_TLS ”
I ping two addresses:
OK! I am checking it. Can you please test by defining the following on top of the scketch?
#define THINGER_SERVER "iot.thinger.io"
Unsuccessfully:
I'm using Windows 10
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 (3.1.0) > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:
- framework-arduinoespressif8266 3.30001.210627 (3.0.1)
- tool-esptool 1.413.0 (4.13)
- tool-esptoolpy 1.30000.201119 (3.0.0)
- tool-mklittlefs 1.203.210628 (2.3)
- tool-mkspiffs 1.200.0 (2.0)
- toolchain-xtensa 2.100300.210717 (10.3.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 37 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <thinger.io> 2.18.0+sha.13f8fd7
| |-- <ESP8266WiFi> 1.0
Building in release mode
Compiling .pio\build\nodemcuv2\src\main.cpp.o
src\main.cpp: In function 'void loop()':
src\main.cpp:52:37: warning: comparison of integer expressions of different signedness:
'long unsigned int' and 'long int' [-Wsign-compare]
52 | if(currentMillis - previousMillis > interval) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
Linking .pio\build\nodemcuv2\firmware.elf
Retrieving maximum program size .pio\build\nodemcuv2\firmware.elf
Checking size .pio\build\nodemcuv2\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [==== ] 37.8% (used 30932 bytes from 81920 bytes)
Flash: [==== ] 37.9% (used 395445 bytes from 1044464 bytes)
Building .pio\build\nodemcuv2\firmware.bin
Creating BIN file ".pio\build\nodemcuv2\firmware.bin" using "C:\.platformio\packages\framework-arduinoespressif8266\bootloaders\eboot\eboot.elf" and ".pio\build\nodemcuv2\firmware.elf"
I tried WiFi on SmartPhone, but it didn’t work.
Settings:
Windows 10
Arduino IDE 1.8.15
ESP8266 Boards 3.0.2
thinger.io 2.17
ega
August 18, 2021, 1:37pm
18
Hi,
I will try to replicate your situation with an ESP8266 to see where could be the issue.
Regards,
1 Like
Hi @ega . Did you manage to replicate the error on ESP8266?
I still get the same error on ESP8266.
I did an initial test with ESP32 and the 2.18 library (using VS Code and Platformio) and managed to successfully connect to Thinger.io server.
But I still do more tests.
In my case, I really need the library bug fix for ESP8266, because my projects were developed with it. I will only be migrating to ESP32 for the next few months.
ega
August 20, 2021, 12:39pm
20
Hi,
Yes, I had the same issue, what you can do is downgrade to version 2.16 meanwhile they patch the library, thats how I get the uC connected.
Hope this helps.