I recently ran into some Problems getting the Serial Binding working on the Raspberry Pi 3.
First off all: I finally got it to work using the following item definition:
String toSerial "To Serial [%s]" <serial> {serial="/dev/ttyS0@9600"}
I’m writing this as reference for anyone also having troubles getting the serial working.
Without the " < serial > " it didn’t work. There was no error in the log but no output on the Serial Port.
Unfortunally this wasn’t mentioned in the wiki. And I did all the recommended steps in the wiki and other forum posts.
Did anyone else have the same Problem? Maybe it can be added to the wiki?
But the confusing part is: After I got it to work once, I can now remove the " < serial > " and it still works. (even after reboot).
Sitemap:
Switch item=Serial_TX
Text item=toSerial
Items:
Switch Serial_TX
String toSerial "To Serial [%s]" <serial> {serial="/dev/ttyS0@9600"}
Rules:
rule "Serial_TX ON"
when
Item Serial_TX received command ON
then
toSerial.sendCommand("Test On\r\n")
end
rule "Serial_TX OFF"
when
Item Serial_TX received command OFF
then
toSerial.sendCommand("Test Off\r\n")
end