MangoAutomation / BACnet4J

BACnet/IP stack written in Java. Forked from http://sourceforge.net/projects/bacnet4j/
GNU General Public License v3.0
187 stars 111 forks source link

How to use this with routed connectivity with bacnet? #62

Closed danishmhmd closed 3 years ago

danishmhmd commented 3 years ago

Please help me using this library with a routed network to bacnet device, currently my device is not connected to bacnet directly on any interface but rather it is routed via a managed switch in which bacnet and my device is on a completely different network, the packets are routed via network routing done in switch. If i send UDP packets directly it works but i am unable to see any devices by sending a who is request. Below is the sample command i sent and response i received from bacnet

Sending Command to Bacnet : 81 a 0 15 1 4 2 75 7c 5 9 1 1c 4 c0 0 1 29 0 39 78 Response from Bacnet : 81 a 0 9 1 0 60 7c 9

My interface ip: inet 192.168.1.200 netmask 255.255.255.0 broadcast 192.168.1.255 Bacnet ip : 192.168.2.200

logs which i see after sending who is:- [main] DEBUG com.serotonin.bacnet4j.transport.DefaultTransport - Broadcasting WhoIsRouter to local network [main] DEBUG com.serotonin.bacnet4j.util.RemoteDeviceFinder - Waiting 10000 ms for something to happen [main] DEBUG com.serotonin.bacnet4j.util.RemoteDeviceFinder - Done waiting [main] DEBUG com.serotonin.bacnet4j.util.RemoteDeviceFinder - Throwing timeout

kishorevenki commented 3 years ago

Any router or Layer 3 Managed switch would never allow any broadcast messages from one subnet to another. They will allow only Unicast messages. Because of the same Who-Is from 192.168.1.200 would never reach to 192.168.2.200.

To accomplish this you have to configure both the devices as BBMD device. Once BBMD are configured you need to add the IP address of other BBMD devices and self in the BDT table of each device. Once they are configured, communuication would happen.

danishmhmd commented 3 years ago

Thanks this would help