Commit Graph

55 Commits

Author SHA1 Message Date
Piyush Shah
2f7db4be6c Merge branch 'feature/local_ctrl_api' into 'master'
feature: Add APIs to enable/disable local control.

See merge request app-frameworks/esp-rainmaker!348
2023-09-12 13:50:17 +08:00
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
Piyush Shah
7070f2ea77 esp_rmaker_ota: Give applications a better control on app rollback 2023-09-08 22:45:52 +05:30
Piyush Shah
844e931187 Merge branch 'task/config_add_secure_boot_digest' into 'master'
task: add secure boot digest in node configuration

See merge request app-frameworks/esp-rainmaker!365
2023-07-28 16:47:50 +08:00
sanket.wadekar
8e6b70641f task: add secure boot digest in node configuration
Signed-off-by: Vikram <vikram.dattu@espressif.com>
2023-07-28 12:03:59 +05:30
sanket.wadekar
9f146dd36d feature: Add a node authentication mechanism using RainMaker certificate.
Can be used for user-node association or other purposes in future.
2023-06-08 15:07:02 +05:30
sanket.wadekar
629ad1090a task: create api to check whether device is connected
to MQTT server
2023-05-29 19:08:10 +05:30
Vikram
7da0ec23db Bugfix: MQTT budget exceed causing WDT trigger in ESP-Insights
Cause: A vicious cycle:
MQTT budget exceed error print getting logged into ESP-Insights.
When the RTC memory is full, this causes it to drop the message and
raise memory full event, which then taken action as reporting Insights
data immediately. This again causes MQTT budget exceed error!

The fix: Do not try to send message when budget is not available

Signed-off-by: Vikram <vikram.dattu@espressif.com>
2023-02-01 12:43:41 +05:30
Piyush Shah
d9994f3fb6 esp_rmaker_mqtt: Add MQTT budgeting to control the number of messages sent 2022-11-23 21:41:23 +05:30
sanket.wadekar
2f2c383e5e mqtt_topics: Added support for AWS basic ingest topics.
Signed-off-by: sanket.wadekar <sanket.wadekar@espressif.com>
2022-11-21 18:59:47 +05:30
sanket.wadekar
9b33df844b Added Job ID to OTA structure
Signed-off-by: sanket.wadekar <sanket.wadekar@espressif.com>
2022-10-18 15:03:44 +05:30
sanket.wadekar
80eec80015 Fixed OTA Race condition
Signed-off-by: sanket.wadekar <sanket.wadekar@espressif.com>
2022-10-12 10:01:25 +05:30
sanket.wadekar
32b2e0229f Added config to disable auto reboot after ota
Signed-off-by: sanket.wadekar <sanket.wadekar@espressif.com>
2022-10-10 19:41:55 +05:30
sanket.wadekar
7f34a7b6e6 Added firmware version to ota data structures
Signed-off-by: sanket.wadekar <sanket.wadekar@espressif.com>
2022-10-10 19:38:00 +05:30
Piyush Shah
757cbe5116 ota: Add support for OTA metadata, applicable for OTA using topics 2022-09-15 18:12:24 +05:30
Piyush Shah
bcde4e1f03 esp_rmaker_ota: Trigger events if the default OTA callback is used 2022-08-29 19:29:36 +05:30
Piyush Shah
c77d27a32f esp_rmaker_core: Add mqtt based support for command-response 2022-07-18 12:21:59 +05:30
sivar2311
07533b82a1 Merge branch 'espressif:master' into master 2022-06-09 09:10:58 +02: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
sivar2311
f1cbb8c412 Added definitions for various parameters and UI types. 2022-05-28 06:41:32 +02:00
Piyush Shah
295b6a3839 rmaker_user_mapping: Fixes for bugs seen during re-provisioning 2022-04-28 20:04:10 +05:30
Piyush Shah
174a38b56c Merge branch 'task/ota_improvements' into 'master'
ota: Minor improvements

See merge request app-frameworks/esp-rainmaker!295
2022-04-28 17:32:32 +08:00
Piyush Shah
1cd07a0099 ota: Minor improvements
- Expose some internal APIs
    - External OTA callbacks can now call the internal function to manage OTA
    - Applications can explicitly send the OTA fetch publish message to check
    if OTA is available in case of OTA using Topics

- Handle network connectivity loss using keep-alive

- Send "rejected" as OTA status for project/version mismatch, instead of
  "failed".
2022-04-28 14:44:28 +05:30
Piyush Shah
72283a552d esp_rmaker_node_config: Added some new fields
Node info:
- project_name: The name of the project as configured in CMakeLists.txt.
  "model" was earlier being used for this and will continue to be used
  for backward compatibility, but now it would be ok to override model
  using the esp_rmaker_node_add_model() API.
- platformm: Read from CONFIG_IDF_TARGET, tells the platform being used
  (esp32, esp32s2, esp32c3,....)

Device
- model (optional)
2022-04-27 20:20:59 +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
c1187fed84 user_node_mapping: Better handling for user reset and mapping state
Even when an explicit user reset was triggered by the firmware,
the RMAKER_EVENT_USER_NODE_MAPPING_DONE event was getting generated,
which was misleading and causing issues while integrating other
frameworks. A new event RMAKER_EVENT_USER_NODE_MAPPING_RESET has
been added to distinguish this event.

The esp_rmaker_user_node_mapping_get_state() has also been exposed
for applications to use. Note that the CONFIG_ESP_RMAKER_USER_ID_CHECK
config option should be enabled to get correct state.
2022-03-16 13:10:33 +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
d229e35b42 esp_rmaker_core: Expose esp_rmaker_param_update() API to assist in multi param updates 2022-02-17 14:37:57 +05:30
Vikram
2ee18ee6f3 esp_rmaker_core: Added an event to indicate that local control service has started
Signed-off-by: Vikram <vikram.dattu@espressif.com>
2022-01-19 17:38:06 +05:30
Chirag Atal
3bd64da66a esp_rmaker_local_ctrl: Added support for sec1
Also created a service which has POP as a param. The clients such as phone app can use this POP to connect to the device if the security type is sec1.
For sec0, this service is not created.
2022-01-11 14:52:46 +05:30
Piyush Shah
afcc67f3ec esp_rmaker_core: Add support for triggering phone app notifications
Supports two types of notifications
1. Parameter updates
2. Alerts

Please check the API docs for more information
2021-09-07 16:00:09 +05:30
Piyush Shah
2655228091 Merge branch 'bugfix/user_association' into 'master'
esp_rmaker_user_mapping: Add checks for user id for better security

See merge request app-frameworks/esp-rainmaker!260
2021-09-02 13:19:42 +00:00
Piyush Shah
412ad546c4 esp_rmaker_user_mapping: Add checks for user id for better security 2021-09-02 14:34:02 +05:30
Chirag Atal
2425b17394 esp_rmaker_core: Added a get_device_by_name API similar to params 2021-09-02 09:57:24 +05:30
Michal Dvořák
8977045b06 Fixed typo in docs for ota server_cert
Correct cert constant name is ESP_RMAKER_OTA_DEFAULT_SERVER_CERT, not ESP_RMAKER_DEFAULT_OTA_SERVER_CERT
2021-07-23 17:57:29 +05:30
Piyush Shah
8f73dda4fb esp_rmaker_core: Add an API to get parameter value from Rmaker core 2021-06-01 20:09:37 +05:30
Piyush Shah
f8b833ac2f esp_rmaker_core: Add a new field "subtype" for devices 2021-06-01 20:08:28 +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
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
3a0f522995 esp_rmaker_standard_types: Added UI Type "esp.ui.hue-slider" for Hue param
This will show up as a coloured hue slider in the phone apps
2021-01-26 00:26:05 +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
892e61b32f esp_rmaker_core: Add a facility for local control
Once the node connects to a Wi-Fi network, it would now be possible to
control it from a client in the same network. This will be useful when
the Internet connection is down. It will also reduce the cloud communication
in general and will be faster.
2020-11-18 22:16:04 +05:30
Piyush Shah
fd094fb045 Miscellaneous minor fixes 2020-11-12 17:19:46 +05:30
Piyush Shah
8a098f08ca esp_rmaker_mqtt: Add a few MQTT events 2020-11-10 19:00:53 +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
ccca176efc esp_rmaker_params: Added an API to indicate max number of elements allowed in an array param 2020-09-30 10:23:09 +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
bf9de50955 esp_rmaker_time_sync: Add support for POSIX timezones
Raw APIs as well as a RainMaker service have been provided to manage timezones.
Timezone information is stored in NVS so that it stays even across reboots.

A config option CONFIG_ESP_RMAKER_DEF_TIMEZONE has also been added to set the
default timezone.
2020-09-04 00:29:48 +05:30