mirror of
https://github.com/SlimeVR/SlimeVR-Tracker-ESP.git
synced 2026-04-06 02:01:57 +02:00
Fix setting WiFi credentials in platformio.ini
This commit is contained in:
@@ -14,10 +14,9 @@ lib_deps=
|
||||
monitor_speed = 115200
|
||||
framework = arduino
|
||||
;If you want to set hardcoded WiFi SSID and password, uncomment and edit the lines below
|
||||
; '" - quotes are necessary!
|
||||
;build_flags =
|
||||
; -DWIFI_CREDS_SSID='"SSID"'
|
||||
; -DWIFI_CREDS_PASSWD='"PASSWORD"'
|
||||
; -DWIFI_CREDS_SSID=SSID
|
||||
; -DWIFI_CREDS_PASSWD=PASSWORD
|
||||
|
||||
; If you want to enable OTA Updates, uncomment and set OTA password here and in credentials.h
|
||||
; You can set upload_port to device's ip after it's set up for the first time
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
#define STRINGIFY(s) STRINGIFY1(s)
|
||||
#define STRINGIFY1(s) #s
|
||||
|
||||
// List of constants used in other places
|
||||
#define IMU_MPU9250 1
|
||||
#define IMU_MPU6500 2
|
||||
|
||||
@@ -52,12 +52,12 @@ void setUpWiFi() {
|
||||
Serial.println("[NOTICE] Setting up WiFi");
|
||||
WiFi.mode(WIFI_STA);
|
||||
WiFi.hostname("SlimeVR FBT Tracker");
|
||||
#if defined(WIFI_CREDS_SSID) && defined(WIFI_CREDS_PASSWD)
|
||||
WiFi.begin(WIFI_CREDS_SSID, WIFI_CREDS_PASSWD);
|
||||
#else
|
||||
#ifdef ESP32
|
||||
WiFi.begin();
|
||||
#endif
|
||||
#if defined(WIFI_CREDS_SSID) && defined(WIFI_CREDS_PASSWD)
|
||||
WiFi.begin(STRINGIFY(WIFI_CREDS_SSID), STRINGIFY(WIFI_CREDS_PASSWD));
|
||||
#else
|
||||
WiFi.begin(WiFi.SSID().c_str(), WiFi.psk().c_str());
|
||||
#endif
|
||||
wifiConnectionTimeout = millis();
|
||||
|
||||
Reference in New Issue
Block a user