BACnet4J icon indicating copy to clipboard operation
BACnet4J copied to clipboard

Failed test with bacnet test suite

Open amrnablus opened this issue 4 years ago • 0 comments

Describe the bug I'm testing my bacnet integration using the bacnet test suite: (https://www.bacnetlabs.org/page/pre_testing_tools), the group object reading is returning two errors: "Error Reading LIST_OF_GROUP_MEMBERS" and "Error Reading PRESENT_VALUE". I tried creating a static GroupObject taken from the sample and i still get the same error.

To Reproduce Steps to reproduce the behavior:

  1. Create a bacnet IP device with a group object
  2. Add AnalogInputObject, BinaryValueObject, MultistateValueObject (as in the test) to the object (code sample below)
  3. click on "Rediscover" then "Start All Tests" on the banet test suite (version 1.9.16)
  4. Notice the errors mentioned above

Expected behavior The test should pass.

Screenshots If applicable, add screenshots to help explain your problem.

Mango Version (please complete the following information): <artifactId>bacnet4j</artifactId> 5.0.1

Browser (please complete the following information):

  • Device: Thinkpad laptop
  • OS: Windows 8

Additional context Add any other context about the problem here.

ma.log Snippet

  • Check your ma.log file (located in ${MA_HOME}/logs) for any errors or warnings The only thing that seems relivant is:
com.serotonin.bacnet4j.npdu.MessageValidationException: Length field does not match data: given=0, expected=22
	at com.serotonin.bacnet4j.npdu.ip.IpNetwork.handleIncomingDataImpl(IpNetwork.java:360)
	at com.serotonin.bacnet4j.npdu.Network.handleIncomingData(Network.java:164)
	at com.serotonin.bacnet4j.npdu.ip.IpNetwork.run(IpNetwork.java:336)
	at java.base/java.lang.Thread.run(Thread.java:834)

Browser console errors Error Reading LIST_OF_GROUP_MEMBERS" and "Error Reading PRESENT_VALUE

Minimal code example to reproduce

 final AnalogInputObject ai = new AnalogInputObject(masterDevice, 0, "ai", 0, EngineeringUnits.noUnits, false);
        final BinaryValueObject bv = new BinaryValueObject(masterDevice, 0, "bv", BinaryPV.inactive, false);
        final MultistateValueObject mv = new MultistateValueObject(masterDevice, 0, "mv", 4,
            new BACnetArray<>(new CharacterString("Off"), new CharacterString("On"), new CharacterString("Auto"),
                new CharacterString("Optional")),
            1, false);

        // Create the group
        final GroupObject g = new GroupObject(masterDevice, 0, "g",
            new SequenceOf<>( //
                new ReadAccessSpecification(ai.getId(),
                    new SequenceOf<>( //
                        new PropertyReference(PropertyIdentifier.presentValue), //
                        new PropertyReference(PropertyIdentifier.units), //
                        new PropertyReference(PropertyIdentifier.stateText))), //
                new ReadAccessSpecification(bv.getId(),
                    new SequenceOf<>( //
                        new PropertyReference(PropertyIdentifier.presentValue), //
                        new PropertyReference(PropertyIdentifier.activeText), //
                        new PropertyReference(PropertyIdentifier.inactiveText))), //
                new ReadAccessSpecification(mv.getId(),
                    new SequenceOf<>( //
                        new PropertyReference(PropertyIdentifier.presentValue), //
                        new PropertyReference(PropertyIdentifier.stateText, new UnsignedInteger(2)), //
                        new PropertyReference(PropertyIdentifier.stateText, new UnsignedInteger(10)))), //
                new ReadAccessSpecification(new ObjectIdentifier(ObjectType.accumulator, 0),
                    PropertyIdentifier.presentValue)));

amrnablus avatar Mar 06 '20 17:03 amrnablus