<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[MSTP WhoIs]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I'm trying to detect MSTP bacnet devices connected to a rs485-usb adapter and I'm having a problem reliably getting IAm responses.</p>
<p dir="auto">I get a response about once every five to ten WhoIs requests,<br />
This increases to about once every two to three tries if I change the MAC address between each request.<br />
Other than that I cannot find any patteren in the responses.<br />
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.<br />
This, combined with tests I've done with other software, leads me to believe its not the hardware I'm using.</p>
<p dir="auto">Originally I assumed it was my code, but once simplified as much as I could I still got the same problem.<br />
Is this a problem others have encountered? Is this a problem with the library? or am I using it wrong?</p>
<p dir="auto">Here is my simplified code:</p>
<pre><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);
    }
}
</code></pre>
<p dir="auto">Thanks for any help you can give,</p>
<p dir="auto">KT</p>
]]></description><link>https://forum.mango-os.com/topic/1835/mstp-whois</link><generator>RSS for Node</generator><lastBuildDate>Wed, 19 Aug 2026 21:23:02 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/1835.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Mar 2015 22:41:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MSTP WhoIs on Thu, 26 Mar 2015 00:16:39 GMT]]></title><description><![CDATA[<p dir="auto">Any other Suggestions as to what it might be?</p>
]]></description><link>https://forum.mango-os.com/post/9810</link><guid isPermaLink="true">https://forum.mango-os.com/post/9810</guid><dc:creator><![CDATA[kaltalen]]></dc:creator><pubDate>Thu, 26 Mar 2015 00:16:39 GMT</pubDate></item><item><title><![CDATA[Reply to MSTP WhoIs on Fri, 20 Mar 2015 03:26:01 GMT]]></title><description><![CDATA[<p dir="auto">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:</p>
<pre><code>    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&lt;=20;i++)
        {
        	localDevice.sendGlobalBroadcast(new WhoIsRequest());
            System.out.println("Broadcast "+i);
            Thread.sleep(20000);
        }
        
        System.out.println("Done");
    }
    finally 
    {
    	localDevice.terminate();
    }
</code></pre>
<p dir="auto">And got the following:</p>
<p dir="auto">Loading Params<br />
Creating Device<br />
Initilising<br />
Broadcast 1<br />
Broadcast 2<br />
Broadcast 3<br />
Broadcast 4<br />
Broadcast 5<br />
Broadcast 6<br />
Broadcast 7<br />
Broadcast 8<br />
Broadcast 9<br />
Broadcast 10<br />
Broadcast 11<br />
Broadcast 12<br />
IAm received from RemoteDevice(instanceNumber=9999, address=Address [networkNumber=0, macAddress=[7]], linkServiceAddress=null)<br />
Broadcast 13<br />
Broadcast 14<br />
Broadcast 15<br />
IAm received from RemoteDevice(instanceNumber=9999, address=Address [networkNumber=0, macAddress=[7]], linkServiceAddress=null)<br />
Broadcast 16<br />
Broadcast 17<br />
Broadcast 18<br />
Broadcast 19<br />
Broadcast 20<br />
Done</p>
<p dir="auto">I then did the same, but changed the mac address about 5 seconds before each broadcast and got the following:</p>
<p dir="auto">Loading Params<br />
Creating Device<br />
Initilising<br />
Broadcast 1<br />
Broadcast 2<br />
Broadcast 3<br />
IAm received from RemoteDevice(instanceNumber=9999, address=Address [networkNumber=0, macAddress=[9]], linkServiceAddress=null)<br />
Broadcast 4<br />
Broadcast 5<br />
Broadcast 6<br />
IAm received from RemoteDevice(instanceNumber=9999, address=Address [networkNumber=0, macAddress=[15]], linkServiceAddress=null)<br />
Broadcast 7<br />
Broadcast 8<br />
Broadcast 9<br />
IAm received from RemoteDevice(instanceNumber=9999, address=Address [networkNumber=0, macAddress=[11]], linkServiceAddress=null)<br />
Broadcast 10<br />
Broadcast 11<br />
Broadcast 12<br />
Broadcast 13<br />
IAm received from RemoteDevice(instanceNumber=9999, address=Address [networkNumber=0, macAddress=[f]], linkServiceAddress=null)<br />
Broadcast 14<br />
Broadcast 15<br />
Broadcast 16<br />
Broadcast 17<br />
Broadcast 18<br />
Broadcast 19<br />
IAm received from RemoteDevice(instanceNumber=9999, address=Address [networkNumber=0, macAddress=**], linkServiceAddress=null)<br />
Broadcast 20<br />
Done</p>
]]></description><link>https://forum.mango-os.com/post/9795</link><guid isPermaLink="true">https://forum.mango-os.com/post/9795</guid><dc:creator><![CDATA[kaltalen]]></dc:creator><pubDate>Fri, 20 Mar 2015 03:26:01 GMT</pubDate></item><item><title><![CDATA[Reply to MSTP WhoIs on Thu, 19 Mar 2015 16:41:26 GMT]]></title><description><![CDATA[<p dir="auto">Can you try putting in a pause after initializing the local device, using "Thread.sleep(###)"? There may be a delay while the device waits to join the network, during which your requests might be timing out. Start with something like 10 seconds to see if this works, and then reduce the time as much as you can.</p>
]]></description><link>https://forum.mango-os.com/post/9794</link><guid isPermaLink="true">https://forum.mango-os.com/post/9794</guid><dc:creator><![CDATA[mlohbihler]]></dc:creator><pubDate>Thu, 19 Mar 2015 16:41:26 GMT</pubDate></item></channel></rss>