<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: UAV GNSS</title>
    <description>The latest articles on DEV Community by UAV GNSS (@uavgnss6bot).</description>
    <link>https://dev.to/uavgnss6bot</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4105630%2Ff7a4c18b-0e6f-4095-a15a-bc9284f6cf31.png</url>
      <title>DEV Community: UAV GNSS</title>
      <link>https://dev.to/uavgnss6bot</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/uavgnss6bot"/>
    <language>en</language>
    <item>
      <title>Parsing Septentrio SBF logs in Python: fix-quality analysis and RTK drop forensics</title>
      <dc:creator>UAV GNSS</dc:creator>
      <pubDate>Fri, 18 Sep 2026 02:33:11 +0000</pubDate>
      <link>https://dev.to/uavgnss6bot/parsing-septentrio-sbf-logs-in-python-fix-quality-analysis-and-rtk-drop-forensics-3f3g</link>
      <guid>https://dev.to/uavgnss6bot/parsing-septentrio-sbf-logs-in-python-fix-quality-analysis-and-rtk-drop-forensics-3f3g</guid>
      <description>&lt;p&gt;If you build robots that depend on RTK, you eventually hit the moment where the fix drops from &lt;strong&gt;RTK Fixed to RTK Float&lt;/strong&gt; and nothing on your ground station explains why. The autopilot log says "float". The correction source looks healthy. The sky is clear.&lt;/p&gt;

&lt;p&gt;The answer is almost always in the receiver's raw log. If that receiver is a Septentrio, the raw log is &lt;strong&gt;SBF (Septentrio Binary Format)&lt;/strong&gt; — and it is very parseable once you know where the traps are.&lt;/p&gt;

&lt;p&gt;This walks through parsing SBF in Python and turning it into a fix-quality + drop-event report you can actually reason about. Fair disclosure up front: we're UAV GNSS, a Septentrio receiver maker, and everything below is what we built into a small open-source parser after our first version quietly produced wrong coordinates.&lt;/p&gt;

&lt;h2&gt;
  
  
  What SBF is, in 30 seconds
&lt;/h2&gt;

&lt;p&gt;SBF is a binary block format. Each block is framed by a &lt;code&gt;0xFA 0xFA&lt;/code&gt; sync marker, followed by a header (block ID, block length, TOW, GPS week) and a payload, and closed by a CRC-16/X25 checksum. Two record types do most of the work for RTK forensics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PVTGeodetic&lt;/strong&gt; — position, plus the fix mode and the satellite count (&lt;code&gt;NrSV&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AttEuler&lt;/strong&gt; — roll / pitch / heading and their accuracies (relevant if you run dual-antenna heading)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fix mode is a small integer, and it is the field you care about most:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;MODE_MAP&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;No GNSS&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Single&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Differential&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;RTK Float&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;RTK Fixed&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you only extract one number from a receiver log all day, make it this one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three bugs that bite everyone writing an SBF parser
&lt;/h2&gt;

&lt;p&gt;We rewrote ours after v1 emitted plausible-but-wrong latitude/longitude — the worst possible failure mode, because nothing crashes and your data looks fine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Field offsets are not where you guess they are.&lt;/strong&gt; In the PVTGeodetic payload we parse lat/lon/height at byte offsets &lt;strong&gt;8 / 16 / 24&lt;/strong&gt;, with &lt;code&gt;mode&lt;/code&gt; at offset &lt;strong&gt;6&lt;/strong&gt; and &lt;code&gt;NrSV&lt;/code&gt; at &lt;strong&gt;62&lt;/strong&gt;. Pick wrong offsets and you still get numbers in a believable numeric range. Always sanity-check your first epoch against a known surveyed point or the receiver's own web interface readout before you trust a single row.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Resync at the byte level — never skip a fixed stride.&lt;/strong&gt; If the sync marker doesn't match, scan forward byte by byte for the next &lt;code&gt;0xFA 0xFA&lt;/code&gt; instead of assuming an 8-byte block header and jumping. A dropped or partially-written block then self-heals instead of desynchronising the entire rest of the file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Validate the CRC.&lt;/strong&gt; SBF uses &lt;strong&gt;CRC-16/X25&lt;/strong&gt; (poly &lt;code&gt;0x1021&lt;/code&gt; reflected, init &lt;code&gt;0xFFFF&lt;/code&gt;, xorout &lt;code&gt;0xFFFF&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;crc16_x25&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;crc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0xFFFF&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;crc&lt;/span&gt; &lt;span class="o"&gt;^=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="n"&gt;crc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;crc&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="mh"&gt;0x8408&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;crc&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;crc&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;crc&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="mh"&gt;0xFFFF&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With CRC checking on, corrupt blocks are counted and dropped rather than parsed into your CSV. In our own tamper test, flipping one byte in a 30-record log dropped the parsed record count from 30 to 29 — exactly the behaviour you want from a forensics tool.&lt;/p&gt;

&lt;p&gt;One more that is easy to forget: timestamps. SBF gives you GPS week + time-of-week in milliseconds. Converting that to UTC means applying the leap-second offset (&lt;code&gt;UTC = GPS - 18 s&lt;/code&gt;, valid through 2026) — otherwise your drop events are timestamped 18 seconds off and won't line up with your flight-controller log.&lt;/p&gt;

&lt;h2&gt;
  
  
  The workflow
&lt;/h2&gt;

&lt;p&gt;The parser lives in our &lt;a href="https://github.com/uavgnss6-bot/septentrio-gnss-integration-guide" rel="noopener noreferrer"&gt;integration guide repo&lt;/a&gt;, alongside a generator that produces synthetic SBF logs with valid CRCs so you can test without flying anything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# dump a CSV: tow, wn, mode, nrsv, lat, lon, height[, roll, pitch, heading]&lt;/span&gt;
python3 sbf-parser.py log.sbf &lt;span class="nt"&gt;--check-crc&lt;/span&gt; &lt;span class="nt"&gt;--utc&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; out.csv

&lt;span class="c"&gt;# or skip the CSV and get the drop report straight to the console&lt;/span&gt;
python3 sbf-parser.py log.sbf &lt;span class="nt"&gt;--check-crc&lt;/span&gt; &lt;span class="nt"&gt;--utc&lt;/span&gt; &lt;span class="nt"&gt;--analyze&lt;/span&gt;

&lt;span class="c"&gt;# synthetic test log with two embedded 3-second RTK float drops&lt;/span&gt;
python3 make-sample-sbf.py &lt;span class="nt"&gt;--drops&lt;/span&gt; 10,20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--analyze&lt;/code&gt; prints a fix-quality summary followed by every drop event, defined as a contiguous run of non-RTK-Fixed epochs following a fixed one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Fix-quality summary (30 epochs):
  RTK Fixed     27  ( 90.0%)
  RTK Float      3  ( 10.0%)

Drop events (RTK Fixed -&amp;gt; degraded):
  #1  2026-08-27T01:46:15Z: RTK Fixed -&amp;gt; RTK Float for 3.0 s
      (NrSV at onset 12 -&amp;gt; min 6)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That mini-report is the whole point: &lt;strong&gt;duration&lt;/strong&gt; tells you how severe the event was, &lt;strong&gt;onset satellite count vs minimum during the drop&lt;/strong&gt; tells you whether satellites disappeared, and an unrecovered run gets flagged as still degraded at the end of the log instead of being silently truncated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading a drop report like a diagnostician
&lt;/h2&gt;

&lt;p&gt;Three completely different faults produce the same "it went to float" symptom on your GCS. The log separates them:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What the log shows&lt;/th&gt;
&lt;th&gt;Most likely cause&lt;/th&gt;
&lt;th&gt;What to change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;NrSV&lt;/code&gt; collapses across many constellations, degrades in one specific location, recovers when you move away&lt;/td&gt;
&lt;td&gt;RF interference desensitising the front end (power lines, electric fences, nearby 4G/5G sites)&lt;/td&gt;
&lt;td&gt;Antenna placement first; then receiver front-end capability&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;NrSV&lt;/code&gt; stays high, fix degrades only under canopy or beside structures, recovers as soon as you clear them&lt;/td&gt;
&lt;td&gt;Multipath — delayed reflections corrupting carrier-phase&lt;/td&gt;
&lt;td&gt;Raise the antenna, add a proper ground plane, move it off motor/ESC wiring&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;NrSV&lt;/code&gt; is healthy but the fix degrades for a stretch and returns&lt;/td&gt;
&lt;td&gt;Corrections were lost or stale (NTRIP dropout, radio link, cellular handover)&lt;/td&gt;
&lt;td&gt;Log correction age; check the link, not the receiver&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In practice you correlate three things on the same timeline: fix mode, satellite count, and correction age. Fix mode alone tells you &lt;em&gt;that&lt;/em&gt; you lost it; the other two tell you &lt;em&gt;why&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters for receiver choice
&lt;/h2&gt;

&lt;p&gt;The third row in that table is a link problem, and no receiver on earth fixes it. But the first row is a hardware differentiator. Receivers differ enormously in how much in-band interference they tolerate before the front end is desensitised: consumer-grade modules typically manage on the order of &lt;strong&gt;25 dB&lt;/strong&gt; of suppression, while our AIM+ receivers are specified at &lt;strong&gt;40–60 dB&lt;/strong&gt;. Same sky, same corrections, same wiring — different outcome when you drive past a pylon or work under a transmission line.&lt;/p&gt;

&lt;p&gt;You cannot see that difference in a datasheet comparison table. You &lt;em&gt;can&lt;/em&gt; see it in an SBF drop report, which is why we instrument it.&lt;/p&gt;

&lt;p&gt;If you want the written-up field guide for the satellite-count-collapse pattern, we keep one here: &lt;a href="https://uav-gnss.com/satellite-count-drop-rtk-fixed-sbf-analyzer-guide/" rel="noopener noreferrer"&gt;Satellite count drop and RTK fix loss — SBF analyzer guide&lt;/a&gt;, and the receiver range that logs this data is &lt;a href="https://uav-gnss.com/product-category/gnss-receiver/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Over to you
&lt;/h2&gt;

&lt;p&gt;Do you capture raw SBF/UBX on your vehicles, or only the autopilot's fix-status field? And when you analyse a drop, what do you plot first — satellite count, C/N0, or correction age? Curious what patterns other people are chasing.&lt;/p&gt;

</description>
      <category>gnss</category>
      <category>python</category>
      <category>robotics</category>
      <category>uav</category>
    </item>
  </channel>
</rss>
