Skip to content

Commit b77f44a

Browse files
committed
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.
1 parent 1ddf30c commit b77f44a

11 files changed

+1370
-253
lines changed

components/esp_rainmaker/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ set(core_srcs "src/core/esp_rmaker_core.c"
1212
"src/core/esp_rmaker_utils.c"
1313
"src/core/esp_rmaker_user_mapping.c")
1414

15+
16+
if(CONFIG_ESP_RMAKER_ASSISTED_CLAIM)
17+
list(APPEND core_srcs
18+
"src/core/esp_rmaker_claim.c"
19+
"src/core/esp_rmaker_claim.pb-c.c")
20+
endif()
1521
if(CONFIG_ESP_RMAKER_SELF_CLAIM)
1622
list(APPEND core_srcs
1723
"src/core/esp_rmaker_claim.c")

components/esp_rainmaker/Kconfig.projbuild

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,19 @@ menu "ESP RainMaker Config"
1515
help
1616
ESP RainMaker Claiming Service Base URL.
1717

18+
config ESP_RMAKER_ASSISTED_CLAIM
19+
bool "Use Assisted Claiming"
20+
depends on IDF_TARGET_ESP32 && BT_ENABLED
21+
select MBEDTLS_HARDWARE_MPI
22+
default y
23+
help
24+
Use Assisted Claiming i.e. get the MQTT credentials
25+
from the claiming service via assistance from clients,
26+
like the phone apps.
27+
1828
config ESP_RMAKER_MQTT_HOST
1929
string "ESP RainMaker MQTT Host"
20-
depends on ESP_RMAKER_SELF_CLAIM
30+
depends on ESP_RMAKER_SELF_CLAIM || ESP_RMAKER_ASSISTED_CLAIM
2131
default "a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
2232
help
2333
ESP RainMaker MQTT Host name.

components/esp_rainmaker/component.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ COMPONENT_SRCDIRS := src/core src/mqtt src/ota src/standard_types src/console
22
COMPONENT_ADD_INCLUDEDIRS := include
33
COMPONENT_PRIV_INCLUDEDIRS := src/core src/ota src/console
44

5+
ifndef CONFIG_ESP_RMAKER_ASSISTED_CLAIM
6+
COMPONENT_OBJEXCLUDE += src/core/esp_rmaker_claim.pb-c.o
57
ifndef CONFIG_ESP_RMAKER_SELF_CLAIM
68
COMPONENT_OBJEXCLUDE += src/core/esp_rmaker_claim.o
79
endif
10+
endif
811

912
COMPONENT_EMBED_TXTFILES := server_certs/mqtt_server.crt server_certs/claim_service_server.crt server_certs/ota_server.crt

0 commit comments

Comments
 (0)