[co7io] BACnet v2 binding for openHAB 2.x

The “Binding - BACnet” step now has the following error.

[ERROR] Failed to execute goal on project org.connectorio.addons.binding.bacnet: Could not resolve dependencies for project org.connectorio.addons:org.connectorio.addons.binding.bacnet:bundle:3.3.0-SNAPSHOT: The the following artifacts could not be resolved: org.code-house.bacnet4j:api:jar:1.3.0-SNAPSHOT, org.code-house.bacnet4j:ip:jar:1.3.0-SNAPSHOT, org.code-house.bacnet4j :mstp:jar:1.3.0-SNAPSHOT: org.code-house.bacnet4j:api:jar:1.3.0-SNAPSHOT was not found in JFrog during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of openhab-snapshot has elapsed or updates are forced → [Help 1]

Change this line:
connectorio-addons/pom.xml at 3.3.x · ConnectorIO/connectorio-addons · GitHub, and set bacnet4j.wrapper to 1.3.0-alpha1 and plc4x-extras to 0.8.0. I made some changes in there, but they should not be critical for build.

Without latest wrapper you will miss support to have all objects at device level, but that’s not relevant for testing with 3.3 for now.

Made changes, the assembly was complete. Nothing has changed, older version 3.0.2 does not work( Testing on v3.0.2, v3.0.4, v3.1.0, my personal v3.2.0.

Do you see any error during installation or while startup of binding?

In the binding manager, the bacnet binding is visible. When you click on install, the installation freezes.

Try installing it via shell - do features:install co7io-binding-bacnet.

Thank you Lukasz!
Works on version 3.2.0. If there are problems, I will write.

Hello, after one month of using bacnet binding, I found out the following… Not without problems. I connected about 50 things, after which the SNMP protocol stopped working, the protocols working through the ethernet tcp/ip also began to work unstable. If you reduce the number of things, other protocols start to work more stable.

This is the input voltage when no more than 15 things are connected to the bacnet. SNMP

This graph is when about 50 things are connected. SNMP voltage monitoring protocol.

I suspect the bacnet is overloading the network, high refresh rate. Although I set 1000ms and higher everywhere, changing the polling time, I did not notice the difference. The processor and memory are normal for loading. Tested on different hardware.

Its likely a case, because binding sends few readout requests for each poll cycle for each object. I been lately adjusting this part and also doing some aggregation of polling (reading up to 3 objects at each cycle to avoid segmentation), but its still not ported to 3.3.x.
You can set logging to DEBUG for org.connectorio.addons.binding.bacnet.internal.handler.object.task.ReadObjectTask and see in detail if your polling settings are accepted. I found out that UI did not present them properly so they were possible to specify only via text configuration (also awaiting port).

Tell me how to set up debug mode? And also is there an instruction for a text configuration or at least one example? The one at the beginning of the article does not fit. I’m testing on version 3.2.0.
I noticed that a thing can be created separately, each or in one thing, any number of channels, but only as a presentValue.

The debug mode can be enabled using openhab shell (ssh -p 8101 openhab@127.0.0.1 or openhab-cli console default password AFAIR is habopen). After logging in into shell you just type log:set DEBUG org.connectorio.addons.binding.bacnet.internal.handler.object.task.ReadObjectTask. It should have immediate effect and result in multiple entries appended to your openhab log file.

The text file config is indeed out of date, however you can take yaml output you see in “config” tab displayed in UI and transform it into xtext file. I do not have any working example of it.

Created the config file, didn’t use the user interface. Turned on debugging as you advised. For the testing I used 40 things and polling time was set to 1000 ms. During the tests I found out that when OH makes a poll of devices, the whole polling happens to all 40 devices at the same time.

One device is 4 channels: eventState, present value, outOfService, reliability.
40*4=160 requests per cycle.

I changed the source code and left only 1 channel - presentValue. After this, it turned into 40 requests per cycle which made it more stable performancewise.

So I have a question: is it possible to make some sort of a pause between channels and things?

I am not sure what you mean, something like Modbus binding min delay between polls for device to?
Scheduler used for polling will queue multiple tasks, thus you might improve stability by increasing thingHandler thread pool size [1]. Your network will definitely survive that.

I think later version of binding (will try to push it over weekend) which groups channels at device level will improve stability cause it polls 3 channels at the time. If you have device with 50 objects then you will have 17 network calls instead of 50.

[1] ThreadPoolManager (openHAB Core 3.4.0-SNAPSHOT API)

I am not sure what you mean, something like Modbus binding min delay between polls for device to?

Yes, the minimum delay between polls.

How to increase the size of the pool did not figure it out.
At the moment, I left only one channel “present Value”, everything became stable. When you update to the new version, I will test it. For now, I’ll leave it as it is, it’s difficult for a beginner to continue.

Hello, after the last update, there is a compile-time crash:

Could not resolve dependencies for project org.connectorio.addons:org.connectorio.addons.binding.bacnet:bundle:3.2.0-SNAPSHOT: The following artifacts could not be resolved: org.code-house.bacnet4j:api:jar:1.3.0-SNAPSHOT, org.code-house.bacnet4j:ip:jar:1.3.0-SNAPSHOT, org.code-house.bacnet4j:mstp:jar:1.3.0-SNAPSHOT: org.code-house.bacnet4j:api:jar:1.3.0-SNAPSHOT was not found in JFrog during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of openhab-snapshot has elapsed or updates are forced

Hello @heavemann,
Please build GitHub - Code-House/bacnet4j-wrapper: Simple facade for bacnet4j api., which is used by bacnet binding (same for plc4x-extras) if you run into troubles of “could not resolve dependencies” kind. These are only two snapshots used currently in connectorio addons project. Once you build them locally they will be used to build KAR which you deploy into your openHAB.

The bacnet4j wrapper received some updates related to “long discovery” allowing binding run in larger networks. I successfully tested discovery of more than 800 devices running in one of skyscrapers. ;))) Updated version also streamlined support for recognition of MSTP devices behind bacnet routers. Binding itself also introduced possibility to manually register network routers through ip bridge configuration (mark advanced options). This means that you can communicate with devices without running discovery.

I started working on subscriptions (COVs), but they again overgrow available time, thus they again have to wait.