Talking to devices without discovery
-
I have a bunch of devices I want to talk to occasionally that's behind a firewall. Messages to/from port 47808 pass fine, but broadcasts do not work.
The device is a Wattstopper digital lighting control segment manager that sits on ethernet. Behind it are four MS/TP segments.
I figured out that I can do the following:
int instanceNumber = 1234; /* not the real instance id of the gateway/segment manager */ Address segmentManagerAddress = new Address("10.1.2.3", 47808); /* not the real IP address */ OctetString segmentManagerLinkService = null; RemoteDevice segmentManager = new RemoteDevice(instanceNumber, segmentManagerAddress, segmentManagerLinkService); segmentManager.setSegmentationSupported(Segmentation.noSegmentation); segmentManager.setMaxAPDULengthAccepted(1476); Encodable descr = RequestUtils.sendReadPropertyAllowNull(localDevice, segmentManager, remoteRequestOid, PropertyIdentifier.description);
this gets me a description so it works.
My next step is to figure out how to talk to the devices that are on the networks BEYOND the gateway/segment manager. Each one has its own network ID and a bunch of devices.
Without using broadcast discovery, how do I configure a RemoteDevice that can talk to these devices?
-
Perhaps you could send the WhoIs directly to the device instead of using a broadcast?
On a semi-related note, you are communicating with a remote device behind a firewall...
Does it mean you exposed the port 47808 to the Internet? :shock: -
Not in my case, but I have noticed that a lot of folks aren't particularly careful about this. I find it very troubling.
Perhaps you could send the WhoIs directly to the device instead of using a broadcast?
Yeah. That lets me see interesting things about the gateway ... but I haven't figured out how to make it tell me about ("discover") things BEYOND the gateway. If I known the network #, device ID, and MAC of the MS/TP device (as an example) then I can talk to it. I feel like this is fragile, though - like what if the power recycles and all these devices come up and arbitrate for new MAC addresses? How do I prevent my software from getting confused by this?
-
Glad to hear you don't expose your BACnet port!
I'm a little rusty on the discovery process.
When answering a WhoIs, isn't the gateway supposed to send you the list of devices it knows about?As a patch, perhaps you could 'scan' for these devices every once in a while to make sure you have all of them.
Say all device from ID 0 to 99 (or whatever is their ID range).