• 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

    Help for bacnet and bacnet4J

    BACnet4J general discussion
    4
    21
    31.1k
    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

      Can you use wireshark to try and figure out what's going on? At least to produce some message traces?

      Best regards,
      Matthew

      1 Reply Last reply Reply Quote 0
      • I
        ilyass
        last edited by

        Hi,

        I found the solution of my problem. On VTS I configured the network as remote network but i test in local network. So i changed it and now i receive informations from my application

        Thank you for your help.

        Just an other question, i have this exception when i send UnconfirmedTextMessage via VTS :

        
        
        com.serotonin.bacnet4j.exception.BACnetException: Error while creating APDU: 
        	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl$IncomingMessageExecutor.runImpl(IpMessageControl.java:501)
        	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl$IncomingMessageExecutor.run(IpMessageControl.java:455)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        	at java.lang.Thread.run(Thread.java:619)
        Caused by: com.serotonin.bacnet4j.exception.BACnetException: java.lang.reflect.InvocationTargetException
        	at com.serotonin.bacnet4j.type.Encodable.read(Encodable.java:174)
        	at com.serotonin.bacnet4j.type.Encodable.read(Encodable.java:186)
        	at com.serotonin.bacnet4j.type.constructed.Choice.read(Choice.java:65)
        	at com.serotonin.bacnet4j.type.constructed.Choice.<init>(Choice.java:54)
        	at com.serotonin.bacnet4j.service.unconfirmed.UnconfirmedTextMessageRequest.<init>(UnconfirmedTextMessageRequest.java:100)
        	at com.serotonin.bacnet4j.service.unconfirmed.UnconfirmedRequestService.createUnconfirmedRequestService(UnconfirmedRequestService.java:46)
        	at com.serotonin.bacnet4j.apdu.UnconfirmedRequest.<init>(UnconfirmedRequest.java:62)
        	at com.serotonin.bacnet4j.apdu.APDU.createAPDU(APDU.java:38)
        	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl$IncomingMessageExecutor.runImpl(IpMessageControl.java:498)
        	... 4 more
        Caused by: java.lang.reflect.InvocationTargetException
        	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        	at com.serotonin.bacnet4j.type.Encodable.read(Encodable.java:171)
        	... 12 more
        Caused by: com.serotonin.bacnet4j.exception.BACnetErrorException: 29
        	at com.serotonin.bacnet4j.type.primitive.CharacterString.validateEncoding(CharacterString.java:138)
        	at com.serotonin.bacnet4j.type.primitive.CharacterString.<init>(CharacterString.java:80)
        	... 17 more
        
        

        do you know why ?

        thanks

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

          The character encoding you are using is not recognized. The reference value is 29, but the only valid values AFAIK are:

              public interface Encodings {
                  byte ANSI_X3_4 = 0;
                  byte IBM_MS_DBCS = 1;
                  byte JIS_C_6226 = 2;
                  byte ISO_10646_UCS_4 = 3;
                  byte ISO_10646_UCS_2 = 4;
                  byte ISO_8859_1 = 5;
              }
          
          

          Can you provide a trace of the message?

          Best regards,
          Matthew

          1 Reply Last reply Reply Quote 0
          • I
            ilyass
            last edited by

            With VTS, when i sent UnconfirmedTextMessage, i specified a numeric class witch doesn't exists, so my application throws exception

            thank you for your help

            Attachment: download link

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

              Code changes have been made so that a more informative error message is provided.

              Best regards,
              Matthew

              1 Reply Last reply Reply Quote 0
              • I
                ilyass
                last edited by

                Hi,

                I have a question about SubscribeCOVRequest; it is possible to make the subscription COV for all time and not for a specific lifetime ?

                thanks for help

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

                  From the spec:

                  13.14.1.5 Lifetime

                  This parameter, of type Unsigned, shall convey the desired lifetime of the subscription in seconds. A value of zero shall
                  indicate an indefinite lifetime, without automatic cancellation. A non-zero value shall indicate the number of seconds that
                  may elapse before the subscription shall be automatically cancelled. If both the 'Issue Confirmed Notifications' and 'Lifetime'
                  parameters are absent, then this shall indicate a cancellation request. If the 'Lifetime' parameter is present then the 'Issue
                  Confirmed Notifications' parameter shall be present.

                  Best regards,
                  Matthew

                  1 Reply Last reply Reply Quote 0
                  • I
                    ilyass
                    last edited by

                    Hi,

                    I have a problem with a new ObjectType that i added, it's CREDENTIAL_INPUT

                    when i execute
                    for each propertyReference i do

                    Encodable encodable = props.getNoErrorCheck(oid, pr);
                    

                    pr is **PropertyReference **and props is PropertyValues and oid is my ObjectIdentifier

                    the result is

                    type.toString()=Credential Input
                    +pr.toString()=Object name--AmbiguousValue
                    +encodable.toString()=Ambiguous([75,e,0,4f,54,45,53,20,52,45,41,44,45,52,20,31])
                    +pr.toString()=Object identifier--AmbiguousValue
                    +objectIdentifier=Ambiguous([c4,9,40,40,0])
                    +pr.toString()=Object type--AmbiguousValue
                    +pr.toString()=Description--AmbiguousValue
                    +pr.toString()=Present value--AmbiguousValue
                    +pr.toString()=Status flags--AmbiguousValue
                    +pr.toString()=Reliability--AmbiguousValue
                    +pr.toString()=Out of service--AmbiguousValue
                    +pr.toString()=Update time--AmbiguousValue
                    updateTime=Ambiguous([])
                    +pr.toString()=Profile name--AmbiguousValue
                    instanceNumber=16384
                    

                    Do you have an Idea ?

                    thanks for help

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

                      Did you define the object type with all of its attributes in com.serotonin.bacnet4j.obj.ObjectProperties?

                      Best regards,
                      Matthew

                      1 Reply Last reply Reply Quote 0
                      • I
                        ilyass
                        last edited by

                        Hi,

                        Thanks for your help, i didn't do that

                        It works know

                        1 Reply Last reply Reply Quote 0
                        • I
                          ilyass
                          last edited by

                          Hi,

                          I have always the same problem with the subscriptionCOV service. I want to make it without cancellation. So from the spec we have :

                          13.14.1.5 Lifetime

                          This parameter, of type Unsigned, shall convey the desired lifetime of the subscription in seconds. A value of zero shall
                          indicate an indefinite lifetime, without automatic cancellation. A non-zero value shall indicate the number of seconds that
                          may elapse before the subscription shall be automatically cancelled. If both the 'Issue Confirmed Notifications' and 'Lifetime'
                          parameters are absent, then this shall indicate a cancellation request. If the 'Lifetime' parameter is present then the 'Issue
                          Confirmed Notifications' parameter shall be present.
                          So i put this

                          
                          SubscribeCOVRequest service = new SubscribeCOVRequest(
                          					new UnsignedInteger(1), objectIdentifier,
                          					new Boolean(true), new UnsignedInteger(0));
                          try {
                                  localDevice.send(remoteDevice, service);
                          	log.info("subsciption of " + objectIdentifier.getObjectType()
                          						+ "-" + objectIdentifier.getInstanceNumber() + " done");
                          } catch (BACnetException e) {
                          	log.error("unable to send <SubscribeCOVRequest> for the Object "
                          		+ objectIdentifier.getObjectType()+  "-"+objectIdentifier.getInstanceNumber()+ "\t"+ e.getMessage());
                          }
                          
                          

                          I tested lifetime = null, but it doesn't work

                          thanks for help

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

                            I tested lifetime = null, but it doesn't work

                            You mean the request fails? If so, can you provide details of the BACnet exception?

                            Or do you mean that the subscription still expires? This may be due to the equipment to which you are sending the request. Or maybe not.

                            Best regards,
                            Matthew

                            1 Reply Last reply Reply Quote 0
                            • I
                              ilyass
                              last edited by

                              I mean that the notification doesn't work, but no exception is made.

                              when i send this subscription, i received just one time the notification.

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

                                Still don't understand. If you received any notification at all, doesn't that mean the subscription worked, at least for some time?

                                Best regards,
                                Matthew

                                1 Reply Last reply Reply Quote 0
                                • J
                                  jeremie
                                  last edited by

                                  Hi,

                                  I think I have an idea what Ilyass tries to mean :

                                  when he uses COV on an object with a lifetime greater than 0, he receives correcty events when the PresentValue of the COVing object changes.

                                  But when he tries with a lifetime equals to 0 (no timeout for COV subscription), he catchs only one time the COV event.

                                  For information, in Mango, the point COVing mechanism is configure with a lifetime greather than 0 : you use COV for a certain time, and when this time is finished, you COV again. Have you got a reason to do this, instead of use a lifetime of 0?

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

                                    It works fine for me. But let's be sure we're talking about the same thing...

                                    In my tests i used BACnet4J as subscriber and subscribee. The subscriber sent the following request:

                                                ObjectIdentifier oid = new ObjectIdentifier(ObjectType.binaryInput, 0);
                                                SubscribeCOVRequest req = new SubscribeCOVRequest(new UnsignedInteger(0), oid, new Boolean(true),
                                                        new UnsignedInteger(0));
                                    
                                    

                                    ... received regular COV notifications from the subscribee. (Specifically, the test code is SimpleSubscriptionClient and SlaveDeviceTest, both of which are now checked into the CVS.

                                    Note that COV subscriptions are only supported by certain object types, as enumerated in the static code block in ObjectCovSubscription (notably excuding analog objects).

                                    Best regards,
                                    Matthew

                                    1 Reply Last reply Reply Quote 0
                                    • J
                                      jeremie
                                      last edited by

                                      Thank for your SimpleSubscriptionClient test file :)
                                      Maybe you can add the unsubscribe code (because COV is done with an indefinite lifetime) :

                                      
                                      localDevice.send(d, new SubscribeCOVRequest(new UnsignedInteger(0), oid, null, null));
                                      
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • M
                                        mlohbihler
                                        last edited by

                                        Good point. And i never answered your question...

                                        For information, in Mango, the point COVing mechanism is configure with a lifetime greather than 0 : you use COV for a certain time, and when this time is finished, you COV again. Have you got a reason to do this, instead of use a lifetime of 0?

                                        Infinite subscription lifetimes are convenient, but in practice they are problematic. Say the subscriber sends a 0 (infinite) lifetime. As far as it is concerned it will get COVs until it unsubscribes. But if the subscribee suffers a power failure it will likely lose the subscription, the COV notifications will stop, and the subscriber will never be the wiser.

                                        Conversely, if the subscriber restarts unexpectedly, the subscribee will continue to send notifications that will never be received (worst case).

                                        Using finite lease times and regular resubscriptions isn't a perfect solution to power failure (et al) situations, but it at least tends toward system stability.

                                        Best regards,
                                        Matthew

                                        1 Reply Last reply Reply Quote 0
                                        • R
                                          R-GiGgS84
                                          last edited by

                                          hi there, i am currently working on a way to retrieve information from a bacnet object if there are changes. Can anyone guide me on how this can be done or is there any sample for me to understand it?

                                          Thanks in advance! :)

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