<?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[Not able to do MS&#x2F;TP communication using BACnet4J]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I am trying to perform BACnet Master Slave communication and for that, I have done below things as given in the example.</p>
<p dir="auto">For Master Device:</p>
<pre><code>static void master(final SerialPort serialPort) throws Exception {
		try (JsscSerialPortInputStream in = new JsscSerialPortInputStream(serialPort);
				JsscSerialPortOutputStream out = new JsscSerialPortOutputStream(serialPort)) {
			final MasterNode node = new MasterNode("test", in, out, (byte) 3, 2);
			node.setMaxInfoFrames(5);
			node.setUsageTimeout(100);
			final MstpNetwork network = new MstpNetwork(node, 0);
			final Transport transport = new DefaultTransport(network);
			final LocalDevice ld = new LocalDevice(1970, transport);
			ld.initialize();
			System.out.println(prefix() + "Initialized");

			for (int i = 0; i &lt; 10; i++) {
				System.out.println(prefix() + "Discovering");
				final RemoteDeviceDiscoverer rdd = ld.startRemoteDeviceDiscovery((r) -&gt; {
					System.out.println(prefix() + "Device: " + r + ", " + r.getName());
				});

				ThreadUtils.sleep(6000);

				System.out.println("remote device list :: "+rdd.getRemoteDevices());
				rdd.stop();
			}

			System.out.println(prefix() + "Terminating");
			ld.terminate();
		}
	}
</code></pre>
<p dir="auto">For Slave Device:</p>
<pre><code>static void slave(final SerialPort serialPort) throws Exception {
		try (JsscSerialPortInputStream in = new JsscSerialPortInputStream(serialPort);
				JsscSerialPortOutputStream out = new JsscSerialPortOutputStream(serialPort)) {
			final SlaveNode node = new SlaveNode("test", in, out, (byte) 3); //Creating mstp node and place it in ideal state
			final MstpNetwork network = new MstpNetwork(node, 0);
			final Transport transport = new DefaultTransport(network);
			final LocalDevice ld = new LocalDevice(111, transport);
			ld.initialize();

			ld.startRemoteDeviceDiscovery((r) -&gt; {
				System.out.println("Get instance number: "+r.getInstanceNumber());
			});

			ThreadUtils.sleep(100000);
			System.out.println("getBytesIn :: "+node.getBytesIn());
			System.out.println("getBytesOut :: "+node.getBytesOut());

			ld.terminate();
		}
	}
</code></pre>
<p dir="auto">But still not able to discover the remote devices.<br />
Is there anything that I miss or any mistake I have done?</p>
<p dir="auto">I think it's probably obvious that I am new to BACnet and the BACnet4J library. I would be super grateful for any help!</p>
<p dir="auto">Thank you,<br />
Vihangi</p>
]]></description><link>https://forum.mango-os.com/topic/4833/not-able-to-do-ms-tp-communication-using-bacnet4j</link><generator>RSS for Node</generator><lastBuildDate>Mon, 15 Jun 2026 17:21:24 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/4833.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 Jun 2020 10:35:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Not able to do MS&#x2F;TP communication using BACnet4J on Wed, 24 Jun 2020 09:19:29 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/user/terrypacker" aria-label="Profile: terrypacker">@<bdi>terrypacker</bdi></a>,</p>
<p dir="auto">Please help to resolve the above queries related to BACne MS/TP.</p>
]]></description><link>https://forum.mango-os.com/post/25393</link><guid isPermaLink="true">https://forum.mango-os.com/post/25393</guid><dc:creator><![CDATA[Vihangi]]></dc:creator><pubDate>Wed, 24 Jun 2020 09:19:29 GMT</pubDate></item><item><title><![CDATA[Reply to Not able to do MS&#x2F;TP communication using BACnet4J on Mon, 15 Jun 2020 06:47:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terrypacker" aria-label="Profile: terrypacker">@<bdi>terrypacker</bdi></a> Is it compulsory to start discovery on slave and master at the same time?</p>
<p dir="auto">I am able to discover remote devices using BACnet/IP.</p>
<p dir="auto">And the same way I am doing with MSTP. The difference between BACnet IP and MSTP is only about the connection type/ communication medium like Ethernet or serial [RS485]. Another thing related to request-response is the same. Am I correct?</p>
<p dir="auto">According to my understanding, I have to provide the serial config details to the master node and create one local device and initialize it and do the "WhoIs" request-response.<br />
But, currently, I am not able to get "iAmReceived" on local device listeners.<br />
Am I wrong at any place?</p>
<p dir="auto">Sorry terry, but I don't understand the socket bridge. Can you please give details like what should I do?</p>
<p dir="auto">I just want to do as simple as done in the below example.<br />
<a href="https://github.com/infiniteautomation/BACnet4J-samples/blob/master/src/test/java/com/infiniteautomation/bacnet4j/rs485/SerialTest.java" rel="nofollow ugc">https://github.com/infiniteautomation/BACnet4J-samples/blob/master/src/test/java/com/infiniteautomation/bacnet4j/rs485/SerialTest.java</a></p>
]]></description><link>https://forum.mango-os.com/post/25328</link><guid isPermaLink="true">https://forum.mango-os.com/post/25328</guid><dc:creator><![CDATA[Vihangi]]></dc:creator><pubDate>Mon, 15 Jun 2020 06:47:22 GMT</pubDate></item><item><title><![CDATA[Reply to Not able to do MS&#x2F;TP communication using BACnet4J on Fri, 12 Jun 2020 15:57:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vihangi" aria-label="Profile: Vihangi">@<bdi>Vihangi</bdi></a> I'm not 100% confident in that test class you are trying to use as I've not ever run it up.  Seems like you shouldn't be starting a discovery on both slave and master at the same time.</p>
<p dir="auto">Here is a more verbose way to achieve the same thing using BACnet/IP.  Once you understand what this is doing you should be able to break it into 2 programs and use on separate machines with BACnet MSTP.</p>
<p dir="auto">The idea for this example is to be able to discover another device using the an TCP/IP socket bridge that relays the messages to the other device.  In your MSTP code you would remove the bridge and start the local devices using an MSTP Master and the other as the Slave.</p>
<p dir="auto"><a href="https://github.com/infiniteautomation/BACnet4J-samples/blob/master/src/test/java/com/infiniteautomation/bacnet4j/npdu/ip/BacnetIpListenerDiscoveryExample.java" rel="nofollow ugc">https://github.com/infiniteautomation/BACnet4J-samples/blob/master/src/test/java/com/infiniteautomation/bacnet4j/npdu/ip/BacnetIpListenerDiscoveryExample.java</a></p>
]]></description><link>https://forum.mango-os.com/post/25321</link><guid isPermaLink="true">https://forum.mango-os.com/post/25321</guid><dc:creator><![CDATA[terrypacker]]></dc:creator><pubDate>Fri, 12 Jun 2020 15:57:31 GMT</pubDate></item><item><title><![CDATA[Reply to Not able to do MS&#x2F;TP communication using BACnet4J on Fri, 12 Jun 2020 05:59:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terrypacker" aria-label="Profile: terrypacker">@<bdi>terrypacker</bdi></a> Thank you so much for the response.</p>
<p dir="auto">Yes, I have used that snippet.</p>
<p dir="auto">Here is my serial port settings,</p>
<pre><code>final SerialPort serialPort = new SerialPort("COM12");
		boolean b = serialPort.openPort();
		System.out.println("port open? :: "+b);
		b = serialPort.setParams(SerialPort.BAUDRATE_38400, SerialPort.DATABITS_8, SerialPort.STOPBITS_1,
				SerialPort.PARITY_NONE);
</code></pre>
<p dir="auto">I am able to open the port and got below success logs for it.<br />
port open? :: true<br />
parameter set? : true</p>
<p dir="auto">Also with slave node, I have got below logs.<br />
getBytesIn :: 1855<br />
getBytesOut :: 0</p>
<p dir="auto">With the listen() snippet given in<br />
<a href="https://github.com/infiniteautomation/BACnet4J/blob/master/src/test/java/com/serotonin/bacnet4j/adhoc/rs485/PortTest.java" rel="nofollow ugc">https://github.com/infiniteautomation/BACnet4J/blob/master/src/test/java/com/serotonin/bacnet4j/adhoc/rs485/PortTest.java</a></p>
<p dir="auto">I got frames as below...<br />
55ff0102010000f5<br />
55ff01030100007c<br />
55ff0104010000c6<br />
55ff01050100004f<br />
55ff0106010000d7<br />
55ff01070100005e<br />
55ff0108010000a0<br />
55ff010901000029<br />
55ff010a010000b1<br />
55ff010b01000038<br />
55ff010c01000082<br />
55ff010d0100000b<br />
55ff010e01000093</p>
<p dir="auto">And still not able to discover remote devices...</p>
<p dir="auto">Am I doing anything wrong in this?</p>
<p dir="auto">If you have any test case with MS/TP then please share. I will be very grateful to you.</p>
]]></description><link>https://forum.mango-os.com/post/25316</link><guid isPermaLink="true">https://forum.mango-os.com/post/25316</guid><dc:creator><![CDATA[Vihangi]]></dc:creator><pubDate>Fri, 12 Jun 2020 05:59:40 GMT</pubDate></item><item><title><![CDATA[Reply to Not able to do MS&#x2F;TP communication using BACnet4J on Thu, 11 Jun 2020 15:56:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vihangi" aria-label="Profile: Vihangi">@<bdi>Vihangi</bdi></a> I see you are using snippets from this code:</p>
<p dir="auto"><a href="https://github.com/infiniteautomation/BACnet4J/blob/master/src/test/java/com/serotonin/bacnet4j/adhoc/rs485/PortTest.java" rel="nofollow ugc">https://github.com/infiniteautomation/BACnet4J/blob/master/src/test/java/com/serotonin/bacnet4j/adhoc/rs485/PortTest.java</a></p>
<p dir="auto">I haven't actually run up that test in some time but I would check your serial port settings to make sure they match on each device you are running the code on.</p>
]]></description><link>https://forum.mango-os.com/post/25313</link><guid isPermaLink="true">https://forum.mango-os.com/post/25313</guid><dc:creator><![CDATA[terrypacker]]></dc:creator><pubDate>Thu, 11 Jun 2020 15:56:19 GMT</pubDate></item><item><title><![CDATA[Reply to Not able to do MS&#x2F;TP communication using BACnet4J on Thu, 11 Jun 2020 06:46:33 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Anyone there to guide me with this issue...</p>
<p dir="auto">Please do the need full as I am stuck with the issue.</p>
<p dir="auto">Thanks,<br />
Vihangi</p>
]]></description><link>https://forum.mango-os.com/post/25304</link><guid isPermaLink="true">https://forum.mango-os.com/post/25304</guid><dc:creator><![CDATA[Vihangi]]></dc:creator><pubDate>Thu, 11 Jun 2020 06:46:33 GMT</pubDate></item></channel></rss>