Commit Graph

42 Commits

Author SHA1 Message Date
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
Piyush Shah
e45bf601ae homekit_switch: Added an example for RainMaker + HomeKit 2020-09-25 22:21:53 +05:30
Piyush Shah
dc61b3429f app_wifi: Make BLE provisioning as the default for ESP32
- This will be required for the new "Assisted Claiming" feature.
2020-09-11 22:32:50 +05:30
Piyush Shah
7d5c39eb83 idf4.0_compat: Minor changes for IDF 4.0 compatibility
If IDF version being used is 4.0, following changes will happen:
- tcpip_adapter will be used, instead of esp_netif.
- MQTT port 8883 will be used, even if 443 is chosen, because
443 requires ALPN options in MQTT, which aren't supported in IDF 4.0
2020-09-01 16:08:09 +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
Piyush Shah
a3a1d05531 esp_rainmaker_core: Code restructure and API changes
- APIs and data structures changed to a more object oriented approach.
- Some internal files split into multiple files to separate out functionality
  of node, device and parameter.
- A new doc file CHANGES.md added to help understand the changes.
- Modified all the examples as per these changes in the RainMaker APIs.
2020-07-31 16:16:21 +05:30
Piyush Shah
2bc2c7396f esp_rainmaker: Combine the various components into a single esp_rainmaker component
- Better exchange of data between different rainmaker components
- Single Kconfig file
- Easier to manage events and other common functionality
2020-07-22 19:16:04 +05:30
Piyush Shah
966a767755 switch: Add an event handler for RainMaker Events 2020-07-02 19:34:54 +05:30
Chirag Atal
dc3b34ccdf esp_rmaker_console: Add support for serial console. 2020-06-25 17:40:34 +05:30
Piyush Shah
febb4bc745 examples: Use the common app_wifi file even in the gpio example 2020-06-25 12:08:04 +05:30
Chirag Atal
227a705430 app_wifi: Add support for BLE based provisioning. 2020-06-22 18:51:08 +05:30
Piyush Shah
4970fd07ba examples: Changes in OTA calls
switch: Used the default OTA Server certificate to demonstrate simplest usage.
led_light: Added OTA calls that demonstrate using own server certificate.
2020-06-05 11:13:49 +05:30
Chirag Atal
34da10fde3 sdkconfig: Enabling dynamic allocation and freeing of mbedtls buffers. 2020-05-27 17:40:36 +05:30
Piyush Shah
6bd86626a5 switch: Minor changes to the OTA Server certificate
- Added a comment in the certificate so that its purpose is clear.
- Added a "const" to the server certificate variable so that it stays in flash.
2020-05-23 17:33:57 +05:30
Piyush Shah
1a32410d00 switch: Use new OTA API and server certificate 2020-05-22 19:08:50 +05:30
Chirag Atal
2ee8c6f21f cmakelists: Minor: Removing the comment that it has been created from makefile. 2020-05-14 15:26:07 +05:30
Piyush Shah
ea3bfcda4b app_wifi: Add a link which can be copy-pasted in browser for provisioning QR code 2020-04-22 19:39:55 +05:30
Piyush Shah
cdb696649b app_wifi: Move the code to a common folder as it is same across all examples 2020-04-22 22:08:34 +08:00
Piyush Shah
72242952a2 esp_rainmaker: Add various required components, examples and CLI 2020-04-16 04:13:35 +05:30