Bacnet binding error on start

I just started using openhab and am hoping to control my home’s bacnet devices with it.

I am getting the following stack trace error on startup:

Exception in thread “bacnet-client-2-discovery” java.lang.IllegalArgumentException: Not an I/P mac
at com.serotonin.bacnet4j.npdu.ip.IpNetworkUtils.getIpBytes(
at com.serotonin.bacnet4j.npdu.ip.IpNetworkUtils.toIpString(
at com.serotonin.bacnet4j.npdu.ip.IpNetworkUtils.toIpPortString(
at com.serotonin.bacnet4j.npdu.ip.IpNetworkUtils.toString(
at org.code_house.bacnet4j.wrapper.api.Device.toString(
at java.lang.String.valueOf(
at java.lang.StringBuilder.append(
at org.openhab.binding.bacnet.internal.BacNetBinding.deviceDiscovered(
at org.code_house.bacnet4j.wrapper.api.DiscoveryCallable.iAmReceived(
at org.code_house.bacnet4j.wrapper.api.util.ForwardingAdapter$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

The openhab log shows one bacnet device detected :

Discovered device Device [61000 network 0]

however the device I need to control (61001) is ‘nested’ below that one (see screenshot from YABE below).

Any idea what I need to do to solve the error and get the nested device detected by OpenHab ?

Thanks !


I did some more troubleshooting on this and it looks like both devices responds to the who-is requests correctly yet for some reason, device 61001 does not end up detected. See the wireshark capture of the traffic. Could it be that the address length is 1 and that somehow this is not acceptable to the binding ? Any help on this would be greatly appreciated !

@splatch - sorry to tag you directly like this… Any insight on this particular issue ? Seems like the binding is rejecting the device due to some issue reading the device address. I can see (and control) the device just fine in Wacnet or Yabe…

Hey @Pierre-Luc_Pelletier,
Thank you for reaching me - indeed this is bug in bacnet wrapper code. Yyou have two devices running on single IP and thats something which may cause troubles. I will have to revisit how device addresses are collected. From stack trace seems second address is formatted differently thus it doesn’t pass.

@Pierre-Luc_Pelletier there is work around for you.

Please install latest release:, then set logging level for org.openhab.binding.bacnet to WARN.

Please let me know if this work around works for you and if your device can be interacted from hab.


Thanks ! I will try this when I get home and report back…

Did some additional testing tonight after cleaning up my network configuration (connected the BACnet device directly to the primary router).

I am getting a bit further (I think) but still errors out for the device I need.

In addition to the errors, the devices are now being discovered but the address transformation seems to fail. I bolded the relevant line (Failed toString). A few lines below, you can see the other device being detected correctly.

2018-01-19 21:00:45.977 [DEBUG] [inding.bacnet.internal.BacNetBinding] - Bacnet binding activated
2018-01-19 21:00:45.977 [DEBUG] [org.openhab.binding.bacnet ] - ServiceEvent REGISTERED - {, org.osgi.service.event.EventHandler}={event.topics=openhab/command/*,,,,, service.bundleid=195, service.scope=bundle} - org.openhab.binding.bacnet
2018-01-19 21:00:45.977 [DEBUG] [inding.bacnet.internal.BacNetBinding] - Bacnet binding is going down
2018-01-19 21:00:46.649 [INFO ] [inding.bacnet.internal.BacNetBinding] - Discovered device '[FAILED toString()]'
2018-01-19 21:01:16.197 [INFO ] [b.core.service.AbstractActiveService] - BacNet Service has been started
2018-01-19 21:02:27.489 [DEBUG] [inding.bacnet.internal.BacNetBinding] - Bacnet binding is going down
2018-01-19 21:02:27.599 [INFO ] [inding.bacnet.internal.BacNetBinding] - Discovered device ‘Device [61000 network 0]’

Looks like this is related to this error in the console :

SLF4J: Failed toString() invocation on an object of type [org.code_house.bacnet4j.wrapper.api.Property]
Reported exception:
at org.code_house.bacnet4j.wrapper.api.Property.toString(
at org.slf4j.helpers.MessageFormatter.safeObjectAppend(
at org.slf4j.helpers.MessageFormatter.deeplyAppendParameter(
at org.slf4j.helpers.MessageFormatter.arrayFormat(
at org.slf4j.helpers.MessageFormatter.arrayFormat(
at org.slf4j.helpers.MessageFormatter.format(
at org.ops4j.pax.logging.slf4j.Slf4jLogger.error(
at java.util.concurrent.Executors$
at java.util.concurrent.FutureTask.runAndReset(
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(
at java.util.concurrent.ScheduledThreadPoolExecutor$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

Hey @splatch… I am at a loss on this one. Let me know if you need any additional info (logs, tests).

Thanks !

Hey @Pierre-Luc_Pelletier, your errors are straight and I need no extra input so far. There is an error with addressing requests passed to bacnet4j under the hood. Wacnet doesn’t have this problem because it recognises properly devices.

I need to revisit how addresses are collected and most likely amend internals of our bacnet4j wrapper. Will answer in this topic once I will have fix for you.
In case if I will not return soon enough you can ping me over forum, message or github issue created for this bug:

Perfect. Thanks for the response. Will sit tight and wait for an update !

Good evening Pierre,
Please find test version of binding available for download:

I removed unecessary ip address creation, however I can not guarantee at this moment that it will work any better. Please give it a try and see if you can read any property values. If you would be so kind - please try to traverse network using console client as described on wrapper wiki:
This will confirm or deny that “client” code itself is fine without pulling binding logic.


1 Like

Hello Łukasz,

I just gave this a quick test this morning and it seems to work !

The only thing I had to do was force the network number in the config file to the network number of the second device and then the binding detected both devices. So far I am able to read and set analog values. Will try other types later tonight but so far so good. I will confirm the results for other property types here.

Thanks so much for solving this issue !