Commit Graph

134 Commits

Author SHA1 Message Date
chiragatal
ffd5efca99 ws2812_led: Fix for rmt APIs getting included in case of make for IDF v4.0. 2020-10-06 18:13:28 +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
Piyush Shah
e352dfda42 Merge branch 'task/simplify_user_assoc' into 'master'
esp_rmaker_user_mapping: Create and register user_mapping handlers internally

See merge request app-frameworks/esp-rainmaker!174
2020-10-01 16:17:18 +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
87f0f355f5 Merge branch 'task/license' into 'master'
license: Add Apache 2.0 License file

See merge request app-frameworks/esp-rainmaker!175
2020-10-01 13:09:43 +08:00
Piyush Shah
06d61977aa license: Add Apache 2.0 License file 2020-10-01 01:12:28 +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
b61dc0401f Merge branch 'task/def_param_name_changes' into 'master'
esp_rmaker_standard_types: Start default names of all standard params with capital letter

See merge request app-frameworks/esp-rainmaker!171
2020-09-29 19:09:30 +08:00
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
e8532e469f Merge branch 'feature/homekit' into 'master'
homekit_switch: Added an example for RainMaker + HomeKit

See merge request app-frameworks/esp-rainmaker!168
2020-09-26 01:41:29 +08:00
Piyush Shah
e45bf601ae homekit_switch: Added an example for RainMaker + HomeKit 2020-09-25 22:21:53 +05:30
Piyush Shah
46f805c9f4 Merge branch 'feature/assisted_claiming' into 'master'
esp_claim: Add support for "Assisted Claiming"

See merge request app-frameworks/esp-rainmaker!158
2020-09-17 13:00:39 +08:00
Piyush Shah
72e199a583 Merge branch 'task/node_param_internal_changes' into 'master'
esp_rainmaker_core: Code restructuring for node config and params

See merge request app-frameworks/esp-rainmaker!165
2020-09-14 22:51:34 +08:00
Piyush Shah
3cdd00725b esp_rainmaker_core: Code restructuring for node config and params
Abstracted out the get node config and get/set node params functions so
that they just act upon the JSON data, irrespective of the source of the
requests.
2020-09-14 18:22:34 +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
b77f44aa97 esp_claim: Add support for "Assisted Claiming"
This is specifically for simplifying ESP32 claiming workflow,
wherein the phone apps will assist the node for claiming during
Wi-Fi provisioning. There would be no need of using CLI for claiming.

This will work only for BLE provisioning, as internet connectivity
will be required for claiming, and it may not be possible with
SoftAP.
2020-09-11 22:32:43 +05:30
Piyush Shah
1ddf30c7b2 Merge branch 'feature/timezone' into 'master'
esp_rmaker_time_sync: Add support for POSIX timezones

See merge request app-frameworks/esp-rainmaker!155
2020-09-04 22:51:44 +08:00
Piyush Shah
2e82d0a2c2 Merge branch 'bugfix/ota_long_url' into 'master'
esp_rmaker_ota: Changes to support longer OTA URLs

See merge request app-frameworks/esp-rainmaker!160
2020-09-04 21:59:27 +08:00
Piyush Shah
56d9e43163 Merge branch 'task/ota_api_update' into 'master'
cli: Update upload OTA image API

See merge request app-frameworks/esp-rainmaker!161
2020-09-04 19:22:04 +08:00
Piyush Shah
d7a1cf36e4 esp_rmaker_ota: Changes to support longer OTA URLs
This required 2 changes
1. Handle longer messages received on MQTT
2. Handle longer URLs in the http client configuration in OTA
2020-09-04 12:27:19 +05:30
Shivani Tipnis
dc1d6b82b0 cli: Update upload OTA image API 2020-09-04 12:19:15 +05:30
Piyush Shah
90354df231 esp_rmaker_console: Added commands for time get and timezone set
Examples:

tz-set posix CST-8
I (25752) esp_rmaker_time_sync: The current time is: Tue Sep  1 21:48:13 2020 +0800[CST], DST: No.

tz-set America/Los_Angeles
I (70892) esp_rmaker_time_sync: The current time is: Tue Sep  1 06:48:58 2020 -0700[PDT], DST: Yes.

local-time
esp_rmaker_commands: Current local time: Tue Sep  1 06:49:21 2020 -0700[PDT], DST: Yes
2020-09-04 00:30:17 +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
Piyush Shah
5d664fc283 Merge branch 'feature/idf4.0_compat' into 'master'
IDF 4.0 compatibility mode

See merge request app-frameworks/esp-rainmaker!154
2020-09-01 20:08:00 +08:00
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
0f4901475a Merge branch 'task/claim_workflow_update' into 'master'
cli: Maintain same host driven claiming workflow for all platforms

See merge request app-frameworks/esp-rainmaker!156
2020-08-26 21:40:01 +08:00
Shivani Tipnis
1c18b08308 cli: Maintain same host driven claiming workflow for all platforms 2020-08-26 18:41:03 +05:30
Piyush Shah
04adf40a35 Merge branch 'feature/wifi_reset' into 'master'
examples: Separate wifi-reset and factory-reset

See merge request app-frameworks/esp-rainmaker!142
2020-08-26 15:02:27 +08:00
Piyush Shah
e0385e9ec3 iot_button: Minor fix in header file to prevent compilation warnings 2020-08-21 23:22:27 +05:30
Piyush Shah
196bcb2d41 examples: Use the new wifi-reset and factory-reset APIs 2020-08-21 23:21:53 +05:30
Piyush Shah
7be8b6e9d4 esp_rmaker_utils: Add helper functions for Wi-Fi and factory reset
Also added events for these.
2020-08-19 23:56:16 +05:30
Piyush Shah
4628715d35 Merge branch 'bugfix/str_list_warning' into 'master'
Fixed a minor compilation warning

See merge request app-frameworks/esp-rainmaker!152
2020-08-19 21:55:32 +08:00
Piyush Shah
2a478e25f8 Fixed a minor compilation warning 2020-08-19 16:47:25 +05:30
Piyush Shah
3c7a563beb Merge branch 'feature/valid_vals' into 'master'
esp_rmaker_core: Add a facility to add a valid set of string values

See merge request app-frameworks/esp-rainmaker!83
2020-08-19 13:36:55 +08:00
Piyush Shah
1cca9ba4c4 esp_rmaker_core: Add a facility to add a valid set of string values
Some string parameters may want to have a set of valid values which
it wants the client (phone apps primarily) to show in a dropdown.
A new API esp_rmaker_param_add_valid_str_list() has been added for that.
2020-08-19 10:37:01 +05:30
Piyush Shah
f74179b771 Merge branch 'task/ci-use-github' into 'master'
gitlab-ci: Changes to esp-idf path to provide more flexibility in CI

See merge request app-frameworks/esp-rainmaker!151
2020-08-19 13:05:44 +08:00
Piyush Shah
0eafc0d20f gitlab-ci: Changes to esp-idf path to provide more flexibility in CI 2020-08-18 23:51:53 +05:30
Piyush Shah
475983131c Merge branch 'feature/json_obj_arr' into 'master'
Add facility for Objects and Arrays in Parameters

See merge request app-frameworks/esp-rainmaker!123
2020-08-06 19:35:45 +08:00
Piyush Shah
a9d1d4792a Merge branch 'feature/console_prov' into 'master'
esp_rmaker_console: Add a command for Wi-Fi provisioning

See merge request app-frameworks/esp-rainmaker!143
2020-08-06 18:41:30 +08:00
Piyush Shah
ff78d1aa07 Merge branch 'bugfix/secure_pop' into 'master'
Generate secure proof of possession

See merge request app-frameworks/esp-rainmaker!135
2020-08-06 14:56:09 +08:00
Piyush Shah
94254771fc esp_rmaker_console: Add a command for Wi-Fi provisioning
Command: wifi-prov <ssid> [<passphrase>]
2020-08-06 12:11:27 +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
67df92932e Merge branch 'feature/persistent_mqtt' into 'master'
esp_rmaker_mqtt: Added support for persistent sockets and use of port 443.

See merge request app-frameworks/esp-rainmaker!95
2020-08-04 01:50:02 +08:00
Piyush Shah
bbeb8f1d4d esp_rmaker_mqtt: Added support for persistent sockets and use of port 443
Using MQTT persistent session improves the reliability as the broker can then deliver any
pending QOS1 messages even after the node disconnects and then re-connects (within max 1hr).
However, it has a side-effect that messages can be received at unexpected times.
Please check the MQTT specs to understand persistent sessions.

Support for port 443 for MQTT has been enabled since it is generally open on most networks,
whereas port 8883 (default MQTT) could be blocked.
2020-08-03 19:28:32 +05:30
Piyush Shah
e24029fc90 esp_rmaker_core: Add support for Objects and Arrays in parameters
Validating the JSON arrays and objects would be the application's responsibility.
The RainMaker core will just treat them as strings (without the quotes, ofcourse).
2020-08-03 17:09:03 +05:30
Piyush Shah
b5cdfecdf7 json: Add facility to specifiy objects and arrays as strings
Eg. Add a pre-generated JSON object, say {"name":"val"} into another object, giving
a result {"pregen":{"name":"val"}}
Similarly allow to read entire object string during parsing.
2020-08-03 16:53:29 +05:30
Piyush Shah
c94d945958 Merge branch 'task/api_restructure' into 'master'
esp_rainmaker_core: Code restructure and API changes

See merge request app-frameworks/esp-rainmaker!136
2020-07-31 21:37:18 +08:00
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