OpenHab 2.5, Issue with Velbus Bridge Port already used: /dev/ttyACM0

Hello,

  • Platform information:
    • Hardware:Raspberry Pi 3 Model B Rev 1.2
    • OS: Raspbian linux 9
    • Java Runtime Environment: 1.8.0_252
    • openHAB version: 2.5.6-1
  • Issue of the topic:
    I had OpenHab 2.4 and Velbus and it worked well(I don’t remember if I had this issue).
    I updated my system to OpenHab 2.5 and since this moment I’m having temporaries issues, that I can not connect OpenHab to my velbus bridge.
    Status: OFFLINE - COMMUNICATION_ERROR Port already used: /dev/ttyACM0

‘’’ LOG
2020-07-02 11:43:34.849 [hingStatusInfoChangedEvent] - ‘velbus:bridge:bfa41595’ changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): Port already used: /dev/ttyACM0

2020-07-02 11:44:32.801 [hingStatusInfoChangedEvent] - ‘velbus:bridge:bfa41595’ changed from OFFLINE (COMMUNICATION_ERROR): Port already used: /dev/ttyACM0 to UNINITIALIZED

2020-07-02 11:44:32.829 [hingStatusInfoChangedEvent] - ‘velbus:bridge:bfa41595’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)

2020-07-02 11:44:33.645 [hingStatusInfoChangedEvent] - ‘velbus:bridge:bfa41595’ changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING

2020-07-02 11:44:35.683 [hingStatusInfoChangedEvent] - ‘velbus:bridge:bfa41595’ changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): Port already used: /dev/ttyACM0

2020-07-02 11:45:31.011 [hingStatusInfoChangedEvent] - ‘velbus:bridge:bfa41595’ changed from OFFLINE (COMMUNICATION_ERROR): Port already used: /dev/ttyACM0 to UNINITIALIZED

2020-07-02 11:45:31.037 [hingStatusInfoChangedEvent] - ‘velbus:bridge:bfa41595’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)

2020-07-02 11:45:31.507 [hingStatusInfoChangedEvent] - ‘velbus:bridge:bfa41595’ changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING

2020-07-02 11:45:33.554 [hingStatusInfoChangedEvent] - ‘velbus:bridge:bfa41595’ changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): Port already used: /dev/ttyACM0
‘’’
Thank you in advance for your help.

Pino

Did you try to reboot the system ?
In case a reboot does not help run this command with root privileges:

lsof /dev/ttyACM0

This should result in an output similar to:

lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/119/gvfs
Output information may be incomplete.
COMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF  NODE NAME
java    7214 openhab   54u   CHR  166,1      0t0 16628 /dev/ttyACM0

In this case it would mean that the java program running with PID 7214 with user openhab privileges uses the ttyACM0 device.

1 Like

By any chance, do you have other Serial devices attached to your setup?

I would strongly advise moving to using the /dev/serial/by-id/usb-Velleman_Projects_VMB1USB_Velbus_USB_interface-if00 method of addressing the USB interface, or use a TCP server application which addresses the interface by the by-id method.

This will also allow you to connect to your Velbus hardware with VelbusLink at the same time as anything else and means you don’t have to be tethered to the USB port while you’re configuring.

This subject is covered in great detail on the Velbus forum.

This thread is very long, but I promise it covers 99% of the questions that come up.

Including how to move from a Velbus Serial Bridge to a Velbus Network bridge.

You might even find it easier if you create the Velbus Network Bridge and give it the same unique ID as the Serial Bridge (which you’d have to delete first)


This Thing file would adopt the same unique ID as your current Serial Bridge, which mean all of your existing Velbus Things & Items will continue to function.

// Network bridge, for use with TCP servers like Velserv, Velbus_PB_Server or the upcoming Velbus TCP gateway. Running on the same machine
	Bridge velbus:networkbridge:bfa41595 "Velbus Network Bridge - Loopback" @ "Cabinet" [ address="127.0.0.1", port=6000 , timeUpdateInterval="360", reconnectionInterval="15" ]

FYI

Installing VelServ and Velbus Binding https://youtu.be/TqZquvxN_aQ?t=576

Adding the Serial Binding https://youtu.be/TqZquvxN_aQ?t=724

Creating the Velbus Network Bridge https://youtu.be/TqZquvxN_aQ?t=810

1 Like

Thank you, I will check the solution later

The user openhab is the owner this process. I restart the OpenHab without success, do you have any idea how I can solve this issue ?

Unplug your “other” device that is taking ttyACM0

Or try using ttyACM1 (or whatever else has been assigned by the OS to the usb-Velleman_Projects_VMB1USB_Velbus_USB_interface-if00


This command –

ls -l /dev/serial/by-id/usb-Velleman_Projects_VMB1USB_Velbus_USB_interface-if00

Will reveal which ttyACM has been assigned

How did you get on?

Are you back up and running now?

Hello Mdar,

Thank you for your help.
But for the moment I’m busy with other things.

Regards,
Pino

No worries.

It should be a quick fix, so feel free to give me a shout when you have time.

Good luck,

Stuart

Hi Mdar,

I followed this link: https://forum.velbus.eu/t/how-to-install-and-run-velserv-a-velbus-tcp-gateway/15422/39
and now my Velbus is connected to OpenHab.

Thank you at all peoples that do a good job with velserv/openhab!

2 Likes