[HELP] ESP8266 Can't Connect To Thinger.io


#8

It could be any problem on your hardware. have you tried any basic example like “analogReadSerial” ? just to know if you are able to flash properly the pcb.


#9

Since I upgraded to the Arduino Thinger Library 2.9.1 I also cannot connect my ESP8266 anymore. This was without code change only by updating the library. It used to work without any problem before.
If I disable SSL (#define DISABLE_TLS) it all works. Also my other devices still on the old version can connect.
I’m not sure howto use older versions with platformio otherwise I’d go back to the previous Thinger.io version.


#10

Hi @nikwest, we have tested client libraries with NodeMCU, and everything seems to work fine both with and without SSL. Can you post your device DEBUG output?


#11

here is with TLS disabled, everything works:
[NETWORK] Starting connection…
[NETWORK] Connecting to network nikwest
[NETWORK] Connected to WiFi!
[NETWORK] Getting IP Address…
[NETWORK] Got IP Address: 10.0.1.129
[NETWORK] Connected!
[_SOCKET] Connecting to [removed otherwise I cannot post]…
[_SOCKET] Using secure TLS/SSL connection: no
[_SOCKET] Connected!
[THINGER] Authenticating. User: nikwest Device: sensor_node
[THINGER] Writing bytes: 43 [OK]
[THINGER] Authenticated
[THINGER] Writing bytes: 31 [OK]

and here is with TLS:

[NETWORK] Starting connection…
[NETWORK] Connecting to network nikwest
[NETWORK] Connected to WiFi!
[NETWORK] Getting IP Address…
[NETWORK] Got IP Address: 10.0.1.129
[NETWORK] Connected!
[_SOCKET] Connecting to [removed otherwise I cannot post]…
[_SOCKET] Using secure TLS/SSL connection: yes
[_SOCKET] Connected!
[THINGER] Authenticating. User: nikwest Device: sensor_node
[THINGER] Writing bytes: 43 [OK]
[_SOCKET] Cannot read from socket!
[THINGER] Auth Failed! Check username, device id, or device credentials.
[_SOCKET] Is now closed!
[THINGER] Writing bytes: 31 [FAIL]
[THINGER] Expected:31
[THINGER] Wrote:0
[_SOCKET] Connecting to [removed otherwise I cannot post]…
[_SOCKET] Using secure TLS/SSL connection: yes
[_SOCKET] Connected!
[THINGER] Authenticating. User: nikwest Device: sensor_node
[THINGER] Writing bytes: 43 [OK]
[_SOCKET] Cannot read from socket!
[THINGER] Auth Failed! Check username, device id, or device credentials.
[_SOCKET] Is now closed!
[THINGER] Writing bytes: 31 [FAIL]
[THINGER] Expected:31
[THINGER] Wrote:0


#12

What is the port while using https connection?


#13

Port number for TLS connection is 25202

[_SOCKET] Connecting to iot.thinger.io:25202


#14

Do you have the ESP8266 board library updated to the latest version? I cannot reproduce the issue!


#15

yes, I am using platformio and everything is up to date.

Do I see it correctly, that the previous version (2.7.2) did not support TLS or it wasn’t enabled by default on ESP8266?

If that’s the case then TLS does not seem to work in my environment. I don’t understand why, but that helps to narrow down the problem.


#16

After several tests, we cannot reproduce this issue. TLS was enabled also by default in previous library versions.
Tested with NodeMCU, Thinger.io Libraries (2.9.1), ESP8266 (2.4.1). Are you using the ESP8266 via AT commands, or just as a standalone microcontroller?


#17

Hey!

i have the same Problem! i testet for some days. I have already the newest library 2.9.1 testet to 2.5.x and nothing happen…
watch my Picture…

the ports are open and the credentials are correct!


#18

Hi! the headers for ESP8266 should be:

#include <ESP8266WiFi.h>
#include <ThingerESP8266.h>

and use ThingerESP8266 instead of ThingerWifi when declaring the thing instance.

In the other side, if you want to disable TLS, you must set #define _DISABLE_TLS_ on top of file, like the _DEBUG_ definition. Hope it helps! :wink:

Best.


#19

Thank you for Your fast reply.
I do anything, but nothing works… what i am doing wrong?
The TLS does not disable… why?

I Am using Unbuntu in VM. But i check the Ports…

please help me :slight_smile:


#20

Just to clarify… You are using your own server, or just the cloud server? If you are using your own server (in a VM, i.e.,), yo need to point the ESP8266 to your own server. Check the manual.

The TLS is not disabled as it is _DISABLE_TLS_. Test with that! Hope it helps.


#21

Hey alvarolb!

i was very stupid! :smiley: now i understand! Its perfect. I just add the Line
#define THINGER_SERVER "192.168.1.94"
and get the access to my Unbuntu server.
at the weekend i testet it successfully and now bought your RASPBERRY Image to use the Server on RASPI

Thank you for all :slight_smile:


#22

Hi
i have the same problem! my esp8266 never Connect to Thinger.io
my device id and username and device credentials is correct.
here is my device DEBUG output


#23

Are you working with cloud server or local server?

I recommend you to delete the device and create it again, taking care of the uppercase and/or lowercase of device and credential fields, and test with the example sketch just modifying this fields with previous established.


#24

Thank u for your reply.
I’m working with cloud server.
I deleted the device and create it again & testet with the example but didn’t work.


#25

Hi,
Make sure that your username, device id, and credentials on firmware you are written is the same as in the cloud.


#26

I was having the same issue and I was only able to authenticate by disabling TLS: https://thinger.io/securing-the-internet-of-things-adding-ssltls-support-for-the-esp8266/

#define _DISABLE_TLS_

I wonder was there a change in how code is configured to talk to the endpoint?


#27

Hi, is the issue “Auth Failed” fixed? (I get the same error message)?