Skip to content

Commit 3d5c1b8

Browse files
committed
fix(prov): Add sketch and CMake fixes
1 parent 1849215 commit 3d5c1b8

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

CMakeLists.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ endforeach()
293293
set(includedirs variants/${CONFIG_ARDUINO_VARIANT}/ cores/esp32/ ${ARDUINO_LIBRARIES_INCLUDEDIRS})
294294
set(srcs ${CORE_SRCS} ${ARDUINO_LIBRARIES_SRCS})
295295
set(priv_includes cores/esp32/libb64)
296-
set(requires spi_flash esp_partition mbedtls wpa_supplicant esp_adc esp_eth http_parser espressif__network_provisioning)
296+
set(requires spi_flash esp_partition mbedtls wpa_supplicant esp_adc esp_eth http_parser)
297297
set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support bt esp_hid usb esp_psram ${ARDUINO_LIBRARIES_REQUIRES})
298298

299299
if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_OpenThread)
@@ -304,6 +304,12 @@ if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_OpenThre
304304
endif()
305305
endif()
306306

307+
if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_RainMaker OR CONFIG_ARDUINO_SELECTIVE_WiFiProv)
308+
if(NOT IDF_TARGET STREQUAL "esp32c2")
309+
list(APPEND requires espressif__network_provisioning)
310+
endif()
311+
endif()
312+
307313
idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires})
308314

309315
if(NOT CONFIG_FREERTOS_HZ EQUAL 1000 AND NOT "$ENV{ARDUINO_SKIP_TICK_CHECK}")

libraries/RainMaker/examples/RMakerCustom/RMakerCustom.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ void sysProvEvent(arduino_event_t *sys_event) {
3636
printQR(service_name, pop, "ble");
3737
#endif
3838
break;
39-
case ARDUINO_EVENT_PROV_INIT: wifi_prov_mgr_disable_auto_stop(10000); break;
40-
case ARDUINO_EVENT_PROV_CRED_SUCCESS: wifi_prov_mgr_stop_provisioning(); break;
39+
case ARDUINO_EVENT_PROV_INIT: network_prov_mgr_disable_auto_stop(10000); break;
40+
case ARDUINO_EVENT_PROV_CRED_SUCCESS: network_prov_mgr_stop_provisioning(); break;
4141
default: ;
4242
}
4343
}

libraries/RainMaker/examples/RMakerCustomAirCooler/RMakerCustomAirCooler.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ void sysProvEvent(arduino_event_t *sys_event) {
5252
printQR(service_name, pop, "ble");
5353
#endif
5454
break;
55-
case ARDUINO_EVENT_PROV_INIT: wifi_prov_mgr_disable_auto_stop(10000); break;
56-
case ARDUINO_EVENT_PROV_CRED_SUCCESS: wifi_prov_mgr_stop_provisioning(); break;
55+
case ARDUINO_EVENT_PROV_INIT: network_prov_mgr_disable_auto_stop(10000); break;
56+
case ARDUINO_EVENT_PROV_CRED_SUCCESS: network_prov_mgr_stop_provisioning(); break;
5757
default: ;
5858
}
5959
}

libraries/RainMaker/examples/RMakerSonoffDualR3/RMakerSonoffDualR3.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ void sysProvEvent(arduino_event_t *sys_event) {
5050
Serial.printf("\nConnected to Wi-Fi!\n");
5151
digitalWrite(gpio_led, true);
5252
break;
53-
case ARDUINO_EVENT_PROV_INIT: wifi_prov_mgr_disable_auto_stop(10000); break;
54-
case ARDUINO_EVENT_PROV_CRED_SUCCESS: wifi_prov_mgr_stop_provisioning(); break;
53+
case ARDUINO_EVENT_PROV_INIT: network_prov_mgr_disable_auto_stop(10000); break;
54+
case ARDUINO_EVENT_PROV_CRED_SUCCESS: network_prov_mgr_stop_provisioning(); break;
5555
default: ;
5656
}
5757
}

libraries/RainMaker/examples/RMakerSwitch/RMakerSwitch.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ void sysProvEvent(arduino_event_t *sys_event) {
3737
printQR(service_name, pop, "ble");
3838
#endif
3939
break;
40-
case ARDUINO_EVENT_PROV_INIT: wifi_prov_mgr_disable_auto_stop(10000); break;
41-
case ARDUINO_EVENT_PROV_CRED_SUCCESS: wifi_prov_mgr_stop_provisioning(); break;
40+
case ARDUINO_EVENT_PROV_INIT: network_prov_mgr_disable_auto_stop(10000); break;
41+
case ARDUINO_EVENT_PROV_CRED_SUCCESS: network_prov_mgr_stop_provisioning(); break;
4242
default: ;
4343
}
4444
}

libraries/WiFiProv/examples/WiFiProv/WiFiProv.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void SysProvEvent(arduino_event_t *sys_event) {
3838
case ARDUINO_EVENT_PROV_CRED_FAIL:
3939
{
4040
Serial.println("\nProvisioning failed!\nPlease reset to factory and retry provisioning\n");
41-
if (sys_event->event_info.prov_fail_reason == NETWORK_PROV_STA_AUTH_ERROR) {
41+
if (sys_event->event_info.prov_fail_reason == NETWORK_PROV_WIFI_STA_AUTH_ERROR) {
4242
Serial.println("\nWi-Fi AP password incorrect");
4343
} else {
4444
Serial.println("\nWi-Fi AP not found....Add API \" nvs_flash_erase() \" before beginProvision()");

0 commit comments

Comments
 (0)