291 Commits

Author SHA1 Message Date
Jim
e0bc3f5e99 ota: Add resumption ota feature 2025-09-12 09:18:40 +08:00
Piyush Shah
726a8e8d06 esp_rainmaker: Add support for sunrise/sunset based schedules
Can be enabled using CONFIG_ESP_RMAKER_SCHEDULE_ENABLE_DAYLIGHT, which
depends on CONFIG_ESP_SCHEDULE_ENABLE_DAYLIGHT=y.

These can be more reliable compared to the cloud driven daylight
automations as the calculations happen locally on the device and
schedules can take effect even when the device is offline.

This also supports offset so that you can schedule actions before/after
sunrise/sunset.

Together, these have a binary size impact of about 12,250 bytes.
CONFIG_ESP_SCHEDULE_ENABLE_DAYLIGHT contributes 11,500 bytes
CONFIG_ESP_RMAKER_SCHEDULE_ENABLE_DAYLIGHT contributes additional 750
bytes.
2025-09-10 18:23:40 +05:30
Piyush Shah
decb722fa4 esp_schedule: Add support for sunrise/sunset schedules
Enable using CONFIG_ESP_SCHEDULE_ENABLE_DAYLIGHT (default enabled)
Has a binary size impact of about 11,500 bytes
2025-09-10 18:23:40 +05:30
Piyush Shah
d7d67e1865 esp_daylight: Add a component to get sunrise/sunset time for a given location
Using NOAA equations as per the reference: https://gml.noaa.gov/grad/solcalc/
2025-09-10 18:23:40 +05:30
Piyush Shah
f3f7f74f4e esp_rainmaker: Remove legacy code for esp-idf versions < 5.1
Also removed CONFIG_ESP_RMAKER_USING_NETWORK_PROV

Made network prov as default since it is supported for esp-idf v5.1
onwards and esp-idf v5.0 has reached end of life.

This will make the code more readable
2025-08-29 19:54:54 +05:30
Piyush Shah
7e2dd9e5db esp_schedule: Remove legacy code for esp-idf versions < 5.1 2025-08-29 19:52:06 +05:30
Piyush Shah
efcb15b137 cleanup: Remove Makefile related files as it is not supported any more
ESP IDF has moved to CMake since long back and these files were anyways
unused
2025-08-29 19:52:06 +05:30
Piyush Shah
eb187e13c1 chall_resp: Allow challenge-response based mapping with Assisted Claiming 2025-08-29 18:54:10 +05:30
Piyush Shah
8371bc0bbf bugfix: User-Node mapping could fail if esp-insights is enabled 2025-08-26 16:13:12 +05:30
Piyush Shah
a87c825fbb chal_resp: Add support for challange response based user node association
This is a synchronous user-node mapping method that is performed during
provisioning, but even before sending Wi-Fi credentials and does not require
any communication from the node to the cloud. Check the esp_rainmaker
component CHANGELOG for details.
2025-08-08 20:02:38 +05:30
sanket.wadekar
cf49ba4219 esp_rmaker_ota: Added OTA Updates over MQTT
The regular OTA upgrades with ESP RainMaker required an additional https
connection to fetch the OTA image, which has a significant impact on
heap usage.

With MQTT OTA, the same MQTT channel used for rest of the RainMaker
communication is used to fetch the OTA image, thereby saving on RAM.
This could be slightly slower and may odd some cost. but the overall
impact would be low enough when compared against the advantages.

Signed-off-by: sanket.wadekar <sanket.wadekar@espressif.com>
Co-authored-by: Piyush Shah <piyush.shah@espressif.com>
2025-08-04 21:27:08 +05:30
Piyush Shah
b2bd4c1e9a bugfix: Duplicate otafetch was causing crashes
Triggering a new otafetch while one was already in progress was causing
crashes due to incorrect setting/clearing of data.

This happened specifically on rebooting into new firmware after an OTA
when both, CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE and CONFIG_ESP_RMAKER_OTA_AUTOFETCH
are enabled.
2025-08-04 14:46:19 +05:30
jim
4a0ff0d0eb esp_rainmaker: make esp_rmaker_params_mqtt_init function execute in
queue so that it will not block event task
2025-08-01 14:00:40 +08:00
Shubham Patil
af03e62381 components/esp_rainmaker: make cmd response payload publish api public
also bump the minimum required rmaker_common's version to 1.4.12 to use
the newly added payload generator APIs.
2025-07-13 11:24:26 +05:30
Shubham Patil
8076c0dd76 rmaker_common: update submodule to add tlv payload generator api 2025-07-11 18:14:09 +05:30
Piyush Shah
d0d0e27a98 Merge branch 'task/ota_reliability' into 'master'
ota: Enhance OTA fetch reliability with retry mechanism and delivery confirmation

See merge request app-frameworks/esp-rainmaker!548
2025-06-25 06:49:32 +05:30
Piyush Shah
b2dd13214c esp_rainmaker: Bump up component version and dependency for OTA reliability improvements 2025-06-24 19:58:21 +05:30
Piyush Shah
085b5da9cf esp_rmaker_ota: Retry on failure
- Try OTA multiple times (as per `CONFIG_ESP_RMAKER_OTA_MAX_RETRIES`, set to 3 by default) if it fails
- Schedule an OTA fetch as per `CONFIG_ESP_RMAKER_OTA_RETRY_DELAY_MINUTES` if all retries fail
2025-06-24 19:53:32 +05:30
esp
8bacc14517 fix(local_ctrl): Fix srp host name is too short for some node id used with uuid 2025-06-24 11:11:46 +08:00
Piyush Shah
e081eef5c2 ota: Enhance OTA fetch reliability with retry mechanism and delivery confirmation
- Monitor message publish acknowledgement for the otafetch message
- Add retry logic if otafetch fails
2025-06-20 14:13:20 +05:30
Piyush Shah
4ab40d00d8 esp_rainmaker: Bump up component version for OTA Progress reporting feature 2025-06-13 18:28:29 +05:30
jim
04613d9c0f ota: Add ota upgrade progress report feature 2025-06-13 18:28:11 +05:30
Piyush Shah
45d2001a28 Merge branch 'task/c5support' into 'master'
esp32c5: Add ESP32-C5 support to RainMaker

See merge request app-frameworks/esp-rainmaker!544
2025-06-10 14:18:46 +05:30
Hrishikesh Dhayagude
48a2ccdc80 Merge branch 'fix-matter-main' into 'master'
examples/matter: fix matter builds with main branch

See merge request app-frameworks/esp-rainmaker!534
2025-06-09 16:15:05 +08:00
Piyush Shah
1d3b86e232 esp32c5: Add ESP32-C5 support to RainMaker core component
- Add ESP32-C5 secure boot header include in esp_rmaker_secure_boot_digest.h
- Bump component version from 1.5.5 to 1.5.6 for ESP32-C5 support
2025-06-06 17:50:32 +05:30
Piyush Shah
6c839a9251 Merge branch 'task/simple_ts_ttl' into 'master'
simple timeseries: Add an option to include ttl field (in days) while reporting values

See merge request app-frameworks/esp-rainmaker!540
2025-05-30 13:28:56 +05:30
Shubham Patil
1f56bf5fde components/esp_rainmaker: use latest version of esp_rcp_update to fix conflict 2025-05-29 22:49:44 +05:30
Piyush Shah
2dcc01c665 esp_rainmaker: Bump up the component version for new simple TS TTL feature 2025-05-22 20:41:31 +05:30
Piyush Shah
08c419da85 simple timeseries: Add a new helper API to directly report time series data
This allows users to avoid the double reporting that happens when using
esp_rmaker_param_update_and_report(), once for regular param update and
once for time series update. This can help reduce cost, especially when
the apps are using values only from the simple time series API.
2025-05-22 20:41:25 +05:30
Piyush Shah
d319d1d7c7 simple timeseries: Add an option to include ttl field (in days) while reporting values
This will ensure that the size of simple time series data in backend
does not keep growing and gets deleted after the configured time.

Typically, 30-60 days would be enough for most use cases.
2025-05-21 16:58:34 +05:30
WanqQixiang
72b54cf485 esp-rmaker: fix the host name check for Thread local control 2025-05-12 18:01:33 +08:00
WanqQixiang
3c019227b4 esp_rmaker: Add local control for Thread devices 2025-04-10 10:34:08 +08:00
Vikram Dattu
699df878b1 Extend signature generation to work on RSA signature
- Added signature generation for RSA signature in addition to ECDSA
 - Bugfix: use inlen, instead of doing strlen on input data
 - Bugfix: outlen should be `2 * slen` and not `slen` as we convert this to HEX
 - Also added a sign-data console command

 - component manager: Updated patch version for rainmaker component
2025-03-26 15:56:19 +05:30
Piyush Shah
327f35437e esp_rainmaker_components: Remove all external dependencies from codebase
Removed
- esp-insights
- jsmn
- json_generator
- json_parser

Instead, pick them up from idf component manager
2025-03-25 17:11:07 +05:30
Piyush Shah
6ed65d92fc Merge branch 'bugfix/fix_string_param_memory_leak' into 'master'
fix(esp_rainmaker): Fix memory leak when set string parameter

See merge request app-frameworks/esp-rainmaker!522
2025-03-04 16:04:34 +08:00
jim
cfaf803fac fix(esp_rainmaker): Fix memory leak when set string parameter 2025-02-28 19:52:28 +08:00
Gautam Agrawal
88d359014e Update esp_insights submodule to 1.2.4
* Update app_insights components dependency version to 1.2.4
2025-02-28 11:30:55 +05:30
Bijan Treister
6350543270 Fix Invalid Pointer Usage in esp_rmaker_report_info
Pull Request Summary: Fix Invalid Pointer Usage in esp_rmaker_report_info
Issue

Compilation failed due to incorrect pointer usage in snprintf and json_gen_obj_set_* calls. The function incorrectly passed &key_name (a char (*)[3] type) instead of key_name (a char *), causing type mismatch errors.
Fix

    Corrected snprintf usage: Passed key_name instead of &key_name.
    Fixed json_gen_obj_set_* calls: Removed unnecessary address-of operator (&key_name).
    Ensured correct string formatting: snprintf now correctly assigns key_name values without an explicit null termination.

Impact

    Resolves compilation errors for ESP32-C3 builds.
    Maintains intended functionality with proper string handling.
    No functional changes, just type correctness fixes.

This fix ensures successful builds and prevents runtime issues due to incorrect pointer usage
2025-02-10 20:54:39 -05:00
Piyush Shah
a43bb53741 Merge branch 'bugfix/fix_roll_back_flag_not_clear' into 'master'
bugfix: Fix when OTA successfully and rollback flag not clear

See merge request app-frameworks/esp-rainmaker!492
2025-01-31 20:45:57 +08:00
jim
0af4040bbb bugfix: Fix memory leak when create device and parameter and then delete them 2025-01-03 11:55:56 +08:00
Piyush Shah
4ee7cc20e8 bugfix: Application registered callback was getting skipped for persistent params
If the new bulk write callback is registered for a device/service instead of regular
callback, it was getting skipped for persistent params during initialisation.
2024-12-24 13:53:59 +05:30
jim
e11bb3076d bugfix: Fix when OTA successfully and rollback flag not clear 2024-11-27 11:21:43 +08:00
Piyush Shah
6c2859008c Merge branch 'tbr/fix_duplicate_initial' into 'master'
thread_br: avoid duplicate initialization for border router and increase mqtt task stack size

Closes RMN-2001 and RMN-2047

See merge request app-frameworks/esp-rainmaker!479
2024-11-05 20:18:59 +08:00
Piyush Shah
e05a72d3dd bugfix: Command-Response topic subscription was happening multiple times 2024-10-28 18:42:11 +05:30
Piyush Shah
630fe690b0 Minor typo fixes 2024-10-25 17:31:21 +05:30
WangQixiang
592c25f0e3 thread_br: avoid duplicate initialization for border router
Closes RMN-2001 RMN-2047
2024-10-17 11:18:51 +08:00
Piyush Shah
3328c7295f Merge branch 'thread-br' into 'master'
feature: Add Thread Border Router service and Thread BR example

See merge request app-frameworks/esp-rainmaker!450
2024-09-10 19:23:14 +08:00
Piyush Shah
1f31d6c816 Merge branch 'rmaker/provisioning_option' into 'master'
rmaker: Add a configuration option to make the provisioning component selectable

See merge request app-frameworks/esp-rainmaker!460
2024-09-10 19:22:38 +08:00
WanqQixiang
189f99bb1c feature: Add Thread Border Router service and Thread BR example 2024-09-10 17:45:03 +08:00
Piyush Shah
7151323109 Merge branch 'fix/matter_ci_build' into 'master'
gitlab_ci: Fix matter build by fixing the docker image to stable release

See merge request app-frameworks/esp-rainmaker!471
2024-09-10 17:18:36 +08:00