Openhab 3 - Serial Binding of Arduino on ttyACM0

Hello together,

I have set up the new Openhab 3 with the latest Openhabian in 32-bit and would like to establish the serial connection to the Arduino via /dev/ttyACM0.

I have followed the instructions in the forum and scoured the internet, but nothing leads to a working communication.

In the current house control I have a working system with Openhab 2 and the serial binding etc. and would now like to get this working with Openhab 3.

Does anyone have any idea if something has fundamentally changed in the serial binding or something else or is causing problems?

Below is an excerpt from “minicom” which shows that the serial connection works, but Openhab does not access it:

Welcome to minicom 2.7.1

OPTIONS: I18n
Compiled on Aug 13 2017, 15:25:34.
Port /dev/ttyACM0, 15:22:31

Press CTRL-A Z for help on special keys

Light_WohnZ_LED,ON;

And here is the permission statement:

[21:20:49] openhabian@openHABianDevice:~$ ls -ltr /dev|grep -i ttyACM0
crw-rw-rw- 1 root dialout 166, 0 Jan 2 21:18 ttyACM0

[21:25:14] openhabian@openHABianDevice:~$ lsusb

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 2341:0042 Arduino SA Mega 2560 R3 (CDC ACM)
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Greetings
Tobi

No direct advice. But did you read the documentation about serial configuration: Serial Port Configuration | openHAB And I assume you are using the new serial binding? Serial - Bindings | openHAB

Hello hilbrand,

thank you very much for the quick answer!

I have already read everything and am now rewriting the serial commands.

At the moment I send serial commands with:

items:
String Arduino "Arduino [%s]" (arduino) {serial="/dev/ttyACM0@115200"} 

rules:
rule "Light Living Room LED  
 when   
     Item Living_room_Light_LED_Switch_HABPANEL changed  
 then  
      var state = Living_room_light_LED_Switch_HABPANEL.state as OnOffType   
      sendCommand (Arduino , "<Light_Living_LED_"+ state + ",>".toString)
end

Greetings
Tobi

the syntax that you is V1 syntax and thus

indeed needs to be rewritten.

Hello Wolfgang,

I was successful with the creation of the “Thing” for the serial port of the Arduino and the newly created and linked item “ArduMEGA”.

 .things
 Bridge serial:serialBridge:ArduMEGA [serialPort="/dev/ttyACM0", 
 baudRate=115200] {}

.rules
rule "Licht Gästezimmer"  
when   
     Item Gaestezimmer_Licht_Allgemein_Schalter_HABPANEL changed  
 then  
      var state = Gaestezimmer_Licht_Allgemein_Schalter_HABPANEL.state as OnOffType  
      //sendCommand (Arduino , "<Licht_GaesteZ_Allgemein_"+ state + ",>".toString)
      sendCommand (ArduMEGA, '<Licht_GaesteZ_Allgemein_' + state +',>');
end  

Thanks again for your quick reply!

Greetings
Tobi

1 Like

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