<?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: Paulo Sérgio Amaral</title>
    <description>The latest articles on DEV Community by Paulo Sérgio Amaral (@pauloamaral).</description>
    <link>https://dev.to/pauloamaral</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%2F131190%2F0f5fb515-7bcc-43a3-b74f-ad9f0795d6d5.png</url>
      <title>DEV Community: Paulo Sérgio Amaral</title>
      <link>https://dev.to/pauloamaral</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pauloamaral"/>
    <language>en</language>
    <item>
      <title>I ported an Electron Starlink app to native Swift, then kept going</title>
      <dc:creator>Paulo Sérgio Amaral</dc:creator>
      <pubDate>Wed, 25 Nov 2026 02:26:01 +0000</pubDate>
      <link>https://dev.to/pauloamaral/i-ported-an-electron-starlink-app-to-native-swift-then-kept-going-3n46</link>
      <guid>https://dev.to/pauloamaral/i-ported-an-electron-starlink-app-to-native-swift-then-kept-going-3n46</guid>
      <description>&lt;p&gt;I wanted my Starlink's latency and outages in the Mac menu bar, one glance away, without opening the phone app. The result is &lt;strong&gt;StarPulse&lt;/strong&gt;, a free and open source (MIT) menu bar app written in Swift and SwiftUI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1kaeh9l9flklaikn25vx.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1kaeh9l9flklaikn25vx.gif" alt="StarPulse: clicking the menu bar item opens the popover, then the dashboard" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Repository and download: &lt;a href="https://github.com/paulo-amaral/starlink-macos-menubar" rel="noopener noreferrer"&gt;https://github.com/paulo-amaral/starlink-macos-menubar&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it came from
&lt;/h2&gt;

&lt;p&gt;StarPulse started as a port of &lt;a href="https://github.com/DaveyHert/dishylink" rel="noopener noreferrer"&gt;Dishylink&lt;/a&gt; by DaveyHert, an MIT-licensed Electron, React and TypeScript app for macOS, Windows and browsers. Dishylink worked out how to talk to the dish, which is the hard part. I wanted something that lived in the menu bar and felt like a Mac app, so I rebuilt it in Swift:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Swift 6 and SwiftUI, macOS 14 or later, Apple silicon and Intel&lt;/li&gt;
&lt;li&gt;No third-party dependencies&lt;/li&gt;
&lt;li&gt;A 3.6 MB download&lt;/li&gt;
&lt;li&gt;100 unit tests, runnable without any Starlink hardware&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Talking to the dish
&lt;/h2&gt;

&lt;p&gt;Every Starlink dish answers a local API at &lt;code&gt;192.168.100.1:9201&lt;/code&gt;. It speaks gRPC-web over plain HTTP: a POST with a 5-byte frame header (one flag byte, four length bytes) followed by a protobuf message. The Starlink router answers the same protocol on port 9001 at your gateway.&lt;/p&gt;

&lt;p&gt;I did not want a protobuf dependency for a handful of messages, so StarPulse has a small reader and writer for the wire format: varints, fixed 32/64-bit values and length-delimited fields. The messages are decoded by field number. The dish's history is a ring buffer of about 900 one-second samples, unrolled from its &lt;code&gt;current&lt;/code&gt; counter.&lt;/p&gt;

&lt;p&gt;Two lessons from working against an undocumented API:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Some requests have side effects&lt;/strong&gt; - Dishylink's author polled the router's &lt;code&gt;get_ping&lt;/code&gt; request every 2, 5 and 30 seconds, and each trial was followed within about 15 minutes by a router watchdog reboot. StarPulse never sends it, it only sends a fixed list of read requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Writes do not work over the LAN on current firmware&lt;/strong&gt; - The router answers setting changes with gRPC status 7 (permission denied). The few writes StarPulse makes (device pause, content filter) go through the signed-in starlink.com session, and only after checking that the router on your LAN is the one on your account.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Outage notifications without the noise
&lt;/h2&gt;

&lt;p&gt;Short drops are routine on Starlink: satellite handoffs and brief obstructions cut the link for a few seconds. A notification for each one would get the feature turned off within a day. The rule is a small state machine: announce "down" once the outage has lasted 30 seconds, then announce "back" with the duration, and only after an announced outage.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;mutating&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;isDown&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Bool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;at&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;Event&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;isDown&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;since&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;downSince&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;
        &lt;span class="n"&gt;downSince&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;since&lt;/span&gt;
        &lt;span class="k"&gt;guard&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;announced&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;timeIntervalSince&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;since&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;threshold&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;announced&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;down&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;since&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;since&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;downSince&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;announced&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;guard&lt;/span&gt; &lt;span class="n"&gt;announced&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;since&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;downSince&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;restored&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;timeIntervalSince&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;since&lt;/span&gt;&lt;span class="p"&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;The time is a parameter, so the tests replay a 95-second outage in a millisecond.&lt;/p&gt;

&lt;h2&gt;
  
  
  "It doesn't find anything"
&lt;/h2&gt;

&lt;p&gt;The most common report is the app not finding the dish, usually with your own router in Starlink's bypass mode. The Mac cannot read the router's routing table, but it can collect clues:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does this Mac have an address in &lt;code&gt;192.168.100.x&lt;/code&gt;, the dish's own range? Then packets for the dish never leave the LAN.&lt;/li&gt;
&lt;li&gt;Which interface would the kernel use to reach the dish? Connecting a UDP socket picks the route without sending a packet, and &lt;code&gt;getsockname&lt;/code&gt; reveals the source address. If that is a &lt;code&gt;utun&lt;/code&gt; interface, a VPN is in the way.&lt;/li&gt;
&lt;li&gt;Does a Starlink router answer at the gateway? If not, it is a third-party router, and it needs a static route to &lt;code&gt;192.168.100.1/32&lt;/code&gt; out of the Starlink WAN port.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;StarPulse turns these clues into one plain sentence in the popover and the dashboard.&lt;/p&gt;

&lt;h2&gt;
  
  
  What else it does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Live latency, throughput, ping success and power draw, with menu bar readouts you choose&lt;/li&gt;
&lt;li&gt;A 3D obstruction dome from the dish's map, with an hourly time-lapse&lt;/li&gt;
&lt;li&gt;Live satellites overhead through an SGP4 port, checked against the reference implementation&lt;/li&gt;
&lt;li&gt;A 3D alignment view against the dish's own target&lt;/li&gt;
&lt;li&gt;Connected devices with per-device throughput, device pause, schedules and DNS rules&lt;/li&gt;
&lt;li&gt;The Starlink app's content filter, switchable from the menu bar&lt;/li&gt;
&lt;li&gt;A speed test that says whether it ran over Starlink (SpaceX's AS14593) and grades bufferbloat&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Download it from the &lt;a href="https://github.com/paulo-amaral/starlink-macos-menubar/releases/latest" rel="noopener noreferrer"&gt;releases page&lt;/a&gt;, or build it with &lt;code&gt;swift test &amp;amp;&amp;amp; scripts/bundle.sh release&lt;/code&gt;. It is not notarized yet; the README explains the first launch.&lt;/p&gt;

&lt;p&gt;I have tested it on one Starlink kit. Reports from other hardware, firmware and bypass setups help the most. Issues and pull requests are welcome.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;StarPulse is an unofficial, independent project with no affiliation to SpaceX or Starlink. Starlink is a trademark of Space Exploration Technologies Corp.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>swift</category>
      <category>macos</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
