Send "I am" to Bacnet Device
-
Hi,
I'm trying to connect to a bacnet device, a Fire detection Panel. For safety reasons the panel only communicates with other devices that respond to his "Who is" on startup.
I've tried sending a Who Is and only get response from the panel after it startup. After that I can only find the panel via "Remote device object list".
How can I send an "I Am" during the startup of the panel?
After that, how can I monitor the panel to know in it is restarted (power failure or other)?Thanks in advance,
Neves -
Hi Neves,
If the BACnet data source in Mango is running when the panel starts, it should respond to the panel's WhoIs with an IAm. If not, I would wonder if the bind address settings for your local device doesn't get the message at the broadcast address the panel is using. But, that's assuming it's BACnet IP. on MS/TP it should definitely respond if the serial settings are right. Which is it? Also, it sounds like you are able to poll the device if you can get the device object list. So, what's not working? I can see how should Mango restart the panel would need to send another WhoIs if indeed you must respond to its request which Mango should handle if the BACnet data source is running when the WhoIs bounces around the network.
I didn't test this and am not sure it does what you want, but I think it would send an unsolicited IAm if it was aware of the device already, (run this in a Mango scripting environment, it will send the request even when the validation button is hit if you've changed the data source xid and device instance number accordingly)
//Get the local device config from a configured bacnet data source. var localDeviceConfig = com.serotonin.m2m2.db.dao.DataSourceDao.instance.getByXid("DS_354e2188-4867-431b-9051-bca39b011ed7").getLocalDeviceConfig(); localDeviceConfig = com.serotonin.ma.bacnet.device.LocalDeviceDwr.getLocalDevice(localDeviceConfig); var localDevice = com.serotonin.ma.bacnet.device.LocalDeviceFactory.getLocalDevice(localDeviceConfig, null); //print(localDevice); //Send the request to device number 1234... var remoteDevice = localDevice.getRemoteDeviceBlocking(1234); try { localDevice.send(remoteDevice, localDevice.getIAm()); } finally { com.serotonin.ma.bacnet.device.LocalDeviceFactory.releaseLocalDevice(localDevice, null); }
Hope that's helpful. If that is what you need to do, which I'm somewhat suspicious of, then we can talk about trying to detect the panel's restart and then send this message from an event handler. But, I think the local device should have replied to its WhoIs without effort were everything configured ideally.