mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-04-19 14:33:45 +02:00
@@ -113,7 +113,7 @@ CommandResult startStreamingCommand()
|
|||||||
esp_timer_handle_t activateStreamingTimer;
|
esp_timer_handle_t activateStreamingTimer;
|
||||||
esp_timer_create(&args, &activateStreamingTimer);
|
esp_timer_create(&args, &activateStreamingTimer);
|
||||||
esp_timer_start_once(activateStreamingTimer, pdMS_TO_TICKS(150));
|
esp_timer_start_once(activateStreamingTimer, pdMS_TO_TICKS(150));
|
||||||
|
streamServer.startStreamServer();
|
||||||
return CommandResult::getSuccessResult("Streaming starting");
|
return CommandResult::getSuccessResult("Streaming starting");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -215,7 +215,11 @@ void startWiFiMode()
|
|||||||
wifiManager->Begin();
|
wifiManager->Begin();
|
||||||
mdnsManager.start();
|
mdnsManager.start();
|
||||||
restAPI->begin();
|
restAPI->begin();
|
||||||
|
StreamingMode mode = deviceConfig->getDeviceMode();
|
||||||
|
if (mode == StreamingMode::WIFI)
|
||||||
|
{
|
||||||
|
streamServer.startStreamServer();
|
||||||
|
}
|
||||||
xTaskCreate(
|
xTaskCreate(
|
||||||
HandleRestAPIPollTask,
|
HandleRestAPIPollTask,
|
||||||
"HandleRestAPIPollTask",
|
"HandleRestAPIPollTask",
|
||||||
|
|||||||
@@ -482,6 +482,15 @@ def get_settings_summary(device: OpenIrisDevice, *args, **kwargs):
|
|||||||
configured = wifi.get("networks_configured", 0)
|
configured = wifi.get("networks_configured", 0)
|
||||||
print(f"📶 WiFi: {status} | IP: {ip} | Networks configured: {configured}")
|
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):
|
def scan_networks(wifi_scanner: WiFiScanner, *args, **kwargs):
|
||||||
use_custom_timeout = (
|
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("🔄 Switch device mode (WiFi/UVC/Auto)", switch_device_mode_command)
|
||||||
menu.add_action("💡 Update PWM Duty Cycle", set_led_duty_cycle)
|
menu.add_action("💡 Update PWM Duty Cycle", set_led_duty_cycle)
|
||||||
menu.add_action("🧩 Get settings summary", get_settings_summary)
|
menu.add_action("🧩 Get settings summary", get_settings_summary)
|
||||||
|
menu.add_action("🔪 Restart device", restart_device_command)
|
||||||
menu.show()
|
menu.show()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user