[SOLVED] OH3.0.0 - Serial 3.0.0 - no carriage return send anymore?' - OH2.5.11 was ok - OH 3 also ok

Hi all OH3 fans,

I’m migrating from OH 2.5.11 to OH 3.0.0 on a docker based setup and have trouble with the serial communication with my Vantage domotic system.

On the same debian buster, by just switching OH containers

  • OH 2.5.11 serial communication runs fine
  • OH 3.0.0 serial reception is ok, transmission seems to block/ignore the terminating ‘\r’

The communication is simple: in ASCII, just send ex. ‘VGC 2 3 5’ + ‘\r’ and the Vantage will reply with the load settings (all commands look similar).

OH 3.0.0 configuration:
serial.things (simplest form possible, without serialDevice)

Bridge serial:serialBridge:port0 [serialPort="/dev/ttyUSB0", baudRate=19200, charset="ASCII"]

vantage.items

String Vantage "Vantage [%s]" { channel="serial:serialBridge:port0:string" }
// Test button
Switch VantageTest

vantage.rules (I push on the VantageTest via HABPanel)

rule "vantageTest"
when
	Item VantageTest changed 
then {
	logInfo("vantage", "Vantage Test ....")
	Vantage.sendCommand("VGC 2 3 5\r")
}
end

On OH 2.5.11, Vantage answers promptly and the String Vantage contains the result.
On OH 3.0.0, Vantage does not answer, the ‘\r’ does not seem to be transmitted over the wire…

Working OH 2.5.11 config:
vantage.items:

String Vantage "Vantage [%s]" { serial="/dev/ttyUSB0@19200,CHARSET(ASCII)" }
// Test button
Switch VantageTest

No serial.things, vantage.rules identical as above.

When I run the openhab (OH 2.5.11) container, it works.
When I run the openhab (OH 3.0.0) container, it does not work.

Note: Vantage returns by itself also status information. On both OH versions this information is received in the Vantage String variable as expected, with no issues.

Are ‘\r’ not part of a String anymore in OH3? or stripped somewhere?
Any clue?
Can I somehow enable more serial debugging? (I have tried log.set DEBUG ROOT, log.set DEBUG org.openhab.binding.serial, …)

Many thanks and OH3 rocks, what a major step, congrats to everyone.

As a test can you change your logInfo to include VGC 2 3 5\r and see if there’s a difference in the log output between 2.5 and 3.0.

I previously noticed something with escape characters when using the UI, but you don’t appear to be using the UI for your rules.

I can’t reproduce that problem, although I’ve only tested with the latest 3.1 snapshot (which doesn’t have any serial binding changes compared to 3.0).

Using socat to emulate a serial port I can see carriage returns being sent and received using your rule example.

1 Like

Found the issue… thanks to @MikeJMajor for pointing me to socat.

Indeed, nothing wrong with OH 3.0.0 and the serial communication. As the carriage returns were visible in socat, I digged into the hardware and found a bad soldered contact in the RS-232 transmission line… :frowning:

Many thanks for the help and I’m glad to have learned about ‘socat’ and ‘ser2net’.

I’m closing this as solved.

1 Like