Connection Problems with new device (Error while connecting!) Linksys Router Problem


#1

I have a device that has been connected for a couple of years to Thinger.io. The original device still connects just fine.
Now I am trying to add a new one and it will not connect via my home network. It connects fine from my phone hotspot. (same code, just changing the SSID and Password. Both get an IP OK)

Connected, IP address: 192.168.3.121
[_SOCKET] Error while connecting!
[_SOCKET] Connecting to iot.thinger.io:25200
[_SOCKET] Using secure TLS/SSL connection: no

Since I have not updated the code on my original device in a long time, perhaps that is part of the difference.

  • Library change?
  • Router problem?
  • ISP Problem?

Thanks for any ideas.
Peter


#2

Hi @Peterh226, what device are you using? Can you check that your router is resolving the host properly? my current ping to iot.thinger.io returns that:

PING ec2-52-50-253-141.eu-west-1.compute.amazonaws.com (52.50.253.141): 56 data bytes


#3

The request times out. This is really odd as my device GDM in my account peterh226 is still online and working fine. These are on the same network and connected through the same router. I’m using another nodemcu just like the other one I have. I’ve tried several variations of nodemcu with the same result.

Pinging ec2-52-50-253-141.eu-west-1.compute.amazonaws.com [52.50.253.141] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 52.50.253.141:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),


#4

The ping is ok. The server does not answer ping requests. I wanted to just see what IP address is resolved. If you are using old code with newer libraries, you must update your thing type.

Maybe you have something like ThingerWiFi thing(.... If you are using the NodeMCU, you must change the type to ThingerESP8266, as shown in the new examples. Let me know if that solves the problem!

Best regards.


#5

Here’s what I’m trying:

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

#define USERNAME "peterh226"
#define DEVICE_ID "TestNodeMCU"
#define DEVICE_CREDENTIAL "***********"

#define SSID "Bulldog_Guest"
#define SSID_PASSWORD "*********"

ThingerESP8266 thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);

void setup()
{
  Serial.begin(115200);
  Serial.println();

 thing.add_wifi(SSID,SSID_PASSWORD);
//WiFi.begin("Peter's iPhone","*************");

  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }
  Serial.println();

  Serial.print("Connected, IP address: ");
  Serial.println(WiFi.localIP());

  pinMode(BUILTIN_LED, OUTPUT);

  // digital pin control example (i.e. turning on/off a light, a relay, configuring a parameter, etc)
  thing["led"] << digitalPin(BUILTIN_LED);

  // resource output example (i.e. reading a sensor value)
  thing["millis"] >> outputValue(millis());
}

void loop() {
  thing.handle();
  HeartBeat();
}

void HeartBeat() {
  digitalWrite(LED_BUILTIN, LOW);
  Serial.print("*");
  delay(1000);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(2000);
  Serial.print("-");
}

When I run it I see:

Connecting…
Connected, IP address: 192.168.3.121
[_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!
*-[_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 also tried #define DISABLE_TLS but that did not change the connection issue.

From a documentation point of view, I’m not sure where to look for the current information. I know it gets hard as the platform keeps growing. What someone like me needs is to understand what includes are required and what methods/properties are available. For example, is WiFi.begin and WiFi.status part of ESP8266 or Thinger8266 and what additional things can be checked.

Thanks
Peter


#6

Just curious… did you tried rebooting your router? It is quite strange that you can connect from your phone AP, but not your WiFi. The code seems to be fine BTW.


#7

I believe the problem is some change in a library and something in the Linksys router. I switched back to my ASUS RT-AC87R and connected right away. The Linksys AC5400 seems to have started to block something.

Very frustrating to debug! But seems ok for now.


#8

This is something complex to debug, as there are many parts involved. Not only the thinger.io library, but also the SDK from espressiff installed in the Arduino IDE, or even the particular NodeMCU. You can try to switch to an older Thinger.io library to see if that solves something. Reading the release notes here, I suggest testing the 2.5.9 or older version. You can easily change the library version directly in the Arduino IDE, so it is easy to test.

Other interesting test, would be to reflash your working NodeMcu, to discard any hardware problem of the new device.

By the way, you have a pair of stunning routers! :sunglasses:


#9

I have the same problem with CC3000 shield. With AP phone wifi works well, but with the router no :pensive: