• 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

    Problem with Read Property Request

    BACnet4J general discussion
    2
    18
    7.4k
    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.
    • M
      mlohbihler
      last edited by

      Ok, but can you post the stack trace? I assume the line numbers are different now.

      Best regards,
      Matthew

      1 Reply Last reply Reply Quote 0
      • D
        decora
        last edited by

        Yes, the line numbers are different.
        This is the stack trace:

        
        Exception in thread "main" java.lang.NullPointerException
        	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.send(IpMessageControl.java:226)
        	at com.serotonin.bacnet4j.LocalDevice.send(LocalDevice.java:480)
        	at com.serotonin.bacnet4j.LocalDevice.send(LocalDevice.java:470)
        	at com.serotonin.bacnet4j.LocalDevice.send(LocalDevice.java:463)
        	at Prova_B4J.main(Prova_B4J.java:143)
        
        
        1 Reply Last reply Reply Quote 0
        • M
          mlohbihler
          last edited by

          Your remote device has a segmentationSupported value of null. Normally you wouldn't instantiate your own RemoteDevice objects, BTW. An IAm (resulting from a WhoIs broadcast) is the typical means of instantiation. A "manual" way to get remote devices is to use the LocalDevice.findRemoteDevice method.

          Best regards,
          Matthew

          1 Reply Last reply Reply Quote 0
          • D
            decora
            last edited by

            I tried your solutions, but there are other problems.
            If I use:

            
            remoteDevice=localDevice.findRemoteDevice( new Address(new byte[] { (byte) 192, (byte) 168, (byte) 1, (byte) 112 },0xBAC0 ), null, 1);
            
            

            eclipse return this exception:

            
            Exception in thread "main" com.serotonin.bacnet4j.exception.BACnetException: java.lang.NullPointerException
            	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.sendImpl(IpMessageControl.java:377)
            	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.send(IpMessageControl.java:302)
            	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.send(IpMessageControl.java:248)
            	at com.serotonin.bacnet4j.LocalDevice.send(LocalDevice.java:480)
            	at com.serotonin.bacnet4j.LocalDevice.send(LocalDevice.java:470)
            	at com.serotonin.bacnet4j.LocalDevice.findRemoteDevice(LocalDevice.java:1047)
            	at Prova_B4J_2.main(Prova_B4J_2.java:57)
            Caused by: java.lang.NullPointerException
            	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.sendImpl(IpMessageControl.java:374)
            	... 6 more
            
            

            If I use:

            
            localDevice.sendBroadcast(0xBAC0,new WhoIsRequest(null,null));
            
            

            eclipse return:

            
            Exception in thread "main" com.serotonin.bacnet4j.exception.BACnetException: java.lang.NullPointerException
            	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.sendImpl(IpMessageControl.java:377)
            	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.sendBroadcast(IpMessageControl.java:359)
            	at com.serotonin.bacnet4j.LocalDevice.sendBroadcast(LocalDevice.java:520)
            	at Prova_B4J_2.main(Prova_B4J_2.java:59)
            Caused by: java.lang.NullPointerException
            	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.sendImpl(IpMessageControl.java:374)
            	... 3 more
            
            
            1 Reply Last reply Reply Quote 0
            • M
              mlohbihler
              last edited by

              Did you initialize the local device before sending those requests?

              Best regards,
              Matthew

              1 Reply Last reply Reply Quote 0
              • D
                decora
                last edited by

                Perfect!! Thnak you very, but very very very much for the help!

                I have only another questions...If I send an I-am message from VTS to instantiate the remote device in my java program, I have no problem ... but if I send it from another java program (always based on bacnet4j), eclipse returns this exception when I send the ReadPropertyRequest:

                
                Exception in thread "main" com.serotonin.bacnet4j.exception.ErrorAPDUException: ErrorAPDU(choice=5, errorClass=Object, errorCode=Unknown object)
                	at com.serotonin.bacnet4j.LocalDevice.send(LocalDevice.java:489)
                	at com.serotonin.bacnet4j.LocalDevice.send(LocalDevice.java:470)
                	at com.serotonin.bacnet4j.LocalDevice.send(LocalDevice.java:463)
                	at Prova_B4J_2.main(Prova_B4J_2.java:106)
                
                
                1 Reply Last reply Reply Quote 0
                • M
                  mlohbihler
                  last edited by

                  Your BACnet4J device does not have the object you are looking for. You need to create a BACnet object with the correct properties, and then add it to the local device.

                  Best regards,
                  Matthew

                  1 Reply Last reply Reply Quote 0
                  • D
                    decora
                    last edited by

                    Thank you mlohbihler! You have been my salvation!

                    1 Reply Last reply Reply Quote 0
                    • M
                      mlohbihler
                      last edited by

                      Glad to help. Buy a license. :)

                      Best regards,
                      Matthew

                      1 Reply Last reply Reply Quote 0
                      • D
                        decora
                        last edited by

                        :wink:

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