As topic. I want to disable BBMD for security reasons; how should I do?
Thanks for your help!
As topic. I want to disable BBMD for security reasons; how should I do?
Thanks for your help!
Ok thanks, that solves most of my issues. But I noticed that on the old version the device was always discovered, but with this version, the device is discovered only if started while the client is running. I suspect that the old version did send getIAM periodically...
Should I start a thread and send getIAM every 30 seconds or so?
Also: how does this snippet translates with the new API?
obj.setProperty(PropertyIdentifier.objectName, new CharacterString("Mains status"));
obj.setProperty(PropertyIdentifier.inactiveText, new CharacterString("Not present"));
obj.setProperty(PropertyIdentifier.activeText, new CharacterString("Present"));
Thanks
I solved by replacing writeProperty
with writePropertyImpl
which skips "using mixins"... no idea of what is it.
Also I noticed that on the old version the device was always discovered, but with this version, the device is discovered only if started while the client is running. I suspect that the old version did send getIAM periodically...
https://github.com/infiniteautomation/BACnet4J/tree/a9696f25dde11ce7ee65b9a2487f91f015fce83a
This should be version 3.2.2 (the one I'm using)
Bacnet4j 4.x requires Java8, which I do not have, so I switched to Bacnet4j 3.x
Is Bacnet4j 3.x still supported?
Also I got
com.serotonin.bacnet4j.exception.BACnetRuntimeException: com.serotonin.bacnet4j.exception.BACnetServiceException: class=Property, code=writeAccessDenied
at com.serotonin.bacnet4j.obj.BACnetObject.writeProperty(BACnetObject.java:355)
at com.ups.bacnet.Bacnet.run(Bacnet.java:619)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.serotonin.bacnet4j.exception.BACnetServiceException: class=Property, code=writeAccessDenied
at com.serotonin.bacnet4j.obj.mixin.CommandableMixin.writeProperty(CommandableMixin.java:132)
at com.serotonin.bacnet4j.obj.BACnetObject.writeProperty(BACnetObject.java:430)
at com.serotonin.bacnet4j.obj.BACnetObject.writeProperty(BACnetObject.java:352)
... 2 common frames omitted
While doing
AnalogValueObject avin1;
avin1 = new AnalogValueObject(localDevice.getNextInstanceObjectNumber(ObjectType.analogInput),"Input voltage", 232, EngineeringUnits.volts, false);
localDevice.addObject(avin1);
avin1.writeProperty(PropertyIdentifier.presentValue, new Real(1));
I've changed the broadcast address but didn't help either... I've tried with wireshark and with the old version I see the bacnet packets
With the new version I don't see anything.
Is there some logging that I can enable to see if at least the "who-is" packet is received from the device?
Thanks
Thanks, but still unable to make it work. I noticed that on the old version of the bacnet4j it was necessary to set the IP address of the client but this setting is no longer present.
The support from Bacnet test tool is telling me that my device is not hearing the who-is message.
Thanks, I made past the compilation phase. But now my device isn't discovered on the network by the client... what is the meaning of
.withLocalBindAddress("0.0.0.0")
.withLocalNetworkNumber(20)
.withBroadcast(broadcast, 255)
I assumed the first one was the ip address of the client (not sure why the code has 0.0.0.0, and have no idea on what to put on the second.
Then I start with
// Start the local device.
localDevice.initialize();
// Send an iam.
localDevice.sendGlobalBroadcast(localDevice.getIAm());
localDevice.sendGlobalBroadcast(new WhoIsRequest());
Thanks, this has been very helpful! But how do I translate this to the new API?
localDevice.getConfiguration().setProperty(PropertyIdentifier.objectName,
new CharacterString("my device"));
Where can I see how to implement a Slave device with the updated library?
The sample sources on github don't compile against the official version (4.1.6). Could somebody please update at least this one:
Thanks!
Hi, I have this code:
systemStatus1 = new BACnetObject(localDevice, localDevice.getNextInstanceObjectIdentifier(ObjectType.analogInput));
systemStatus1.setProperty(PropertyIdentifier.objectName, new CharacterString("System status group 1"));
systemStatus1.setProperty(PropertyIdentifier.units, EngineeringUnits.noUnits);
systemStatus1.setProperty(PropertyIdentifier.presentValue, new Real(65535));
localDevice.addObject(systemStatus1);
As you can see, I'm inserting a Real
with value 65535, which gets translated into 65535.00.
Is there a way to set a integer value? I've tried with UnsignedInteger
but I get
com.serotonin.bacnet4j.exception.BACnetServiceException: class=Property, code=Invalid data type, message=expected class com.serotonin.bacnet4j.type.primitive.Real, received=class com.serotonin.bacnet4j.type.primitive.UnsignedInteger
Thanks
I do agree with you in that the priority is working with valid messages; however any improvement with handling the corner cases would be welcomed. :wink:
My application is basically the BACnet4J sample application:
LocalDevice localDevice = new LocalDevice(1968, "10.1.10.168");
localDevice.getConfiguration().setProperty(PropertyIdentifier.objectName,
new CharacterString("my device"));
localDevice.setPort(0xBAC0);
// a few properties...
// Start the local device.
localDevice.initialize();
// Send an iam.
localDevice.sendBroadcast(47808, localDevice.getIAm());
You can dowload the test client from http://www.bac-test.com/download.php and you'll get the same errors as I get.
Hi, I've tested my BACnet4J app with BACnet test client (http://www.bac-test.com/download.php).
Many tests pass, but some do not pass. Take these, for example:
15/01/2013 09:45:39: Running Diagnostic: BC 135.1: 13.4.3 - Bad Tag Diagnostic
15/01/2013 09:45:39: Sending a Read Property where the Tag number is 2, not 1 as expected, should receive a 'Reject PDU' as a result
15/01/2013 09:45:39: tpde00532 - Wrong response received, expected RejectPDU but received: Error Class=Property, Error Code=Missing Required Parameter
15/01/2013 09:45:39: *** Diagnostic Fails ***
15/01/2013 09:45:39:
15/01/2013 09:45:39: Running Diagnostic: BC 135.1: 13.4.4-A - Missing Required Parameter
15/01/2013 09:45:39: Reject PDU expected
15/01/2013 09:45:39: *** Diagnostic Fails ***
15/01/2013 09:45:39:
15/01/2013 09:45:39: Running Diagnostic: BC 135.1: 9.13.4.3-A - Invalid Tag for Property
15/01/2013 09:45:39: Incorrect PDU Type in response: ERROR
15/01/2013 09:45:39: *** Diagnostic Fails ***
15/01/2013 09:45:39:
15/01/2013 09:45:39: Running Diagnostic: BC 135.1: 9.13.4.3-B - Invalid (8 bit) Tag for Property
15/01/2013 09:45:39: Incorrect PDU Type in response: ERROR
15/01/2013 09:45:39: *** Diagnostic Fails ***
15/01/2013 09:45:39:
Do you have any suggestion? Thanks.
Hi, I've tested my BACnet4J app with BACnet test client (http://www.bac-test.com/download.php).
Many tests pass, but some do not pass. Take these, for example:
15/01/2013 09:45:39: Running Diagnostic: BC 135.1: 13.4.3 - Bad Tag Diagnostic
15/01/2013 09:45:39: Sending a Read Property where the Tag number is 2, not 1 as expected, should receive a 'Reject PDU' as a result
15/01/2013 09:45:39: tpde00532 - Wrong response received, expected RejectPDU but received: Error Class=Property, Error Code=Missing Required Parameter
15/01/2013 09:45:39: *** Diagnostic Fails ***
15/01/2013 09:45:39:
15/01/2013 09:45:39: Running Diagnostic: BC 135.1: 13.4.4-A - Missing Required Parameter
15/01/2013 09:45:39: Reject PDU expected
15/01/2013 09:45:39: *** Diagnostic Fails ***
15/01/2013 09:45:39:
15/01/2013 09:45:39: Running Diagnostic: BC 135.1: 9.13.4.3-A - Invalid Tag for Property
15/01/2013 09:45:39: Incorrect PDU Type in response: ERROR
15/01/2013 09:45:39: *** Diagnostic Fails ***
15/01/2013 09:45:39:
15/01/2013 09:45:39: Running Diagnostic: BC 135.1: 9.13.4.3-B - Invalid (8 bit) Tag for Property
15/01/2013 09:45:39: Incorrect PDU Type in response: ERROR
15/01/2013 09:45:39: *** Diagnostic Fails ***
15/01/2013 09:45:39:
Do you have any suggestion? Thanks.
It works! Many thanks! :mrgreen: :mrgreen: :mrgreen:
To clarify: I don't know how to get the property values. The code posted prints the reference instead of the actual values...
Please let me know how to rectify this, thanks.
On the SlaveDeviceTest, I have set
ai0x.setProperty(PropertyIdentifier.objectName, new CharacterString("AAAAAaaaaAAAA"));
ai0x.setProperty(PropertyIdentifier.units, EngineeringUnits.centimeters);
How do I get them on the DiscoveryTest?