luc-github / ESP3D-TFT

ESP3D Firmware for ESP32 based TFT
GNU General Public License v3.0
38 stars 9 forks source link

Very slow communication with connected device to usb host #77

Open j1981 opened 1 month ago

j1981 commented 1 month ago

I am using ESP32-S3 DEV KIT N8R8 with esp3d-tft to communicate via wifi with my cnc 3030 prover max (with GRBL, USB port CH340) and the setting is made to communicate via USB SERIAL port. I can send and I receive data from the cnc through the USB SERIAL port.. The problem is that there is a delay of about 1 second between the sending of the command and the execution from cnc device, this is very clear visible when a file is executed, all commands are executed with a delay between each other and the whole process is interrupted. I tested with communication from my computer directly to port 23 of an esp3d-tft board the delay remains, I tested using the web interface the delay remains on sending commands or executing file. If connect the machine directly to the computer with a usb cable everything works fine.

Can someone tell me if this is a bug or if I missed something when compiling the code.

I apologize for my bad English.

Jairolaya12x commented 1 month ago

Maybe is related to this? https://github.com/luc-github/ESP3D-TFT/discussions/75

luc-github commented 1 month ago

if there is delay from webUI or telnet beween sending and execution it is not normal, command is sent right away. The current ESP3D-TFT FW does not compile for CNC/grbl because it is not ready - what FW and settings are you using ?

j1981 commented 1 month ago

After few days of test after small correction of this code

// this task only handle connection static void esp3d_usb_serial_connection_task(void pvParameter) { (void)pvParameter; while (1) { / Delay / -----> vTaskDelay(1);//vTaskDelay(pdMS_TO_TICKS(10));<------ if (!usbSerialClient.started()) { break; } usbSerialClient.connectDevice(); } / A task should NEVER return */ vTaskDelete(NULL); }

the delay reduced to maybe to 100ms. This delay 100ms exist and at communication with SERIAL PORT. May be from other task. However i switched to latest version of ESP3D ver. 3 with usb host support and everything work fine.

luc-github commented 4 weeks ago

I am travelling now but I will have a check - it looks like there is some task competition

luc-github commented 1 week ago

@j1981 so now you are using ESP3D and no more ESP3D-TFT ?

I am back home now so I will review that issue in coming days

j1981 commented 1 week ago

Yes I already use esp3d and it works great. I only needed communication via usb without using a display. I hadn't read that usb communication has already been added to esp3d.

luc-github commented 1 week ago

Yes I already use esp3d and it works great. I only needed communication via usb without using a display. I hadn't read that usb communication has already been added to esp3d.

do you mean : https://esp3d.io/ESP3D/Version_3.X/documentation/otg/

j1981 commented 1 week ago

Yes. My cnc uses CP340 USB to UART converter