Skip to content

Commit

Permalink
Fixes Rainmaker to be a Managed Component (#8842)
Browse files Browse the repository at this point in the history
* Uses IDF Managed Components

This changes is targeted to be used within Arduino Lib Builder and with projects that use Arduino as IDF Component.

* Fixes RainMaker QR code

Fixes RainMaker in order to use it as Managed Component and with the latest RainMaker release.

* Removes Camera Component

* SR Component only needed for the S3
  • Loading branch information
SuGlider authored Nov 9, 2023
1 parent e382b6a commit 1e2ee37
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
12 changes: 0 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -254,21 +254,9 @@ function(maybe_add_component component_name)
endif()
endfunction()

maybe_add_component(esp-dsp)

if(CONFIG_ESP_INSIGHTS_ENABLED)
maybe_add_component(esp_insights)
endif()
if(CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK)
maybe_add_component(esp_rainmaker)
maybe_add_component(qrcode)
endif()
if(IDF_TARGET MATCHES "esp32s2|esp32s3" AND CONFIG_TINYUSB_ENABLED)
maybe_add_component(arduino_tinyusb)
endif()
if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_ArduinoOTA)
maybe_add_component(esp_https_ota)
endif()
if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_LITTLEFS)
maybe_add_component(esp_littlefs)
endif()
11 changes: 11 additions & 0 deletions idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,14 @@ dependencies:
idf: ">=5.1"
mdns: "^1.1.0"
chmorgan/esp-libhelix-mp3: "1.0.3"
esp-dsp: "^1.3.4"
espressif/esp_rainmaker: "^1.0.0"
espressif/rmaker_common: "^1.4.3"
espressif/esp_insights: "^1.0.1"
espressif/qrcode: "^0.1.0~1"
joltwallet/littlefs: "^1.10.2"
espressif/esp-sr:
version: "^1.4.2"
rules:
- if: "target in [esp32s3]"

6 changes: 4 additions & 2 deletions libraries/RainMaker/src/RMakerQR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ void printQR(const char *name, const char *pop, const char *transport)
log_w("Cannot generate QR code payload. Data missing.");
return;
}
char payload[150];
char payload[150] = {0};
snprintf(payload, sizeof(payload), "{\"ver\":\"%s\",\"name\":\"%s\"" \
",\"pop\":\"%s\",\"transport\":\"%s\"}",
PROV_QR_VERSION, name, pop, transport);
if(Serial){
Serial.printf("Scan this QR code from the ESP RainMaker phone app.\n");
}
qrcode_display(payload);
//qrcode_display(payload); // deprecated!
esp_qrcode_config_t cfg = ESP_QRCODE_CONFIG_DEFAULT();
esp_qrcode_generate(&cfg, payload);
if(Serial){
Serial.printf("If QR code is not visible, copy paste the below URL in a browser.\n%s?data=%s\n", QRCODE_BASE_URL, payload);
}
Expand Down

1 comment on commit 1e2ee37

@hcglhcgl
Copy link

@hcglhcgl hcglhcgl commented on 1e2ee37 Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit broke building for me in a PIO environment with framework = esp-idf,arduino. I get the following error:

*** [.pio\build\esp32h2.pio\build\esp32h2\https_server.crt.S.o] Source .pio\build\esp32h2\https_server.crt.S' not found, needed by target .pio\build\esp32h2.pio\build\esp32h2\https_server.crt.S.o'.

Please sign in to comment.