bdring / Grbl_Esp32

A port of Grbl CNC Firmware for ESP32
GNU General Public License v3.0
1.7k stars 532 forks source link

Job Stops in Telnet mode #249

Open semos2k opened 5 years ago

semos2k commented 5 years ago

Latest firmware version. The problem is constant. I used the zebra milling test on my laser diode CNC the programs tested bCNC(Telnet), laserGrbl(telnet),UGS(Windows Virtual Port - very slow) the cnc stops on the line 9502.

https://drive.google.com/file/d/1_zLdfeZSLuprQjtclKEfZDW82WkD_uqC/view?usp=sharing

semos2k commented 5 years ago

image

bdring commented 5 years ago

Have you tried running the same file via SD card or USB/Serial port? That would help me debug.

semos2k commented 5 years ago

From USB work fine.

rafik84 commented 5 years ago

I spent several hours today on something similar, I wrote my own program in delphi for communication via telnet. I send gcode lines every 15ms (about 65 lines per second) (BLOCK_BUFFER_SIZE = 1024 with a few code changes uint8_t! = Uint16_t). Communication with esp was different from a few minutes to an hour and ... ping is esp and communication is gone, responses to usb / uart were returned after about 10s. and what turned out: in WiFiClient.cpp (wifi / src) it was enough to change lines: with

define WIFI_CLIENT_MAX_WRITE_RETRY (10)

define WIFI_CLIENT_SELECT_TIMEOUT_US (1,000,000)

on

define WIFI_CLIENT_MAX_WRITE_RETRY (1)

define WIFI_CLIENT_SELECT_TIMEOUT_US (100000)

everything is great and I can send gcode: D commands even faster

my soft is looks like this : [IMG]https://images92.fotosik.pl/274/a117771b1f296768med.png [/IMG] im added 2x MCP23017 (16 inputs , 16 outputs OC) 1x485 to controll VFD

luc-github commented 5 years ago

@rafik84 you send faster no doubt, because decreasing number of retries/timeout will decrease transfert time but what about data integrity ? Because retry is happening if issue occur, ignoring it may have consequence.

Question : Do you do data integrity check to verify everything is received and same as sent?

rafik84 commented 5 years ago

Yes , im control line gcode by N0000 .. X added to send line and everiting is fine ,decreasing number of retries it's posible lost data recv from ESP but .Im connecting to esp as AP then i'm have ping between 1ms < 3ms(when im connecting with in station mode , it worst ,ping is to high to stable comunication with TCP/IP) ,im using 2 telnet servers / on differents ports and task (im have 4 tasks wire to mcp23017 , rs485 to controll Vfd , serial from this code , and last to 2 tcpServer ) ,one to send gcode line and recv OK from parser (and this is work fine) and 2 to recv/send commands system (report,ovr) to separate layers system/gcode parser ,in report im always control state of buffer planner with do not cross < 100 when im lose response from report_real