ESP8266 Library, call from a device not registered or wrong account

Hi @rin67630, the grace pause is a good idea for your use case, but still not convinced about establishing a threshold of 100ms just for that. As we have discussed before, there are plenty of possibilities this would happen, even in normal operation (and can drop your connection with the server or make it unresponsive during the pause). I suggest to improve your approach by setting the GracePause depending on the current device state. From this post: Check Cloud Connection on Arduino, you can currently monitor what is happening, i.e., if the credential is bad, or cannot connect to network. So, establish then the GracePause then. You can even improve the logic by stopping calling thing.handle() if the device cannot authenticate for more than x times, or your cannot connect to network more than y times, so, the device is completely available for OTA.

switch(state){
    case NETWORK_CONNECTING:
        break;
    case NETWORK_CONNECTED:
        break;
    case NETWORK_CONNECT_ERROR:
        // connect error. grace pause here?
        break;
    case SOCKET_CONNECTING:
        break;
    case SOCKET_CONNECTED:
        break;
    case SOCKET_CONNECTION_ERROR:
        break;
    case SOCKET_DISCONNECTED:
        break;
    case SOCKET_TIMEOUT:
        break;
    case THINGER_AUTHENTICATING:
        break;
    case THINGER_AUTHENTICATED:
        break;
    case THINGER_AUTH_FAILED:
        // bad credentials. grace pause here?
        break;
    case THINGER_STOP_REQUEST:
        break;
}