Ubidots Community

[SOLVED] Question about which protocoll my esp32 use

Hello. I’m involved in an IT project. There I will write about the protocol the esp32 uses when talking to Ubidot.com. The code I use does not specify which protocol is used. This is the code I use: Ubidots ubidots (UBIDOTS_TOKEN); Which protocol is used when not specifying either TCP, UDP or HTTP?

Info: I use temperature sensor on esp32 which sends float data up to Ubidot every second. I have a fixed wifi connection.
ubidot

Good day @Jack

Thanks for sharing your question with the community, we’re happy to see you around.

To answer your question, you can send data to Ubidots using an ESP32 over any protocol (HTTP, UTP, TPC and even MQTT). Checking the code snippet that you share with us, it is very difficult to identify which protocol is being used, however, I recommend you visit the link below to be guided on how to send data from your temperature sensor to Ubidots using an ESP32. Bear in mind that, according to the protocol you choose to use, you must uncomment some specific lines, please read carefully and if you have any questions, we will be here to help you.

Moreover, the Ubidot's Token is a temporary and revocable key to be used in your API requests. In this link you can understand how to use it since you will need it in your code to send data to Ubidots.

Please let us know if we can help you with anything else.

All the best,
Ángela

If you reference the library’s docs https://github.com/ubidots/ubidots-esp32 , you will find that the default protocol is TCP

Thanks for answers! I am a little smarter now.
I thought originally it would primarily use UDP. Because after one of my test runs in the field where I was publishing data every 1000ms to ubidots. Afterwards I took a look at the data collected in ubidots and it might have had a possible disconnect or package loss. 15 seconds in the middle of my test was missing data. I firstly assumed then it was because of UDP inconsistency and thought not much of it until I learned my code is using TCP. Is this kind of data loss with TCP normal or is something else causing it, like hardware faults.

My question is: What is most likely the reason for lost packages? Can TCP have 15 seconds of disconnection?

Addition info: I was outside using my phone on 4g LTE as hotspot. Actively moving in a city environment with big buildings and decent amount of people. My phone was moving with the esp32.

Hi @Jack

Probably, those 15 seconds are due to network connection problems, however, I will run some tests to see if we can replicate the problem and we will get back to you.

-Ángela