diff --git a/components/esp_rainmaker/Kconfig.projbuild b/components/esp_rainmaker/Kconfig.projbuild index ed8467e..a255557 100644 --- a/components/esp_rainmaker/Kconfig.projbuild +++ b/components/esp_rainmaker/Kconfig.projbuild @@ -97,7 +97,7 @@ menu "ESP RainMaker Config" config ESP_RMAKER_DEF_TIMEZONE string "Default Timezone" - default "" + default "Asia/Shanghai" help Default Timezone to use. Eg. "Asia/Shanghai", "America/Los_Angeles". Check documentation for complete list of valid values. This value diff --git a/components/esp_rainmaker/include/esp_rmaker_core.h b/components/esp_rainmaker/include/esp_rmaker_core.h index ccfa24b..a48c3d7 100644 --- a/components/esp_rainmaker/include/esp_rmaker_core.h +++ b/components/esp_rainmaker/include/esp_rmaker_core.h @@ -495,7 +495,7 @@ char *esp_rmaker_device_get_name(const esp_rmaker_device_t *device); * @return NULL terminated device type string on success. * @return NULL in case of failure, or if the type wasn't provided while creating the device. */ -char *esp_rmaker_device_get_name(const esp_rmaker_device_t *device); +char *esp_rmaker_device_get_type(const esp_rmaker_device_t *device); /** * Add a parameter to a device/service diff --git a/components/esp_rainmaker/include/esp_rmaker_schedule.h b/components/esp_rainmaker/include/esp_rmaker_schedule.h index 6d63a5b..383c094 100644 --- a/components/esp_rainmaker/include/esp_rmaker_schedule.h +++ b/components/esp_rainmaker/include/esp_rmaker_schedule.h @@ -26,6 +26,8 @@ extern "C" * * It is recommended to set the timezone while using schedules. Check [here](https://rainmaker.espressif.com/docs/time-service.html#time-zone) for more information on timezones * + * @note This API should be called after esp_rmaker_node_init() but before esp_rmaker_start(). + * * @return ESP_OK on success. * @return error in case of failure. */ diff --git a/components/esp_rainmaker/src/core/esp_rmaker_schedule.c b/components/esp_rainmaker/src/core/esp_rmaker_schedule.c index b8b4784..4567238 100644 --- a/components/esp_rainmaker/src/core/esp_rmaker_schedule.c +++ b/components/esp_rainmaker/src/core/esp_rmaker_schedule.c @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include #include #include #include diff --git a/examples/fan/main/app_main.c b/examples/fan/main/app_main.c index 7a232e9..c934fae 100644 --- a/examples/fan/main/app_main.c +++ b/examples/fan/main/app_main.c @@ -86,7 +86,13 @@ void app_main() esp_rmaker_device_add_param(fan_device, esp_rmaker_speed_param_create(ESP_RMAKER_DEF_SPEED_NAME, DEFAULT_SPEED)); esp_rmaker_node_add_device(node, fan_device); - /* Enable scheduling */ + /* Enable scheduling. + * Please note that you also need to set the timezone for schedules to work correctly. + * Simplest option is to use the CONFIG_ESP_RMAKER_DEF_TIMEZONE config option. + * Else, you can set the timezone using the API call `esp_rmaker_time_set_timezone("Asia/Shanghai");` + * For more information on the various ways of setting timezone, please check + * https://rainmaker.espressif.com/docs/time-service.html. + */ esp_rmaker_schedule_enable(); /* Start the ESP RainMaker Agent */ diff --git a/examples/fan/sdkconfig.defaults b/examples/fan/sdkconfig.defaults index b40efc3..bdb4d65 100644 --- a/examples/fan/sdkconfig.defaults +++ b/examples/fan/sdkconfig.defaults @@ -11,3 +11,8 @@ CONFIG_PARTITION_TABLE_MD5=y CONFIG_MBEDTLS_DYNAMIC_BUFFER=y CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y + +# For BLE Provisioning using NimBLE stack (ESP32 only) +CONFIG_BT_ENABLED=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BT_NIMBLE_ENABLED=y diff --git a/examples/gpio/sdkconfig.defaults b/examples/gpio/sdkconfig.defaults index b40efc3..bdb4d65 100644 --- a/examples/gpio/sdkconfig.defaults +++ b/examples/gpio/sdkconfig.defaults @@ -11,3 +11,8 @@ CONFIG_PARTITION_TABLE_MD5=y CONFIG_MBEDTLS_DYNAMIC_BUFFER=y CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y + +# For BLE Provisioning using NimBLE stack (ESP32 only) +CONFIG_BT_ENABLED=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BT_NIMBLE_ENABLED=y diff --git a/examples/homekit_switch/README.md b/examples/homekit_switch/README.md index 8ce80f7..a5b9e2d 100644 --- a/examples/homekit_switch/README.md +++ b/examples/homekit_switch/README.md @@ -1,6 +1,6 @@ # HomeKit Switch Example -This example demonstrates ESP RaimMaker + HomeKit integration using the [esp-homekit-sdk](https://github.com/espressif/esp-homekit-sdk). +This example demonstrates ESP RainMaker + HomeKit integration using the [esp-homekit-sdk](https://github.com/espressif/esp-homekit-sdk). ## Setup diff --git a/examples/homekit_switch/main/app_homekit.c b/examples/homekit_switch/main/app_homekit.c index 1df1b8d..1c91f3d 100644 --- a/examples/homekit_switch/main/app_homekit.c +++ b/examples/homekit_switch/main/app_homekit.c @@ -30,7 +30,7 @@ static hap_char_t *on_char; static void app_homekit_show_qr(void) { #ifdef CONFIG_EXAMPLE_USE_HARDCODED_SETUP_CODE -#define QRCODE_BASE_URL "https://api.qrserver.com/v1/create-qr-code/" +#define QRCODE_BASE_URL "https://espressif.github.io/esp-homekit-sdk/qrcode.html" char *setup_payload = esp_hap_get_setup_payload(CONFIG_EXAMPLE_SETUP_CODE, CONFIG_EXAMPLE_SETUP_ID, false, HAP_CID_SWITCH); if (setup_payload) { diff --git a/examples/homekit_switch/sdkconfig.defaults b/examples/homekit_switch/sdkconfig.defaults index 782341f..4618cd7 100644 --- a/examples/homekit_switch/sdkconfig.defaults +++ b/examples/homekit_switch/sdkconfig.defaults @@ -21,3 +21,8 @@ CONFIG_LWIP_MAX_LISTENING_TCP=12 CONFIG_LWIP_UDP_RECVMBOX_SIZE=10 CONFIG_LWIP_AUTOIP=y CONFIG_LWIP_AUTOIP_RATE_LIMIT_INTERVAL=60 + +# For BLE Provisioning using NimBLE stack (ESP32 only) +CONFIG_BT_ENABLED=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BT_NIMBLE_ENABLED=y diff --git a/examples/led_light/main/app_main.c b/examples/led_light/main/app_main.c index 23792bb..267aae8 100644 --- a/examples/led_light/main/app_main.c +++ b/examples/led_light/main/app_main.c @@ -107,7 +107,13 @@ void app_main() }; esp_rmaker_ota_enable(&ota_config, OTA_USING_PARAMS); - /* Enable scheduling */ + /* Enable scheduling + * Please note that you also need to set the timezone for schedules to work correctly. + * Simplest option is to use the CONFIG_ESP_RMAKER_DEF_TIMEZONE config option. + * Else, you can set the timezone using the API call `esp_rmaker_time_set_timezone("Asia/Shanghai");` + * For more information on the various ways of setting timezone, please check + * https://rainmaker.espressif.com/docs/time-service.html. + */ esp_rmaker_schedule_enable(); /* Start the ESP RainMaker Agent */ diff --git a/examples/led_light/sdkconfig.defaults b/examples/led_light/sdkconfig.defaults index b40efc3..bdb4d65 100644 --- a/examples/led_light/sdkconfig.defaults +++ b/examples/led_light/sdkconfig.defaults @@ -11,3 +11,8 @@ CONFIG_PARTITION_TABLE_MD5=y CONFIG_MBEDTLS_DYNAMIC_BUFFER=y CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y + +# For BLE Provisioning using NimBLE stack (ESP32 only) +CONFIG_BT_ENABLED=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BT_NIMBLE_ENABLED=y diff --git a/examples/multi_device/main/app_main.c b/examples/multi_device/main/app_main.c index 5cf0e46..3f139ef 100644 --- a/examples/multi_device/main/app_main.c +++ b/examples/multi_device/main/app_main.c @@ -115,7 +115,13 @@ void app_main() temp_sensor_device = esp_rmaker_temp_sensor_device_create("Temperature Sensor", NULL, app_get_current_temperature()); esp_rmaker_node_add_device(node, temp_sensor_device); - /* Enable scheduling */ + /* Enable scheduling. + * Please note that you also need to set the timezone for schedules to work correctly. + * Simplest option is to use the CONFIG_ESP_RMAKER_DEF_TIMEZONE config option. + * Else, you can set the timezone using the API call `esp_rmaker_time_set_timezone("Asia/Shanghai");` + * For more information on the various ways of setting timezone, please check + * https://rainmaker.espressif.com/docs/time-service.html. + */ esp_rmaker_schedule_enable(); /* Start the ESP RainMaker Agent */ diff --git a/examples/multi_device/sdkconfig.defaults b/examples/multi_device/sdkconfig.defaults index b40efc3..bdb4d65 100644 --- a/examples/multi_device/sdkconfig.defaults +++ b/examples/multi_device/sdkconfig.defaults @@ -11,3 +11,8 @@ CONFIG_PARTITION_TABLE_MD5=y CONFIG_MBEDTLS_DYNAMIC_BUFFER=y CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y + +# For BLE Provisioning using NimBLE stack (ESP32 only) +CONFIG_BT_ENABLED=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BT_NIMBLE_ENABLED=y diff --git a/examples/switch/main/app_main.c b/examples/switch/main/app_main.c index 76500a4..98f314c 100644 --- a/examples/switch/main/app_main.c +++ b/examples/switch/main/app_main.c @@ -160,7 +160,13 @@ void app_main() }; esp_rmaker_ota_enable(&ota_config, OTA_USING_PARAMS); - /* Enable scheduling */ + /* Enable scheduling. + * Please note that you also need to set the timezone for schedules to work correctly. + * Simplest option is to use the CONFIG_ESP_RMAKER_DEF_TIMEZONE config option. + * Else, you can set the timezone using the API call `esp_rmaker_time_set_timezone("Asia/Shanghai");` + * For more information on the various ways of setting timezone, please check + * https://rainmaker.espressif.com/docs/time-service.html. + */ esp_rmaker_schedule_enable(); /* Start the ESP RainMaker Agent */ diff --git a/examples/switch/sdkconfig.defaults b/examples/switch/sdkconfig.defaults index b40efc3..bdb4d65 100644 --- a/examples/switch/sdkconfig.defaults +++ b/examples/switch/sdkconfig.defaults @@ -11,3 +11,8 @@ CONFIG_PARTITION_TABLE_MD5=y CONFIG_MBEDTLS_DYNAMIC_BUFFER=y CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y + +# For BLE Provisioning using NimBLE stack (ESP32 only) +CONFIG_BT_ENABLED=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BT_NIMBLE_ENABLED=y diff --git a/examples/temperature_sensor/sdkconfig.defaults b/examples/temperature_sensor/sdkconfig.defaults index b40efc3..bdb4d65 100644 --- a/examples/temperature_sensor/sdkconfig.defaults +++ b/examples/temperature_sensor/sdkconfig.defaults @@ -11,3 +11,8 @@ CONFIG_PARTITION_TABLE_MD5=y CONFIG_MBEDTLS_DYNAMIC_BUFFER=y CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y + +# For BLE Provisioning using NimBLE stack (ESP32 only) +CONFIG_BT_ENABLED=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BT_NIMBLE_ENABLED=y