- Jun 6, 2020
- 11,559
- 4,422
Hi all,
in my 3D printer host app I've a problem than cannot know how to solve.
I'm explain better...
My app communicate over TCP socket with ESP8266 / ESP32 to control a 3D printer, it send and
receive commands. ESP act as server and as WiFi<->Serial bridge, my app as client and connect to ESP.
Because the ESP sketch in written in C++ I avoided to use a stream in Prefix mode and used the standard way,
this forced me to collect on both side the data, not simple in C++ but after a lots of changes worked well.
I do not used AstreamText because I reuse the same socket to send string commands and even to upload
gcode files (as binary data) from Android to ESP SD Card, I just replicated what AstreamText do using a StringBuilder to collect data and CRLF as delimiter, only on the send command sub (strings).
Every command I send to ESP it send to a 3D printer, ESP read response from 3D printer and return back (the original command and reply from 3D printer) to Android as log.
My...
in my 3D printer host app I've a problem than cannot know how to solve.
I'm explain better...
My app communicate over TCP socket with ESP8266 / ESP32 to control a 3D printer, it send and
receive commands. ESP act as server and as WiFi<->Serial bridge, my app as client and connect to ESP.
Because the ESP sketch in written in C++ I avoided to use a stream in Prefix mode and used the standard way,
this forced me to collect on both side the data, not simple in C++ but after a lots of changes worked well.
I do not used AstreamText because I reuse the same socket to send string commands and even to upload
gcode files (as binary data) from Android to ESP SD Card, I just replicated what AstreamText do using a StringBuilder to collect data and CRLF as delimiter, only on the send command sub (strings).
Every command I send to ESP it send to a 3D printer, ESP read response from 3D printer and return back (the original command and reply from 3D printer) to Android as log.
My...
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید