Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RemoteDeviceDiscoverer can't find all devices connected #107

Open
wangdong2023 opened this issue Dec 13, 2024 · 0 comments
Open

RemoteDeviceDiscoverer can't find all devices connected #107

wangdong2023 opened this issue Dec 13, 2024 · 0 comments

Comments

@wangdong2023
Copy link

Hi, we are using RemoteDeviceDiscoverer to find all connected bacnet devices, but some are missing from time to time. We are listening on 0.0.0.0/24, and sending WhoIs to broad cast address.

We use wireshark to capture the network, the devices all answered to the WhoIs request.

Is this reported before? What could go wrong?

`
private synchronized LocalDevice getLocalDevice() {
try {
int deviceId = new Random().nextInt(10000);
log.info("Local device id {}", deviceId);
localDevice = new LocalDevice(deviceId, new DefaultTransport(ipNetwork)); // e.g. ip 0.0.0.0, broadcast address 192.168.0.255
localDevice.initialize();
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new CustomizeException(e.getMessage());
}

  return localDevice;

}

private List getAllRemoteDevices(LocalDevice localDevice) throws InterruptedException {
RemoteDeviceDiscoverer remoteDeviceDiscoverer = new RemoteDeviceDiscoverer(localDevice, remoteDevice -> {
log.info("found {} {}", remoteDevice.getInstanceNumber(), remoteDevice.getAddress().getMacAddress().getDescription());
});
remoteDeviceDiscoverer.start();

    Thread.sleep(3000);

    List<RemoteDevice> remoteDevices = remoteDeviceDiscoverer.getRemoteDevices();

    remoteDeviceDiscoverer.stop();
    log.info("Found {} devices: ips are {}", remoteDevices.size(), remoteDevices.stream().map(rd -> rd.getAddress().getMacAddress().getDescription()).collect(Collectors.joining(",")));
    return remoteDevices;
}

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant