Signal Strength Heatmap

He posted in another thread that he installed it. If he didn’t, then it would throw up an error before it gets to this point.

Yes, you can see the output here.

I just removed the upintheair.json file and ran it again. I still get an error but it’s a little different.

"/dev/stdin" line 101: warning: Cannot find or open file "/tmp/tmp.TmzGqNEbyZ/32"

Just as a side note caius: mktemp does not create a tmpfs.

And for Raspbian at least /tmp is not mounted on a tmpfs im i’m not mistaken.

Please make sure you have the most current version.
Also post the complete console output, it may help.

polar.sh was last updated eight days ago, I grabbed it at the weekend so it’s the most current version.

Full output:

pi@new_external_tracker:~ $ ./make_heatmap.sh
HWT OK
Using disk : /home/pi/heatmap
Using local archive:
Unpacking compressed data:
.....................................
Retrieving recent history:
..
Number of data points collected: 3222432
Calculating Range, Azimuth and Elevation data:
Filtering altitudes
Processing heywhatsthat.com data:
Generating all altitudes heatmap...
Generating high altitude heatmap...
Generating low altitude heatmap...
Generating close range heatmap
Generating elevation heatmap...
"/dev/stdin" line 101: warning: Cannot find or open file "/tmp/tmp.TmzGqNEbyZ/32"
Generating Range/Altitude plot...
Generating Close Range altitude plot
Graphs available at :
http://192.168.1.185/dump1090-fa/data/plots.html
Graphs rendered in 1379 seconds

I checked and the directory in /tmp is there but the file called 32 is missing.

What is the rh did you use at the start of the file?

@Caius is that rh above ground or above sea level?
Reading the script it’s meters above sea level.

@keithma My best guess the rh you specified is too low.
It should be the same AMSL as used in the creation of the heywhatsthat ID. (converted to meters)

I used 22 which is my height AGL. I don’t remember exactly what I set on heywhatsthat but the aerial is 10m above the ground so 32 makes sense.
I’ve run it again with the altitude set to 32 but now I get this:

Generating elevation heatmap...
"/dev/stdin" line 101: warning: Cannot find or open file "/tmp/tmp.SjlEhIc5gB/42"
Generating Range/Altitude plot...

With the new rh of 32, delete upintheiar.json and run the script again :slight_smile:

Pretty sure you mean AMSL :slight_smile:

Picky :smiley: Yes, I did. I’m 22m ASL and the feeder is 10m AGL (actually currently about 12m AGL).

Done that again and it’s working perfectly, thank you. I’ve got it set to run at 23:30 each evening so it’ll always show the last day.

mktemp -d makes a random named directory in /tmp. On my installation at least, tmp is mounted on tmpfs. Whether that is still the case for a fresh image of buster I don’t know, but this one was upgraded from stretch, and jessie before that.

image

The height should be set in meters above sea level and should match what you used when you created the heywhatsthat ID. The script requests a range ring for the receive height + 10m to use to generate the horizon line. It’s pretty arbitrary, but the value has to be higher than the receiver or heywhatsthat won’t return anything, and using one closer to the receiver doesn’t look right. The horizon line is quite approximate rather than being an exact representation, because I can’t get the proper horizon from the heywhatsthat API, even though it can be shown on their map. The approach I used was that a range ring of fixed altitude, would vary in angle with the horizon depending on how far away it was, so high ground would be closer in and have a higher angle, and flat sea or horizon would be further away and lower.

The problem in the script when changing receiver height is that it won’t download a new upintheair.json if one already exists, so if you make a change to the height and leave the old json there the change won’t be reflected in the file that is used, however the script will expect data for the new value to be there. Which of course it isn’t. I ran out of arguments I could pass to gnuplot, so the method used is not very robust at the moment - it just assumes that a particular file will be there and complains if it isn’t. I’ll have to come up with a better way to do it so people don’t have to fiddle to make it work.

Is polar.sh intended to work with remote systems that do not have timelapse1090 installed?
At present the script does not work for remote systems with only dump1090-fa as it looks for aircraft.json in a local directory.

At the moment it won’t work for remote systems without timelapse1090 installed because it just retrieves the data from that via ssh. It is relatively simple to change the script to work on remote systems and gather the aircraft.json however.

If you change line 101, which is currently this:

jq -r '.aircraft | .[] | select(.lat != null) | select (.lon !=null) | select(.rssi != -49.5) | [.lon,.lat,.rssi,.alt_baro] | @csv' /run/dump1090-fa/aircraft.json >> $wdir/heatmap

to this:

curl -sS http://$pi/dump1090-fa/data/aircraft.json | jq -r '.aircraft | .[] | select(.lat != null) | select (.lon !=null) | select(.rssi != -49.5) | [.lon,.lat,.rssi,.alt_baro] | @csv' >> $wdir/heatmap

and make sure the ip address of the remote pi is set at the top of the script. You also need to remember to change the lat/lon and heywhatsthat ID to match those for the remote receiver, and delete any existing upintheair.json file before running.

Edit - just tested it and it does work OK, so try it and see how it goes.

1 Like

Once I installed curl, all seems good now thanks.

Hi @caius

is it possible to get the image without they HWT circle? In the script it’s mentioned “doesn’t work without it”

I was running it this morning for a few hours and my wife : “wow, please print it for our wall, but without that circle”

I could do Photoshop and get it black, but maybe there is a smarter way of doing it :slight_smile:

As a quick fix, you could just remove the lines that plot the range circle. For example, lines 246-248 plot the complete heatmap:

plot dir.'/heatmap' u ($6):($5/1852):($3) with dots lc palette, \
        hwt.'/12121' u  ($4):($3/1852) with lines lc rgb "white" notitle, \
        hwt.'/12121' u ($4):($3/1852) every 359::0::359 with lines lc rgb "white" notitle

If you remove the last two starting hwt and the , \ from the end of the first line it will plot the heatmap without the range circle.

Alternatively you could grab an older version of the script before the range rings were added, though there may have been some bug fixes since then.
https://raw.githubusercontent.com/caiusseverus/adsbcompare/f2143c9e110a87490415692948f4d15ef82d38df/polar.sh

OK, thanks, will give it a try :+1:

I let it running today for four hours (4pm to 8pm local time) with a frequency of 5 seconds.

Good results if living close to busy routes and one of the largest airports (Frankfurt)
Some blind spots where either the antenna needs to be adjusted and geographic limitations cannot be removed :slight_smile:

I also need to play a bit with the value regarding max range

2 Likes

@caius
In regards to the range outline: The process described here Bake a Pi uses a diffraction of 0.25, that’s where some differences come from i guess.

I’m not sure what is strictly “correct”.

I did have a look at the diffraction value before, and from what I can gather from the heywhatsthat technical FAQ it refers to optical diffraction not RF. I’m not sure how much difference it makes to the accuracy of the range, or whether it takes into account ground shape.

I suspect that the difference is not too large, and that the range should probably be taken with a pinch of salt anyway, as practical considerations will have some impact.

@caius
@wiedehopf

Please see this post: