ESP Insights (Beta)
Espressif has just launched a new product called ESP Insights which is a remote diagnostics solution that allows users to remotely monitor the health of ESP devices in the field. This is now available in all ESP RainMaker examples as well!
Enabling ESP Insights
Update esp-rainmaker
Before you even go any further, please ensure that your esp-rainmaker repository is up to date by executing the below:
cd /path/to/esp-rainmaker
git pull origin master
git submodule update --init --recursive
This will pull in the esp-insights as a submodule under esp-rainmaker/components. This will also set up all the default examples with appropriate support for ESP Insights. If you just want to try any default example, you may skip the next 2 sections about CMakeLists.txt.
Edit CMakeLists.txt
For pulling in the ESP Insights functionality in your existing projects, you will have to include the components under esp-rainmaker/components/esp-insights/components
. Search for this line in your CMakeLists.txt
set(EXTRA_COMPONENT_DIRS ${CMAKE_CURRENT_LIST_DIR}/../../components ${CMAKE_CURRENT_LIST_DIR}/../common)
and replace with
set(EXTRA_COMPONENT_DIRS ${CMAKE_CURRENT_LIST_DIR}/../../components ${CMAKE_CURRENT_LIST_DIR}/../common ${CMAKE_CURRENT_LIST_DIR}/../../components/esp-insights/components)
A better option is to just refer the new CMakeLists.txt from any of the examples and copy appropriate sections into your file.
Enable the ESP Insights
ESP Insights related code is abstracted out by the examples/common/app_insights
component and is disabled by default. To enable it, set CONFIG_ESP_INSIGHTS_ENABLED=y
(idf.py menuconfig -> Component config -> ESP Insights -> Enable ESP Insights)
Include app_insights.h
in your project's code and add the below line before esp_rmaker_start()
:
app_insights_enable();
The above line is already included in all ESP RainMaker examples. So, you will just have to enable
CONFIG_ESP_INSIGHTS_ENABLED
.
Build and Flash your project
Follow the regular process for build and flash
idf.py build flash monitor
Notice that you will see such extra lines in your build log:
===================== Generating insights firmware package build/led_light-v1.0.zip ======================
led_light-v1.0
led_light-v1.0/led_light.bin
led_light-v1.0/sdkconfig
led_light-v1.0/partition_table
led_light-v1.0/partition_table/partition-table.bin
led_light-v1.0/bootloader
led_light-v1.0/bootloader/bootloader.bin
led_light-v1.0/partitions.csv
led_light-v1.0/project_build_config.json
led_light-v1.0/led_light.map
led_light-v1.0/led_light.elf
led_light-v1.0/project_description.json
The zip file generated under build/
(build/led_light-v1.0.zip
above) would be required later.
Claiming
Assuming that you have already been using ESP RainMaker, you must be aware of the concept of claiming. It has 3 variants:
To get access to ESP Insights, you need admin access to the nodes, and so, you will have to use either Host Driven Claiming or Assisted Claiming. Even for ESP32-S2, which uses Self claiming by default, you will need to use Host Driven Claiming to get the admin access.
Checking the ESP Insights
Once the firmware is ready and claiming done, use your project as you would normally do. Visit the ESP RainMaker Dashboard, login using the credentials used for claiming, search for your node id and check your insights.
Here is a sample of how it shows up on the Dasboard:
Upload firmware package
To get better insights into the diagnostics information, you also need to upload the Firmware package, which consists of the binary, elf, map file and other information useful for analysis. Please upload the package, (named <project_name>-<fw_version>.zip
) which you can find in the build/
folder of your project by navigating to the Firmware Images section of the dashboard.
Important Note
Commands like idf.py build
, idf.py flash
, etc. rebuild the firmware even if there is no change in the code and this also causes the Firmware Package to change. Please take care that the binary flashed on your board and the firmware package uploaded on the dashboard are in sync.
Further Reading
Please check out the ESP Insights documentation here. If you want to use ESP Insights in a commercial products, please contact us.