• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. ealebie
    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
    E
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Getting remote device by using device IP Address and not sending broadcast??

      Hi Phildunlap,

      Thanks, that helped. I ran different tests. There are devices from different vendors in the Bacnet network, I realised all the other Vendor devices except the ones I was interest in, Lutron, would respond to the broadcast. But I needed to register as a foreign device for the Lutron devices to respond back, but it only resonds 50% of the time, other 50 it times out.

      This is the output I get now when it works:

      RemoteDevice(instanceNumber=1761053, address=Address [networkNumber=3004, macAddress=[0,0,0,1a,df,1d]], maxAPDULengthAccepted=1476, segmentationSupported=no-segmentation, vendorId=176, vendorName=null, name=Superior Conference Room 1761053, servicesSupported=[false, false, false, false, false, true, false, false, false, false, false, false, true, false, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, false, false, false, false, false])

      I'm supposed to be printing out the present value for the Occupancy state Object, but the getObject returns null. looks like I'm using the right objectype and instance. Not sure what I'm doing wrong, any hints or help would be appriciated.

      Thanks!

      /Alex

      Here is the Device info from BQT:

      0_1519683602281_ecae175b-0835-42b3-b1be-332d870c4861-image.png

      	    	int instance = Integer.parseInt(args[0]);    	
      	    	int timeout = Integer.parseInt(args[1]);
      	
      	        Integer deviceId = 1234;    	
      	        int port = 0xBAC0;
      	
      		String localBindAddress = "10.116.189.90";  	
      	
      	        IpNetworkBuilder builder = new IpNetworkBuilder();    	
      	        builder.withPort(port);    	
      	        builder.withLocalBindAddress(localBindAddress);    	
      	        builder.withBroadcast("10.116.189.127", 26);
                      IpNetwork network = builder.build();  	
      
      	
      	        LocalDevice localDevice = new LocalDevice(deviceId, new DefaultTransport(network));    	
      	        
      	        try {
      	            localDevice.initialize();    	
      	            network.registerAsForeignDevice(new java.net.InetSocketAddress(localBindAddress, 0xBAC0), 60);
      	        } catch (Exception e) {    	
      	        	System.out.println("Unable to initialize localDevice");    	
      	            e.printStackTrace();	    	
      	        }    	        
      	
      	        RemoteDevice rd = null;    	    	        
      	
      		try {    	
      			rd = localDevice.getRemoteDeviceBlocking(instance, timeout);    	
      		} catch (BACnetException e) {    	
      			// TODO Auto-generated catch block    	
      			System.out.println("Unable to find device: "+ instance);    	
      			e.printStackTrace();    	
      			System.exit(1);    	
      		}    	    	        
      	
      		System.out.println("");    	
      		System.out.println(rd.toExtendedString());   	    	        
      	
      	        RemoteObject ro = rd.getObject(new ObjectIdentifier(19,8));    	
      	        if (ro != null)    	
      	        {    	
      	        	Encodable value = ro.getProperty(PropertyIdentifier.presentValue);    	
      	        	System.out.println(ro.getObjectName() +  " present value = " + value);    	
      	        }    	    	        
      	
      	        System.exit(0);
      
      posted in BACnet4J general discussion
      E
      ealebie
    • Getting remote device by using device IP Address and not sending broadcast??

      Hi,

      I have the device Id's and ip addresses for all the devices I need to retrieve data from. My machine sits on the same network as all the bacnet devices I need to access.

      getRemoteDeviceBlocking(int, int) sends a broadcast with the device ID to find the remote device, This is currently not working for me. in my wireshark capture I can see the broadcast being sent out, but I never get a response back.

      Since I have the IP wouldn't it be better to just query the ip no to unnecessarily flood the network. I don't see a method allowing me to do so.

      Maybe I'm not using this the right way, Could it be that I have to use localDevice since I have the IP for all devices I need?

      Here in my sample test code:

      Thank you!

         int instance = Integer.parseInt(args[0]);
         int timeout = Integer.parseInt(args[1]);
      	
          Integer deviceId = 1234;
          int port = 0xBAC0;
      	String localBindAddress = "10.116.189.90";
      
          IpNetworkBuilder builder = new IpNetworkBuilder();
          builder.withPort(port);
          builder.withLocalBindAddress(localBindAddress);
          builder.withBroadcast("10.116.189.127", 26);
      
          IpNetwork network = builder.build();
          LocalDevice localDevice = new LocalDevice(deviceId, new DefaultTransport(network));
          try {
              localDevice.initialize();
          } catch (Exception e) {
          	System.out.println("Unable to initialize localDevice");
              e.printStackTrace();	
          }
          
          //Get Superior conference room
          RemoteDevice rd = null;
      	try {
      		rd = localDevice.getRemoteDeviceBlocking(instance, timeout);
      	} catch (BACnetException e) {
      		// TODO Auto-generated catch block
      		System.out.println("Unable to find device: "+ instance);
      		e.printStackTrace();
      		System.exit(1);
      	}
          
          System.out.println("Vendor: " + rd.getVendorName());
          RemoteObject ro = rd.getObject(new ObjectIdentifier(19,8));
          Encodable value = ro.getProperty(PropertyIdentifier.presentValue);
          System.out.println("Device: " + rd.getInstanceNumber()+  " present value =" + value);
      
      posted in BACnet4J general discussion
      E
      ealebie