• Recent
    • Tags
    • Popular
    • Register
    • Login

    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

    Not able to create local device using port 47809

    BACnet4J general discussion
    2
    9
    2.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      Vihangi
      last edited by

      Hi,
      With BACnet4J library, I am trying to create a new object of the local device using port 47809 and initialize it.
      Code snippet::

      static LocalDevice initializeLocalDevice() {
      LocalDevice device = null;
      try {
      device = new LocalDevice(localDeviceId, new DefaultTransport(new IpNetworkBuilder().withPort(47809).build()));
      device.initialize();
      } catch (Exception e) {
      System.err.println("Error in initializeLocalDevice: " + e);
      e.printStackTrace();
      }
      return device;
      }

      But, got below error while executing the above code.
      Error:
      Error in initializeLocalDevice: java.lang.IllegalArgumentException: Either withBroadcast or withSubnet must be called.
      java.lang.IllegalArgumentException: Either withBroadcast or withSubnet must be called.
      at com.serotonin.bacnet4j.npdu.ip.IpNetworkBuilder.build(IpNetworkBuilder.java:129)

      Please provide any solution for the same.

      Thanks,
      Vihangi

      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by

        Hi Vihangi, welcome to the forum.

        The answer is right there in the exception. If you're going to be developing with BACnet4J you will need to be able to read in the code why the exception has occurred if its message is not clear to you: https://github.com/infiniteautomation/BACnet4J/blob/master/src/main/java/com/serotonin/bacnet4j/npdu/ip/IpNetworkBuilder.java#L128

        1 Reply Last reply Reply Quote 1
        • V
          Vihangi
          last edited by

          Hi Phildunlap, Thanks for the reply.

          My error is resolved by doing below changes:
          new DefaultTransport(new IpNetworkBuilder().withPort(47809).withBroadcast(broadcastAdd, 24).build()

          Can we implement BACnet router to do communication between two devices with the different ports?

          For example:
          One device with port 47808 and another one with 47809

          Is it possible to do this with BACnet4J library?

          1 Reply Last reply Reply Quote 0
          • phildunlapP
            phildunlap
            last edited by

            Per the BACnet specification all devices on a network must be on the same port. So, to bridge networks you need a BBMD, which could be a BACnet router. The IpNetwork class does have support for behaving as a BBMD, but as Mango does not expose this functionality I have little experience with it. You can see there is an enableBBMD method, though: https://github.com/infiniteautomation/BACnet4J/blob/master/src/main/java/com/serotonin/bacnet4j/npdu/ip/IpNetwork.java#L991

            1 Reply Last reply Reply Quote 0
            • V
              Vihangi
              last edited by

              Thanks, Phildunlap !!

              1 Reply Last reply Reply Quote 0
              • V
                Vihangi
                last edited by Vihangi

                Hi Phildunlap,

                I am getting below error while reading log record of TrendLog Object.

                Error:
                Error: ErrorAPDU(errorClass=property, errorCode=read-access-denied,errorClass=property, errorCode=read-access-denied)

                Other Property Values are as below:
                Property:: acked-transitions Value :: EventTransitionBits [to-offnormal=true, to-fault=true, to-normal=true]
                Property:: align-intervals Value :: true
                Property:: buffer-size Value :: 50
                Property:: client-cov-increment Value :: ClientCov [entry=2.0]
                Property:: cov-resubscription-interval Value :: 200
                Property:: description Value :: EventEnrollment Object
                Property:: event-enable Value :: EventTransitionBits [to-offnormal=false, to-fault=true, to-normal=false]
                Property:: event-state Value :: normal
                Property:: event-time-stamps Value :: [TimeStamp [choice=DateTime [date=Date [year=255, month=UNSPECIFIED, day=255, dayOfWeek=UNSPECIFIED], time=255:255:255.255]], TimeStamp [choice=DateTime [date=Date [year=255, month=UNSPECIFIED, day=255, dayOfWeek=UNSPECIFIED], time=255:255:255.255]], TimeStamp [choice=DateTime [date=Date [year=255, month=UNSPECIFIED, day=255, dayOfWeek=UNSPECIFIED], time=255:255:255.255]]]
                Property:: interval-offset Value :: 100
                Property:: last-notify-record Value :: 1064
                Property:: log-device-object-property Value :: DeviceObjectPropertyReference [objectIdentifier=analog-output 12, propertyIdentifier=present-value, propertyArrayIndex=null, deviceIdentifier=device 105]
                Property:: enable Value :: true
                Property:: log-interval Value :: 100
                Property:: logging-type Value :: polled
                Property:: notification-class Value :: 19
                Property:: notification-threshold Value :: 100
                Property:: notify-type Value :: event
                Property:: object-identifier Value :: trend-log 26
                Property:: object-name Value :: EventEnrollment-Object
                Property:: object-type Value :: trend-log
                Property:: profile-name Value :: Default
                Property:: record-count Value :: 50
                Property:: records-since-notification Value :: 26
                Property:: start-time Value :: DateTime [date=Date [year=119, month=SEPTEMBER, day=27, dayOfWeek=FRIDAY], time=4:0:0.0]
                Property:: stop-time Value :: DateTime [date=Date [year=119, month=OCTOBER, day=4, dayOfWeek=FRIDAY], time=6:30:0.0]
                Property:: stop-when-full Value :: false
                Property:: total-record-count Value :: 1094

                Please help me with this.
                As I want to poll and read trend logs.

                1 Reply Last reply Reply Quote 0
                • phildunlapP
                  phildunlap
                  last edited by

                  Did you attempt to figure this out before you asked? Are you attempting to read the log buffer property? https://github.com/infiniteautomation/BACnet4J/blob/master/src/main/java/com/serotonin/bacnet4j/obj/TrendLogObject.java#L233

                  https://github.com/infiniteautomation/BACnet4J/blob/master/src/main/java/com/serotonin/bacnet4j/obj/logBuffer/LogBuffer.java#L8

                  1 Reply Last reply Reply Quote 0
                  • V
                    Vihangi
                    last edited by

                    Yes, I have tried to trigger it and it will work. But, with " logging-type Value = polled", it was not able to get a trend log.

                    With polling, it will generate below error:
                    ErrorAPDU(errorClass=property, errorCode=invalid-data-type,errorClass=property, errorCode=invalid-data-type) Error: ErrorAPDU(errorClass=property, errorCode=invalid-data-type,errorClass=property, errorCode=invalid-data-type), originalInvokeId=18

                    Read the output of log buffer property:
                    Error: ErrorAPDU(errorClass=property, errorCode=read-access-denied,errorClass=property, errorCode=read-access-denied)

                    Is there any configuration issue?

                    1 Reply Last reply Reply Quote 0
                    • V
                      Vihangi
                      last edited by

                      Still not able to read Log buffer values.
                      Got same Error:
                      ErrorAPDU(errorClass=property, errorCode=invalid-data-type,errorClass=property, errorCode=invalid-data-type) Error: ErrorAPDU(errorClass=property, errorCode=invalid-data-type,errorClass=property, errorCode=invalid-data-type), originalInvokeId=18

                      Please help me with this.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post