chilipeppr / serial-port-json-server

Serial Port JSON Server is a websocket server for your serial devices. It compiles to a binary for Windows, Mac, Linux, Raspberry Pi, or BeagleBone Black that lets you communicate with your serial port from a web application. This enables web apps to be written that can communicate with your local serial device such as an Arduino, CNC controller, or any device that communicates over the serial port.
http://chilipeppr.com
GNU General Public License v2.0
323 stars 101 forks source link

May remove {"ej":""} after every command for g2core? #21

Open xpix opened 7 years ago

xpix commented 7 years ago

Hi,

after every manual command over the serial console in CP, the spjs send this command: image

if this really necessary or can we remove this echo-command?

Here some comments from @giseburt about this topic:

image

thank you Frank

chilipeppr commented 7 years ago

This command is necessary to put TinyG back into JSON mode. So, if a user types $1 to see all motor settings then it's placed into text mode and ChiliPeppr can no longer communicate with the critical JSON features. The entire way the buffer flow works is to look for an r:{} response from TinyG. Imagine that TinyG could send back a text response instead of a JSON response. The whole buffer flow falls apart instantly. So this isn't just lightly important, this is critically important.

I pointed this out back in the day that this was a problem and there was no solution on the horizon, so I had to implement this in the buffer. If the new version of the firmware solves this then for sure get rid of it in the g2core buffer, but don't touch it on the v8 because it is SUPER critical.

On Thu, Dec 8, 2016 at 5:11 AM, Frank Herrmann notifications@github.com wrote:

Hi,

after every manual command over the serial console in CP, the spjs send this command: [image: image] https://cloud.githubusercontent.com/assets/3763176/21011075/d33d37a4-bd4f-11e6-89a2-3c2470267609.png

if this really necessary or can we remove this echo-command?

Here some comments from @giseburt https://github.com/giseburt about this topic:

[image: image] https://cloud.githubusercontent.com/assets/3763176/21010987/603308a6-bd4f-11e6-9932-5247f9e74013.png

thank you Frank

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chilipeppr/serial-port-json-server/issues/21, or mute the thread https://github.com/notifications/unsubscribe-auth/AHidbeA9KNtQZudeFpUYz3Mkw3AjP2R8ks5rGAIHgaJpZM4LHzVw .