mirror of
https://github.com/EyeTrackVR/OpenIris.git
synced 2025-09-26 23:29:14 +08:00
Merge branch 'EyeTrackVR:master' into master
This commit is contained in:
commit
44f7d6667c
28
CHANGELOG.md
28
CHANGELOG.md
@ -3,6 +3,34 @@
|
||||
[](https://semver.org)
|
||||
> All notable changes to this project will be documented in this file
|
||||
|
||||
## [2.2.11](https://github.com/EyeTrackVR/OpenIris/compare/v2.2.10...v2.2.11) (2023-11-18)
|
||||
|
||||
|
||||
### 🔁 Continuous Integration
|
||||
|
||||
* **ci-fix:** esp32 chipset capitalization issue ([a0835a6](https://github.com/EyeTrackVR/OpenIris/commit/a0835a6403cc2a1acb07e1170ddd1eaaee8dece3))
|
||||
|
||||
## [2.2.10](https://github.com/EyeTrackVR/OpenIris/compare/v2.2.9...v2.2.10) (2023-11-18)
|
||||
|
||||
|
||||
### 🔁 Continuous Integration
|
||||
|
||||
* **ci-fix:** esp32 chipset type hyphen issue ([660ca84](https://github.com/EyeTrackVR/OpenIris/commit/660ca84d8ebfbf16a970c695e621ff64b23c467f))
|
||||
|
||||
## [2.2.9](https://github.com/EyeTrackVR/OpenIris/compare/v2.2.8...v2.2.9) (2023-11-17)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
* minor bugs related to the Wifi logging ([dca378c](https://github.com/EyeTrackVR/OpenIris/commit/dca378c0488bed6af7da80c7da94d2ba998e076b))
|
||||
|
||||
## [2.2.8](https://github.com/EyeTrackVR/OpenIris/compare/v2.2.7...v2.2.8) (2023-11-17)
|
||||
|
||||
|
||||
### 🧑💻 Code Refactoring
|
||||
|
||||
* comment out progress indicator during wifi setup ([1bbb61b](https://github.com/EyeTrackVR/OpenIris/commit/1bbb61beeeb20a730001737bd670b6c0873130d8))
|
||||
|
||||
## [2.2.7](https://github.com/EyeTrackVR/OpenIris/compare/v2.2.6...v2.2.7) (2023-10-27)
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
platform = https://github.com/platformio/platform-espressif32.git
|
||||
framework = arduino
|
||||
monitor_speed = 115200
|
||||
custom_firmware_version = 2.2.7
|
||||
custom_firmware_version = 2.2.11
|
||||
monitor_rts = 0
|
||||
monitor_dtr = 0
|
||||
monitor_filters =
|
||||
@ -19,7 +19,8 @@ lib_ldf_mode = deep+
|
||||
;115200 is used for compatability - if you are on windows and want the code to flash faster use 921600
|
||||
upload_speed = 921600
|
||||
lib_deps =
|
||||
https://github.com/espressif/esp32-camera
|
||||
# https://github.com/espressif/esp32-camera
|
||||
esp32-camera
|
||||
https://github.com/me-no-dev/ESPAsyncWebServer.git
|
||||
https://github.com/me-no-dev/AsyncTCP.git
|
||||
extra_scripts =
|
||||
|
@ -20,7 +20,7 @@
|
||||
"include": "/lib/src"
|
||||
},
|
||||
"dependencies": {},
|
||||
"version": "2.2.7",
|
||||
"version": "2.2.11",
|
||||
"frameworks": "arduino",
|
||||
"platforms": "espressif32"
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ void ProjectConfig::wifiConfigSave() {
|
||||
std::string ssid = "ssid";
|
||||
std::string password = "pass";
|
||||
std::string channel = "channel";
|
||||
std::string power = "power";
|
||||
std::string power = "txpower";
|
||||
for (int i = 0; i < this->config.networks.size(); i++) {
|
||||
char buffer[2];
|
||||
std::string iter_str = Helpers::itoa(i, buffer, 10);
|
||||
@ -122,7 +122,7 @@ void ProjectConfig::mdnsConfigSave() {
|
||||
|
||||
void ProjectConfig::wifiTxPowerConfigSave() {
|
||||
/* Device Config */
|
||||
putInt("power", this->config.txpower.power);
|
||||
putInt("txpower", this->config.txpower.power);
|
||||
}
|
||||
|
||||
void ProjectConfig::cameraConfigSave() {
|
||||
@ -159,14 +159,16 @@ void ProjectConfig::load() {
|
||||
this->config.mdns.service = getString("service").c_str();
|
||||
|
||||
/* Wifi TX Power Config */
|
||||
this->config.txpower.power = getUInt("power", 52);
|
||||
// 11dBm is the default value
|
||||
this->config.txpower.power = getUInt("txpower", 52);
|
||||
|
||||
/* WiFi Config */
|
||||
int networkCount = getInt("networkCount", 0);
|
||||
std::string name = "name";
|
||||
std::string ssid = "ssid";
|
||||
std::string password = "pass";
|
||||
std::string channel = "channel";
|
||||
std::string power = "power";
|
||||
std::string power = "txpower";
|
||||
for (int i = 0; i < networkCount; i++) {
|
||||
char buffer[2];
|
||||
std::string iter_str = Helpers::itoa(i, buffer, 10);
|
||||
@ -280,7 +282,7 @@ void ProjectConfig::setWifiConfig(const std::string& networkName,
|
||||
|
||||
if (shouldNotify) {
|
||||
wifiStateManager.setState(WiFiState_e::WiFiState_Disconnected);
|
||||
//WiFi.disconnect();
|
||||
// WiFi.disconnect();
|
||||
this->wifiConfigSave();
|
||||
this->notifyAll(ConfigState_e::networksConfigUpdated);
|
||||
}
|
||||
@ -309,7 +311,7 @@ void ProjectConfig::setWifiConfig(const std::string& networkName,
|
||||
|
||||
if (shouldNotify) {
|
||||
wifiStateManager.setState(WiFiState_e::WiFiState_None);
|
||||
//WiFi.disconnect();
|
||||
// WiFi.disconnect();
|
||||
this->wifiConfigSave();
|
||||
this->notifyAll(ConfigState_e::networksConfigUpdated);
|
||||
}
|
||||
@ -342,7 +344,6 @@ void ProjectConfig::deleteWifiConfig(const std::string& networkName,
|
||||
|
||||
void ProjectConfig::setWiFiTxPower(uint8_t power, bool shouldNotify) {
|
||||
this->config.txpower.power = power;
|
||||
|
||||
log_d("Updating wifi tx power");
|
||||
if (shouldNotify)
|
||||
this->notifyAll(ConfigState_e::wifiTxPowerUpdated);
|
||||
|
@ -100,7 +100,7 @@ void BaseAPI::setWiFi(AsyncWebServerRequest* request) {
|
||||
// note: We're passing empty params by design, this is done to reset
|
||||
// specific fields
|
||||
projectConfig.setWifiConfig(networkName, ssid, password, channel, power,
|
||||
adhoc, true);
|
||||
adhoc, true);
|
||||
|
||||
/* if (WiFiStateManager->getCurrentState() ==
|
||||
WiFiState_e::WiFiState_ADHOC)
|
||||
@ -118,8 +118,7 @@ void BaseAPI::setWiFi(AsyncWebServerRequest* request) {
|
||||
break;
|
||||
}
|
||||
case DELETE: {
|
||||
projectConfig.deleteWifiConfig(request->arg("networkName").c_str(),
|
||||
true);
|
||||
projectConfig.deleteWifiConfig(request->arg("networkName").c_str(), true);
|
||||
request->send(200, MIMETYPE_JSON,
|
||||
"{\"msg\":\"Done. Wifi Creds have been deleted.\"}");
|
||||
break;
|
||||
@ -210,23 +209,7 @@ void BaseAPI::setDeviceConfig(AsyncWebServerRequest* request) {
|
||||
|
||||
void BaseAPI::setWiFiTXPower(AsyncWebServerRequest* request) {
|
||||
switch (_networkMethodsMap_enum[request->method()]) {
|
||||
case GET: {
|
||||
int params = request->params();
|
||||
|
||||
uint8_t txPower = 0;
|
||||
|
||||
for (int i = 0; i < params; i++) {
|
||||
AsyncWebParameter* param = request->getParam(i);
|
||||
if (param->name() == "txPower") {
|
||||
txPower = atoi(param->value().c_str());
|
||||
}
|
||||
}
|
||||
projectConfig.setWiFiTxPower(txPower, true);
|
||||
projectConfig.wifiTxPowerConfigSave();
|
||||
request->send(200, MIMETYPE_JSON,
|
||||
"{\"msg\":\"Done. TX Power has been set.\"}");
|
||||
break;
|
||||
}
|
||||
case GET:
|
||||
case POST: {
|
||||
int params = request->params();
|
||||
|
||||
@ -234,7 +217,7 @@ void BaseAPI::setWiFiTXPower(AsyncWebServerRequest* request) {
|
||||
|
||||
for (int i = 0; i < params; i++) {
|
||||
AsyncWebParameter* param = request->getParam(i);
|
||||
if (param->name() == "txPower") {
|
||||
if (param->name() == "txpower" || param->name() == "txPower") {
|
||||
txPower = atoi(param->value().c_str());
|
||||
}
|
||||
}
|
||||
@ -308,8 +291,8 @@ void BaseAPI::setCamera(AsyncWebServerRequest* request) {
|
||||
// note: We're passing empty params by design, this is done to reset
|
||||
// specific fields
|
||||
projectConfig.setCameraConfig(temp_camera_vflip, temp_camera_framesize,
|
||||
temp_camera_hflip, temp_camera_quality,
|
||||
temp_camera_brightness, true);
|
||||
temp_camera_hflip, temp_camera_quality,
|
||||
temp_camera_brightness, true);
|
||||
|
||||
request->send(200, MIMETYPE_JSON,
|
||||
"{\"msg\":\"Done. Camera Settings have been set.\"}");
|
||||
@ -330,7 +313,7 @@ void BaseAPI::restartCamera(AsyncWebServerRequest* request) {
|
||||
request->send(200, MIMETYPE_JSON,
|
||||
"{\"msg\":\"Done. Camera had been restarted.\"}");
|
||||
}
|
||||
#endif // SIM_ENABLED
|
||||
#endif // SIM_ENABLED
|
||||
|
||||
//*********************************************************************************************
|
||||
//! General Command Functions
|
||||
|
@ -30,8 +30,6 @@ void WiFiHandler::begin() {
|
||||
"power \n\r");
|
||||
auto txpower = configManager.getWiFiTxPowerConfig();
|
||||
log_d("Setting Wifi Power to: %d", txpower.power);
|
||||
// log_d("Enabling STA mode \n\r");
|
||||
// WiFi.mode(WIFI_STA);
|
||||
log_d("Setting WiFi sleep mode to NONE \n\r");
|
||||
WiFi.setSleep(false);
|
||||
|
||||
@ -56,7 +54,7 @@ void WiFiHandler::begin() {
|
||||
for (auto& network : networks) {
|
||||
log_i("Trying to connect to network: %s \n\r", network.ssid.c_str());
|
||||
if (this->iniSTA(network.ssid, network.password, network.channel,
|
||||
(wifi_power_t)txpower.power)) {
|
||||
(wifi_power_t)network.power)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -130,7 +128,7 @@ bool WiFiHandler::iniSTA(const std::string& ssid,
|
||||
wifi_power_t power) {
|
||||
unsigned long currentMillis = millis();
|
||||
unsigned long startingMillis = currentMillis;
|
||||
int connectionTimeout = 30000; // 30 seconds
|
||||
int connectionTimeout = 45000; // 30 seconds
|
||||
int progress = 0;
|
||||
|
||||
wifiStateManager.setState(WiFiState_e::WiFiState_Connecting);
|
||||
@ -142,12 +140,15 @@ bool WiFiHandler::iniSTA(const std::string& ssid,
|
||||
INADDR_NONE); // need to call before setting hostname
|
||||
WiFi.setHostname(mdnsConfig.hostname.c_str());
|
||||
WiFi.begin(ssid.c_str(), password.c_str(), channel);
|
||||
WiFi.setTxPower(power);
|
||||
log_d("Waiting for WiFi to connect... \n\r");
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
progress++;
|
||||
currentMillis = millis();
|
||||
Helpers::update_progress_bar(progress, 100);
|
||||
delay(301);
|
||||
log_i(".");
|
||||
log_d("Progress: %d \n\r", progress);
|
||||
/* Helpers::update_progress_bar(progress, 100);
|
||||
delay(301); */
|
||||
if ((currentMillis - startingMillis) >= connectionTimeout) {
|
||||
wifiStateManager.setState(WiFiState_e::WiFiState_Error);
|
||||
log_e("Connection to: %s TIMEOUT \n\r", ssid.c_str());
|
||||
@ -157,7 +158,6 @@ bool WiFiHandler::iniSTA(const std::string& ssid,
|
||||
wifiStateManager.setState(WiFiState_e::WiFiState_Connected);
|
||||
log_i("Successfully connected to %s \n\r", ssid.c_str());
|
||||
log_i("Setting TX power to: %d \n\r", (uint8_t)power);
|
||||
WiFi.setTxPower(power);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -66,18 +66,23 @@ def createZip(source, target, env):
|
||||
# detect the chip type
|
||||
chip_type = env["BOARD_MCU"]
|
||||
|
||||
flash_size = '4'
|
||||
|
||||
# TODO: detect the flash size from the board manifest
|
||||
if chip_type == "esp32s3":
|
||||
if chip_type == "esp32":
|
||||
flash_size = '4'
|
||||
elif chip_type == "esp32s2":
|
||||
flash_size = '2'
|
||||
elif chip_type == "esp32c3":
|
||||
flash_size = '2'
|
||||
elif chip_type == "esp32s3":
|
||||
flash_size = '8'
|
||||
|
||||
|
||||
if chip_type == "esp32c3" or chip_type == "esp32s3" or chip_type == "esp32s2":
|
||||
chip_type = chip_type.replace("esp32", "esp32-")
|
||||
|
||||
# capitalize the chip type
|
||||
chip_type = chip_type.upper()
|
||||
|
||||
# add hyphen between ESP32 and the suffix (WROOM, WROVER, etc)
|
||||
chip_type = chip_type.replace("ESP32", "ESP32-")
|
||||
|
||||
sys.stdout.write(BLUE)
|
||||
print("Flash Mode: %s" % flash_mode)
|
||||
print("Chip Type: %s" % chip_type)
|
||||
print("Flash Frequency: %s" % flash_freq)
|
||||
@ -93,6 +98,8 @@ def createZip(source, target, env):
|
||||
|
||||
print("Executing: %s" % execute_cmd)
|
||||
|
||||
sys.stdout.write(RESET)
|
||||
|
||||
env.Execute(
|
||||
execute_cmd.format(
|
||||
chip=chip_type, flash_mode=flash_mode, flash_freq=flash_freq, flash_size=flash_size)
|
||||
|
Loading…
Reference in New Issue
Block a user