I want to run my bacnet application in a docker launched with docker compose. The host machine is on the bacnet network. I would like to be able to discover the bacnet network in my application. My application is unable to send the broadcast request required to discover the bacnet network because the docker hosting my application is in the subnet created by docker.
I have tried many things:
- trying to run docker on the host network (network_mode: host) => the main problem is that I can no longer expose my application's port
- play with the different settings offered by my bacnet library (Bacnet4J)
Perhaps it is essential to set up a BBMD?
If anyone has ever run a bacnet application in a docker that runs on the bacnet network, I'd be really interested in a bit of help setting this up.
Here is the architecture I have :
It is not strictly essential to have a BBMD; BBMD's are no longer being advocated for use since Bn/SC, and (UDPv4) Broadcasts are not strictly supported by IPv6 - you have to use a Multicast group to emulate them.
The important thing to be sure of is that you have request-response connectivity between the (BACnet) Client & Server - ideally for both (ICMP) ping (/'Echo Request') and BACnet/IP communication.
If you know the address details for your (BACnet) server, then you should be able to target it directly with 'YABE' & 'VTS', if not also with 'BACnet4j' too.
For example, using the NodeJS 'node-bacnet' package; the directed/'unicast' (/non-'broadcast') approach - reading the 'ObjId' from server device '127.1.2.2:47810' having a DOIN (Device Object Instance Number) of '321':
Output:
(Alongside ping, you can use 'Wireshark' and/or Windows 'netsh' for checking the network connectivity - but check your firewall rules too.)
...
I've not messed with Java for a long time, and have never tried using 'BACnet4J' until today - and have found it quite hard to get going with, but here's an example of me finding a (target) device that I know about (via a directed/'unicast' route), rather than via 'Who-Is'/'broadcast' (- IPv4 address '192.168.1.7' & port # '47810'/0xBAC2 with a DOIN value of '999'); I haven't tested the 'iAmReceived' code / I borrowed it from elsewhere :
Folders & files:
My run (Windows 'Command Prompt') 'CMD' script (/Batch file):
Environment:
Output:
Hope this helps. ;D