[co7io] Persistent serial port identifier provider for openhab

There are multiple tutorials on how to get serial port devices working just fine with openHAB and Linux (see below). Addon which I am bringing to the table does that without necessity to touch any operating system configuration. It does not require adjustment of startup options. It should just work out of the box.

Under the hood add do create a hash for each available usb/serial device and look up a real /dev/tty* port based on that hash. This means that as long as your USB devices stay unique it should work between restarts saving you time on fighting with udev. More importantly it works with vanilla openHAB 3 serial port APIs.
Information used for hash:

  • Vendor id
  • Product id
  • Product
  • Manufacturer
  • Interface Description
  • Interface Number
  • Serial Number

Port seen in openHAB UIs and other places is in format #Persistent,xyz:/dev/ttyZYX. Out of this first xyz is a device identification hash. The capital ZYX is a node name which was initially used to calculate that hash. It does serve only informational purposes. All identification is based upon hash!

To download addon you must register:

If you seek for a operating system level solution see:

Hello @splatch , Thanks for the addon.
I had downloaded and copied the .kar file to the addons folder. /usr/share/openhab/addons.
The addon does not show up on any UI, But the bundle shows up in list on the console.
So I tried to install manually by editing addons.cfg file 'and adding serial2", still nothing happened
ls /dev/tty* does not show the persistent port.
I followed a step by @sidamos(I cannot see the binding under bindings, but I can do Things → “+”, then I see it.) still did not work for me.
I’m using OH3.2 on RPi4, where should I look? thanks.

Hey,
This addon was made prior marketplace stuff really evolved into own thing and been tested so far with openHAB 3.0.x and 3.1, I haven’t ran it with OH 3.2 yet.
If you dropped the KAR file into addons folder then kar:list command should list its location or name at some point. There is some delay between drop in folder and processing of file.

Features which you can install through UI or command line are:

  1. openhab-transport-serial2 which installs co7io-transport-serial2
  2. openhab-transport-serial2-shell which installs co7io-transport-serial2-shell

Reason why there are aliases is because openHAB sometimes rely on feature names so in order to avoid conflicts I provide own feature names which work independently of openHAB convention.

This means that if you use openHAB UI you probably should notice serial2 somewhere in “misc” or “transport” addon category. This is not a binding, so you have to look for it somewhere else. If you think of addons.cfg then serial2 should be probably added to the transport list.

If you are not certain if addon is working properly get into openHAB shell (ssh -p 8101 openhab@127.0.0.1 from raspberry pi ssh terminal), or using some openhabian specific calls I can’t remember right now.
If you are there the quickest way to verify if addon was activated is la -l|grep -i connectorio which will print you out all modules which are installed together with their state.

Best,
Łukasz

Thanks @splatch , I will try it out again.