No Datagram receive on Unix based systems
carnecro last edited by
I started to play a bit with the Bacnet4J code and I have an issue that I cannot resolve. The simple DiscoveryTest from src_test works for me only on Windows OS. Running the same code on MacOSX, Linux (Debian) and even Embedded ARM Linux blocks on UDP receive(). In the wiresharrk I see the WhoIs messages are sent and my Bacnet remote devices are responding the IAm. First I thought I have a local firewall active on the hosts, however, running UdpDump test works fine and brings me the responses on all systems.
Any idea from community before I start to dive into the code? BTW is the community active? I did not see any answer since last 6 months in this forum?
I had exactly the same issue, running the library on linux with multiple network interfaces. I investigated "a bit" and found out that the library works until commit 519d464e686a1d551093e11316a2f314a60f02c3 (2015-10-14 16:56:50). This was the commit where BBMD-support was added.
The problem is, that in the class IpNetwork during initialization phase the DatagramSocket is always bound to a specific interface (using it's address). In previous versions a wildcast-binding was supported. Unfortunately, the specific binding causes problems on some implementations when trying to receive broadcast messages, as stated in the JavaDoc of DatagramSocket (see class-level description of http://docs.oracle.com/javase/7/docs/api/java/net/DatagramSocket.html).
I tried several versions of the JVM (oracle and openjdk) - without success. It seems to be an issue on operation-system level.
ATM, I have a quick and dirty workaround for me, maybe breaking BBMD-support or other features and which prevents me releasing new versions of libraries which use this library as base. It would be nice to have a "certified" fix for this.
phildunlap last edited by phildunlap
What version of the BACnet module do you have? We were just fixing this in 2.2.3 which is available for download in the store or through your modules page's upgrade button. This wiki article is relevant: http://infiniteautomation.com/wiki/doku.php?id=datasources:bacnet:configuring_local_devices
Testing on 2.2.3 showed that the discovery tool is only working properly when bound to 0.0.0.0:47808, while Windows was happier with forwarding to a more exclusive local device (192.168.1.11:47808 for instance)
I used the latest version (af736e9fa7d37736e69c4d29f9442d20c60f548b - 2015-12-10 18:47:09) taken from https://github.com/mlohbihler/BACnet4J which is version 3.2.2.
phildunlap last edited by
That's not the latest for Mango. https://github.com/infiniteautomation/BACnet4J
It doesn't seem to have 3.2.3 in the lib-opt folder, but if you read the RELEASE-NOTES you may see some pertinent stuff. You can get the 3.2.3 jar in the BACnet module.
Excellent. I fetched the infiniteautomation project several days ago when there was no difference between the two forks. But it seems that the problem has been fixed in the meantime (at least if the commit-messages are correct). I will grab the latest version and try again.
Works with version commit 18b2b5531da1f436da50f73f44d9b3fb25522ed0 - 2015-12-17 01:10:43.
Note: I used this version since there were test errors in the JUnit tests in the latest one (commit 4a445c93356d8558988f270c3e7a97a85df28eef)