• K
    kaltalen

    I'm having a problem conceptualising how segmentation works,

    BACnet4J seems to segment based on the remote devices maxAPDUlength, and from what I've read, segmentation is managed above the Network layer, so I'm assuming routers do not reassemble and resegment when transmitting onto the next network.

    I may be incorrect in either of these assumptions, but if i am not, how would a device, lets say on an IP network, correctly segment for another device on a different IP network, if the two networks are joined by an MSTP network, with routers at the intersections of networks.

    How can the device know to segment small enough for the intermediate network if it is smaller than the 2 end networks?

    I know that that would be a bad way to set up a network, but as far as i know there is nothing that prevents that in bacnet(unlike multiple paths between networks).

    I'm wondering if this is something that bacnet4j does/should handle, and if so how?

    posted in BACnet4J general discussion read more
  • K
    kaltalen

    Any other Suggestions as to what it might be?

    posted in BACnet4J general discussion read more
  • K
    kaltalen

    That didn't fix it, I even went up to 30 seconds, same problem. the original program I had initialized them on startup then the user manually triggered the whoIs so there was usually a substantial delay between initialisation and broadcast anyway. I also tried this:

        System.out.println("Creating Device");
        localDevice = new LocalDevice(1234, new Transport(new MstpNetwork(new MasterNode(params,(byte) 0x01,1))));
        try 
        {
        	System.out.println("Initilising");
            localDevice.initialize();
            Thread.sleep(10000);
            localDevice.getEventHandler().addListener(new Listener());
            for(int i=1; i<=20;i++)
            {
            	localDevice.sendGlobalBroadcast(new WhoIsRequest());
                System.out.println("Broadcast "+i);
                Thread.sleep(20000);
            }
            
            System.out.println("Done");
        }
        finally 
        {
        	localDevice.terminate();
        }
    

    And got the following:

    Loading Params
    Creating Device
    Initilising
    Broadcast 1
    Broadcast 2
    Broadcast 3
    Broadcast 4
    Broadcast 5
    Broadcast 6
    Broadcast 7
    Broadcast 8
    Broadcast 9
    Broadcast 10
    Broadcast 11
    Broadcast 12
    IAm received from RemoteDevice(instanceNumber=9999, address=Address [networkNumber=0, macAddress=[7]], linkServiceAddress=null)
    Broadcast 13
    Broadcast 14
    Broadcast 15
    IAm received from RemoteDevice(instanceNumber=9999, address=Address [networkNumber=0, macAddress=[7]], linkServiceAddress=null)
    Broadcast 16
    Broadcast 17
    Broadcast 18
    Broadcast 19
    Broadcast 20
    Done

    I then did the same, but changed the mac address about 5 seconds before each broadcast and got the following:

    Loading Params
    Creating Device
    Initilising
    Broadcast 1
    Broadcast 2
    Broadcast 3
    IAm received from RemoteDevice(instanceNumber=9999, address=Address [networkNumber=0, macAddress=[9]], linkServiceAddress=null)
    Broadcast 4
    Broadcast 5
    Broadcast 6
    IAm received from RemoteDevice(instanceNumber=9999, address=Address [networkNumber=0, macAddress=[15]], linkServiceAddress=null)
    Broadcast 7
    Broadcast 8
    Broadcast 9
    IAm received from RemoteDevice(instanceNumber=9999, address=Address [networkNumber=0, macAddress=[11]], linkServiceAddress=null)
    Broadcast 10
    Broadcast 11
    Broadcast 12
    Broadcast 13
    IAm received from RemoteDevice(instanceNumber=9999, address=Address [networkNumber=0, macAddress=[f]], linkServiceAddress=null)
    Broadcast 14
    Broadcast 15
    Broadcast 16
    Broadcast 17
    Broadcast 18
    Broadcast 19
    IAm received from RemoteDevice(instanceNumber=9999, address=Address [networkNumber=0, macAddress=**], linkServiceAddress=null)
    Broadcast 20
    Done

    posted in BACnet4J general discussion read more
  • K
    kaltalen

    Hi,

    I'm trying to detect MSTP bacnet devices connected to a rs485-usb adapter and I'm having a problem reliably getting IAm responses.

    I get a response about once every five to ten WhoIs requests,
    This increases to about once every two to three tries if I change the MAC address between each request.
    Other than that I cannot find any patteren in the responses.
    Once I get a response(and save its details) i can reliably send requests to that device as much and as often as i want.
    This, combined with tests I've done with other software, leads me to believe its not the hardware I'm using.

    Originally I assumed it was my code, but once simplified as much as I could I still got the same problem.
    Is this a problem others have encountered? Is this a problem with the library? or am I using it wrong?

    Here is my simplified code:

    public static void main(String[] args) throws Exception 
    {
    	System.out.println("Loading Params");
    	SerialParameters params = new SerialParameters();
        params.setCommPortId("COM3");
        params.setBaudRate(9600);
        params.setDataBits(8);
        params.setStopBits(1);
        params.setParity(0);
        
        System.out.println("Creating Device");
        localDevice = new LocalDevice(1234, new Transport(new MstpNetwork(new MasterNode(params,(byte) 0x01,1))));
        try 
        {
        	System.out.println("Initilising");
            localDevice.initialize();
            localDevice.getEventHandler().addListener(new Listener());
            localDevice.sendGlobalBroadcast(new WhoIsRequest());
            System.out.println("Listening");
            Thread.sleep(20000);
            System.out.println("Done");
        }
        finally 
        {
        	localDevice.terminate();
        }
    }
    
    static class Listener extends DeviceEventAdapter 
    {
        @Override
        public void iAmReceived(RemoteDevice d) 
        {
        	System.out.println("IAm received from " + d);
        }
    }
    

    Thanks for any help you can give,

    KT

    posted in BACnet4J general discussion read more