added alternative to set wifi params via env variables
This commit is contained in:
@@ -264,7 +264,7 @@ static void wifi_event_cb(WiFiEvent_t event)
|
||||
void setupWiFi()
|
||||
{
|
||||
WiFi.onEvent(wifi_event_cb);
|
||||
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
|
||||
WiFi.begin(WIFI_SSID, WIFI_PASS);
|
||||
|
||||
configTzTime(DEFAULT_TIMEZONE, NTP_SERVER1, NTP_SERVER2);
|
||||
// set notification call-back function
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#define WIFI_SSID "You WIFI SSID"
|
||||
#endif
|
||||
|
||||
#ifndef WIFI_PASSWORD
|
||||
#define WIFI_PASSWORD "You WIFI PASSWORD"
|
||||
#ifndef WIFI_PASS
|
||||
#define WIFI_PASS "You WIFI PASSWORD"
|
||||
#endif
|
||||
|
||||
#define NTP_SERVER1 "pool.ntp.org"
|
||||
|
||||
+10
-5
@@ -7,6 +7,11 @@
|
||||
;
|
||||
; Please visit documentation for the other options and examples
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[wifi]
|
||||
ssid = ${sysenv.PIO_WIFI_SSID}
|
||||
password = ${sysenv.PIO_WIFI_PASSWORD}
|
||||
|
||||
[platformio]
|
||||
; default_envs = T-Keyboard
|
||||
; src_dir = examples/Keyboard_ESP32C3
|
||||
@@ -44,14 +49,14 @@ framework = arduino
|
||||
upload_speed = 921600
|
||||
monitor_speed = 115200
|
||||
build_flags =
|
||||
-DBOARD_HAS_PSRAM
|
||||
|
||||
-DBOARD_HAS_PSRAM=1
|
||||
-DCORE_DEBUG_LEVEL=5
|
||||
; Enable UARDUINO_ USB_ CDC_ ON_ BOOT will start printing and wait for terminal access during startup
|
||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||
|
||||
'-DWIFI_SSID="${wifi.ssid}"'
|
||||
'-DWIFI_PASS="${wifi.password}"'
|
||||
; Enable UARDUINO_USB_CDC_ON_BOOT will turn off printing and will not block when using the battery
|
||||
; -UARDUINO_USB_CDC_ON_BOOT
|
||||
|
||||
-DDISABLE_ALL_LIBRARY_WARNINGS
|
||||
; -DDISABLE_ALL_LIBRARY_WARNINGS
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user