Serial Out node - RS232 Barcode Reader

Hi

Sorry for my bad english:
Im use a Raspberry Pi (Revolution Pi) with Node-Red.

With serial_in Node (/dev/ttyUSB0:9600-8N1), im recive the Barcodes from Barcode Reader (https://www.delock.de/produkte/G_90287/merkmale.html?setLanguage=en) -
that works fine!

My problem:
Sending data to the barcode reader!
Im create injection node, send the payload {MVERRR}, but no response from barcodereader. So assume the sending did not work.

thank you for your help

Can you show how the serial node is set to send data? (on certain character? after an amount of time?

Are you using serial request node?

Hi Steve-Mcl

Yes, use the serial request. Settings in Screenshot:

So see where you have split char \n the serial request node won't output until a newline. Are you certain newlines are given out by the device?

Also, if it does use newline as a marker, it may also use newline as it's input marker. I.e. try setting add character to output message as \n or adding a newline \n to your payload.

I've tried both unsuccessfully.
For your information: With \ n the scans arrive successfully. But only the scanns

Development Guide from Barcodereader
https://www.delock.de/files/40928.download

Can you show us in a debug node what the output is from your injection node?
Or share your flow.

Devices often need \r rather than \n

thank for your help

The flow is:[{"id":"5d5ef21b.a6885c","type":"tab","label":"ReaderInputs","disabled":false,"info":""},{"id":"310a6d52.150c22","type":"inject","z":"5d5ef21b.a6885c","name":"SetReadMode","topic":"","payload":"{MVERRR}","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":160,"wires":[["705398bf.ccbc08","edee5b23.ef03a8"]]},{"id":"edee5b23.ef03a8","type":"debug","z":"5d5ef21b.a6885c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":890,"y":160,"wires":[]},{"id":"705398bf.ccbc08","type":"serial request","z":"5d5ef21b.a6885c","name":"SendAndRequest","serial":"a7dbf2e6.98de5","x":590,"y":80,"wires":[["edee5b23.ef03a8"]]},{"id":"a7dbf2e6.98de5","type":"serial-port","z":"","serialport":"/dev/ttyUSB0","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","waitfor":"","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"\\n","bin":"false","out":"char","addchar":"","responsetimeout":"10000"}]

According the datasheet the scanner needs an CR+LF as terminator.
Try \r\n in the Add character to output messages box.

It does not work

why should that actually go to the right device? /dev/ttyUSB0 - there could be several devices behind it?

What if you add \r\n to the payload e.g...

msg.payload ="{MVERRR}\r\n"; 

(Remember to remove the \r\n from the config first)

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.