Merge pull request #18 from bwmp/oli/fix

fix streaming
This commit is contained in:
Lorow
2025-10-26 13:10:12 +01:00
committed by GitHub
3 changed files with 16 additions and 2 deletions

View File

@@ -113,7 +113,7 @@ CommandResult startStreamingCommand()
esp_timer_handle_t activateStreamingTimer;
esp_timer_create(&args, &activateStreamingTimer);
esp_timer_start_once(activateStreamingTimer, pdMS_TO_TICKS(150));
streamServer.startStreamServer();
return CommandResult::getSuccessResult("Streaming starting");
}

View File

@@ -215,7 +215,11 @@ void startWiFiMode()
wifiManager->Begin();
mdnsManager.start();
restAPI->begin();
StreamingMode mode = deviceConfig->getDeviceMode();
if (mode == StreamingMode::WIFI)
{
streamServer.startStreamServer();
}
xTaskCreate(
HandleRestAPIPollTask,
"HandleRestAPIPollTask",

View File

@@ -482,6 +482,15 @@ def get_settings_summary(device: OpenIrisDevice, *args, **kwargs):
configured = wifi.get("networks_configured", 0)
print(f"📶 WiFi: {status} | IP: {ip} | Networks configured: {configured}")
def restart_device_command(device: OpenIrisDevice, *args, **kwargs):
print("🔄 Restarting device...")
response = device.send_command("restart_device")
if has_command_failed(response):
print(f"❌ Failed to restart device: {response['error']}")
return
print("✅ Device restart command sent successfully")
print("💡 Please wait a few seconds for the device to reboot")
def scan_networks(wifi_scanner: WiFiScanner, *args, **kwargs):
use_custom_timeout = (
@@ -668,6 +677,7 @@ def handle_menu(menu_context: dict | None = None) -> str:
menu.add_action("🔄 Switch device mode (WiFi/UVC/Auto)", switch_device_mode_command)
menu.add_action("💡 Update PWM Duty Cycle", set_led_duty_cycle)
menu.add_action("🧩 Get settings summary", get_settings_summary)
menu.add_action("🔪 Restart device", restart_device_command)
menu.show()