Connection to Thinger

Hi,
How can you test for connection to Thinger in ESP32 Code. I am using WiFi_Connected == 1 before I initiate a thing.stream but sometimes WiFi is connected but Thinger is not, data is lost.

Thanks,

1 Like

Try thing.is_connected()

1 Like

Thanks George, that is working.

I also have the problem that sometimes the servers for thinger are unreachable.
The consequence is that the thinger.handle() takes a long time (up to more than 1000ms).
That is massively disturbing my collaborative multitasking.
Could a wrapping with
if (thing.is_connected())
prevent that?

Hi,

I guess it won’t do anything, because the thing.handle(); instruction should be out of that “if” to get the client connected and get into the if.

Hope this helps.

1 Like

Thank you. It’s what I feared.