Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time Series PUT from a custom mobile app and from a node local storage log (MEGH-4900) #280

Open
3 tasks done
farmersfish opened this issue Aug 24, 2023 · 3 comments
Open
3 tasks done

Comments

@farmersfish
Copy link

Answers checklist.

  • I have read the Rainmaker documentation and the issue is not addressed there.
  • I have updated my IDF branch (release/vX.Y) to the latest version and checked that the issue is present there. This is not applicable if you are using Rainmaker with Arduino.
  • I have searched the Rainmaker forum and issue tracker for a similar issue and not found a similar issue.

General issue report

Hi Team,

There is a case when the node doesn't have an Internet connection, and we need to save the data log (time series) to local storage, in this case, sdcard. I want to find a way to sync data from the node to the RainMaker whenever it gets the Internet connection. Is that possible?

Can I also PUT the same data log from the custom mobile phone app to the RainMaker backend? It happens when the mobile phone and the node don't have an Internet connection when they exchange data.

@farmersfish farmersfish changed the title Time Series PUT from mobile app Time Series PUT from a custom mobile app and from a node local storage log Aug 24, 2023
@github-actions github-actions bot changed the title Time Series PUT from a custom mobile app and from a node local storage log Time Series PUT from a custom mobile app and from a node local storage log (MEGH-4900) Aug 24, 2023
@shahpiyushv
Copy link
Collaborator

There is a case when the node doesn't have an Internet connection, and we need to save the data log (time series) to local storage, in this case, sdcard. I want to find a way to sync data from the node to the RainMaker whenever it gets the Internet connection. Is that possible?

The SDK itself does not support backing up data in case of No internet connectivity and then trying when Internet is back. However, since we use QOS1, it improves reliability in case of flaky connection. Additionally, you can monitor the RMAKER_MQTT_EVENT_PUBLISHED event to get assurance that MQTT publish has succeeded. Additionally, you can make use of RMAKER_MQTT_EVENT_CONNECTED and RMAKER_MQTT_EVENT_DISCONNECTED events in your application code to decide whether to store the data somewhere (if disconnected) or send right away. Handling of events can be found in the switch example.

Can I also PUT the same data log from the custom mobile phone app to the RainMaker backend? It happens when the mobile phone and the node don't have an Internet connection when they exchange data.

We do not support this. Each device has its unique id and mutually authenticated session with the cloud backend. Only the device can report its data and no other entity can report it in behalf of the device.

@farmersfish
Copy link
Author

There is a case when the node doesn't have an Internet connection, and we need to save the data log (time series) to local storage, in this case, sdcard. I want to find a way to sync data from the node to the RainMaker whenever it gets the Internet connection. Is that possible?

The SDK itself does not support backing up data in case of No internet connectivity and then trying when Internet is back. However, since we use QOS1, it improves reliability in case of flaky connection. Additionally, you can monitor the RMAKER_MQTT_EVENT_PUBLISHED event to get assurance that MQTT publish has succeeded. Additionally, you can make use of RMAKER_MQTT_EVENT_CONNECTED and RMAKER_MQTT_EVENT_DISCONNECTED events in your application code to decide whether to store the data somewhere (if disconnected) or send right away. Handling of events can be found in the switch example.

Can I also PUT the same data log from the custom mobile phone app to the RainMaker backend? It happens when the mobile phone and the node don't have an Internet connection when they exchange data.

We do not support this. Each device has its unique id and mutually authenticated session with the cloud backend. Only the device can report its data and no other entity can report it in behalf of the device.

Thanks for a great explanation!

@farmersfish
Copy link
Author

farmersfish commented Aug 29, 2023

There is a case when the node doesn't have an Internet connection, and we need to save the data log (time series) to local storage, in this case, sdcard. I want to find a way to sync data from the node to the RainMaker whenever it gets the Internet connection. Is that possible?

The SDK itself does not support backing up data in case of No internet connectivity and then trying when Internet is back. However, since we use QOS1, it improves reliability in case of flaky connection. Additionally, you can monitor the RMAKER_MQTT_EVENT_PUBLISHED event to get assurance that MQTT publish has succeeded. Additionally, you can make use of RMAKER_MQTT_EVENT_CONNECTED and RMAKER_MQTT_EVENT_DISCONNECTED events in your application code to decide whether to store the data somewhere (if disconnected) or send right away. Handling of events can be found in the switch example.

Can I also PUT the same data log from the custom mobile phone app to the RainMaker backend? It happens when the mobile phone and the node don't have an Internet connection when they exchange data.

We do not support this. Each device has its unique id and mutually authenticated session with the cloud backend. Only the device can report its data and no other entity can report it in behalf of the device.

One more question, just in case the node wasn't able to update and report a param due to Internet connectivity lost, can the node update the param later with a specific timestamp in the past?
esp_rmaker_param_update_and_report function seems not take the node's timestamp as a variable. Seems as a struct esp_rmaker_param
struct esp_rmaker_param { char *name; char *type; uint8_t flags; uint8_t prop_flags; char *ui_type; esp_rmaker_param_val_t val; esp_rmaker_param_bounds_t *bounds; esp_rmaker_param_valid_str_list_t *valid_str_list; struct esp_rmaker_device *parent; struct esp_rmaker_param * next; };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants