Commit Graph

70 Commits

Author SHA1 Message Date
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
Chirag Atal
8fb1966178 gpio_button: Renaming button to gpio_button to fix compilation errors
Multiple components with the same name are detected if the idf_component_manager also includes the button component.
2022-07-20 14:43:07 -04:00
Piyush Shah
9f87e123e7 Merge branch 'task/ota-rollback' into 'master'
ota: Better usage of App rollback feature

See merge request app-frameworks/esp-rainmaker!309
2022-07-14 19:23:26 +08:00
Chirag Atal
db2c8d3b58 minor: Fix support for cpp 2022-07-13 12:46:41 -04:00
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
cd12423912 bugfix: Compilation fixes for different idf versions and targets 2022-06-06 16:11:36 +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
67cefd68d3 led_light: Use default OTA server certificate
Earlier example used a local certificate just for demo purposes.
However, since the RainMaker OTA server is the default server anyways,
it's better to use that same default certificate.
2022-05-04 18:05:55 +05:30
Piyush Shah
e1dacc27d7 homekit_switch: Add provisioning timeout support similar to rest of the examples 2022-04-28 20:04:15 +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
Piyush Shah
4250addc13 app_wifi: Make provisioning prefix configurable 2022-04-28 17:21:34 +05:30
Piyush Shah
c0af462fee app_wifi: Add an option to reset prov state machine on failure
Earlier, a reset and reboot were required if wrong Wi-Fi credentials
were given during provisioning. With this change, based on some
configured number of reconnection attempts, the firmware will go back into
provisioning mode.
2022-04-28 17:21:34 +05:30
Piyush Shah
d796985bac app_wifi: Minor feature additions to provisioning workflow
- Provide an option of provisioning without PoP pin (use with caution).
- Config option for provisioning timeout (set to 30 min by default).
Useful especially when there is no PoP, and so you want to keep the device
in provisioning mode only for a few minutes after boot up.
2022-04-28 17:21:34 +05:30
Piyush Shah
f57a5ec62d Merge branch 'feature/scenes' into 'master'
esp_rmaker_scenes: Add scenes support.

See merge request app-frameworks/esp-rainmaker!245
2022-03-29 21:48:25 +08:00
Piyush Shah
2a08ed9cfe Fixes for idf v5.0 2022-03-15 20:53:20 +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
Shubham Patil
e3573c81da app_insights: Insights transport changes 2022-03-04 17:44:31 +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
Piyush Shah
dc8ca4018f homekit_switch: Modifications to support WAC and IPV6
Also move app_wifi_with_homekit to a separate private component which would override the common/app_wifi

Note that WAC can be enabled only with MFi variant of ESP HomeKit SDK

Closes: https://github.com/espressif/esp-rainmaker/issues/78
2022-01-07 10:39:27 +05:30
Shubham Patil
dc65f11661 esp_insights: Update submodule and minor fixes
- app_insights:
 - Replaced esp_insights_rmaker_enable() API with esp_insights_enable()
 - Enable errors, warnings, and events when user selects LOG_TYPE_ALL
 - Fixed compilation errors and warnings
2021-10-29 09:48:59 +05:30
Shubham Patil
e69372a2fe examples: Fixed typos in comment 2021-09-09 10:53:31 +05:30
Piyush Shah
8738eb0fab esp32s3: Add support for the new platform ESP32-S3 2021-09-08 00:32:39 +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
f1b92c293f Minor fixes
- Compilation issues were seen on some hosts after insights components were included.
- app_wifi: CMake file had esp_rainmaker as a dependency even if it was no dependent on it.
- WS2812 could not be used for ESP32 due to Kconfig logic
2021-07-06 23:02:24 +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
522452a0e5 homekit_switch: Minor change to fix compilation error due to JSON component change 2021-06-01 14:45:32 +05:30
Piyush Shah
fce91c4fb0 esp_rmaker_core: Add a system service for reboot/reset 2021-05-28 23:21:58 +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
8854443e4e examples: Use FreeRTOS timer instead of esp_timer for periodic tasks
esp_timer is generally recommended when high precision is required.
However, since that is not the case for periodic reporting of temperature
values, replaced it with freeRTOS Timer.
2021-03-23 01:24:39 +05:30
Piyush Shah
009c6d7ab3 Remove a stale file added mistakenly 2021-03-23 01:02:03 +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
50c3023e43 esp32-c3: Minor changes for ESP32-C3 support 2021-02-08 23:27:57 +05:30
Piyush Shah
2271c51144 Merge branch 'task/module_restructure' into 'master'
esp_rmaker: Moved out some generic modules from esp_rainmaker component

See merge request app-frameworks/esp-rainmaker!222
2021-02-04 00:51:19 +08:00
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
Shubham Patil
460eb620e0 app_wifi: Initialized the nvs_random to NULL. 2021-02-01 20:53:25 +05:30
Piyush Shah
63b7471a88 app_wifi: Added some optional prints on console to help getting started
CONFIG_APP_WIFI_SHOW_DEMO_INTRO_TEXT needs to be set to enable these prints
2021-01-28 16:03:46 +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
Piyush Shah
fd50262b42 app_wifi: Changes in SSID and PoP generation for Provisioning
- In claiming, change the 4 byte random number to 64 byte and store it
as binary data instead of hex representation.
- Instead of reading PoP as hex string from NVS, read it as binary data
(because of above change) and then convert to hex representation.
- Instead of using mac address, use last 3 bytes of the above random number
number as suffix for SSID.

The last change was made so as to allow generating the QR code completely outside
the device, without knowing its mac address.
2020-10-16 18:44:29 +05:30
Piyush Shah
ddeba1670e Merge branch 'feature/device_scheduling' into 'master'
Scheduling support

See merge request app-frameworks/esp-rainmaker!125
2020-10-02 03:12:01 +08:00
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
52f9d01956 esp_rmaker_user_mapping: Create and register user_mapping handlers internally
Earlier, it was the application code's responsibility to call the
esp_rmaker_user_mapping_endpoint_create() and esp_rmaker_user_mapping_endpoint_register()
APIs at appropriate places in Wi-Fi provisioning code to enable user node mapping
functionality. To simplify this, the logic has been moved to RainMaker Core, so that
this happens automatically.

For some reason, if you want to retain the older logic in your application code
and do not want RainMaker_core to enable this, please set the
CONFIG_ESP_RMAKER_DISABLE_USER_MAPPING_PROV config option.
2020-10-01 00:58:37 +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