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
321 stars 101 forks source link

Carriage return instead of linefeed? #68

Closed scooger closed 3 years ago

scooger commented 3 years ago

The device I'm interacting with is expecting \r at the end of a command instead of \n. I haven't found anything in the documentation that indicates how to change that behavior. Any ideas?

chilipeppr commented 3 years ago

What device are you using? The serial port JSON server model is to create a buffer for each device so that it knows how/when each command is processed. It would seem to me you'd need to write a buffer like the other buffers in the source code. Just copy the one that's the closest to what you need.

scooger commented 3 years ago

I have it working through a web interface (html and javascript) that I am repurposing from the one that controls my Rotel RC-1570 preamp. My devices for this solution are Raspberry Pi 3 B+ to Parasound ZPre3 (stereo preamp) via FTDI USB to RS232. The issue I was experiencing was only for through the serial-port-json-server test interface that appends a linebreak to each command. Fortunately this is not what happens when interacting directly.