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!!
[wifi]
ssid = ""
password = ""
mdnsname = "openiristracker"
ssid = "ARRIS-4039-5G"
password = "145080724114"
mdnsname = "babble"
channel = 1
ap_ssid = "EyeTrackVR"
ap_password = "12345678"

View File

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

View File

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