How to send several values in PROP_FLAG_TIME_SERIES time series in one MQTT message

KaosESP32
Posts: 12
Joined: Tue Oct 31, 2023 9:17 am

How to send several values in PROP_FLAG_TIME_SERIES time series in one MQTT message

Postby KaosESP32 » Wed Mar 13, 2024 11:44 am

Hi I'm trying to send several values (one per second) in single MQTT message with a higher frequency (let's say one message per minute)

My understanding is that this should be accomplished with full time series flag parameter (PROP_FLAG_TIME_SERIES) but I'm not able to found documentation nor example on the docs how to do it. Specifically, how to populate the parameter with 60 different pairs (time, value)

Anyone can provide pointers to documentation or/and examples?

Thanks in advance

ESP_Piyush
Posts: 309
Joined: Wed Feb 20, 2019 7:02 am

Re: How to send several values in PROP_FLAG_TIME_SERIES time series in one MQTT message

Postby ESP_Piyush » Wed Mar 13, 2024 11:50 am

Currently, we do not have an API for this, but you can format the data as per the specifications mentioned here. Meanwhile, even though sending a message once per minute fits into our fair usage policy, a data point every second is still quite a huge data. Does your use case really require such high rate?

KaosESP32
Posts: 12
Joined: Tue Oct 31, 2023 9:17 am

Re: How to send several values in PROP_FLAG_TIME_SERIES time series in one MQTT message

Postby KaosESP32 » Wed Mar 13, 2024 5:02 pm

Hi again,

Thanks a lot for your VERY fast response, I appreciate it.
I understand that is a lot of data, it was just an example to facilitate de explanation of what I intend to do.

To be sure that I understand correctly your answer, do you mean that using the api "esp_rmaker_mqtt_publish" with the correct payload and topic pointed by the documentation is 100% equivalent to use the esp_rmaker_param_update_and_report api?

Thanks

Cesc

ESP_Piyush
Posts: 309
Joined: Wed Feb 20, 2019 7:02 am

Re: How to send several values in PROP_FLAG_TIME_SERIES time series in one MQTT message

Postby ESP_Piyush » Wed Mar 13, 2024 5:15 pm

Yes, the understanding is correct. Formatting the data into correct JSON representation and sending on the topics is equivalent to calling the C APIs. You can write your own wrappers for time series data.

KaosESP32
Posts: 12
Joined: Tue Oct 31, 2023 9:17 am

Re: How to send several values in PROP_FLAG_TIME_SERIES time series in one MQTT message

Postby KaosESP32 » Wed Mar 13, 2024 5:18 pm

Many Thanks ! :)

Who is online

Users browsing this forum: No registered users and 78 guests