<?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[RS485 BACnet sniffing]]></title><description><![CDATA[<p dir="auto">Our control attaches to a BACnet server via RS485 and we are trying to capture comms between the two. Currently we have the IO Ninja TX+/TX- and GND attached to the the servers TX, RX and Gnd. The issue we are having is that the bytes do not look correct. Here is the dump of what the internal controller packet memory sees(notice the 55FF which is correct):</p>
<p dir="auto">00&gt; TX: 55FF000C200000A9<br />
00&gt; RX: 55FF05200C0018D3010C000106C0A80182E38B<br />
00&gt; RX: 02759A0E0C034000021E09081F537E<br />
00&gt; TX: 55FF070C2000003E<br />
55FF060C200113E30120000106C0A80182E38BFF309A0E0C034000021E<br />
00&gt; TX: 55FF000C200000A9<br />
00&gt; TX: 55FF000C200000A9<br />
00&gt; TX: 55FF000C200000A9</p>
<p dir="auto">The serial tap trace looks like the byte start is is taken on the wrong clock edge(55FF becomes 5500.) The serial settings are correct and we don't see any other filters/tweaks we could try:<br />
<img src="/forum/assets/uploads/files/1702560004877-capture.jpg" alt="Capture.JPG" class=" img-responsive img-markdown" width="1013" height="614" /></p>
<p dir="auto">A BACnet vendors likes to runs a 485 to USB and feeds that into wire shark on a PC but we would rather stick with the serial tap as it's important to see the data in real time(USB capture on a PC can be to slow.)</p>
<p dir="auto">Any advice is appreciated.</p>
]]></description><link>http://64.23.185.212/forum/topic/270/rs485-bacnet-sniffing</link><generator>RSS for Node</generator><lastBuildDate>Wed, 13 May 2026 16:30:49 GMT</lastBuildDate><atom:link href="http://64.23.185.212/forum/topic/270.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 14 Dec 2023 13:26:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to RS485 BACnet sniffing on Fri, 15 Mar 2024 13:45:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://64.23.185.212/forum/uid/2">@vladimir</a> Looks really good. I'm going to send this log over to our BACnet stack supplier to see if he has any extra feedback. To me this looks much better than running a 485 to USB connection into WireShark.</p>
<p dir="auto">Thanks again for all the help. Any chance you could release this into your standard layer plugins?</p>
<p dir="auto"><a href="/forum/assets/uploads/files/1710510146535-bacnet_38400_heavery_traffic_error_v5.7z">BACnet_38400_heavery_traffic_error_v5.7z</a></p>
]]></description><link>http://64.23.185.212/forum/post/649</link><guid isPermaLink="true">http://64.23.185.212/forum/post/649</guid><dc:creator><![CDATA[LynneJohn]]></dc:creator><pubDate>Fri, 15 Mar 2024 13:45:37 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Tue, 12 Mar 2024 06:20:21 GMT]]></title><description><![CDATA[<p dir="auto">Try the updated analyzer:</p>
<p dir="auto"><a href="/forum/assets/uploads/files/1710223862574-bacnetmstp.7z">BacNetMsTp.7z</a></p>
<p dir="auto">It checks CRCs now and discards frames with broken headers (in the previous log, the decoder didn't actually stop, but because a broken header specified a very long payload size, it kept buffering data assuming it still was a payload).</p>
<p dir="auto">Also, when you upload the log, please detach the Analyzer before saving the log. This way, we can access the original raw &amp; unprocessed data (instead of the already decoded frames).</p>
]]></description><link>http://64.23.185.212/forum/post/647</link><guid isPermaLink="true">http://64.23.185.212/forum/post/647</guid><dc:creator><![CDATA[Vladimir]]></dc:creator><pubDate>Tue, 12 Mar 2024 06:20:21 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Mon, 11 Mar 2024 12:04:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://64.23.185.212/forum/uid/2">@vladimir</a><br />
Here is a log that is working very well until time stamp 9:55:07 +00:46.470 and then the decode stops.</p>
<p dir="auto">Thanks again for all the help.</p>
<p dir="auto"><a href="/forum/assets/uploads/files/1710158545707-bacnet_38400_heavery_traffic_error_v4.7z">BACnet_38400_heavery_traffic_error_v4.7z</a></p>
]]></description><link>http://64.23.185.212/forum/post/645</link><guid isPermaLink="true">http://64.23.185.212/forum/post/645</guid><dc:creator><![CDATA[LynneJohn]]></dc:creator><pubDate>Mon, 11 Mar 2024 12:04:32 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Thu, 07 Mar 2024 02:49:44 GMT]]></title><description><![CDATA[<p dir="auto">No prob, I've increased the upload file size limit to 8MB.</p>
<p dir="auto">Also, you could have archived it with <code>7z</code> <img src="http://64.23.185.212/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=miq4h6da9ug" class="not-responsive emoji emoji-android emoji--wink" title=";)" alt="😉" /></p>
]]></description><link>http://64.23.185.212/forum/post/643</link><guid isPermaLink="true">http://64.23.185.212/forum/post/643</guid><dc:creator><![CDATA[Vladimir]]></dc:creator><pubDate>Thu, 07 Mar 2024 02:49:44 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Wed, 06 Mar 2024 19:19:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://64.23.185.212/forum/uid/2">@vladimir</a> Sorry for the delay. Upload symbol is there but I get an error that file is too big. The log is 1Mbyte in size.  Is there a way to reduce the size once the log is loaded into IO Ninja?</p>
<p dir="auto">Thanks.</p>
<p dir="auto">[0_1709752179535_BACnet_38400_heavery_traffic_error_v4.njlog](Uploading 100%)</p>
]]></description><link>http://64.23.185.212/forum/post/642</link><guid isPermaLink="true">http://64.23.185.212/forum/post/642</guid><dc:creator><![CDATA[LynneJohn]]></dc:creator><pubDate>Wed, 06 Mar 2024 19:19:34 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Tue, 05 Mar 2024 09:18:55 GMT]]></title><description><![CDATA[<p dir="auto">Apparently, this was a permission issue; it doesn't apply to administrators, so I didn't even know it was there...</p>
<p dir="auto">Anyway, I've adjusted the file upload permissions for registered users; please try again.</p>
]]></description><link>http://64.23.185.212/forum/post/641</link><guid isPermaLink="true">http://64.23.185.212/forum/post/641</guid><dc:creator><![CDATA[Vladimir]]></dc:creator><pubDate>Tue, 05 Mar 2024 09:18:55 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Mon, 04 Mar 2024 14:21:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://64.23.185.212/forum/uid/2">@vladimir</a> That icon does not show on my Firefox. I'll try a different browser.<br />
<img src="/forum/assets/uploads/files/1709562053523-capture.jpg" alt="Capture.JPG" class=" img-responsive img-markdown" width="1341" height="553" /></p>
]]></description><link>http://64.23.185.212/forum/post/640</link><guid isPermaLink="true">http://64.23.185.212/forum/post/640</guid><dc:creator><![CDATA[LynneJohn]]></dc:creator><pubDate>Mon, 04 Mar 2024 14:21:15 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Thu, 29 Feb 2024 15:56:52 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">Tried using the upload images(right most icon) to send a 7z zip file but I don't have privileges for it.</p>
</blockquote>
<p dir="auto">Not "Upload image", "Upload file". Does your "Reply toolbar" have this button?</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1709222099583-8537fcf3-5daa-4d0d-8b6e-dd4ba104fe29-image.png" alt="8537fcf3-5daa-4d0d-8b6e-dd4ba104fe29-image.png" class=" img-responsive img-markdown" width="1436" height="660" /></p>
]]></description><link>http://64.23.185.212/forum/post/639</link><guid isPermaLink="true">http://64.23.185.212/forum/post/639</guid><dc:creator><![CDATA[Vladimir]]></dc:creator><pubDate>Thu, 29 Feb 2024 15:56:52 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Thu, 29 Feb 2024 15:40:42 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">Most likely, you just commented out the padding code, but forgot to add a semicolon <code>;</code></p>
</blockquote>
<p dir="auto">Exactly correct as I had missed the '+' on the line above.</p>
<p dir="auto">Traces look very good now as I will try to move to your latest code. Tried using the upload images(right most icon) to send a 7z zip file but I don't have privileges for it.</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1709221235394-capture.jpg" alt="Capture.JPG" class=" img-responsive img-markdown" width="690" height="614" /></p>
]]></description><link>http://64.23.185.212/forum/post/638</link><guid isPermaLink="true">http://64.23.185.212/forum/post/638</guid><dc:creator><![CDATA[LynneJohn]]></dc:creator><pubDate>Thu, 29 Feb 2024 15:40:42 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Thu, 29 Feb 2024 15:09:47 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">How do I send you the log that is out of sync</p>
</blockquote>
<p dir="auto">Hit "Reply" (not "Post quick reply"); the rightmost button on the toolbar is "Upload File". 7-zip it first so that it has the <code>.7z</code> extension permitted by this forum.</p>
<blockquote>
<p dir="auto">Removing the padding gives this trying to load the Analyzer:</p>
</blockquote>
<p dir="auto">Most likely, you just commented out the padding code, but forgot to add a semicolon <code>;</code> at the end of the statement. In Jancy, just like in C, declarations and expression statements must be terminated with a semicolon.</p>
<blockquote>
<p dir="auto">While using this analyzer should we have been running Settings-&gt;Log Engine-&gt;Binary Data-&gt;Binary Data Merge with a 3msec threshold.</p>
</blockquote>
<p dir="auto">This won't affect the analyzer, but I think it's completely unnecessary now. You will see packets boundaries anyway -- and not just boundaries, decoded header fields, too.</p>
]]></description><link>http://64.23.185.212/forum/post/637</link><guid isPermaLink="true">http://64.23.185.212/forum/post/637</guid><dc:creator><![CDATA[Vladimir]]></dc:creator><pubDate>Thu, 29 Feb 2024 15:09:47 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Thu, 29 Feb 2024 14:06:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://64.23.185.212/forum/uid/2">@vladimir</a> Removing the padding gives this trying to load the Analyzer:<br />
<img src="/forum/assets/uploads/files/1709214348567-capture.jpg" alt="Capture.JPG" class=" img-responsive img-markdown" width="728" height="192" /></p>
<p dir="auto">Inserting the changes to BacNetMsTpParser.jnc(without the modification to the padding) it runs very well with an occasional issues toward the end of a large packet:<br />
<img src="/forum/assets/uploads/files/1709215241265-capture.jpg" alt="Capture.JPG" class=" img-responsive img-markdown" width="755" height="643" /></p>
<p dir="auto">While using this analyzer should we have been running Settings-&gt;Log Engine-&gt;Binary Data-&gt;Binary Data Merge with a 3msec threshold. Should we still be using this ?</p>
<p dir="auto">Just want to also add how nice it is to be able to see the packets.</p>
<p dir="auto">Thanks.</p>
]]></description><link>http://64.23.185.212/forum/post/636</link><guid isPermaLink="true">http://64.23.185.212/forum/post/636</guid><dc:creator><![CDATA[LynneJohn]]></dc:creator><pubDate>Thu, 29 Feb 2024 14:06:46 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Thu, 29 Feb 2024 13:00:03 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">Re "stop" of the analyzer -- could you share the original <code>.njlog</code> with the large packet?</p>
</blockquote>
<p dir="auto">How do I send you the log that is out of sync. I'll try your fixes and report back. Also here are a couple frame types if you want to add them to the analyzer:</p>
<pre><code>enum BacNetMsTcpFrameType: uint8_t {
	Token                       = 0,
	PollForMaster               = 1,
	PollForMasterReply          = 2,
	TestRequest                 = 3,
	TestResponse                = 4,
	BacNetDataExpectingReply    = 5,
	BacNetDataNotExpectingReply = 6,
	ReplyPostponed              = 7,
	ExtendedDataExpectingReply	= 32,
	ExtendedDataNotExpectingReply = 33,
	CustomFrame					= 254,
	NoFrame						= 255
}
</code></pre>
]]></description><link>http://64.23.185.212/forum/post/635</link><guid isPermaLink="true">http://64.23.185.212/forum/post/635</guid><dc:creator><![CDATA[LynneJohn]]></dc:creator><pubDate>Thu, 29 Feb 2024 13:00:03 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Thu, 29 Feb 2024 02:08:37 GMT]]></title><description><![CDATA[<p dir="auto">P.S.<br />
For simplicity, just sync on <code>0x55</code>; that should be good enough.</p>
<p dir="auto">In <code>BacNetMsTpParser.parse(...)</code>, add this:</p>
<pre><code>	while (p &lt; end) {
		void const* p0 = p;

		// 0. sync on 0x55

		if (!m_buffer.m_size) {
			void const* preamble = memchr(p, 0x55, end - p);
			if (!preamble)
				break;

			p = preamble; // skip everything before the preamble
		}

		...

</code></pre>
]]></description><link>http://64.23.185.212/forum/post/634</link><guid isPermaLink="true">http://64.23.185.212/forum/post/634</guid><dc:creator><![CDATA[Vladimir]]></dc:creator><pubDate>Thu, 29 Feb 2024 02:08:37 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Thu, 29 Feb 2024 01:26:27 GMT]]></title><description><![CDATA[<p dir="auto">Version 5.5.0 will not display the contents of BACnet headers properly (after you click [+] to expand). The pre-release <code>.7z</code> file is a portable archive; extract it anywhere and run <code>ioninja-5.5.1\bin\ioninja.exe</code>.</p>
<p dir="auto">Re "stop" of the analyzer -- could you share the original <code>.njlog</code> with the large packet?</p>
<p dir="auto">I suspect that the reason is the incorrect handling of padding in the script (it went out of sync immediately after the large frame). Try removing the padding:</p>
<pre><code>size_t frameSize =
	sizeof(BacNetMsTpHdr) +  // header
	hdr.m_length +           // payload
	sizeof(uint16_t);        // CRC
	// (hdr.m_length &amp; 1);      // padding &lt;---
</code></pre>
<p dir="auto">Also, it makes sense to wait and sync on <code>\x55\xff</code> before starting buffering the packet; this way, the parser will re-sync after synchronization is lost (this still can occasionally happen because RS485 does not guarantee lossless delivery).</p>
]]></description><link>http://64.23.185.212/forum/post/633</link><guid isPermaLink="true">http://64.23.185.212/forum/post/633</guid><dc:creator><![CDATA[Vladimir]]></dc:creator><pubDate>Thu, 29 Feb 2024 01:26:27 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Wed, 28 Feb 2024 21:38:29 GMT]]></title><description><![CDATA[<p dir="auto">Wow, this is great. Couple questions:</p>
<ul>
<li>The Pre-release does not have an install script(msi file.) Can I just drop the folders into the current C:\Program Files\Tibbo\IO Ninja directory?</li>
</ul>
<p dir="auto">Loaded your analyzer(on version 5.5.0) using Settings-&gt;Add-on Plugins-&gt;Layers-&gt;Add and selected BacNetMsTp.njplg(this was a guess).</p>
<ul>
<li>It ran very well except that after a large packet came through it seemed to stop(see timestamp 16:21:35 +00:06:437. Looked through the scripts(everything you sent) to see if there was a max number of bytes for a packet but did not find one.</li>
</ul>
<p dir="auto"><img src="/forum/assets/uploads/files/1709156050545-capture.jpg" alt="Capture.JPG" class=" img-responsive img-markdown" width="1095" height="697" /></p>
<p dir="auto">Thanks again.</p>
]]></description><link>http://64.23.185.212/forum/post/632</link><guid isPermaLink="true">http://64.23.185.212/forum/post/632</guid><dc:creator><![CDATA[LynneJohn]]></dc:creator><pubDate>Wed, 28 Feb 2024 21:38:29 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Wed, 28 Feb 2024 11:55:49 GMT]]></title><description><![CDATA[<p dir="auto">P.S. FYI, just as with any representation generated by <code>log.representStruct()</code>, you can click on a header field, and the corresponding data bytes will be highlighted below -- so that you can see the mapping between header fields and data bytes.</p>
]]></description><link>http://64.23.185.212/forum/post/631</link><guid isPermaLink="true">http://64.23.185.212/forum/post/631</guid><dc:creator><![CDATA[Vladimir]]></dc:creator><pubDate>Wed, 28 Feb 2024 11:55:49 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Wed, 28 Feb 2024 11:50:03 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">How do you get to the Transmit pane if it is greyed out(un-selectable) ?</p>
</blockquote>
<p dir="auto">The Transmit pane is greyed out in the Serial Tap plugin because it's a read-only sniffer device. You can transmit using the <a href="https://ioninja.com/plugins/serial.html" rel="nofollow ugc">Serial Terminal</a> plugin and a regular USB-to-RS485 adapter.</p>
<blockquote>
<p dir="auto">I tried using RegEx Markup with default Session settings and it does not want to break the packets up.</p>
</blockquote>
<blockquote>
<p dir="auto">After adding "Force Latin-1 encoding" to the Log Regex Markup settings I'm getting color highlights but no new timestamps when it see's the pattern.</p>
</blockquote>
<p dir="auto">Right, I should have mentioned that Latin-1 encoding might be necessary when the pattern contains invalid UTF-8 sequences (such as <code>\x55\xff</code>).</p>
<p dir="auto">In general, using timestamps to split the data stream into packets is not a reliable enough approach (unless every captured byte is precisely timestamped). Serial Tap doesn't do that; instead, timestamps are assigned to the whole blocks of data as they are received over USB. There are multiple layers of buffering involved (at both the Serial Tap and the PC side), so the timing could be distorted to some extent, and bytes from different packets could end up being read within the same block. It's much better to parse the stream and split it into packets based on the actual data contents.</p>
<p dir="auto">I've created a draft of the BACnet MSTP protocol analyzer for you: <a href="https://tibbo.com/downloads/archive/ioninja/.internal/scripts/BacNetMsTp.7z" rel="nofollow ugc">https://tibbo.com/downloads/archive/ioninja/.internal/scripts/BacNetMsTp.7z</a></p>
<p dir="auto">It breaks the stream into BACnet frames, gives a human-readable representation of the frame header, and highlights the payload (if any).</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1709120857831-ae83d05d-099d-4d65-a9e8-3902fff59533-image.png" alt="ae83d05d-099d-4d65-a9e8-3902fff59533-image.png" class=" img-responsive img-markdown" width="1276" height="1009" /></p>
<p dir="auto">Feel free to modify or extend it to your liking. However, please note, that <code>ioninja-5.5.0</code> has a regression that prevents <code>log.representStruct()</code> used in this script from operating properly (it's already fixed but the service release is not out yet). So, to use this plugin, please either (a) roll back to <code>ioninja-5.4.2</code> or (b) use the internal build <code>ioninja-5.5.0-a</code>: <a href="https://tibbo.com/downloads/archive/ioninja/.internal/prerelease/ioninja-5.5.0-a-windows-amd64.7z" rel="nofollow ugc">https://tibbo.com/downloads/archive/ioninja/.internal/prerelease/ioninja-5.5.0-a-windows-amd64.7z</a></p>
<p dir="auto">Let me know if it works for you, and feel free to ask me anything about the internal implementation of the analyzer script.</p>
]]></description><link>http://64.23.185.212/forum/post/630</link><guid isPermaLink="true">http://64.23.185.212/forum/post/630</guid><dc:creator><![CDATA[Vladimir]]></dc:creator><pubDate>Wed, 28 Feb 2024 11:50:03 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Mon, 26 Feb 2024 18:53:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://64.23.185.212/forum/uid/2">@vladimir</a> After adding "Force Latin-1 encoding" to the Log Regex Markup settings I'm getting color highlights but no new timestamps when it see's the pattern.<br />
<img src="/forum/assets/uploads/files/1708973354301-capture.jpg" alt="Capture.JPG" class=" img-responsive img-markdown" width="458" height="525" /></p>
<p dir="auto">Is there any way to get the log to show a timestamp at the beginning of each 55 FF pattern?</p>
<p dir="auto">Thanks</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1708973513389-capture.jpg" alt="Capture.JPG" class=" img-responsive img-markdown" width="742" height="385" /></p>
]]></description><link>http://64.23.185.212/forum/post/629</link><guid isPermaLink="true">http://64.23.185.212/forum/post/629</guid><dc:creator><![CDATA[LynneJohn]]></dc:creator><pubDate>Mon, 26 Feb 2024 18:53:33 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Mon, 26 Feb 2024 14:38:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://64.23.185.212/forum/uid/2">@Vladimir</a> I think at this point it would be nice to do a basic packet decode of sender/receiver and and packet type as it is only one byte long so 255 possibilities.</p>
<p dir="auto">How do you get to the Transmit pane if it is greyed out(un-selectable) ?</p>
]]></description><link>http://64.23.185.212/forum/post/628</link><guid isPermaLink="true">http://64.23.185.212/forum/post/628</guid><dc:creator><![CDATA[LynneJohn]]></dc:creator><pubDate>Mon, 26 Feb 2024 14:38:18 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Mon, 26 Feb 2024 13:49:38 GMT]]></title><description><![CDATA[<p dir="auto">Really appreciate the information.<br />
I tried using RegEx Markup with default Session settings and it does not want to break the packets up.<br />
<img src="/forum/assets/uploads/files/1708954294700-capture.jpg" alt="Capture.JPG" class=" img-responsive img-markdown" width="728" height="370" /></p>
<p dir="auto">Using Session-&gt;Settings-&gt;Log Engine-&gt;Binary Data-&gt;Binary Data Merge with a value of 3msec it looks better but I'm really after the timestamp of each packet.<br />
<img src="/forum/assets/uploads/files/1708954682032-capture.jpg" alt="Capture.JPG" class=" img-responsive img-markdown" width="705" height="284" /></p>
<p dir="auto">We have tried using a 485 to USB to monitor the BACnet traffic, but there is a point where the tokens are shown with the exact same timestamp and I suspect that the USB on the PC can't keep up with data which is surprising given the link speed is only 38400.<br />
<img src="/forum/assets/uploads/files/1708955304755-capture.jpg" alt="Capture.JPG" class=" img-responsive img-markdown" width="1095" height="258" /></p>
<p dir="auto">Thanks again for the help.</p>
]]></description><link>http://64.23.185.212/forum/post/627</link><guid isPermaLink="true">http://64.23.185.212/forum/post/627</guid><dc:creator><![CDATA[LynneJohn]]></dc:creator><pubDate>Mon, 26 Feb 2024 13:49:38 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Mon, 26 Feb 2024 12:06:07 GMT]]></title><description><![CDATA[<p dir="auto">Hello John,</p>
<p dir="auto">I'm really sorry for not answering your questions earlier; somehow this topic went under my radar...</p>
<p dir="auto">The very first question (garbage input) you actually solved by yourself (by reversing polarity). Alas, there's a bit of trial and error involved when connecting RS485 lines; usually, A is negative and B is positive, but on some devices, it could be the opposite.</p>
<p dir="auto">Now, to the next post -- how to break data into packets in the log. For simple visual aids, I'd recommend starting with the Regex Markup feature. It's very simple and could work quite well in your case, actually. Each packet is prefixed with a fixed preamble <code>0x55 0xff</code>, so you can define a regex as <code>\x55\xff</code> and set "Markup Mode" to "Add delimiters before matches". All packets will be visually separated from one another with red lines.</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1708949039893-659467c2-d6cb-4822-a90a-006a81b3dc4b-image.png" alt="659467c2-d6cb-4822-a90a-006a81b3dc4b-image.png" class=" img-responsive img-markdown" width="452" height="521" /></p>
<p dir="auto">Now, if we are not talking about <em>visual aids</em> but rather want to export it into Wireshark as a sequence as separate packets, it's a different story. Here, you would need to write a custom script (using any language of your choise) that would parse the data from <code>.njlog</code> file (generated by IO Ninja), split it into packets, then write those to a <code>.pcap</code> file programmatically.</p>
<p dir="auto">IO Ninja only knows how to generate a <code>.pcap</code> file when it captures <em>actual</em> network packets via <a href="/plugins/pcap-sniffer.html">Pcap Sniffer</a>, <a href="/hardware/ethernet-tap.html">Ethernet Tap</a> and similar plugins. For <a href="/hardware/serial-tap.html">Serial Tap</a> and most other plugins, however, the data is a continuous data stream, and it doesn't map to the <code>.pcap</code> format very well -- at least, not well enough to do it automatically. However, with a custom script everything is possible. If you choose this path -- the <code>.njlog</code> file format is very simple, and all the related structure definitions are open source:</p>
<p dir="auto"><code>&lt;ioninja-dir&gt;/scripts/api/log_RecordCode.jnc</code><br />
<code>&lt;ioninja-dir&gt;/scripts/api/log_RecordFile.jnc</code></p>
<p dir="auto">Finally, your last question is about how to use Jancy to work with BACnet MSTP. It's also possible, of course, but let's clarify your end goal here. Do you want to (a) conveniently prepare packets for sending -- i.e., fill the fields using the property grid, automatically calculate checksums, etc? Or (b) parse the incoming data and show the decoded packets in the log?</p>
<p dir="auto">For (a) you would want to create a <em>packet template</em>. Here's a simple introduction and tutorial: <a href="https://ioninja.com/doc/developer-manual/tutorial-ias-packet.html" rel="nofollow ugc">https://ioninja.com/doc/developer-manual/tutorial-ias-packet.html</a>. Also, for your reference, you can take a look at the Modbus Packet Template library (Packet Template Pane -&gt; Load Stock Script -&gt; <code>Modbus RTU</code>, sources are at <code>/scripts/packets/ModbusRtu.jnc</code>).</p>
<p dir="auto">If it's (b) that you want, then you need a <em>protocol analyzer plugin</em>. This is a bit more challenging task. Here's a short tutorial: <a href="https://ioninja.com/doc/developer-manual/tutorial-plugin-analyzer.html" rel="nofollow ugc">https://ioninja.com/doc/developer-manual/tutorial-plugin-analyzer.html</a> to get you started. Also, I'd recommend skimming through the sources of the <a href="/plugins/modbus.html">Modbus Analyzer</a> plugin for a working real-world protocol analyzer. Sources could be found at <code>/scripts/plugins/Modbus/</code></p>
<p dir="auto">Let me know which one (a or b) is your priority, and we'll focus on that. Maybe, we can create a quick skeleton script for you to work on.</p>
]]></description><link>http://64.23.185.212/forum/post/626</link><guid isPermaLink="true">http://64.23.185.212/forum/post/626</guid><dc:creator><![CDATA[Vladimir]]></dc:creator><pubDate>Mon, 26 Feb 2024 12:06:07 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Fri, 23 Feb 2024 21:58:06 GMT]]></title><description><![CDATA[<p dir="auto">We have come back to looking to have IO Ninja decode BACnet and maybe someone could help us understand how using a Jancy script could work with BACnet MS/TP packets. Defining the different fields is understandable until you get BACnet packets that have specific data which is attached onto the end of the packet. How do you tell Jacncy that if the packet length goes beyond the CRC you need to process it?</p>
<p dir="auto">Thanks</p>
<p dir="auto">![alt text](<img src="/forum/assets/uploads/files/1708725390341-4455f381-1d23-43f5-9912-de5e910a6e86-image.png" alt="4455f381-1d23-43f5-9912-de5e910a6e86-image.png" class=" img-responsive img-markdown" width="591" height="437" /> image url)</p>
<pre><code>import "crc16.jnc"

enum MyEnum: int8_t {
	Value1,
	Value2,
	Value3,
}

pragma(Alignment, 1);

[ displayName = "BACnet packet" ]
struct MyPacket {
	[ displayName = "Preamble" ]
	int16_t m_field1;

	[ displayName = "Frame type" ]
	int8_t m_field2;

	[ displayName = "Destination Address" ]
	int8_t m_field3;

	[ displayName = "Source Address" ]
	int8_t m_field4;

	[ displayName = "Length" ]
	uint16_t m_length;

	[ displayName = "CRC-8" ]
	uint8_t m_checksum;

	[ userAction = "Initialize" ]
	void initialize(char const* name) {
		m_field1 = MyEnum.Value1;
		m_field2 = 2;
		m_field3 = 3;

		size_t size = strlen(name) + 1;
		if (size &gt; sizeof(m_name))
			size = sizeof(m_name);

		memcpy(m_name, name, size);
	}

	[
		userAction = "Update length",
		autorun = "Auto-update length"
	]
	void updateLength() {
		m_length = dynamic sizeof(this);
	}

	[
		userAction = "Update checksum",
		autorun = "Auto-update checksum"
	]
	void updateChecksum() {
		m_checksum = crc16_ansi(this, dynamic sizeof(this));
	}
}

</code></pre>
]]></description><link>http://64.23.185.212/forum/post/625</link><guid isPermaLink="true">http://64.23.185.212/forum/post/625</guid><dc:creator><![CDATA[LynneJohn]]></dc:creator><pubDate>Fri, 23 Feb 2024 21:58:06 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Wed, 03 Jan 2024 14:08:11 GMT]]></title><description><![CDATA[<p dir="auto">Is there any way to break these packets apart or export the log?</p>
<p dir="auto">Thanks</p>
]]></description><link>http://64.23.185.212/forum/post/599</link><guid isPermaLink="true">http://64.23.185.212/forum/post/599</guid><dc:creator><![CDATA[LynneJohn]]></dc:creator><pubDate>Wed, 03 Jan 2024 14:08:11 GMT</pubDate></item><item><title><![CDATA[Reply to RS485 BACnet sniffing on Thu, 14 Dec 2023 19:18:18 GMT]]></title><description><![CDATA[<p dir="auto">We looked at the Modbus Packet Templates because ModBus RTU uses time gaps to signal the Beginning/End of a packet. It is not clear how the time stamp works with this as timestamps are not shown in the templates. Tried doing a straight hex dump of the log file to see if we could import it into WireShark but when you save the log as a text file, WireShark takes it as a single packet. Any way to break the packets apart by gaps in the time stamp?</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1702581492494-capture.jpg" alt="Capture.JPG" class=" img-responsive img-markdown" width="1292" height="825" /></p>
]]></description><link>http://64.23.185.212/forum/post/577</link><guid isPermaLink="true">http://64.23.185.212/forum/post/577</guid><dc:creator><![CDATA[LynneJohn]]></dc:creator><pubDate>Thu, 14 Dec 2023 19:18:18 GMT</pubDate></item></channel></rss>