Hello everyone,
I have been using the Azure SDK to publish some data that is coming from a serial port into my IoT hub. I have an infinite loop that reads the data from the serial port and publishes it to the hub.
When I run the code to read the serial data without publishing it, it works smoothly. Similarly, when I publish random data to the IoT hub without reading serial data, it also works perfectly fine. However, when I use the publishing function inside the loop that reads the serial data, the code starts lagging, and only a few samples (2-3 seconds time interval) are published to the hub.
I assume the issue might be related to threads, but I'm not sure what could be wrong.
Any comments, suggestions, or solutions would be highly appreciated.