Hallo,
welche Einstellungen muss ich vornehmen, damit bei einem ESP32 die
Variablen aus der Kconfig.projbuild genommen werden?
im Code:
1 | #define WIFI_CONFIG_SSID CONFIG_ESP_WIFI_SSID
|
2 | #define WIFI_CONFIG_PASS CONFIG_ESP_WIFI_PASSWORD
|
3 | #define WIFI_CONFIG_MAX_RETRY CONFIG_ESP_MAXIMUM_RETRY
|
config: (anstelle von 123456789 steht dort mein richtiges passwort)
1 | menu "Example Configuration"
|
2 |
|
3 | config ESP_WIFI_SSID
|
4 | string "FRITZ!Box Fon WLAN 7360"
|
5 | default "myssid"
|
6 | help
|
7 | SSID (network name) for the example to connect to.
|
8 |
|
9 | config ESP_WIFI_PASSWORD
|
10 | string "123456789"
|
11 | default "mypassword"
|
12 | help
|
13 | WiFi password (WPA or WPA2) for the example to use.
|
14 |
|
15 | config ESP_MAXIMUM_RETRY
|
16 | int "Maximum retry"
|
17 | default 5
|
18 | help
|
19 | Set the Maximum retry to avoid station reconnecting to the AP unlimited when the AP is really inexistent.
|
20 | endmenu
|
Die Konfigdatei habe ich aus dem Beispeil "station" genommen und
angepasst.
Es wir aber immer nur der default wert genommen. Also es wird
anscheinend schon die Datei benutzt, aber nicht die richtigen werte
im code:
1 | else if(bits & WIFI_FAIL_BIT)
|
2 | {
|
3 | ESP_LOGI(TAG, "Failed to connect to SSID:%s, password:%s", WIFI_CONFIG_SSID, WIFI_CONFIG_PASS);
|
4 | }
|
also bei SSID wird "myssid" und password wird "mypassword" ausgegeben.
Gebe ich die SSID und Passwort im code direkt an, verbindet sich der ESP
mit meinem Router