Serial Binding OH3 send ctrl+Z command

Hi,

Have OH3 M5 running on a Ubuntu server. And have a SMS modem on /dev/ttyUSB2 port.
Installed the serial Binding and sending and receiving from the modem works well. But i do not know how to send the ctrl+Z command wich is needed to close the AT+CMG command (send sms).
Have tried:

  • Item.sendCommand(“AT+CMGS=“phone number”\rMessage\u001A”)
  • Item.sendCommand(“AT+CMGS=“phone number”\rMessage\x1A”)

But the binding could not parse the \u nore the \x…

Could someone help me with this issue.
@gitMiguel

Many Thanks

What do you mean the binding could not parse the \x, do you mean the binding is sending the string \x1A rather than the byte value 26?

How are you trying to send those item commands, is it a rule configured through the UI? If so are you able to look at the rule in the JSONDB and see how many \ characters are before the x

This could be this issue:

Hi Mike,

The serial thing is configured as:

Bridge serial:serialBridge:modem [serialPort="/dev/ttyUSB2", baudRate=9600] {
Thing serialDevice myModem [patternMatch=".*"] {
Channels:
Type string : control [commandFormat=“COMMAND=%s;”]
}
}

The item is configured as:

String sSendSerialMsg “Send Serial communication [%s]” {channel=“serial:serialDevice:modem:myModem:control”}

I make use of a Rule (GSM.rules) to send the AT commands to the modem.
image

the openhab.log gives the error

Configuration model ‘GSM.rules’ has errors, therefore ignoring it: [168,45]: Invalid escape sequence (valid ones are \b \t \n \f \r " ’ \ )

The question is how to parse the CTRL+Z command and put it in the string sSendSerialMsg to send it to the serial port?