• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. Valter Henrique
    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
    V
    • Profile
    • Following 0
    • Followers 0
    • Topics 8
    • Posts 38
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by Valter Henrique

    • RE: Not understand how to know the objectType value

      @mlohbihler said:

      Use read property requests with the present value property identifier.

      I did as you said :

          public String getPresentValue(LocalDevice localDevice, ObjectIdentifier oid) throws Exception {
              ReadPropertyRequest rpr = new ReadPropertyRequest(oid, PropertyIdentifier.presentValue);
              ReadPropertyAck rpa = (ReadPropertyAck) localDevice.send(isa, null, 1476, Segmentation.segmentedReceive, rpr);
      
              SequenceOf<ObjectIdentifier> sOis = (SequenceOf<ObjectIdentifier>) rpa.getValue();
      
              List<ObjectIdentifier> ois = new ArrayList<ObjectIdentifier>();
              for (ObjectIdentifier oi : sOis) {
                  System.out.println("--> " + oi.getObjectType().intValue());
              }
              
              
              return rpa.getValue().toString();
          }
      

      But it gives this follow error:

      java.lang.ClassCastException: com.serotonin.bacnet4j.type.primitive.Real cannot be cast to com.serotonin.bacnet4j.type.constructed.SequenceOf
      	at brainset.bacnet4j.Supervisory.getPresentValue(Supervisory.java:123)
      

      What I'm trying to do is scan my device and know what kind of points I have, if is a analog output, analog input, etc.
      And store these points values in my List<...>.

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: Not understand how to know the objectType value

      @mlohbihler said:

      Valter,

      You are incorrect in thinking that an analog can only be an input or an output. There are three possible analog types: input, output, and value. Your object is a value.
      Ow, got it mlohbihler.

      There's some way to get the values from the input and output objects ?

      This is how I'm doing to get these values :

          private List&lt;ObjectIdentifier&gt; getListObjectIdentifier(LocalDevice localDevice) throws Exception {
              ReadPropertyRequest rpr = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.device, deviceID), PropertyIdentifier.objectList);
              ReadPropertyAck rpa = (ReadPropertyAck) localDevice.send(isa, null, 1476, Segmentation.segmentedBoth, rpr);
      
              SequenceOf&lt;ObjectIdentifier&gt; sOis = (SequenceOf&lt;ObjectIdentifier&gt;) rpa.getValue();
      
              List&lt;ObjectIdentifier&gt; ois = new ArrayList&lt;ObjectIdentifier&gt;();
              for (ObjectIdentifier oi : sOis) {
                  ois.add(oi);
              }
      
              return ois;
          }
      
      
      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: Not understand how to know the objectType value

      @mlohbihler said:

      That object, "oi", is not an "output" or an "input"; it is a "value", which is a valid third type of bacnet input. "Value"s are basically both input and output.
      So, what should I do to get the exact type of the object ?
      I mean, how do I know if is a analog output or analog input ?

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • Not understand how to know the objectType value

      I have some objects that I must to know which is the exactly the value of this object, if it's analog OUTPUT or analog INPUT, got it ?

      For example:
      If you I did this :

                  System.out.println("oi.getObjectType().intValue(): " + oi.getObjectType().intValue());
                  
                  System.out.println("ObjectType.analogOutput.intValue(): " + ObjectType.analogOutput.intValue());
                  System.out.println("ObjectType.analogInput.intValue(): " + ObjectType.analogInput.intValue());
                  System.out.println("ObjectType.analogValue.intValue(): " + ObjectType.analogValue.intValue());
      

      Which the answer gonna be:

      oi.getObjectType().intValue(): 2
      ObjectType.analogOutput.intValue(): 1
      ObjectType.analogInput.intValue(): 0
      ObjectType.analogValue.intValue(): 2
      

      But I need to know if is OUTPUT (1) or INPUT (0).
      How can I do that ?

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: Not understand how to know the objectType value

      I have some objects that I must to know which is the exactly the value of this object, if it's analog OUTPUT or analog INPUT, got it ?

      For example:
      If you I did this :

                  System.out.println("oi.getObjectType().intValue(): " + oi.getObjectType().intValue());
                  
                  System.out.println("ObjectType.analogOutput.intValue(): " + ObjectType.analogOutput.intValue());
                  System.out.println("ObjectType.analogInput.intValue(): " + ObjectType.analogInput.intValue());
                  System.out.println("ObjectType.analogValue.intValue(): " + ObjectType.analogValue.intValue());
      

      Which the answer gonna be:

      oi.getObjectType().intValue(): 2
      ObjectType.analogOutput.intValue(): 1
      ObjectType.analogInput.intValue(): 0
      ObjectType.analogValue.intValue(): 2
      

      But I need to know if is OUTPUT (1) or INPUT (0).
      How can I do that ?

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: How communicate to a remote device ?

      In the end I created a server (which runs in the computer that's locally placed in my network) and then communicate via socket.

      Until I found out how implement a RemoteDevice that you said, thanks mlohbihler.

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: How communicate to a remote device ?

      @mlohbihler said:

      I don't think so, but it's not hard. The only trick is that you need to know the instance id of the device.

      RemoteDevice rd = new RemoteDevice(...);
      localDevice.addRemoteDevice(rd); // This may not actually be necessary
      localDevice.send(rd, myRequest);
      

      Where "myRequest" is, say, a read property with pid of objectList. If your setting are correct, you should get the object list of the remote device.

      I found the id of my device, it's 101, but I have some doubts about it :

          public static void main(String[] args) throws Exception {
              // How to initialize the LocalDevice ?
              LocalDevice ld = new LocalDevice (???);
      
              // let's say my ip is : 1.2.3.4, is this correct ?
          	RemoteDevice rd = new RemoteDevice(101, new Address(new byte[] { (byte) 1, (byte) 2, 3, (byte) 4 }, 47808), null);
              ld.addRemoteDevice(rd);
      
              // now I have the remote device, in the localDevice, now I should be able to use the method 'getObjectList()' ?
             
              // how to use this 'myRequest' (I don't understand what you said about it ) ?
              localDevice.send(rd, myRequest);
              ...
      }
      
      
      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: How communicate to a remote device ?

      @mlohbihler said:

      Hi Valter,

      What do you mean by remote? I suspect you mean a device with which you cannot exchange a WhoIs/IAm, but please confirm.

      If this is the case, you will need to manually instantiate a RemoteDevice by explicitly providing the IP, port, and instance id. Then, you will be able to send messages to it.

      Regarding using a domain name, BACnet only deals with IP addresses, so you will need to handle domain name resolution yourself.

      I mean, a device that is not in my network.
      There's some example in the test folder that could use for that ?

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: How to get the objects in the remote device?

      Pine,
      I'm trying to read value using bacnet4j too.

      Could you please tell which code do you use to do that ?
      I did this locally, but not remotely.

      Thank you very much.

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: Constructor for Network and RemoteDevice

      @drubin said:

      There are many lost souls out there with this basic question. Can someone please answer?
      Drubin, there's some place where we could find some documentation about bacnet4j ?

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • How communicate to a remote device ?

      Hi,
      I made a local device communicate with my application.
      But how do I make to communicate to a remote device ?

      Is possible to do this using ip or dns ? (because the ip changes sometimes).

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: How communicate to a remote device ?

      Hi,
      I made a local device communicate with my application.
      But how do I make to communicate to a remote device ?

      Is possible to do this using ip or dns ? (because the ip changes sometimes).

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: Encodable not found ?

      @mlohbihler said:

      You'll need to check the class path of your jsf context, which is no doubt different than that of your application.

      The problem was that I do not put the .jars in the WEB-INF/lib folder.

      Thanks mlohbihler.

      By the way, you make a great job doing bacnet4j, thanks dude.

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: Encodable not found ?

      Hi,
      I'm trying to use bacnet4j with JSF.

      I build an application in .java which turn on/off a lamp, but if I try to call the same method from a JSF page, gives me :

      type Exception report
      
      message
      
      descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
      
      exception
      
      javax.servlet.ServletException: com/serotonin/bacnet4j/type/Encodable
      root cause
      
      java.lang.NoClassDefFoundError: com/serotonin/bacnet4j/type/Encodable
      root cause
      
      java.lang.ClassNotFoundException: com.serotonin.bacnet4j.type.Encodable
      

      But I'm pretty sure that the class is there, because if not my java application don't work, right ?

      Any idea why this is happening ?

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • Encodable not found ?

      Hi,
      I'm trying to use bacnet4j with JSF.

      I build an application in .java which turn on/off a lamp, but if I try to call the same method from a JSF page, gives me :

      type Exception report
      
      message
      
      descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
      
      exception
      
      javax.servlet.ServletException: com/serotonin/bacnet4j/type/Encodable
      root cause
      
      java.lang.NoClassDefFoundError: com/serotonin/bacnet4j/type/Encodable
      root cause
      
      java.lang.ClassNotFoundException: com.serotonin.bacnet4j.type.Encodable
      

      But I'm pretty sure that the class is there, because if not my java application don't work, right ?

      Any idea why this is happening ?

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: Fire Alarm trigger and send informaton to notify the client software

      Get the information from your point then verify if match with what you understand the is 'on fire' then send your message to the client software.

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: How to know the type of the object ?

      sorry taking so long to reply friend. (I was involved in another project, but now returning to bacnet4j )

      I try what you suggest but it just told me the value of the binary and the analog, which is :

      Object type || value
      Device : 8
      Analog Value : 2
      Binary Value : 5

      What I need is a little more specific, how to know the int value of a binary input for example ?

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • How to know the type of the object ?

      Hi everyone,
      i was thinking how to know if the object is 'analog output' or 'analog input' ? the same to binary type.

      in Test2.java you can :

      
          private static void getObjectList(LocalDevice localDevice, String ip, int port, int deviceId) throws Exception {
              InetSocketAddress addr = new InetSocketAddress(InetAddress.getByName(ip), port);
              ReadPropertyRequest read = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.device, deviceId), PropertyIdentifier.objectList);
              ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(addr, null, 1476, Segmentation.segmentedBoth, read);
      
              System.out.println("IP: " + ip);
              SequenceOf<ObjectIdentifier> oids = (SequenceOf<ObjectIdentifier>) ack.getValue();
              for (ObjectIdentifier oid : oids)
                  System.out.println("    " + oid);
          }
      
      

      But if i try get only the analogOutput like this:

      
          private static void getAnalogOutputList(LocalDevice localDevice, String ip, int port, int deviceId) throws Exception {
              InetSocketAddress addr = new InetSocketAddress(InetAddress.getByName(ip), port);
              ReadPropertyRequest read = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.analogOutput, deviceId), PropertyIdentifier.presentValue);
              ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(addr, null, 1476, Segmentation.segmentedBoth, read);
              
              System.out.println("IP: " + ip);
              SequenceOf<ObjectIdentifier> oids = (SequenceOf<ObjectIdentifier>) ack.getValue();
              for (ObjectIdentifier oid : oids) {
                  System.out.println("    " + oid);
              }
          }
      
      

      Launch a exception:

      ErrorAPDU(choice=12, errorClass=Object, errorCode=Unknown object)

      Could anyone help me with this ?

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: How to know the type of the object ?

      Hi everyone,
      i was thinking how to know if the object is 'analog output' or 'analog input' ? the same to binary type.

      in Test2.java you can :

      
          private static void getObjectList(LocalDevice localDevice, String ip, int port, int deviceId) throws Exception {
              InetSocketAddress addr = new InetSocketAddress(InetAddress.getByName(ip), port);
              ReadPropertyRequest read = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.device, deviceId), PropertyIdentifier.objectList);
              ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(addr, null, 1476, Segmentation.segmentedBoth, read);
      
              System.out.println("IP: " + ip);
              SequenceOf<ObjectIdentifier> oids = (SequenceOf<ObjectIdentifier>) ack.getValue();
              for (ObjectIdentifier oid : oids)
                  System.out.println("    " + oid);
          }
      
      

      But if i try get only the analogOutput like this:

      
          private static void getAnalogOutputList(LocalDevice localDevice, String ip, int port, int deviceId) throws Exception {
              InetSocketAddress addr = new InetSocketAddress(InetAddress.getByName(ip), port);
              ReadPropertyRequest read = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.analogOutput, deviceId), PropertyIdentifier.presentValue);
              ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(addr, null, 1476, Segmentation.segmentedBoth, read);
              
              System.out.println("IP: " + ip);
              SequenceOf<ObjectIdentifier> oids = (SequenceOf<ObjectIdentifier>) ack.getValue();
              for (ObjectIdentifier oid : oids) {
                  System.out.println("    " + oid);
              }
          }
      
      

      Launch a exception:

      ErrorAPDU(choice=12, errorClass=Object, errorCode=Unknown object)

      Could anyone help me with this ?

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: How read and write values from local devices ?

      @Valter Henrique said:

      Hi everyone,

      i need to read the values of my objects, i only can read the instance number:

      
         private static void getObjectList(LocalDevice localDevice, String ip, int port, int deviceId, float value) throws Exception {
             InetSocketAddress addr = new InetSocketAddress(InetAddress.getByName(ip), port);
             ReadPropertyRequest read = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.device, deviceId), PropertyIdentifier.objectList);
             ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(addr, null, 1476, Segmentation.segmentedBoth, read);
      
             System.out.println("IP: " + ip);
             SequenceOf<ObjectIdentifier> oids = (SequenceOf<ObjectIdentifier>) ack.getValue();
      
             int i = 0;
             for (ObjectIdentifier oid : oids) {
                 System.out.println("--------  " + oid.getInstanceNumber());
             }
      
         }
      
      

      But how read the value of each object ?
      For example, i would like to read '15' from my analog output object, o true or false from my digital values and go on.
      image

      I try to write this code:

      
             InetSocketAddress addr = new InetSocketAddress(InetAddress.getByName(ip), port);
             ReadPropertyRequest read = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.analogOutput, deviceId), PropertyIdentifier.priorityArray);
             ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(addr, null, 1476, Segmentation.segmentedBoth, read);
             PriorityArray priorityArray = (PriorityArray) ack.getValue();
      
             float priority = priorityArray.get(16).getRealValue().floatValue();
             System.out.println("priorityArray = " + priority);
      
      

      But is not working.

      Could anyone help me with this please ?

      Best regards,
      Valter Henrique.

      Hi, someone could help me with this please ?

      mlohbihler , could you help me, please ?

      Thanks in advance.

      posted in BACnet4J general discussion
      V
      Valter Henrique