61 Commits

Author SHA1 Message Date
Piyush Shah
23123e3a2d esp32c5: Added default config for binary size optimisation
And also make esp32c5 part of standard esp-idf release/v5.5 CI builds
2025-12-19 23:52:32 +05:30
Piyush Shah
da838cbf13 rmaker_common: Remove the submodule and its references 2025-11-13 09:42:38 +05:30
Piyush Shah
8a816fc6c3 examples: Update the names for the common example components 2025-11-13 09:42:38 +05:30
Piyush Shah
2de5cd5a56 examples: Enable parameter console commands in some examples 2025-11-12 20:50:06 +05:30
Piyush Shah
a640b220de examples: Remove dependency on ws2812 and ledc components
- Use led_indicator component from component manager for ws2812 and RGB
  LEDs
- Add other components from examples/common via idf_component.yml
  instead of adding as EXTRA_COMPONENT_DIRS in CMakeLists.txt
2025-11-11 19:56:43 +05:30
Piyush Shah
1dc2fc3130 examples: Use modified app_reset APIs and upstream button component 2025-10-27 18:00:42 +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
f6e07b593e examples: Configure ESP32-C5 GPIO defaults for examples
- Set button GPIO to 28 for ESP32-C5 devkit (vs GPIO 9 for other C-series)
- Set WS2812 LED GPIO to 27 for ESP32-C5 devkit (vs GPIO 8 for other C-series)
- Updated examples: gpio, switch, multi_device, temperature_sensor, fan, led_light
2025-06-09 17:44:47 +05:30
Piyush Shah
b5e1a46591 examples: Changes for component manager based builds 2025-03-25 17:54:31 +05:30
Vikram Dattu
54554b6c8a Provide correct default BOOT pin config for ESP32-H2 2024-10-17 14:30:16 +05:30
Vikram Dattu
66160cdaf7 Changed default partion csv file to partions_4mb_optimised.csv
- With newest IDF releases with recent feature additions, the app partitions were getting overflown.
 - This optimised partions file make fullest use of flash. Hence we get more room for app partitions.
2024-10-15 18:06:42 +05:30
Vikram Dattu
3e375f43f6 Enable Insights command response module
- Updated esp_insights submodule and the component version dependency
 - Selected `ESP_INSIGHTS_TRANSPORT_MQTT` in examples sdkconfig.defaults
 - Called esp_insights_cmd_resp_enable

 - Also updated `cli` submodule to the latest
2024-08-22 10:32:54 +05:30
WanqQixiang
aa6dcdf559 example: Update examples to use app_network for Thread provisioning 2024-08-06 16:29:35 +08:00
Piyush Shah
b6ca97d689 examples: Changes for bulk parameter reporting
- led_light: Use the new bulk write callback (single callback invoked just once
  for multiple param writes) and use esp_rmaker_param_update()
  so that all updated params are also reported together.
- Other examples: Just replace esp_rmaker_param_update_and_report with
  esp_rmaker_param_update() and let the Rainmaker core report all
  updated params together.
2024-06-20 14:26:11 +08:00
Vikram Dattu
5dccee9eac examples: Add support for esp32c2
- Added entry for esp32c2 build in CI
- RAM optimized sdkconfig.defaults.esp32c2
- Disable ws2812 led drivers from non-rmt supported devices
- Use GPIO9 as BOOT button for C2
2024-05-09 20:38:11 +05:30
Piyush Shah
798825b07d bugfix: ci failures were seen for esp32s2
- Due to some changes in esp-idf after v5.1.3, CONFIG_BT_ENABLED gets set
even for esp32s2, causing issues in compilation.
 - In earlier esp-idf versions, since this was not applicable for esp32-s2,
it was getting skipped even when it was present in sdkconfig.defaults.
 - Added sdkconfig.defaults.esp32s2 and disabled BT explicitly
2024-03-08 20:30:19 +05:30
Vikram Dattu
f1d16cf736 examples: Added support for ESP32C6
1. ESP32C6 button configs for RGB LED and Boot GPIO
2. CI: Added entry for C6 in `.gitlab.yaml`
3. Added `partitions_4mb_optimised.csv` which uses flash to the full extent
  - Created sdkconfig.defaults for esp32c6 and used partitions_4mb_optimised.csv as default
  - This is made default for esp32c6 because, for esp32c6, image sizes exceed config from partitions.csv
4. Fixed matter examples CMakeLits.txt files for c6 support
2023-10-26 17:38:53 +05:30
sanket.wadekar
ed52355881 feature: Add APIs to enable/disable local control.
If local control is enabled via config option (CONFIG_ESP_RMAKER_LOCAL_CTRL_AUTO_ENABLE),
the enabling/disabling will happen internally and the behaviour will be
unchanged. However, if the config option is disabled, applications can
still call esp_rmaker_local_ctrl_enable/disable at runtime as and when
required, if CONFIG_ESP_RMAKER_LOCAL_CTRL_FEATURE_ENABLE option is enabled.

Note that the older config option CONFIG_ESP_RMAKER_LOCAL_CTRL_ENABLE
has been renamed to CONFIG_ESP_RMAKER_LOCAL_CTRL_AUTO_ENABLE. However,
CONFIG_ESP_RMAKER_LOCAL_CTRL_ENABLE will also continue to work and
ensure backward compatibility
2023-09-08 23:46:21 +05:30
sanket.wadekar
d789c719e6 wifi_prov: Add mfg data for improved device discovery
For BLE provisioning, adding some metadata in BLE advertisement can help
apps in filtering the scanned device list better, instead of relying
just on the prefix. It can also help show the device type even before
provisioning.

Metadata has been added in led_light and switch examples only, but can be
added in any other project too, as per the apps' requirement.
2023-08-18 18:22:06 +05:30
sanket.wadekar
58e936f79f examples: Include nvs keys partition to enable using nvs encryption
Also updates the rmaker_common submodule to include support for encrypted fctry nvs partition.
2023-07-14 14:37:24 +05:30
Dhaval Gujar
741b2c64a1 Adds support for using esp_secure_cert_mgr for TLS credentials
- Updated partitions.csv in all examples to use final
 esp_secure_cert partition format.
- This option can only be enabled if claiming is disabled.
- The Rainmaker app will fall back to using NVS if it
 fails to fetch from the `esp_secure_cert` partition.
 This has been done to allow a common firmware to be built that
 can run on both kinds of devices, i.e. ones that use NVS
 and ones that use the `esp_secure_cert` partition.
2023-03-30 22:23:17 +05:30
Vikram
3dc25a47c5 Revert "examples: Disable mbedTLS server config to reduce firmware size"
This reverts commit 7c1e894fe0.

The commit needs to be reverted as IDF5.0 does not allow selecting
ESP_HTTPS_SERVER when MBEDTLS is in client only mode.
2023-01-17 17:31:50 +05:30
sanket.wadekar
4acad87be9 Added OTA event handlers in examples 2022-11-09 20:35:27 +05:30
yuanjianmin
7c1e894fe0 examples: Disable mbedTLS server config to reduce firmware size 2022-11-08 19:00:54 +08:00
Piyush Shah
4abd2cf641 switch: sdkconfig IRAM optimisation for ESP32
CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y set to prevent IRAM overflow
on ESP32 with switch example using idf v5.0

Can be used in other projects too, if similar IRAM overflows are seen.
2022-09-30 18:31:08 +05:30
Vikram
a9798f71df IDF5.0 build fixes
1. Added requires wherever necessary
2. Use exact format specifiers
3. Updated `esp-insights` and `rmaker_common` submodules

Signed-off-by: Vikram <vikram.dattu@espressif.com>
2022-08-26 19:04:02 +05:30
Piyush Shah
cd173972a7 examples: Enable CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE in all examples
.. Since this is the recommended setting and well supported by the
RainMaker SDK, to ensure that OTA upgrades do not break the device
and ensure that the MQTT connection works fine with the new firmware.
2022-07-13 21:56:04 +05:30
shixinke
082a916720 example: Update IO for all examples to work with all ESP devkits and provide options in menuconfig 2022-06-07 10:47:40 +08:00
Piyush Shah
ef410e14b0 ota: Make "OTA using Topics" as default and provide a simplified API for that
- OTA using topics is now enabled in all examples
- esp_rmaker_ota_enable_default() is the simplified API that enables
  OTA using Topics with the default server certificates
2022-06-06 20:37:17 +05:30
Piyush Shah
b4db703281 Merge branch 'task/led_light_server_crt' into 'master'
ssl_server_cert: Use mbedtls certificate bundle for server authentication

See merge request app-frameworks/esp-rainmaker!298
2022-05-09 17:22:17 +08:00
Piyush Shah
93a2b36160 ssl_server_cert: Use mbedtls certificate bundle for server authentication
Instead of using 1 or 2 certificates for server authentication, use a
bundle of commonly used server certificates, so that even if the server
moves to a different signing authority, the device connection is not
affected.

This change has been done for claiming, OTA and MQTT certificates.
2022-05-05 19:06:28 +05:30
Piyush Shah
baf1dea322 switch: Add handling of new app wifi events
Also added the call missing for RMaker Common events
2022-04-28 20:04:15 +05:30
Chirag Atal
764db8d072 esp_rmaker_scenes: Add scenes support.
This adds a new standard service and its standard params.
The implementation is similar to the schedule structure but without triggers.
2022-03-09 16:16:23 +05:30
Piyush Shah
229713488c examples: Enable some security features and change order of component dirs
Features now enabled by default are:

- User id check in user-node association for better handling of reset to
factory from security perspective.
- Secure local control

Order of component dirs has been changed so that the rmaker_common from
esp-rainmker gets used, rather than the one from esp-insights
2022-01-25 13:59:28 +05:30
Shubham Patil
e69372a2fe examples: Fixed typos in comment 2021-09-09 10:53:31 +05:30
Piyush Shah
036e2dae48 switch: Add sample usage for mobile push notifications
Enabling CONFIG_EXAMPLE_ENABLE_TEST_NOTIFICATIONS for the switch example will
enable the test mobile notifications on push button events. Turning the switch
on would report a parameter notification like {"Switch":{"Power":true}} and
turning off would report an alert "Switch was turned off".

Note that push notifications should be used only when users need to be specifically
alerted about some event even when the app is in background, not otherwise.
2021-09-07 16:00:13 +05:30
Piyush Shah
0c84527cfb esp_insights: Add facility to enable esp_insights in the examples
Please check out CHANGES.md as this commit may break your existing
projects' compilation.
2021-07-06 00:39:07 +05:30
Piyush Shah
0b819949cf examples: Add timezone service in some examples
Setting correct timezone is mandatory for scheduling to work correctly.
Earlier, the default timezone was set to "Asia/Shanghai" and a config
change was required for setting appropriate timezone.

However, now that the phone apps have support for setting the timezone
using the RainMaker timezone service, it has been enabled in all
examples that had scheduling enabled.
2021-06-07 11:16:45 +05:30
Piyush Shah
332c6e7d58 examples: Increase FreeRTOS timer stack size
Button event callbacks are executed in the context of FreeRTOS Timer task.
Reporting param updates from that causes stack overflow, specifically on ESP32-C3.
As a temporary workaround, the stack size for FreeRTOS Timer task has been increased.
2021-03-23 01:25:02 +05:30
Piyush Shah
66dc818ba8 esp_events: Corrected the event handler prototypes to be in sync with esp_event_handler_t
Closes https://github.com/espressif/esp-rainmaker/issues/55
2021-03-15 11:03:32 +05:30
Piyush Shah
86b4dbbd68 examples: Changes for the ESP32-C3, primarily for Boot button
And some other minor changes
- Corrected comments in example READMEs and sdkconfig.defaults
- Duplicate macro in homekit_switch removed
2021-02-09 22:32:03 +05:30
Piyush Shah
31d4b375e3 esp_rmaker: Moved out some generic modules from esp_rainmaker component
The following are now part of a separate repo (and included as git submodule):
- MQTT glue layer
- Work Queue
- Utilities (reset, reboot, time sync, timezone, etc.)
- Factory Storage

Even CLI is now a part of a seperate repo, included here as a git submodule.
2021-02-03 15:30:55 +05:30
Piyush Shah
32b7d65d9b esp_rmaker_core: Provide an API to get request source in string format
Used this API in all examples.
2020-11-18 22:16:05 +05:30
Piyush Shah
fd094fb045 Miscellaneous minor fixes 2020-11-12 17:19:46 +05:30
Piyush Shah
cfd2624d79 switch: Handle the newly introduced MQTT events 2020-11-10 19:00:58 +05:30
Chirag Atal
a9c4e5b489 esp_rmaker_core: Added support for scheduling which allows actions to trigger automatically at the specified time.
For more information: https://rainmaker.espressif.com/docs/scheduling.html
2020-10-01 13:32:01 +05:30
Piyush Shah
367b48c995 esp_rmaker_standard_types: Start default names of all standard params with capital letter
Default parameter names like name, power, etc. have been changed to Name, Power, etc.
respectively, so that they look better in the phone app UIs.

Note that, with this change, any user configured device name (the name set from phone apps),
or any other persistent parameter for which a default name was used (Eg. power)
will be affected, as the values will no more be found in the NVS storage. Please edit your
application code accordingly if you want to stick with the old names.

Please check CHANGES.md for guidelines.
2020-09-29 14:07:38 +05:30
Piyush Shah
f4767018f9 ws2812_led: Simplify WS2812 RGB LED handling logic and also allow disabling it
The common code for WS2812 RGB LED has been moved to a component ws2812_led.

The WS2812 LED is available only on ESP32-S2-Saola-1 boards and hence
it will be enabled only if IDF target is set to ESP32S2. It can
be disabled by disabling the CONFIG_WS2812_LED_ENABLE config option.

led_strip component files have also been moved to ws2812_led
2020-09-01 16:07:57 +05:30
Piyush Shah
196bcb2d41 examples: Use the new wifi-reset and factory-reset APIs 2020-08-21 23:21:53 +05:30
Shubham Patil
e19abab592 wifi_provisioning: Use a random pop instead of creating it from MAC address
MAC address is a public information and can also be sniffed easily. Creating the proof of
possession pin from that is not secure enough. Instead, a random stream of bytes is now generated
and stored in the fctry partition during claiming and that is used for the PoP.
2020-08-05 23:12:08 +05:30