What is the Maximum Range I can Get?

That’s not what obj said. wget is the method for doing it by hand. The script.js cannot do it directly from the browser.

Have to agree with toverfield here. I tested the (manual) wget command on my Pi and it did indeed download a populated json file. Additionally, the wget is the exact method that jprochazka’s script uses to fetch the json file.

@toverfield
@mgunther
Thanks for correcting my misunderstanding. But then why @phillx19090 failed with wget? Any ideas?

Check you have single-quoted the URL (at both ends, with the same quote type!) since it has shell metacharacters.

An incorrect id will cause an empty json file to be returned. That’s one possibility. Another is that he did not put the whole command on one line. The comments I copied/pasted from the latest dump1090 script.js may be a bit confusing since they have a line break and the full wget command is split across two lines.

@phillx19090

Where to find your heywhatsthat ID?

===================================================================

Copy-paste wget command from below. After pasting in terminal, replace XXXX by your ID from heywhatsthat site.


sudo wget -O /usr/share/dump1090-mutability/html/upintheair.json 'http://www.heywhatsthat.com/api/upintheair.json?id=XXXX&refraction=0.25&alts=3048,9144'
# add ,6096 at the end if you want 20,000 feet ring also. 
# add ,12192 at the end if you want 40,000 feet ring also.


EDIT: Updated wget command to writte the json data to a file directly in the required place and required name (i.e. in the folder /usr/share/dump1090-mutability/html with name upintheair.json). I have missed out that part of command. Thanks to @phillx19090 for giving a complete command in his post below.

.

Many thanks for all the advice guys.

wget -O /usr/share/dump1090-mutability/html/upintheair.json \ ‘http://www.heywhatsthat.com/api/upintheair.json?id=XXXX&refraction=0.25&alts=3048,9144

wget -O /usr/share/dump1090-mutability/html/upintheair.json “http://www.heywhatsthat.com/api/upintheair.json?id=XXXXXXXX&refraction=0.25&alts=3048,12192

User error again! I didn’t appreciate that there was a \ at the join of the two lines in the first example. The second example worked perfectly.

Thanks again.

Phill

@obj
The default value of refraction on heywhatsthat site is 0.14, but you have specified refraction=0.25. I am not sure, but feel this is due to slight difference in propagation parameters of Light waves & Micro waves, and will cover for difference between optical and radio horizons (For microwaves, the radio horizon is farther than optical horizon by say 50 nautical miles or so).

Yes. See the note at the end of this post: post183592.html#p183592

Thanks. I have missed that note. My oversight, possibly due to this one-line note being below a large image at the end of the post.

I’m having trouble getting this working. I followed wnypoker’s instructions to the letter. In ‘vi’ I used ‘:set list’ to make sure I didn’t have any extraneous characters in the file. It looks good. Now I see this about the upintheair.json. Do I need that as well as wnypoker’s instructions? I did ‘wget’ my json file as described below. Do I need to update/rebuild dump1090-muta to get this to work?

in /usr/share/dump1090-mutability/html I have added the files

  1. 12000.js (my javascript file with coords as per wnypoker
  2. modified script.js
  3. modified gmap.html
  4. upintheair.json downloaded with wget from mutability (this produced a populated file)

I’m just getting the endless spinner. :frowning:

Edit: Nevermind. :blush: Got it working. Thanks to all. This is great! :smiley:

Congratulations! Did you find what went wrong?

[quote=“abcd567”]

It wasn’t working when I followed wnypoker’s instructions (sorry). Next I created the upintheair.json and it worked. I got confused reading this thread. Probably just me being dense. :laughing:

[quote=“jepolch”]

wnypoker’s instructions came first, and were ok.
Shortly after that, obj included necessary coding in script.js and also included a script to pull the json file automatically when user enter their heywhatsthat ID, but the heywhtsthat site had restrictions to automatic pull of the json data. Then obj added a comment in the script.js file, as well as posted in this thread, advising users to pull the json data manually by wget command.
obj’s mods have made wnypoker’s steps unnecessary.

love that heywhatsthat reach rings - thanks to abcd + lignumaqua for sharing.
does anyone already integrated them in virtual-radar-server?

click picture to enlarge
https://dl.dropboxusercontent.com/u/39745369/hey_rings_s.jpg

Thanks! That clears up my confusion.

Just to be clear, this isn’t really something that heywhatsthat is limiting, it is a general browser security restriction on javascript that forbids cross-origin resource sharing, i.e. a script cannot request data from a different domain unless it’s explicitly permitted by the datasource.

en.wikipedia.org/wiki/Cross-ori … ce_sharing

@obj
Thanks for clarification about cross origin resource sharing.

… finally did a small (quick and dirty) change in dump1090 look with heywhatsthat rings:

https://dl.dropboxusercontent.com/u/39745369/hey_rings_mod_s.jpg

I’ve been experimenting with live plotting the maximum range within the normal dump1090 Google map. In the image below, the red and blue polygons are the 10,000 ft and 30,000 ft predicted polygons from HeyWhatsThat.com.

The green polygon is continuously updated as new positions come in showing the maximum range actually achieved in the current session at any altitude. Actually the polygon is saved in browser Local Storage, so it will survive between web sessions and you can keep building it up for as long as you like. It’s quite interesting to reset this and then watch as aircraft move and ‘push’ the polygon larger. :laughing: The map shown here was after about 6 hours of collecting data for the range polygon.

It follows the shape of the predicted 30,000 ft contour fairly well. I’m not sure if the dead area south west of San Antonio is because I can’t see it, or because it’s just not an area where flights normally track. I ought to plot the 40,000 ft contour instead I think.