ESP32 disconnected

Nothing was there to find.
In the source code I found:
enum THINGER_STATE{
NETWORK_CONNECTING,
NETWORK_CONNECTED,
NETWORK_CONNECT_ERROR,
SOCKET_CONNECTING,
SOCKET_CONNECTED,
SOCKET_CONNECTION_ERROR,
SOCKET_DISCONNECTED,
SOCKET_TIMEOUT,
SOCKET_ERROR,
THINGER_AUTHENTICATING,
THINGER_AUTHENTICATED,
THINGER_AUTH_FAILED,
THINGER_STOP_REQUEST
};
Which could be the answer, so
THINGER_AUTH_FAILED, could be the status for wrong credentials and

SOCKET_CONNECTION_ERROR, the status for Thinger server not reachable
or is
SOCKET_TIMEOUT the better status for it?

NETWORK_CONNECT_ERROR, the status for Internet not available?

Is there a way to detect “device not recognized”?

Yes, there is a link into the post that I’ve made reference, that link has a post with all the states, didn’t you see it?

I honestly dont know if I understand what specific you want to do, I have the idea that you want your device to know if the thinger service is reachable to avoid keep it stuck trying to connect, and try again in 5 mins (ie), said that, any error state will give the proof that it is not and should set the flag to avoid calling the thinger process in the next 5 mins.

If you are so kind to explain what specific want to do would be helpful to understand and evaluate if it is feasible right now with the available features.

Hope this helps.

  • Internet hot available is one possibilty.
  • Server Not reachable is another possibilty.
  • Bad credentials is another one and
  • No corresponding device known at server side a fourth reason

It would have been good to know what has caused the malfunctionning of the Thinger.io connection to guide the user in order to fix it.

Yes I understand that could be by many reasons why the device does not connect, but my point is that the device does not care where is the issue, what it will do is, by any error, stop trying to connect and try again later, to avoid keep stuck and work on other processes.

What could be helpful is that the device has the capability to inform locally to the end user what’s going on, by a LCD or a led blinking pattern (by somehow without the serial port need), so the end user may know and solve (or try to) the situation.

1 Like

What could be helpful is that the device has the capability to inform locally to the end user what’s going on

Exactly!
LCD is present.