This commit is contained in:
Andres Tejeda 2025-02-27 09:44:44 -08:00
parent 2b259ee727
commit d68a181673
5 changed files with 16 additions and 8 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

BIN
ESP/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -3,9 +3,9 @@
## !!Important note: Apostrophes inside of quotes ex: "a't" are NOT ALLOWED. This will fail to build!! ## !!Important note: Apostrophes inside of quotes ex: "a't" are NOT ALLOWED. This will fail to build!!
[wifi] [wifi]
ssid = "" ssid = "ARRIS-4039-5G"
password = "" password = "145080724114"
mdnsname = "openiristracker" mdnsname = "babble"
channel = 1 channel = 1
ap_ssid = "EyeTrackVR" ap_ssid = "EyeTrackVR"
ap_password = "12345678" ap_password = "12345678"

View File

@ -38,6 +38,7 @@ struct DeviceStates {
WiFiState_Connecting, WiFiState_Connecting,
WiFiState_Connected, WiFiState_Connected,
WiFiState_ADHOC, WiFiState_ADHOC,
WiFiState_USB,
WiFiState_Error WiFiState_Error
}; };

View File

@ -80,6 +80,10 @@ void etvr_eye_tracker_web_init() {
} }
#endif // ETVR_EYE_TRACKER_WEB_API #endif // ETVR_EYE_TRACKER_WEB_API
bool isUSBConnected() {
return Serial.availableForWrite() > 0;
}
void setup() { void setup() {
setCpuFrequencyMhz(240); setCpuFrequencyMhz(240);
Serial.begin(115200); Serial.begin(115200);
@ -104,11 +108,14 @@ void setup() {
serialManager.init(); serialManager.init();
#ifndef ETVR_EYE_TRACKER_USB_API // Check if USB is connected
etvr_eye_tracker_web_init(); if (isUSBConnected()) {
#else // ETVR_EYE_TRACKER_WEB_API log_i("USB connection detected, enabling USB mode");
WiFi.disconnect(true); WiFi.disconnect(true);
#endif // ETVR_EYE_TRACKER_WEB_API } else {
log_i("No USB connection detected, trying WiFi mode");
etvr_eye_tracker_web_init();
}
} }
void loop() { void loop() {