• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. kishorev

    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
    K
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    kishorev

    @kishorev

    0
    Reputation
    325
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    kishorev Unfollow Follow

    Latest posts made by kishorev

    • Timeout error - Bacnet4j is not able to read the ack message from the device

      If i run a test program i am getting an timeout error, i am using the latest version of bacnet4j from sourceforge...
      That is version 1.2 "http://sourceforge.net/projects/bacnet4j/files/bacnet4j/1.2/"
      Below is the program

      import java.net.InetAddress;
      import java.net.InetSocketAddress;

      import com.serotonin.bacnet4j.LocalDevice;
      import com.serotonin.bacnet4j.RemoteDevice;
      import com.serotonin.bacnet4j.event.DefaultDeviceEventListener;
      import com.serotonin.bacnet4j.service.acknowledgement.ReadPropertyAck;
      import com.serotonin.bacnet4j.service.confirmed.ReadPropertyRequest;
      import com.serotonin.bacnet4j.type.Encodable;
      import com.serotonin.bacnet4j.type.constructed.Address;
      import com.serotonin.bacnet4j.type.constructed.SequenceOf;
      import com.serotonin.bacnet4j.type.enumerated.ObjectType;
      import com.serotonin.bacnet4j.type.enumerated.PropertyIdentifier;
      import com.serotonin.bacnet4j.type.enumerated.Segmentation;
      import com.serotonin.bacnet4j.type.primitive.ObjectIdentifier;

      public class Test2 {
      public static void main(String[] args) throws Exception {
      LocalDevice localDevice = new LocalDevice(1968, "255.255.255.255");
      localDevice.getEventHandler().addListener(new Listener());
      localDevice.setPort(47808);
      localDevice.initialize();
      getObjectList(localDevice, "192.168.1.3", 0xBAC0, 260001);
      localDevice.terminate();
      }

      private static void getObjectList(LocalDevice localDevice, String ip, int port, int deviceId) throws Exception {
      	
          InetSocketAddress addr = new InetSocketAddress(InetAddress.getByName(ip), port);
          System.out.println(""+addr);
          ReadPropertyRequest read = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.device, deviceId),
                  PropertyIdentifier.objectList);
          Thread.sleep(1000);
          ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(addr, null, 1476, Segmentation.segmentedBoth, read);
          Thread.sleep(1000);
        
      
          System.out.println("IP: " + ip);
          SequenceOf<ObjectIdentifier> oids = (SequenceOf<ObjectIdentifier>) ack.getValue();
          for (ObjectIdentifier oid : oids)
          System.out.println("    " + oid);  
      }
      
      static class Listener extends DefaultDeviceEventListener {
          @Override
          public void iAmReceived(RemoteDevice d) {
              System.out.println("IAm received" + d);
          }
      }
      

      }

      Everytime if i run this program i am getting the Timeout error:

      Exception in thread "main" com.serotonin.bacnet4j.exception.BACnetTimeoutException: Timeout while waiting for response for id 0
      at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.send(IpMessageControl.java:314)
      at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.send(IpMessageControl.java:249)
      at com.serotonin.bacnet4j.LocalDevice.send(LocalDevice.java:480)
      at Test2.getObjectList(Test2.java:44)
      at Test2.main(Test2.java:29)

      Able to see the response from the device using wireshark and since bacnet4j is not able to receive the complex ack from the device it will be keep polling and finally timeout error will be thrown..

      Even i tried using the latest code available in CVS --->"http://bacnet4j.cvs.sourceforge.net/viewvc/bacnet4j/BACnet4J/" but still the same error results. Can you please help is there something wrong i am doing?
      Can you please resolve this issue :roll:


      I am finding this issue more on WIFI network not wired, with wired network some times it works fine

      posted in BACnet4J general discussion
      K
      kishorev
    • RE: Timeout error - Bacnet4j is not able to read the ack message from the device

      If i run a test program i am getting an timeout error, i am using the latest version of bacnet4j from sourceforge...
      That is version 1.2 "http://sourceforge.net/projects/bacnet4j/files/bacnet4j/1.2/"
      Below is the program

      import java.net.InetAddress;
      import java.net.InetSocketAddress;

      import com.serotonin.bacnet4j.LocalDevice;
      import com.serotonin.bacnet4j.RemoteDevice;
      import com.serotonin.bacnet4j.event.DefaultDeviceEventListener;
      import com.serotonin.bacnet4j.service.acknowledgement.ReadPropertyAck;
      import com.serotonin.bacnet4j.service.confirmed.ReadPropertyRequest;
      import com.serotonin.bacnet4j.type.Encodable;
      import com.serotonin.bacnet4j.type.constructed.Address;
      import com.serotonin.bacnet4j.type.constructed.SequenceOf;
      import com.serotonin.bacnet4j.type.enumerated.ObjectType;
      import com.serotonin.bacnet4j.type.enumerated.PropertyIdentifier;
      import com.serotonin.bacnet4j.type.enumerated.Segmentation;
      import com.serotonin.bacnet4j.type.primitive.ObjectIdentifier;

      public class Test2 {
      public static void main(String[] args) throws Exception {
      LocalDevice localDevice = new LocalDevice(1968, "255.255.255.255");
      localDevice.getEventHandler().addListener(new Listener());
      localDevice.setPort(47808);
      localDevice.initialize();
      getObjectList(localDevice, "192.168.1.3", 0xBAC0, 260001);
      localDevice.terminate();
      }

      private static void getObjectList(LocalDevice localDevice, String ip, int port, int deviceId) throws Exception {
      	
          InetSocketAddress addr = new InetSocketAddress(InetAddress.getByName(ip), port);
          System.out.println(""+addr);
          ReadPropertyRequest read = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.device, deviceId),
                  PropertyIdentifier.objectList);
          Thread.sleep(1000);
          ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(addr, null, 1476, Segmentation.segmentedBoth, read);
          Thread.sleep(1000);
        
      
          System.out.println("IP: " + ip);
          SequenceOf<ObjectIdentifier> oids = (SequenceOf<ObjectIdentifier>) ack.getValue();
          for (ObjectIdentifier oid : oids)
          System.out.println("    " + oid);  
      }
      
      static class Listener extends DefaultDeviceEventListener {
          @Override
          public void iAmReceived(RemoteDevice d) {
              System.out.println("IAm received" + d);
          }
      }
      

      }

      Everytime if i run this program i am getting the Timeout error:

      Exception in thread "main" com.serotonin.bacnet4j.exception.BACnetTimeoutException: Timeout while waiting for response for id 0
      at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.send(IpMessageControl.java:314)
      at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.send(IpMessageControl.java:249)
      at com.serotonin.bacnet4j.LocalDevice.send(LocalDevice.java:480)
      at Test2.getObjectList(Test2.java:44)
      at Test2.main(Test2.java:29)

      Able to see the response from the device using wireshark and since bacnet4j is not able to receive the complex ack from the device it will be keep polling and finally timeout error will be thrown..

      Even i tried using the latest code available in CVS --->"http://bacnet4j.cvs.sourceforge.net/viewvc/bacnet4j/BACnet4J/" but still the same error results. Can you please help is there something wrong i am doing?
      Can you please resolve this issue :roll:


      I am finding this issue more on WIFI network not wired, with wired network some times it works fine

      posted in BACnet4J general discussion
      K
      kishorev