Insights suddenly stops getting updates

djorr5
Posts: 17
Joined: Fri Nov 17, 2023 4:12 am

Insights suddenly stops getting updates

Postby djorr5 » Wed Oct 02, 2024 1:54 am

Hi,

I have noticed that the Insights dashboard suddenly stops presenting values at a random point in time. I had a board connected on 29th Sept at 8:55am and was sending data through until 1st Oct at 2:46am. The board is still functioning and I can control it etc, but Insights doesn't display anymore informatino from teh 01/10/2024 onwards.

Node ID = Uo9LGDhnqiHom72seFCYdZ

I am only sending a custom parameter every 2 minutes and Wifi metrics. The wifi metrics sends every 30 seconds but I have not found a way of altering the frequency of that. Either way I should be affecting the fair use policy so not sure why it suddenly stops connection. The board is not connected to a PC so I can't see the logs and I was hoping you could check if something is happening in your backend that stops this data being displayed?

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

Re: Insights suddenly stops getting updates

Postby ESP_Piyush » Wed Oct 16, 2024 2:34 pm

Hello, sorry for not responding earlier, but we indeed see that there was no data received in Insights for a few days but it started again on 12th. Did anything change on your side making it work again?

djorr5
Posts: 17
Joined: Fri Nov 17, 2023 4:12 am

Re: Insights suddenly stops getting updates

Postby djorr5 » Wed Oct 16, 2024 11:32 pm

I power cycled the device.

djorr5
Posts: 17
Joined: Fri Nov 17, 2023 4:12 am

Re: Insights suddenly stops getting updates

Postby djorr5 » Mon Oct 21, 2024 10:38 pm

@ESP_Piyush

It suddenly stopped again. I just noticed it this morning and looking into Insights it shows it suddenly just stopped yesterday:
Screenshot 2024-10-22 092715.png
Screenshot 2024-10-22 092715.png (60.64 KiB) Viewed 7830 times
In esp_idf it jsut shows that wifi metrics failed to add, also the parameters aren't being sent either, however the esp_rmaker_param_update_and_report doesn't seem to throw an error.
Screenshot 2024-10-22 092957.png
Screenshot 2024-10-22 092957.png (65.49 KiB) Viewed 7830 times
The node is still connected to Rainmaker because I can still send control messages and they are received successfully.
Screenshot 2024-10-22 093312.png
Screenshot 2024-10-22 093312.png (43.26 KiB) Viewed 7830 times
Any idea what might be causing this?

djorr5
Posts: 17
Joined: Fri Nov 17, 2023 4:12 am

Re: Insights suddenly stops getting updates

Postby djorr5 » Tue Dec 17, 2024 5:19 am

It happened again.

No other alerts happened around that time, just stopped all of a sudden at 12/12/2024 21:05

ESP_Vikram
Posts: 26
Joined: Fri Nov 23, 2018 12:07 pm

Re: Insights suddenly stops getting updates

Postby ESP_Vikram » Mon Jan 20, 2025 12:54 pm

Hi @djor, we have found a fix for the issue. It only occurs when Insights is used with the external transport, (ESP RainMaker in this context).
Do check with the below patch applied, and it should fix the issue.
  1. From 904eb2e57a588123c0a377ef7c57e266a0a22b40 Mon Sep 17 00:00:00 2001
  2. From: Shardul Nalegave <shardul.nalegave@espressif.com>
  3. Date: Tue, 24 Dec 2024 11:19:08 +0530
  4. Subject: [PATCH 1/1] Bug fix: MQTT event handler incorrectly resets timers.
  5.  
  6. - Event handler was incorrectly resetting data send timers causing a lost message to completely block further requests.
  7. - Fixed by moving timer reset logic to correct location.
  8. - For further information, see: https://www.esp32.com/viewtopic.php?f=41&t=42129&sid=73d94616778e403b74fc58dcb8378a12
  9. ---
  10.  components/esp_insights/src/esp_insights.c | 22 ++++++++++++++++------
  11.  1 file changed, 16 insertions(+), 6 deletions(-)
  12.  
  13. diff --git a/components/esp_insights/src/esp_insights.c b/components/esp_insights/src/esp_insights.c
  14. index 44168cd..3d8bf8e 100644
  15. --- a/components/esp_insights/src/esp_insights.c
  16. +++ b/components/esp_insights/src/esp_insights.c
  17. @@ -279,25 +279,31 @@ static void insights_event_handler(void* arg, esp_event_base_t event_base,
  18.      }
  19.      switch(event_id) {
  20.          case INSIGHTS_EVENT_TRANSPORT_SEND_SUCCESS:
  21. -#if INSIGHTS_DEBUG_ENABLED
  22. -            ESP_LOGI(TAG, "Data send success, msg_id:%d.", data ? data->msg_id : 0);
  23. -#endif
  24.              if (data && data->msg_id) {
  25.                  xSemaphoreTake(s_insights_data.data_lock, portMAX_DELAY);
  26. -                if (xTimerIsTimerActive(s_insights_data.data_send_timer) == pdTRUE) {
  27. -                    xTimerStop(s_insights_data.data_send_timer, portMAX_DELAY);
  28. -                }
  29.                  if (data->msg_id == s_insights_data.data_msg_id) {
  30. +#if INSIGHTS_DEBUG_ENABLED
  31. +                    ESP_LOGI(TAG, "Data message send success, msg_id:%d.", data ? data->msg_id : 0);
  32. +#endif
  33.                      esp_diag_data_store_critical_release(s_insights_data.data_msg_len);
  34.                      s_insights_data.data_sent = true;
  35.                      s_insights_data.data_send_inprogress = false;
  36. +                    if (xTimerIsTimerActive(s_insights_data.data_send_timer) == pdTRUE) {
  37. +                        xTimerStop(s_insights_data.data_send_timer, portMAX_DELAY);
  38. +                    }
  39.  #if SEND_INSIGHTS_META
  40.                  } else if (s_insights_data.meta_msg_pending && data->msg_id == s_insights_data.meta_msg_id) {
  41. +#if INSIGHTS_DEBUG_ENABLED
  42. +                    ESP_LOGI(TAG, "Meta message send success, msg_id:%d.", data ? data->msg_id : 0);
  43. +#endif
  44.                      esp_insights_meta_nvs_crc_set(s_insights_data.meta_crc);
  45.                      s_insights_data.meta_msg_pending = false;
  46.                      s_insights_data.data_sent = true;
  47.  #endif /* SEND_INSIGHTS_META */
  48.                  } else if (s_insights_data.boot_msg_id > 0 && s_insights_data.boot_msg_id == data->msg_id) {
  49. +#if INSIGHTS_DEBUG_ENABLED
  50. +                    ESP_LOGI(TAG, "Boot message send success, msg_id:%d.", data ? data->msg_id : 0);
  51. +#endif
  52.  #if CONFIG_ESP_INSIGHTS_COREDUMP_ENABLE
  53.                      esp_core_dump_image_erase();
  54.  #endif // CONFIG_ESP_INSIGHTS_COREDUMP_ENABLE
  55. @@ -305,9 +311,13 @@ static void insights_event_handler(void* arg, esp_event_base_t event_base,
  56.                  }
  57.  #if INSIGHTS_CMD_RESP
  58.                  else if (s_insights_data.conf_msg_id > 0 && s_insights_data.conf_msg_id == data->msg_id) {
  59. +#if INSIGHTS_DEBUG_ENABLED
  60. +                    ESP_LOGI(TAG, "Conf message send success, msg_id:%d.", data ? data->msg_id : 0);
  61. +#endif
  62.                      s_insights_data.conf_msg_id = 0;
  63.                  }
  64.  #endif
  65. +
  66.                  xSemaphoreGive(s_insights_data.data_lock);
  67.              }
  68.              break;
  69. --
  70. 2.39.5 (Apple Git-154)

Who is online

Users browsing this forum: No registered users and 11 guests