Wingbits Optimization: Graphs1090 Plus

Ok, so ya caught the Wing­bits bug and are will­ing to play the game just to see how good you can get? It’s fun to mess around with the Tar1090 tool (which I’ve cov­ered in a pre­vi­ous post) and see the pret­ty pic­tures, but…what about them numbers?

Pret­ty clear­ly here we’re see­ing that Set­up 2 is bet­ter than Set­up 1. For right now, let’s skip the “why” and ask, “How do we KNOW this?”

I know, I know, you’re super smart and you can just look at the pic­tures and see that #2 is reach­ing out further. 

Still, you might be a lit­tle geeky, and you might enjoy dig­ging into the graphs and learn­ing about the sys­tem so that you know for a fact not only how to move from #1 to #2, but how to mea­sure it along the way to make sure you’re mak­ing the right moves.

So, how do we do eval­u­ate our set­up, which include the don­gle, any fil­ters or ampli­fiers, cable, and anten­na? One way is with graphs1090.

Once you have Wing­bits installed, you get to graphs1090 by going to http://192.168.xx.xxx/graphs1090/ You’ll want to replace the xx.xxx with your local IP.

That will bring up a page that looks like this.

Offi­cial­ly, Wing­bits cal­cu­lates your rewards with this equation:

user rewards = uptime % * data provided in hex % * hex rewards * 1 Wing

The rough trans­la­tion of that is “I want you to be a reli­able source and cov­er as much ground as accu­rate­ly as possible.” 

For this post, we’ll focus on the sec­ond term, data provided in hex %.

Let’s start with the big pic­ture:

For every hex out there, there are X num­ber of avail­able mes­sages to col­lect each day. Your goal is to have a set­up that col­lects as many of those mes­sages as pos­si­ble and sub­mits them to Wingbits.

@acci via Discord

We have (at least) two issues when under­stand­ing how those mes­sages count: How many mes­sages we’re get­ting out of the total, and the clar­i­ty of the messages. 

Think of it this way: If you receive an enve­lope in pris­tine con­di­tion, open it up and have a clear­ly leg­i­ble let­ter inside, you can under­stand the mes­sage. If, on the oth­er hand, you get a torn-in-half enve­lope with water-stained and fad­ed writ­ing on the let­ter inside that you can bare­ly read, or the thing is on fire when you get it, well…you got the mes­sage, but it’s not real­ly useable.

You want to get lots of envelopes that are clear­ly readable.

There’s one more thing when it comes to test­ing your set­up: Some of us have an unfair advan­tage when it comes to test­ing.

I live in San Diego, which has an inter­na­tion­al air­port and is a tourist des­ti­na­tion. We almost always have air­craft in range. I’ve got two rigs out­doors and up high. Dur­ing most week­days each can eas­i­ly see over 500 message/second. You’ll see the “messages/second” down in the ADSB-Max­i­ma box, and it’s a good mea­sure of just how busy things can get. 

My bud­dy r4wk, on the oth­er hand, lives way out back of beyond and rou­tine­ly gets less than 50 mes­sages a sec­ond. Unless he decides to pack up and live clos­er to a major air traf­fic hub, it’ll just take him longer to gath­er enough data to make a good decision.

So, how much data do you need? It depends on what you’re try­ing to know, and how sure of the data you want to be. You can get a rough idea of how many air­craft you’re track­ing by look­ing at the ADS‑B Air­craft Seen / Tracked graph, but keep in mind that’s not the total, just a per sec­ond amount over the course of the time peri­od you’re look­ing at.

If you want to know exact­ly how many planes you see in a giv­en time peri­od, you can install and run the Unique Air­craft Track­er which you can find on my Github. By default its set for 15 min­utes, but you can change it to any length of time. 

gk@wingbits:~ $ python3 unique_aircraft_tracker.py
Unique aircraft in the last 15 minutes: 106

If you’re geo­graph­i­cal­ly lucky and can “see” a ton of plans, your test­ing peri­od can gen­er­al­ly be shorter.

If you’re like my bud­dy r4wk, you’ll need more time to gath­er the same amount of data. You’ll need to fig­ure out what works for you, in your situation.

Ok, so with “how many planes/messages do you need” addressed, what else should you look at?

We’ll start with using graphs1090 to tune your set­up a bit. I’d rec­om­mend you do this in the ear­ly evening, after a full day of mes­sages. Set the timescale to 24 hours (at a min­i­mum), then look at the sec­tion marked “Mes­sages > ‑3 dBFS”. This is the first ROUGH step of gain tun­ing, there is a deep­er dive into why dBFS isn’t the only met­ric to use over here.

In gen­er­al, you want that to be less than 10%.

The “dB” is prob­a­bly famil­iar to those of you who’ve deployed Heli­um Hotspots. This is your RSSI, or Received Sig­nal Strength Indi­ca­tor. The FS refers to the dB being mea­sured Rel­a­tive to Full Scale, where Full Scale is 0. You don’t want to reach Full Scale. 🙂 Think of Full Scale (in our enve­lope exam­ple before) as your enve­lope being on fire. Very hard to read a burn­ing envelope.

Now, you might think you just want to stay hell away from those red lines. How would you do that? By turn­ing down your gain. Think of (and yes radio nerds, I know this isn’t exact­ly right) gain as vol­ume. As you crank the vol­ume, at some point it gets dis­tort­ed and becomes dif­fi­cult to hear what’s going on.

How do you tune your gain? First, there’s a way to def­i­nite­ly NOT do it; DON’T use the the Auto­mat­ic Gain Opti­miza­tion script. It won’t get you where you want to go fast enough, and it may over­shoot in either direction.

You can see your cur­rent gain in the graphs1090 sec­tion labled (odd­ly), “Misc”. Here, you can see my gain is set to 38.6

Chang­ing gain is easy (and let’s be hon­est, it’s fun to fid­dle with this!). Open up a Ter­mi­nal to your Pi or what­ev­er you’re using and type this, where “xx.x” is the gain you want.

sudo readsb-gain xx.x

Your options are lim­it­ed to the fol­low­ing. If you set some­thing else, it’ll snap to the near­est num­ber in the fol­low­ing list.

0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6 -10

You CAN get around this with an exter­nal gain tuner, but for now let’s just use what you already have.

Once you’ve set your gain, you can wait a bit and watch the 1090graph tables, OR you can stay in the com­mand line and exe­cute this, to give you a real time gain read over a spe­cif­ic time peri­od since readsb started.

grep -sh /run/{dump1090,dump1090-fa,readsb}/stats.json -e '' | jq '.total.local | ((.accepted | add), .strong_signals, .signal, .noise)' | xargs -n4 echo | awk '{printf "\nPercentage of strong messages: %.3f\nSignal: %.1f\nNoise: %.1f\n", $(2) * 100 / $(1), $(3), $(4)}'

That will return some­thing like this:

Percentage of strong messages: 6.657
Signal: -10.0
Noise: -22.3

In that com­mand, you can change the word total in .total.local to one of the fol­low­ing to read the last 1 minute, 5 min­utes, or 15 minutes.

last1min
last5min
last15min

I’d sug­gest at least 15 min­utes, but part of the joy of this whole thing is muck­ing about with it and decid­ing what works for you.

Now that you’ve set your gain, let’s make sure you did­n’t set it too high (or too low).

We’ll use the ADS‑B Range graph to help us con­firm that we’re still get­ting enough range even as we turn down our gain.

You can also run the Unique Air­craft Track­er Python script from above, chang­ing your time peri­od to match what you’re testing.

Here in San Diego on a week­day, I’d be pret­ty com­fort­able run­ning 15 minute tests after I changed some­thing on the rig. That could be the gain, or a dif­fer­ent anten­na, or a new fil­ter, etc. 

At this point (mid-Novem­ber 2023) it’s dif­fi­cult to say what to aim for with Wing­bits. It’s not clear if we want max range, or a low amount of “too hot” mes­sages, or the max­i­mum num­ber of air­craft. My *guess* is that you’ll be best off strik­ing a bal­ance with all three. Remem­ber, that’s just a guess; the offi­cial goals haven’t been released.

Going Further — ADS‑B Analysis With Dirk Beer

Ok, let’s say you want even more number‑y stuff. Where might you turn? Why, my good friend and fel­low San Die­gan Dirk Beer! Dirk has writ­ten an addi­tion­al Python script to help assess your range.

It does this by mak­ing an assump­tion; the air­craft that just trans­mit­ted via ADS‑B will do again. If you received the first trans­mis­sion, you should receive the next. If you don’t receive the next, it’s not because the air­craft ceased to exist, it’s that your rig no longer has the range to ade­quate­ly hear it.

You can find Dirk’s scripts along with his well writ­ten instruc­tions over on his Github.

Run­ning them will give you a graph like this:

You can use this to act as a check the range report­ed with my Python scripts, then con­tin­ue to adjust your gain (or oth­er aspects) accord­ing­ly. Dirk has been work­ing a bunch on this late­ly, and you may find that you’ll get most of the infor­ma­tion you need just from his script.

What­ev­er you do, have fun with Wing­bits, enjoy learn­ing about new tools and ways to use ’em, and have a blast! Huge thanks to @acci, @grayhatguy, @dirkbeer, and @r4wk for the help with this post; this com­mu­ni­ty is so rad!

Thanks a ton for read­ing through this, hope­ful­ly you found it helpful. 

If you’d like to go deep­er into more projects, con­sid­er join­ing the Gris­tle Crüe, a paid mem­ber­ship I main­tain for peo­ple seri­ous about learn­ing in the DePIN space. We cov­er lots of projects as well as entre­pre­neur­ial opportunities. 

If that’s not quite your jam but you’d still like to sup­port, check out a week­ly pub­lic show I run called State of the Net­works. It’s focused more on pub­licly avail­able news and updates in the wider DePIN space. 


Comments

One response to “Wingbits Optimization: Graphs1090 Plus”

  1. […] Graphs1090 gives you some more stats to geek out on. If you want to go deep­er into it, check out this article. […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.