Ubidots library with AsyncTCPClient methods on Particle device

Hello Ubidots,

I am working on a program that has a very high speed event loop but needs to upload data to Ubidots over TCP. The default uploading with TCP on a Particle device is a synchronus operation, and as a result it causes a delay, (usually 5 seconds). This delay is not ideal for our operation.

Particle recently shared on their forum a new subclass that adds asyncConnect() methods, which allows the TCP connection to run on a separate thread of the device.

GitHub of the new methods
https://github.com/rickkas7/asynctcpclient14

I would like to investigate what it would take to update the Ubidots library to have it upload using the asyncConnect() methods.

I also would like to understand if there are barriers that may keep this from being possible.

Thanks!
Adam

Greetings @Adam_B,

First than all thanks for using Ubidots, it is very interesting what you tell us about asynchronous TCP clients using Particle’s devices. Unfortunately, for an update inside our library with this feature we need to schedule the development team and this would take some time but I think that I can help you to make available that feature to send data, I attach you two codes that sends data properly to Ubidots using TCP, one of them uses our translate service and the other one uses our standard API, I advice you to look at them and adapt it properly using the asynchronous feature that you need.

Hope it helps you.

photon-translate.cpp (2.3 KB)
photon-http.cpp (4.4 KB)