Getting serial port input via alternative provider

In a quest to fix something in a binding, @Nadahar discovered that not all data that comes in via a serial port (in casu USB) finds its way into openHAB.

He’s been trying to get that data in via another “provider”, e.g. with this approach: [enocean] Gateway doesn't issue updates (but it does send commands) · Issue #17693 · openhab/openhab-addons · GitHub. But no luck, thus far…

@splatch advised to create a forum topic about this. (I don’t know whether this is the correct subforum?)

It would be very helpful if anybody that has gotten purejavacomm to work could share if there are some special things to take care of, like permission somewhere. The serial port provider “seems to work”, there are no errors that we’ve found, and the ports shows up. But, trying to use the provided port fails.

How bizarre:

I once again did this:

openhab>
co7io-list-serial-ports
Detected ports:
1) /dev/ttyS4 owner: none
openhab> ^C
openhab> feature:status openhab-misc-serial-purejavacomm
Uninstalled
openhab> feature:install openhab-misc-serial-purejavacomm
openhab> co7io-list-serial-ports
Detected ports:
1) ttyUSB0 owner: none
2) ttyS4 owner: none
3) ttyS31 owner: none
4) ttyS30 owner: none
5) ttyS29 owner: none
6) ttyS28 owner: none
7) ttyS27 owner: none
8) ttyS26 owner: none
9) ttyS25 owner: none
10) ttyS24 owner: none
11) ttyS23 owner: none
12) ttyS22 owner: none
13) ttyS21 owner: none
14) ttyS20 owner: none
15) ttyS19 owner: none
16) ttyS18 owner: none
17) ttyS17 owner: none
18) ttyS16 owner: none
19) ttyS15 owner: none
20) ttyS14 owner: none
21) ttyS13 owner: none
22) ttyS12 owner: none
23) ttyS11 owner: none
24) ttyS10 owner: none
25) ttyS9 owner: none
26) ttyS8 owner: none
27) ttyS7 owner: none
28) ttyS6 owner: none
29) ttyS5 owner: none
30) ttyS3 owner: none
31) ttyS2 owner: none
32) ttyS1 owner: none
33) ttyS0 owner: none
34) /dev/ttyUSB0 owner: none

And now:

This appears to only work if I run feature:install openhab-misc-serial-purejavacomm after every openHAB restart:

openhab> co7io-list-serial-ports
Detected ports:
1) /dev/ttyS4 owner: none
openhab> feature:install openhab-misc-serial-purejavacomm
openhab> co7io-list-serial-ports
Detected ports:
1) ttyUSB0 owner: none
2) ttyS4 owner: none
3) ttyS31 owner: none
4) ttyS30 owner: none
5) ttyS29 owner: none
6) ttyS28 owner: none
7) ttyS27 owner: none
8) ttyS26 owner: none
9) ttyS25 owner: none
10) ttyS24 owner: none
11) ttyS23 owner: none
12) ttyS22 owner: none
13) ttyS21 owner: none
14) ttyS20 owner: none
15) ttyS19 owner: none
16) ttyS18 owner: none
17) ttyS17 owner: none
18) ttyS16 owner: none
19) ttyS15 owner: none
20) ttyS14 owner: none
21) ttyS13 owner: none
22) ttyS12 owner: none
23) ttyS11 owner: none
24) ttyS10 owner: none
25) ttyS9 owner: none
26) ttyS8 owner: none
27) ttyS7 owner: none
28) ttyS6 owner: none
29) ttyS5 owner: none
30) ttyS3 owner: none
31) ttyS2 owner: none
32) ttyS1 owner: none
33) ttyS0 owner: none
34) /dev/ttyS4 owner: none
openhab>

Ok, but to the “important part”: Does it change the “malformed packets”?

Sadly, no…

But the logs of org.connectorio.addons.io.transport.serial do mention a lot of “declared methods” “not found”. So maybe there’s still an issue there?

What you see in that log is just OSGi trying to resolve the resources needed to start the bundle. It tries various things, some of which aren’t found, but it doesn’t matter, because it managed to find what it needs, and it ends with: Changed state from satisfied to active.

That means that the bundle started successfully, and is all that really matters from that part of the log. Not a single line were logged after the bundle started though, so it’s probably logging to different “coordinates” (not org.connectorio.addons.io.transport.serial).

Hey, I think you got it sorted. I am really thankful that you gave a spin to the addon and committed time to test it with another binding. Much appreciated!

As for installation and other people who missed related thread on github:

Happy testing to everyone who is brave enough to try 3rd party stuff with OH. :slight_smile:

It seems like feature:install openhab-transport-serial-shell is needed after every openHAB restart, though…

That doesn’t feel very practical. :wink:

You may have to add it through community marketplace. Once KAR is in addons/ you can see purejavacomm feature in the UI under regular addons. I think its an unintended side effect introduced somewhere around OH 3.4 where runtime state is controlled by OH and not underlying framework.