Arduino-Library icon indicating copy to clipboard operation
Arduino-Library copied to clipboard

Implement new states for THINGER_STATE enum

Open georgevbsantiago opened this issue 10 months ago • 1 comments

If possible, implement a state in THINGER_STATE enum to inform when the Router SSID and Password have not yet been registered on the device, either using WiFiManager (ThingerESP8266WebConfig and ThingerESP32WebConfig) or thing.add_wifi();

Something like NETWORK_NOT_REGISTERED

Another suggestion is to implement a state ( THINGER_CONNECTED ) to inform that the device is Online on the Thinger Server.

enum THINGER_STATE{
NETWORK_NOT_REGISTERED, <================
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,
THINGER_CONNECTED  <================
};

This function can help to implement some functionality like:

if state_listener_ is equal to NETWORK_NOT_REGISTERED, then blink RED LED once every 2 seconds

if state_listener_ is equal to THINGER_CONNECTED, then blink BLUE LED once every 15 seconds

georgevbsantiago avatar Mar 16 '25 14:03 georgevbsantiago

@alvarolb Do you think this implementation is feasible or justifiable? If not, I will close the issue. Thanks

georgevbsantiago avatar May 07 '25 13:05 georgevbsantiago