From what i see there is no way to Force close Webserial Socket once open, This leads to OTA functions not working correctly
Shown Below is the errors i get while webserial is running(Client connected or not) from the USB Serial.
Error[4]: End Failed
Start updating sketch
Progress: 0%
Error[2]: Connect Failed
Error[4]: End Failed
Start updating sketch
Progress: 0%
Error[2]: Connect Failed
Error[4]: End Failed
Start updating sketch
Progress: 0%
Error[2]: Connect Failed
Error[4]: End Failed
Start updating sketch
Progress: 0%
Error[2]: Connect Failed
Error[4]: End Failed
Start updating sketch
Progress: 0%
Error[2]: Connect Failed
Error[4]: End Failed
Start updating sketch
Progress: 0%
Error[2]: Connect Failed
Error[4]: End Failed
So in this block i want to close Webserial so OTA can work(Shown Below)
ArduinoOTA
.onStart([]() {
String type;
if (ArduinoOTA.getCommand() == U_FLASH)
type = "sketch";
else // U_SPIFFS
type = "filesystem";
// NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end()
Serial.println("Start updating " + type);
//Would also like a way to check if Webserial is running currently
if (WebSerial.IsRunning()==true) {
WebSerial.CloseConnection(); //close Connection so i have to recall "WebSerial.begin(&server);"
//OR
WebSerial.PauseConnection(5); //A pause for X world work as well however i would prefer to close and begin Webserial
}
})
From what i see there is no way to Force close Webserial Socket once open, This leads to OTA functions not working correctly Shown Below is the errors i get while webserial is running(Client connected or not) from the USB Serial.
So in this block i want to close Webserial so OTA can work(Shown Below)