Unbuffered telnet output issue

Telnet communication problem with ESP chip.

Hi! I am new at this forum. Used search but didn’t find actual information for my question.
I got issue with communuication with ESP6266 over telnet.

Exactly it work but terminal is unreadable. To fix it need parse input buffer.
If string start with ‘<’ dont send it to buffer until got ‘>’ or disconnect by timeout.

Firmware grbl 1.1 detected
 h ['$
 ' for
 hel
 p]
 Idle|MPo
 s:44.
 000,
 40.000,0
 .000|FS:0
 ,0|WCO:0.000,0.000,0.000>
 s:44.
 000,4
 0.000,
 0.000
 |FS:0,0|O
 v:100,1
 00,100>
 Idle|MPo
 s:44.
 000,40.000,0.0
 00|FS:0,0
 >
 Idle|MPo
 s:44.000,
 40.0
 00,0.0
 00|FS:0,
 0>
 Idle|MPo
 s:44.000,
 40.000,0
 .000|
 FS:0,
 0>
 Idle|MPo
 s:44.
 000,4
 0.000,0.000|F
 S:0,0>
 Idle|MPos:44.
 000,4
 0.000,0.000|FS:0
 ,0>
 Idle|MPo
 s:44.000,4
 0.000,0.000|FS:0,0>
 Idle|MPo
 s:44.0
 00,40
 .000,
 0.000|FS:0,0
 >
 s:44
 .000,4
 0.000
 ,0.000|FS:0,0
 >
 os:44
 .000,
 40.00
 0,0.0
 00|FS
 :0,0|
 WCO:0.
 000,0.000,0.000
 >
 Idle|MPo
 s:44
 .000,
 40.0
 00,0.
 000|
 FS:0,
 0|Ov:100
 ,100,100>
 Idle|MPo
 s:44.
 000,40.0
 00,0.000|FS:0
 ,0>
 Idle|MPo
 s:44.
 000,4
 0.000,0.0
 00|FS:0,0>
 Idle|MPo
 s:44.000,4
 0.000
 ,0.0
 00|FS
 :0,0>
 Idle|MPo
 s:44.0
 00,40.000,0.
 000|FS
 :0,0>

This is esp telenet firmware project link
https://github.com/nekdfl/UartNetBridge

All data going directly from uart to tcp socket and from tcp socket to uart.
telnetbridge.cpp

from serial to TCP

void TelnetBridge::serialWatcher()
{
    if (isHaveClient())
    {
        size_t rxlen = Serial.available();
        if (rxlen > 0)
        {
            uint8_t sbuf[rxlen];
            Serial.readBytes(sbuf, rxlen);
            m_telnetclient.write(sbuf, rxlen);
        }
    }
}

from TCP to serial

void TelnetBridge::manageConnected()
{
    size_t rxlen = m_telnetclient.available();
    if (rxlen > 0)
    {
        uint8_t sbuf[rxlen];
        m_telnetclient.readBytes(sbuf, rxlen);
        Serial.write(sbuf, rxlen);
    }
}

Hi Nick
What is the goal of your telnet communication? Do you try to run a remote machine over telnet bridge?

The telnet interface was originaly implemented for lan connected smoothie boards. It never was intedet to run over wifi. Some experiments with ESP8266 WiFi communication showed that it had a lot of runtime/delay issues.

I suggest to use a Raspberry Pi close to the Machine and connect it from remote over a web browser. The lw.comm-server installation for Raspberry Pi hosts a webserver with the LW frontend.

Hi! Thanks for unswer.
I want to use Onboard PC (Rpi) like tablet with touch LCD. And need wireless communication with CNC between it.
To make project work exists several ways. If all other ways failed i will use ESP as Access point and tablet as client.
LaserWEB look intresting and I want it install on handmade tablet as control software.

The main reason to do this is what i don’t have pc in separate room where i can be moved laser. So i cant do manual laser set home on material before start engrave.
I alreeady have 3d printer with octo-print and want the same for laser. But didn’t found solution for this and start develop own.

I don’t recommend it for everyone but if you can find your way around Linux pretty good there is USBIP which I run on an rPi connected to my diode laser then I run the USBIP client on my laptop over WiFi(both rPi and laptop are on the same WiFi router) and it creates a /dev/ttyACM0 device on my laptop for Lightburn. Could work for other clients as well because it acts like the USB device is local. It’s been around for over 10 years…

http://usbip.sourceforge.net/

There are commercial USB over IP products but I’ve not used or researched them.

1 Like

Thanks for unswer. But it is not solution for me.
May be I dont’t understood somthing but i see problem how to set zero on material remotly.

Realy thanks all for unswers!
I did start this topik becouse want to know unswer: is planned make buffered output or may be exists telnet example for ESP where this problem not exists?

you would set your focus at the machine. Your 0,0 location is always home or defined by homing.
If you mean how would you position work piece then you would setup Lightburn with a camera and add another USBIP port for the camera. How were you planning on doing this “set zero” over telnet?

As I wrote, it woud be easyer to have LaserWeb (lw.comm-server) on a Raspberry Pi and place the Pi close to the CNC machine connected via USB (same as OctoPi for 3d-Printer). Then use the Webbrowser on a Tablet or PC to get the LaserWeb frontend and command the machine.

2 Likes

right. Sorry, I didn’t see the forum topic heading. Yes, put LaserWeb on the rPi at the machine and do remote connectivity.

1 Like