[SOLVED] [Zwave, Zigbee, ...] RFC2217 remote serial port HowTo?

Hmmm, I don’t really know how that works. It might be only applicable to some systems as on my system (OSX) I don’t have any pre-populated ports…

What UI? HABmin?

EDIT: for Z-Wave, at least, HABmin is restricted to the dropdown.

image

It will be UI independent since it’s populated by OH Core, and not the UI.

Well, might be the case. My Debian shows perfectly all (socat-provided) serial ports.
When I click on the port configuration, it opens the list and let me choose from the existing entries. No add possible… :frowning:

Both:


image

For completeness, my PaperUI

image

Anyway: Back to the main questions from above:

Answer: At least partly not (yet?). For the Zwave I have to stick with the socat stuff anyway due to the reverted implementation. Thanks Chris for pointing this out!

Remain open:

Would still appreciate to see some working setup as an example.

But:
I guess I should skip rfc2217 for now.
Thanks guys, I think you saved me a lot of spare time :+1:+1

1 Like

FTR: I’ve opened an issue for the “non-editable” drop-down list:

Maybe it should go to openhab-core too according to Chris:

1 Like

And that is likely pulled from the OS.

Yes, I think it would be better in the core since that’s where the config description gets populated. The UI is just doing what OH says - in this case, showing and limiting to the options.

1 Like

done:

2 Likes

I think that needs to be fixed in the bindings, I have left a comment on the issue.

1 Like

I think we’ll let @Kai and @chris fight this one out. (in a friendly manner, of course) :wink::popcorn::popcorn:

Is there an open issue we can track? Convert ZWave binding to use ESH SerialPort classes by cdjackson · Pull Request #1152 · openhab/org.openhab.binding.zwave · GitHub Is in state “Merged” and I cannot find a replacement issue or indication of the revert itself.

The ZWave binding doesn’t support the RFC2217 classes - these were removed from the ZWave binding a long time ago.

Just did a code dive and seems like the OHC serial transport is used by the zigbee binding, so trying to get it to work with "rfc2217://ip:port’ but can’t get past the check in the binding that 0 or more serial ports exist. A how-to would be great, as I’ve spent some time searching on relevant keywords but not turning up anything explanatory.

In the meantime, can anyone help me out with a point in the right direction? Given the code that I’ve examined so far, I speculate that I would need to register my port somehow for it to be in the SerialPortManager’s list at the time that the binding checks for ports, but I haven’t yet managed to puzzle out where to do this.

Chris is working on a total rewrite of the binding. I think it is based more off the official standard rather than reverse engineering. It may be best to wait on that before adding features to the existing binding.

If you do wish to proceed you could start an issue on GitHub and receive help there.

I think this post is asking about ZigBee?

Either way though, this is should not be related to the binding I think. The theory is that this abstraction means that bindings don’t need to worry about the specifics of different transport layers (that’s the theory anyway :wink: ).

Oops. My bad.

Chris, Bruce,

Thanks for the replies. I’ll try to clarify. I’m not seeking a feature addition; rather, I’m trying to understand how to use my own pty based virtual serial ports, or to leverage the rfc2217 port capability provided by the core, with the zigbee binding as-is. The zigbee binding performs a check, before trying to open the configured serial port, for there to be at least one serial port ‘registered’. I think the serial port I configure probably must also exist in this registry for the binding to use it, but not sure there. I gather, from comments, that actual serial port devices, and those created for USB dongles, are discovered at startup and so are in the registry when the binding starts, but, of course, the registry used by the SerialPortManager will not contain any entries for arbitrary remote rfc2217 serial ports I may want to use. Is there a way register the existence of such ports or, for that matter, any custom pty based port I might create (i.e., so that they are in the list provided by the SerialPortRegistry to the SerialPortManager)?

refs:


I think I found my answer here (from RFC2217PortProvider.java):

    @Override
    public Stream<SerialPortIdentifier> getSerialPortIdentifiers() {
        // TODO implement discovery here. https://github.com/eclipse/smarthome/pull/5560
        return Stream.empty();
    }