Openhabian - Arduino via USB

  • Platform information: Raspberry Pi 2
  • openHAB version: last OpenHabian downloaded
    • Items
      String ArduinoData “ArduinoData [%s ON/OFF]” (arduino) {serial="/dev/ttyACM0@9600"}

    • Sitemap
      Frame label=“Arduino”{
      Text item=ArduinoData
      }
      serialbinding installed

Hello!
After some investigation, reading, trying I can’t find, where it stucks.

I just want do show a “signal” comming from the arduino and I want to do it with USB connection. No WiFi, modbus or other possibilities.

I send each second “S1:0\n” or “S1:1\n”

    void loop() {
          Serial.print("S1:0");
          Serial.println(";");  
          delay(1000);
          Serial.print("S1:1");
          Serial.println(";");  
          delay(1000);
    }

On raspberry I see the incomming data with minicom
minicom -b 9600 -D /dev/ttyACM0

I tried to set openhabian on ttyACM0
export EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0"

When I had only 4 DS1820 running, everything worked. Now they are disconnected and I started to add this USB connection.

Can I check if openhab get the data?

Use the openhabian-config tool and select Apply Improvements then Fix Permissions to make sure that openhab has the needed permissions to access the serial ports.

Thank you!
I’ve done this. (call sudo openhabian-config via ssh - done all “10 | Apply Improvements”)

ls -al /dev/ttyACM0
crwxrwxrwx 1 root dialout 166, 0 Dec 30 15:43 /dev/ttyACM0

(I verified with minicom the info is comming in on ttyACM0)

grep ‘dialout’ /etc/group
dialout:x:20:openhabian,openhab

So I think, the permission should be OK.

In an other thread
vzorglub posted for someone other with the same problem “Can you post the serial.cfg file, please?”
It should be in etc/openhab2/services
If it is not there then the binding didn’t install properly

The problem in this thread was (I think) never solved.

I have also nothing like serial.cfg

sudo ls /etc/openhab2/services
addons.cfg dashboard.cfg readme.txt rrd4j.cfg runtime.cfg

I added in (somewhere - I do not remember) some cfg file “bindings=serial” (I could add more bindings comma seperated). This was told in some forumpost.

in PaperUI -> Add ons -> Bindings ->

Serial Binding binding-serial1 - 1.13.0

seems to be installed.

So what can and should I do next?
Thank you in advanced,
Andi

Is openhab a member of the tty group?

Also in openhabian-config is System Settings (30) and Serial Port (35) are they set correctly?