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