Skip to content

Commit

Permalink
feat: Release 2.5.0
Browse files Browse the repository at this point in the history
* Refactor commands and serial manager to support updated commands payload

* set setMinSecurity to WIFI_AUTH_WEP to fix boards not connecting to some networks, cleanup some logs and comments

* feat: Move logging in serial streaming so that we at least attempt to get new frame

* remove unused etvr_eye_tracker_usb

* PoC query manager for better flasher logging

* simplify query implementation

* remove old include

* fix: serial output for esp32cams and other boards not supporting higher frequency baud rate

* fix: serial output for esp32cams and other boards not supporting higher frequency baud rate

* Switch higher frequency to be opt-in

* feat: Add support for ov5640 cameras

* feat: fix usb streaming on wroom boards, add support for babble custom board 

* feat: PoC add support for project babble board

* Add support for bable wireless, adjust flash_mode and memory type to get PSRAM working

* Add DARDUINO_USB_MODE=1 and DARDUINO_USB_CDC_ON_BOOT=1 to Babble and wroom boards to fix USB streaming

discovered and fixed entirely by Rames the Generic

* cleanup PoC
  • Loading branch information
lorow authored Jun 21, 2024
1 parent 3fa84dc commit 81cda52
Show file tree
Hide file tree
Showing 16 changed files with 295 additions and 193 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,37 @@
[![semantic versioning](https://img.shields.io/badge/semantic%20versioning-2.0.0-green.svg)](https://semver.org)
> All notable changes to this project will be documented in this file
## [2.5.0-beta.1](https://github.com/EyeTrackVR/OpenIris/compare/v2.4.0...v2.5.0-beta.1) (2024-06-11)


### 🍕 Features

* Add support for ov5640 cameras ([14d2cb0](https://github.com/EyeTrackVR/OpenIris/commit/14d2cb0858cd65452f2ce1cee9a3a1f68d8f7f51))
* Fix ov5640 support implementation after beta cleanup ([4894c22](https://github.com/EyeTrackVR/OpenIris/commit/4894c2205864d5a7d52e37c81b14ff7dc46517d4))
* fix usb streaming on wroom boards, add support for babble custom board ([049b160](https://github.com/EyeTrackVR/OpenIris/commit/049b16078ec5c07042652f2de3545ea6b69de6a9))
* Move logging in serial streaming so that we at least attempt to get new frame ([53a3d4b](https://github.com/EyeTrackVR/OpenIris/commit/53a3d4bcd603e2fd07546621628e69de88e4139a))
* Refactor commands and serial manager to support updated commands payload ([811a9f8](https://github.com/EyeTrackVR/OpenIris/commit/811a9f898a3f1bdb1e20ffd6f0d6e77a4533f52c))


### 🐛 Bug Fixes

* serial output for esp32cams and other boards not supporting higher frequency baud rate ([01e5e28](https://github.com/EyeTrackVR/OpenIris/commit/01e5e280ad26d2709231fe6aa2a96d1991cbf360))

## [2.5.0-beta.1](https://github.com/EyeTrackVR/OpenIris/compare/v2.4.0...v2.5.0-beta.1) (2024-06-10)


### 🍕 Features

* Add support for ov5640 cameras ([14d2cb0](https://github.com/EyeTrackVR/OpenIris/commit/14d2cb0858cd65452f2ce1cee9a3a1f68d8f7f51))
* fix usb streaming on wroom boards, add support for babble custom board ([049b160](https://github.com/EyeTrackVR/OpenIris/commit/049b16078ec5c07042652f2de3545ea6b69de6a9))
* Move logging in serial streaming so that we at least attempt to get new frame ([53a3d4b](https://github.com/EyeTrackVR/OpenIris/commit/53a3d4bcd603e2fd07546621628e69de88e4139a))
* Refactor commands and serial manager to support updated commands payload ([811a9f8](https://github.com/EyeTrackVR/OpenIris/commit/811a9f898a3f1bdb1e20ffd6f0d6e77a4533f52c))


### 🐛 Bug Fixes

* serial output for esp32cams and other boards not supporting higher frequency baud rate ([01e5e28](https://github.com/EyeTrackVR/OpenIris/commit/01e5e280ad26d2709231fe6aa2a96d1991cbf360))

## [2.4.0](https://github.com/EyeTrackVR/OpenIris/compare/v2.3.0...v2.4.0) (2024-03-11)


Expand Down
45 changes: 45 additions & 0 deletions ESP/ini/boards.ini
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ build_type = debug
build_flags = ${env.build_flags}
-DCORE_DEBUG_LEVEL=4
-DDEBUG_MODE=1
-DSERIAL_MANAGER_USE_HIGHER_FREQUENCY
${pinoutsESPS3WROVER.build_flags}
upload_flags = --no-stub

Expand All @@ -113,6 +114,7 @@ build_type = release
build_flags = ${env.build_flags}
-DDEBUG_MODE=0
-DCORE_DEBUG_LEVEL=1
-DSERIAL_MANAGER_USE_HIGHER_FREQUENCY
${pinoutsESPS3WROVER.build_flags}
upload_flags = --no-stub

Expand All @@ -123,8 +125,10 @@ build_type = debug
build_flags = ${env.build_flags}
-DCORE_DEBUG_LEVEL=4
-DDEBUG_MODE=1
-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1
-DETVR_EYE_TRACKER_USB_API
-DSERIAL_MANAGER_USE_HIGHER_FREQUENCY
${pinoutsESPS3WROVER.build_flags}

[env:wrooms3QIOUSB_release]
Expand All @@ -134,8 +138,10 @@ build_type = release
build_flags = ${env.build_flags}
-DDEBUG_MODE=0
-DCORE_DEBUG_LEVEL=1
-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1
-DETVR_EYE_TRACKER_USB_API
-DSERIAL_MANAGER_USE_HIGHER_FREQUENCY
${pinoutsESPS3WROVER.build_flags}

[env:wrooms3]
Expand All @@ -144,6 +150,7 @@ build_type = debug
build_flags = ${env.build_flags}
-DCORE_DEBUG_LEVEL=4
-DDEBUG_MODE=1
-DSERIAL_MANAGER_USE_HIGHER_FREQUENCY
${pinoutsESPS3WROOM.build_flags}

[env:wrooms3_release]
Expand All @@ -152,6 +159,7 @@ build_type = release
build_flags = ${env.build_flags}
-DDEBUG_MODE=0
-DCORE_DEBUG_LEVEL=1
-DSERIAL_MANAGER_USE_HIGHER_FREQUENCY
${pinoutsESPS3WROOM.build_flags}

[env:wrooms3USB]
Expand All @@ -160,7 +168,10 @@ build_type = debug
build_flags = ${env.build_flags}
-DCORE_DEBUG_LEVEL=4
-DDEBUG_MODE=1
-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1
-DETVR_EYE_TRACKER_USB_API
-DSERIAL_MANAGER_USE_HIGHER_FREQUENCY
${pinoutsESPS3WROOM.build_flags}
upload_flags = --no-stub

Expand All @@ -170,10 +181,40 @@ build_type = release
build_flags = ${env.build_flags}
-DDEBUG_MODE=0
-DCORE_DEBUG_LEVEL=1
-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1
-DETVR_EYE_TRACKER_USB_API
-DSERIAL_MANAGER_USE_HIGHER_FREQUENCY
${pinoutsESPS3WROOM.build_flags}
upload_flags = --no-stub

[env:Babble-wrooms-s3]
board = esp32-s3-devkitc-1
board_build.flash_mode = qio ; qio_qspi
board_build.arduino.memory_type = qio_qspi
build_type = debug
build_flags = ${env.build_flags}
-DCORE_DEBUG_LEVEL=4
-DDEBUG_MODE=1
-DSERIAL_MANAGER_USE_HIGHER_FREQUENCY
${pinoutSWROOMBABBLES3.build_flags}
upload_flags = --no-stub

[env:Babble_USB-wrooms-s3]
board = esp32-s3-devkitc-1
board_build.flash_mode = qio ; qio_qspi
board_build.arduino.memory_type = qio_qspi
build_type = debug
build_flags = ${env.build_flags}
-DCORE_DEBUG_LEVEL=4
-DDEBUG_MODE=1
-DETVR_EYE_TRACKER_USB_API
-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1
-DSERIAL_MANAGER_USE_HIGHER_FREQUENCY
${pinoutSWROOMBABBLES3.build_flags}
upload_flags = --no-stub

[env:xiaosenses3]
board = seeed_xiao_esp32s3
build_type = debug
Expand All @@ -182,6 +223,7 @@ build_flags = ${env.build_flags}
-DDEBUG_MODE=1
#-DARDUINO_USB_MODE=1
#-DARDUINO_USB_CDC_ON_BOOT=1
-DSERIAL_MANAGER_USE_HIGHER_FREQUENCY
${pinoutsESPS3XIAOSENSE.build_flags}

[env:xiaosenses3_USB]
Expand All @@ -191,6 +233,7 @@ build_flags = ${env.build_flags}
-DCORE_DEBUG_LEVEL=4
-DDEBUG_MODE=1
-DETVR_EYE_TRACKER_USB_API
-DSERIAL_MANAGER_USE_HIGHER_FREQUENCY
${pinoutsESPS3XIAOSENSE.build_flags}
upload_flags = --no-stub

Expand All @@ -200,6 +243,7 @@ build_type = release
build_flags = ${env.build_flags}
-DDEBUG_MODE=0
-DCORE_DEBUG_LEVEL=1
-DSERIAL_MANAGER_USE_HIGHER_FREQUENCY
${pinoutsESPS3XIAOSENSE.build_flags}

[env:xiaosenses3_USB_release]
Expand All @@ -209,5 +253,6 @@ build_flags = ${env.build_flags}
-DDEBUG_MODE=0
-DCORE_DEBUG_LEVEL=1
-DETVR_EYE_TRACKER_USB_API
-DSERIAL_MANAGER_USE_HIGHER_FREQUENCY
${pinoutsESPS3XIAOSENSE.build_flags}
upload_flags = --no-stub
2 changes: 1 addition & 1 deletion ESP/ini/dev_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
platform = https://github.com/platformio/platform-espressif32.git
framework = arduino
monitor_speed = 115200
custom_firmware_version = 2.4.0
custom_firmware_version = 2.5.0
monitor_rts = 0
monitor_dtr = 0
monitor_filters =
Expand Down
36 changes: 36 additions & 0 deletions ESP/ini/pinouts.ini
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,42 @@ build_flags =
-DHREF_GPIO_NUM=${pinoutsESPS3WROOM.HREF_GPIO_NUM}
-DPCLK_GPIO_NUM=${pinoutsESPS3WROOM.PCLK_GPIO_NUM}

[pinoutSWROOMBABBLES3]
pwdn_gpio_num = -1
reset_gpio_num = -1
xclk_gpio_num = 4
siod_gpio_num = 14
sioc_gpio_num = 13
y9_gpio_num = 39
y8_gpio_num = 5
y7_gpio_num = 6
y6_gpio_num = 15
y5_gpio_num = 17
y4_gpio_num = 8
y3_gpio_num = 18
y2_gpio_num = 16
vsync_gpio_num = 9
href_gpio_num = 10
pclk_gpio_num = 7
build_flags =
'-DCAMERA_MODULE_NAME="SWROOM_BABBLE_S3"'
-DPWDN_GPIO_NUM=${pinoutSWROOMBABBLES3.PWDN_GPIO_NUM}
-DRESET_GPIO_NUM=${pinoutSWROOMBABBLES3.RESET_GPIO_NUM}
-DXCLK_GPIO_NUM=${pinoutSWROOMBABBLES3.XCLK_GPIO_NUM}
-DSIOD_GPIO_NUM=${pinoutSWROOMBABBLES3.SIOD_GPIO_NUM}
-DSIOC_GPIO_NUM=${pinoutSWROOMBABBLES3.SIOC_GPIO_NUM}
-DY9_GPIO_NUM=${pinoutSWROOMBABBLES3.Y9_GPIO_NUM}
-DY8_GPIO_NUM=${pinoutSWROOMBABBLES3.Y8_GPIO_NUM}
-DY7_GPIO_NUM=${pinoutSWROOMBABBLES3.Y7_GPIO_NUM}
-DY6_GPIO_NUM=${pinoutSWROOMBABBLES3.Y6_GPIO_NUM}
-DY5_GPIO_NUM=${pinoutSWROOMBABBLES3.Y5_GPIO_NUM}
-DY4_GPIO_NUM=${pinoutSWROOMBABBLES3.Y4_GPIO_NUM}
-DY3_GPIO_NUM=${pinoutSWROOMBABBLES3.Y3_GPIO_NUM}
-DY2_GPIO_NUM=${pinoutSWROOMBABBLES3.Y2_GPIO_NUM}
-DVSYNC_GPIO_NUM=${pinoutSWROOMBABBLES3.VSYNC_GPIO_NUM}
-DHREF_GPIO_NUM=${pinoutSWROOMBABBLES3.HREF_GPIO_NUM}
-DPCLK_GPIO_NUM=${pinoutSWROOMBABBLES3.PCLK_GPIO_NUM}

[pinoutsESPS3XIAOSENSE]
pwdn_gpio_num = -1
reset_gpio_num = -1
Expand Down
2 changes: 1 addition & 1 deletion ESP/lib/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"include": "/lib/src"
},
"dependencies": {},
"version": "2.4.0",
"version": "2.5.0",
"frameworks": "arduino",
"platforms": "espressif32"
}
133 changes: 70 additions & 63 deletions ESP/lib/src/data/CommandManager/CommandManager.cpp
Original file line number Diff line number Diff line change
@@ -1,74 +1,81 @@
#include "CommandManager.hpp"

CommandManager::CommandManager(ProjectConfig *deviceConfig) : deviceConfig(deviceConfig) {}
CommandManager::CommandManager(ProjectConfig* deviceConfig)
: deviceConfig(deviceConfig) {}

const CommandType CommandManager::getCommandType(JsonVariant& command) {
if (!command.containsKey("command"))
return CommandType::None;

const CommandType CommandManager::getCommandType(Command &command){
if (!command.data.containsKey("command"))
return CommandType::None;
if (auto search = commandMap.find(command["command"]);
search != commandMap.end())
return search->second;

if (auto search = commandMap.find(command.data["command"]); search != commandMap.end())
return search->second;

return CommandType::None;
return CommandType::None;
}

bool CommandManager::hasDataField(JsonVariant& command) {
return command.containsKey("data");
}

bool CommandManager::hasHasDataField(Command &command) {
return command.data.containsKey("data");
void CommandManager::handleCommands(CommandsPayload commandsPayload) {
if (!commandsPayload.data.containsKey("commands")) {
log_e("Json data sent not supported, lacks commands field");
return;
}

for (JsonVariant commandData :
commandsPayload.data["commands"].as<JsonArray>()) {
this->handleCommand(commandData);
}

this->deviceConfig->save();
}

void CommandManager::handleCommand(Command command) {
auto command_type = this->getCommandType(command);

switch(command_type)
{
case CommandType::SET_WIFI: {
if (!this->hasHasDataField(command))
// malformed command, lacked data field
break;


if(!command.data["data"].containsKey("ssid") || !command.data["data"].containsKey("password"))
break;

std::string customNetworkName = "main";
if (command.data["data"].containsKey("network_name"))
customNetworkName = command.data["data"]["network_name"].as<std::string>();

this->deviceConfig->setWifiConfig(
customNetworkName,
command.data["data"]["ssid"],
command.data["data"]["password"],
0, // channel, should this be zero?
0, // power, should this be zero?
false,
false
);

// we purposefully save here
this->deviceConfig->save();
break;
}
case CommandType::SET_MDNS: {
if (!this->hasHasDataField(command))
break;

if(!command.data["data"].containsKey("hostname") || !strlen(command.data["data"]["hostname"]))
break;

this->deviceConfig->setMDNSConfig(
command.data["data"]["hostname"],
"openiristracker",
false
);

break;
}
case CommandType::PING: {
Serial.println("PONG \n\r");
break;
}
default:
break;
void CommandManager::handleCommand(JsonVariant command) {
auto command_type = this->getCommandType(command);

switch (command_type) {
case CommandType::SET_WIFI: {
if (!this->hasDataField(command))
// malformed command, lacked data field
break;

if (!command["data"].containsKey("ssid") ||
!command["data"].containsKey("password"))
break;

std::string customNetworkName = "main";
if (command["data"].containsKey("network_name"))
customNetworkName = command["data"]["network_name"].as<std::string>();

this->deviceConfig->setWifiConfig(customNetworkName,
command["data"]["ssid"],
command["data"]["password"],
0, // channel, should this be zero?
0, // power, should this be zero?
false, false);

break;
}
case CommandType::SET_MDNS: {
if (!this->hasDataField(command))
break;

if (!command["data"].containsKey("hostname") ||
!strlen(command["data"]["hostname"]))
break;

this->deviceConfig->setMDNSConfig(command["data"]["hostname"],
"openiristracker", false);

break;
}
case CommandType::PING: {
Serial.println("PONG \n\r");
break;
}
default:
break;
}
}
Loading

0 comments on commit 81cda52

Please sign in to comment.