• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. carnecro
    3. Posts

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website
    • Profile
    • Following 0
    • Followers 0
    • Topics 9
    • Posts 24
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by carnecro

    • RE: Timeouts when discovering BACnet device

      @CraigWeb I apologize for the false alarm. I analyzed everything again with Wireshark and found out that the problem was a misconfigured firewall.

      If the data are transported in multiple segments, the server obviously opens a new socket for each Complex-ACK. For us, the direction from device to Mango was blocked for BACnet. After modifying the rules on the firewall everything works fine. Sorry again.

      posted in Mango General
      carnecroC
      carnecro
    • RE: Timeouts when discovering BACnet device

      I opened a ticket on GitHub Bacnet4J, but honestly, I don't believe anyone will bother with it. There are quite a lot of bugs described there, and I've documented and described some, but no one is responding. For me it is annoying because I bought a license to use Bacnet4J commercially (it was not cheap), but as it turns out, the library is not of good quality and especially there is no support. I do not recommend using it for professional implementations.

      posted in Mango General
      carnecroC
      carnecro
    • RE: Timeouts when discovering BACnet device

      @CraigWeb The problem is clearly a bug in the Bacnet4J library during the segmented response to ReadProperty. From a certain number of objects the server returns a segmented response. Bacnet4J for some reason misses the first segment of the response and therefore repeats the request. This leads to an error. Here are screnshots of the communication in the case of Bacnet4J and Yabe.

      Yabe
      Yabe.png

      Bacnet4J
      Bacnet4J.png

      I think that nobody has ever tested segmented responses, otherwise they would have found this problem.

      posted in Mango General
      carnecroC
      carnecro
    • RE: Timeouts when discovering BACnet device

      @CraigWeb Mango doesn't give me much information where to look for the problem. That's why I wrote a BACnet client using BACnet4J. I have found that problems with BACnet4J occur when the discovery process tries to read information about a larger number of points. I can't say where the limit is. I've experimented with segmentation, ReadPropertyMultiple, APDU timeouts, all with no reasonable results.

      What do you mean by API timeout? Personally, I don't think anyone has tested BACnet4J in this configuration.

      posted in Mango General
      carnecroC
      carnecro
    • RE: Timeouts when discovering BACnet device

      @CraigWeb FYI I checked the device with 750 data points in BacEye (BacEye can communicate with this device without any issues):

      Pic20230310011051.png

      posted in Mango General
      carnecroC
      carnecro
    • RE: Timeouts when discovering BACnet device

      @CraigWeb IMO it's an issue with Bacnet4J library. I can discover all these devices and objects with many Bacnet clients (Yabe, BacEye, Tridium Niagara, etc). So I have written a small application using Bacnet4J and when I am reading object list from a device with 750 data points, I get an error

      error reading object list: ErrorAPDU(errorClass=services, errorCode=operational-problem,errorClass=services, errorCode=operational-problem)
      

      There is no problem to read points from a device with approx 250 data points. Because I can read all objects with all other clients I have I assume it's Bacnet4J issue related to MaxAPDU setting.

      posted in Mango General
      carnecroC
      carnecro
    • Timeouts when discovering BACnet device

      I have BACnet devices with 1500+ data points. I am unable to discover data points. Although I set the timeout to 600000 ms (600 secons/5 minutes) I still get timeout errors. I can discover smaller devices with approx 300 data points, although even this operation takes an unusually long time.

      posted in Mango General bacnet
      carnecroC
      carnecro
    • Error when writing MultistateObject property stateText

      When I try to write property stateText on MultistateValue object (assuming same for MultistateInput and Output), I get the following error:

      java.lang.ClassCastException: com.serotonin.bacnet4j.type.constructed.SequenceOf cannot be cast to com.serotonin.bacnet4j.type.constructed.BACnetArray
              at com.serotonin.bacnet4j.obj.mixin.MultistateMixin.validateProperty(MultistateMixin.java:63)
              at com.serotonin.bacnet4j.obj.BACnetObject.writeProperty(BACnetObject.java:481)
              at com.serotonin.bacnet4j.service.confirmed.WritePropertyRequest.handle(WritePropertyRequest.java:102)
              at com.serotonin.bacnet4j.transport.DefaultTransport.handleConfirmedRequest(DefaultTransport.java:870)
              at com.serotonin.bacnet4j.transport.DefaultTransport.incomingConfirmedRequest(DefaultTransport.java:827)
              at com.serotonin.bacnet4j.transport.DefaultTransport.receiveAPDU(DefaultTransport.java:640)
              at com.serotonin.bacnet4j.transport.DefaultTransport.receiveImpl(DefaultTransport.java:578)
              at com.serotonin.bacnet4j.transport.DefaultTransport.run(DefaultTransport.java:498)
              at java.lang.Thread.run(Thread.java:748)
      

      IMO there is inconsistency. Multistate object constructor uses BacnetArray<CharacterString>, write property handler uses SequenceOf<CharacterString>, however, both objects are passed to the same mixin validation procedure.

      posted in BACnet4J general discussion
      carnecroC
      carnecro
    • localDate, localTime and utcOffset

      It looks like the properties localDate, localTime and utcOffset are modified in the device beforeReadProperty method. These properties are obviously derived from thy system clock and operating system setting.

      In our case, the device OS (Linux) is always running the clock in the UTC timezone even when the device is installed in another timezone. We would like to return the properties localDate, localTime and UTC offset to clients converted to the real device timezone.

      Is there any way how to do it except to subclass the DeviceObject and override beforeReadProperty?

      posted in BACnet4J general discussion
      carnecroC
      carnecro
    • Proper response for ReadPropertyMultiple, PID=all

      I defined some proprietary properties on the analog-value object and when I disable the ReadPropertyMultiple requests the Bacnet4J server returns all properties to the client (for testing I am using MBS BACeye). Obviously, the client reads the properties one by one based on the property-list.

      With ReadPropertyMultiple enabled the proprietary properties must be queried manually. I noticed, that the client sends the request with PropertyIdentifier.all (#8).

      ReadPropertyMultipleRequest [listOfReadAccessSpecs=[ReadAccessSpecification [objectIdentifier=analog-value 45, listOfPropertyReferences=[PropertyReference [propertyIdentifier=all, propertyArrayIndex=null]]]]]
      

      Should I as application developer create the response with the List of Read Access Results (Bacnet 15.7.1.2.1) od does it Bacnet4J automaticaly for me? I checked the answer using this code snippet and it looks like the Bacnet4J response does not contain the proprietary properties,

      public void requestReceived(Address from, Service service) {
               super.requestReceived(from, service);
      
               if (service.getChoiceId() == 14) {
      
                   ReadPropertyMultipleRequest req = (ReadPropertyMultipleRequest) service;
                   CommLogger.info("REQ: " + req.toString());
      
                   SequenceOf<ReadAccessSpecification> ras = req.getListOfReadAccessSpecs();
                   try {
                       final ReadPropertyMultipleAck ack = (ReadPropertyMultipleAck) new ReadPropertyMultipleRequest(
                               ras).handle(executor.getLocalDevice(), from);
                       CommLogger.info("RSP: " + ack.toString());
                   } catch (BACnetException e) {
                       e.printStackTrace();
                   }
               }
           }
      

      Robert

      posted in BACnet4J general discussion
      carnecroC
      carnecro
    • RE: How to tell the client ReadPropertyMultiple is not supported

      Thank you, the right hint! The framework can do it without source code modification:

      DeviceObject deviceObject = localDevice.getDeviceObject();
      ServicesSupported servicesSupported = deviceObject.readProperty(PropertyIdentifier.protocolServicesSupported);
      servicesSupported.setReadPropertyMultiple(false);
      

      Robert

      posted in BACnet4J general discussion
      carnecroC
      carnecro
    • How to tell the client ReadPropertyMultiple is not supported

      What is the right way for BACnet4J server to tell the client, that it does not support Read Property Multiple to force clients sending ReadProperty one by one? I know that BACnet4J supports Read Property Multiple but in my case, I need the device does not support this feature

      posted in BACnet4J general discussion
      carnecroC
      carnecro
    • RE: switching from bacnet4j3 to bacnet4j4 using special ObjectProperties

      Thank you for clarification.

      posted in BACnet4J general discussion
      carnecroC
      carnecro
    • RE: switching from bacnet4j3 to bacnet4j4 using special ObjectProperties

      I purchased the license because I am using it in my closed project. The question is if I am allowed to make changes in the code I purchased. I will clear it with the sales.

      posted in BACnet4J general discussion
      carnecroC
      carnecro
    • RE: switching from bacnet4j3 to bacnet4j4 using special ObjectProperties

      OK, maybe this was the motivation to close the add() methods. But I purchased the library to implement it in my own device where I need the proprietary properties. Looks like I have to contact the author if I am even entitled to make a change in the source code.

      posted in BACnet4J general discussion
      carnecroC
      carnecro
    • RE: switching from bacnet4j3 to bacnet4j4 using special ObjectProperties

      I found a way, how to add my own proprietary identifier! The static method PropertyIdentifier.forId adds the new id into the idMap when the id does not exist. Unfortunatelly, the new property name is not added into the nameMap and prettyMap, so I added the names directly.

      public class MyPropertyIdentifier extends PropertyIdentifier {
      
          public static final PropertyIdentifier myProperty = PropertyIdentifier.forId(2048);
      
          public MyPropertyIdentifier(ByteQueue queue) throws BACnetErrorException {
              super(queue);
          }
      
          static {
      
              // Enumerated.init(MyPropertyIdentifier.class, idMap, nameMap, prettyMap);
              getNameMap().put("my-property", myProperty);
              getPrettyMap().put(2048, "my-property");
          }
      }
      

      However, adding the new property identifier to an object is not possible because the add methods are private. The library, without source code modifications, is not conform with the chapter 23 of the BACnet specification.

      posted in BACnet4J general discussion
      carnecroC
      carnecro
    • RE: switching from bacnet4j3 to bacnet4j4 using special ObjectProperties

      And ObjectProperties.add() has private access in com.serotonin.bacnet4j.obj.ObjectProperties.

      Making a gateway I need to map a proprietary point attributes to BACnet point properties. However, some of the attributes do not have a standard equivalent on the BACnet side. For example, we have multiple alarm levels on the analog value object (HiLevel1=warning, HiLevel2=alarm, HiLevel3=fault), etc. I really did not find any way how to add proprietary (custom) properties to a standard BACnet object except to modify the original code.

      posted in BACnet4J general discussion
      carnecroC
      carnecro
    • RE: switching from bacnet4j3 to bacnet4j4 using special ObjectProperties

      Not so easy, PropertyIdentifier, that is the most important for me, has private constructor.

      posted in BACnet4J general discussion
      carnecroC
      carnecro
    • RE: switching from bacnet4j3 to bacnet4j4 using special ObjectProperties

      Did you find a solution? I have exactly the same problem.

      posted in BACnet4J general discussion
      carnecroC
      carnecro
    • Proprietary properties

      Is there any example of how to define and use proprietary object properties?

      posted in BACnet4J general discussion
      carnecroC
      carnecro