I am currently trying to create multiple local devices within my application. Like in previous posts I created virtual networks (Linux ipconfig) and then tried to bind the different devices to the corresponding addresses.
The issue is that as soon as I add withLocalBindAddress to the IpNetworkBuilder, nothing happens, not even with one device, it is not discovered, cant be read etc.. When examining the network traffic with wireshark, the WhoIsRouter is sent the same way as without the bindAddress, but no NPDUs are received.
Here is my code:
int localDeviceID = Integer.parseInt(deviceData.getAttribute("id")); network[localDeviceID] = new IpNetworkBuilder().withPort(bacnetPort) .withLocalBindAddress(deviceData .getElementsByTagName("ip") .item(0).getTextContent()) .withBroadcast("192.168.1.255",24) .build(); transport[localDeviceID] = new DefaultTransport(network[localDeviceID]); transport[localDeviceID].setTimeout(500000); transport[localDeviceID].setSegTimeout(15000); localDeviceHashMap.put(localDeviceID,new LocalDevice(localDeviceID, transport[localDeviceID])); localDeviceHashMap.get(localDeviceID).initialize();
No exceptions or errors are generated, but when enabling logging, WhoIsRouter is always sent. When not using localBindAddress and only one device two NPDUs are received. When using it nothing happens after the WhoIsRouter.
Any help would be greatly appreciated.