Disconnect Device from ZDM

Everytime i unlink the wifi after i’m connected to the ZDM an exception occour that makes my firmware reset.
Is there a way to disconnect my device so this doesn’t happen?

also, i need to make sure that my data is published correctly before i disconnect the wifi, but as of now there’s no way to make sure that happens (i’ve seen that if i just have publish(data,TAG) and then i unlink no data is posted at all)

hi @pirrofra
The published data should be written to the data console on Zerynth device manager command line interface and GUI, As they are sent.
Have you checked the data console on the CLI or GUI for incoming data points before calling unlink() method?

Please let me check this issue and get back to you.

ZDMClient uses mqtt (from what I’ve seen) and, as default, mqtt publish does not directly send data to the end point, it just stores them in a buffer and then sends them.
So you have to manually check if the data has been published or not.
As of now, there is no way to see this in the ZDMClient library. I’ve seen that I need to use sleep between publish and unlink to give time to the mqtt thread to send data correctly. Yes, I’ve checked and no data is stored if I don’t use the sleep function.

Also there’s the issue about exceptions being thrown by a thread (which is is thread that handles mqtt connection) that makes my firmware reset when I unlink my wifi.
For this too, there’s no way I could catch that exception, except if I disconnect my mqtt client before making the unlink call.

I hope I explained everything, I’m here to clarify

This problem is caused by the MQTT client as you suggested, we will work on fixing this bug and hopefully, we will solve this soon.
Thanks for reporting this.

Could you paste the error code and the code line that raises it to have more details.