johnlauer/serial-port-json-server

How to

osvikvi opened this issue · 9 comments

First of all, Sorry for asking a dumb question.

I'm wondering how I should formulate the string to send.
I've installed SPJS on a windows machine, where I have a samsung monitor connected to the COM3 port. My intention is to be able to control this monitor remotely (ie from the webserver).
Currently I can control the monitor from the machine locally by a batch that I've written using Serialsend.exe The batch looks like this:
@echo off serialsend /baudrate 9600 /devnum 3 /hex "\xAA\x11\xFE\x01\x00\x10" exit
running this script will turn the screen off.

Now for my question, How do I formulate this command into SPJS?

I've successfully opened the correct port using 'open com3 9600' and tried to send various combinations of what I think the string could be, but untill now the screen has never responded.
Here's the major strings I've tried, with the response from SPJS:

send COM3 "AA 11 FE 01 00 10"
{"Cmd":"Queued","QCnt":1,"Ids":[""],"D":["\"AA 11 FE 01 00 10\"\n"],"Port":"com3"}
{"Cmd":"Write","QCnt":0,"Id":"","P":"com3"}
{"Cmd":"CompleteFake","Id":"","P":"com3"}
sendjson {"P":"COM3","Data":[{"D": "AA 11 FE 01 00 10\n", "Id":"123"}]}
{"Cmd":"Queued","QCnt":1,"P":"com3","Data":[{"D":"AA 11 FE 01 00 10\n","Id":"123","Pause":0}]}
{"Cmd":"Write","QCnt":0,"Id":"123","P":"com3"}
{"Cmd":"CompleteFake","Id":"123","P":"com3"}

I'm really lost here, I don't see what I'm doing wrong, any suggestions are appreciated.

thanks,
osvikv

I think you're trying to send binary and only text is supported
On Feb 4, 2016 12:57 AM, "osvikvi" notifications@github.com wrote:

First of all, Sorry for asking a dumb question

I'm wondering how I should formulate the string to send
I've installed SPJS on a windows machine, where I have a samsung monitor
connected to the COM3 port My intention is to be able to control this
monitor remotely (ie from the webserver)
Currently I can control the monitor from the machine locally by a batch
that I've written using Serialsendexe
https://githubcom/tedburke/SerialSend The batch looks like this:
@echo off
serialsend /baudrate 9600 /devnum 3 /hex "\xAA\x11\xFE\x01\x00\x10"
exit
running this script will turn the screen off

Now for my question, How do I formulate this command into SPJS?

I've successfully opened the correct port using 'open com3 9600' and tried
to send various combinations of what I think the string could be, but
untill now the screen has never responded
Here's what I've tried, with the response from SPJS
'send COM3 "AA 11 FE 01 00 10"
{"Cmd":"Queued","QCnt":1,"Ids":[""],"D":[""AA 11 FE 01 00
10"\n"],"Port":"com3"}
{"Cmd":"Write","QCnt":0,"Id":"","P":"com3"}
{"Cmd":"CompleteFake","Id":"","P":"com3"}'
'sendjson {"P":"COM3","Data":[{"D": "AA 11 FE 01 00 10\n", "Id":"123"}]}
{"Cmd":"Queued","QCnt":1,"P":"com3","Data":[{"D":"AA 11 FE 01 00
10\n","Id":"123","Pause":0}]}
{"Cmd":"Write","QCnt":0,"Id":"123","P":"com3"}
{"Cmd":"CompleteFake","Id":"123","P":"com3"}'

I'm really lost here, I don't see what I'm doing wrong, any suggestions
are appreciated

thanks,
osvikvi


Reply to this email directly or view it on GitHub
#38.

actually it's Hexadecimal values, I don't think I can translate this into text, Can I? Correct me if I'm wrong but which serial device is expecting text commands?

You could just look up an ASCII chart and see what letter represents what
number and see if you can map it.

As to what serial port uses text, all Arduinos do. All CNC controllers do.
Most serial ports in the IoT and DIY maker community are text based.

What you could do is merge the code that the Arduino team added to Serial
Port JSON Server in their fork back into this fork that supports binary
sending. That would solve this as well.

On Thu, Feb 4, 2016 at 3:17 AM, osvikvi notifications@github.com wrote:

actually it's Hexadecimal values, I don't think I can translate this into
text, Can I? Correct me if I'm wrong but which serial port is expecting
text commands?


Reply to this email directly or view it on GitHub
#38 (comment)
.

Thanks for the tip,
So I've converted my Hexadecimals to decimal values and sent that to SPJS
`send COM3 170 17 254 1 0 16\n
{"Cmd":"Queued","QCnt":1,"Ids":[""],"D":["170 17 254 1 0 16\n\n"],"Port":"com3"}
{"Cmd":"Write","QCnt":0,"Id":"","P":"com3"}
{"Cmd":"CompleteFake","Id":"","P":"com3"}

send COM3 170 17 254 1 0 16
{"Cmd":"Queued","QCnt":1,"Ids":[""],"D":["170 17 254 1 0 16\n"],"Port":"com3"}
{"Cmd":"Write","QCnt":0,"Id":"","P":"com3"}
{"Cmd":"CompleteFake","Id":"","P":"com3"}`

But still no response from the screen.
Excuse me for my ignorance but I have no knowledge of what arduino, IoT or fork is. n Wikipedia tells me it has something to do with Linux (what I don't have).

All I want to do is send a simple command through a webinterface so that I can control a serial device from a remote computer, preferably with a single url or button on a webpage.
Please tell me if this is possible with SPJS or not.

Thanks and once more, excuse me for my ignorance.

Serial Port JSON Server was made for exactly what you said “All I want to do is send a simple command through a webinterface so that I can control a serial device”.

You previously said you need to send binary values to your device. Sending digits is still text.

From: osvikvi [mailto:notifications@github.com]
Sent: Friday, February 5, 2016 4:51 AM
To: johnlauer/serial-port-json-server serial-port-json-server@noreply.github.com
Subject: Re: [serial-port-json-server] How to (#38)

Thanks for the tip,
So I've converted my Hxadecimals to decimal values and sent that to SPJS send COM3 170 17 254 1 0 16\n
{"Cmd":"Queued","QCnt":1,"Ids":[""],"D":["170 17 254 1 0 16\n\n"],"Port":"com3"}
{"Cmd":"Write","QCnt":0,"Id":"","P":"com3"}
{"Cmd":"CompleteFake","Id":"","P":"com3"}
send COM3 170 17 254 1 0 16
{"Cmd":"Queued","QCnt":1,"Ids":[""],"D":["170 17 254 1 0 16\n"],"Port":"com3"}
{"Cmd":"Write","QCnt":0,"Id":"","P":"com3"}
{"Cmd":"CompleteFake","Id":"","P":"com3"}

But still no response from the screen.
Excuse me for my ignorance but I have no knowledge of what arduino, IoT or fork is. n Wikipedia tells me it has something to do with Linux (what I don't have).

All I want to do is send a simple command through a webinterface so that I can control a serial device from a remote computer, preferably with a single url or button on a webpage.
Please tell me if this is possible with SPJS or not.

Thanks and once more, excuse me for my ignorance.


Reply to this email directly or view it on GitHubhttps://github.com//issues/38#issuecomment-180340730.

Than I just don't understand what I 'm doing wrong. Can you confirm I need
to send nothing more than "open com3 9600" and "send com3 + commandstring"
Actually it's hexadecimals that need to be received by the device connected
to the serial port.
My server is running on XP without firewalls, the clients are on W7.
Opening the port is working, only the commands are not being (received /
understood) is there a debugging or logging option on the server side? So I
can at least figure out where the problem lies.

Thanks
On 5 Feb 2016 5:55 pm, "John Lauer" notifications@github.com wrote:

Serial Port JSON Server was made for exactly what you said “All I want to
do is send a simple command through a webinterface so that I can control a
serial device”.

You previously said you need to send binary values to your device. Sending
digits is still text.

From: osvikvi [mailto:notifications@github.com]
Sent: Friday, February 5, 2016 4:51 AM
To: johnlauer/serial-port-json-server <
serial-port-json-server@noreply.github.com>
Subject: Re: [serial-port-json-server] How to (#38)

Thanks for the tip,
So I've converted my Hxadecimals to decimal values and sent that to SPJS
send COM3 170 17 254 1 0 16\n
{"Cmd":"Queued","QCnt":1,"Ids":[""],"D":["170 17 254 1 0
16\n\n"],"Port":"com3"}
{"Cmd":"Write","QCnt":0,"Id":"","P":"com3"}
{"Cmd":"CompleteFake","Id":"","P":"com3"}
send COM3 170 17 254 1 0 16
{"Cmd":"Queued","QCnt":1,"Ids":[""],"D":["170 17 254 1 0
16\n"],"Port":"com3"}
{"Cmd":"Write","QCnt":0,"Id":"","P":"com3"}
{"Cmd":"CompleteFake","Id":"","P":"com3"}

But still no response from the screen.
Excuse me for my ignorance but I have no knowledge of what arduino, IoT or
fork is. n Wikipedia tells me it has something to do with Linux (what I
don't have).

All I want to do is send a simple command through a webinterface so that I
can control a serial device from a remote computer, preferably with a
single url or button on a webpage.
Please tell me if this is possible with SPJS or not.

Thanks and once more, excuse me for my ignorance.


Reply to this email directly or view it on GitHub<
https://github.com/johnlauer/serial-port-json-server/issues/38#issuecomment-180340730>.


Reply to this email directly or view it on GitHub
#38 (comment)
.

Hello,

I know this is an old issue, but is there any update?

Did you fix this problem indeed @osvikvi ? :)

Hello,

maybe you did but not with me :)
It's not my software, I'm just using it as you did.

Best regards,
Salvo