The Java Feeder

This forum is for users who are developing applications (or resources) to work alongside BaseStation (i.e. add-ons) and who wish to discuss development techniques.

Moderators: KineticChris, KineticDavid, Moderators

Post Reply
edgy31

The Java Feeder

Post by edgy31 » March 13th, 2010, 6:29 am

The purpose of the feeder is to provide a way to exchange data with other spotters, and not consume a lot of bandwidth sending TCP socket 30003 raw data.

It actually has two components. The TCP socket 30003 data is processed into tracks, and then these tracks are immediately sent out a UDP Multicast port onto your LAN. Thus any computer on your LAN can startup a track viewer and sniff the multicast packets as they fly by. The second component is UDP Unicast packets that can be directed to other users on the Internet cloud. This link can be compressed and the cycle time specified. For example, you can send any tracks that have been updated a specified time, such as every 10 seconds.

These UDP packets on the Multicast and Unicast paths don't have to connect to another Viewer, and your Viewer can receive multiple tracks from multiple sources, and none of them have to TCP connect to your PC. It is broadcast data essentially. If one of the broadcasts gets lost, no big deal, you'll get another broadcast soon.

The broadcasts are much smaller size, and not as verbose as the raw TCP 30003 socket. Thus, you can add more users into your spotter exchange.

This feeder should work with the radarbox as well, and either Windows or Linux.

The Java (requires JRE 1.6) files for doing this are at:

obsolete

This is a hobby program, and not a commercial product. The source is also provided for those that want to modify, or convert it to another language.
Last edited by edgy31 on December 13th, 2010, 5:38 pm, edited 3 times in total.

User avatar
bones
Posts: 9737
Joined: August 8th, 2005, 4:44 am
Location: Isle of Man
Contact:

Re: The Java Feeder

Post by bones » March 13th, 2010, 10:42 am

MicroSoft want me to spend $30 to view your wps works file.
Opens fine in Word here.

edgy31

Re: The Java Feeder

Post by edgy31 » March 13th, 2010, 1:44 pm

vk4tec wrote:Can you write a bit about the content of the data packets.

What information is supported ?

obsolete
Last edited by edgy31 on December 13th, 2010, 5:38 pm, edited 2 times in total.

edgy31

Re: The Java Feeder

Post by edgy31 » March 13th, 2010, 10:50 pm

I think the doc file might have left it out, but the java JAR and config files all go into your "home" directory.

On Vista this is c:\users\<login name>
On Linux this is /home/<login name>
On XP it is c:\Documents and Settings\<login name>

Good luck!

edgy31

Re: The Java Feeder

Post by edgy31 » March 14th, 2010, 4:05 pm

I know the multicast thing is kind of confusing.

The original program had you add each of your computers to a list, and then sent all the targets to each computer in the list, one after the other.

So, if you had three machines on your LAN, the program would send the same information to each machine. Kind of a waste of bandwidth, when you can send it once, and all three machines get it at the same time.

There's a particular IP address range you have to use with multicast packets. There's no reason to change the one I use in the example config file. This IP address is in the correct multicast range.

Since the packets are both UDP, you have to use a different port for multicast than you use for unicast. I've been using 31090 because it has 1090 in it for multicast, and 30339 for unicast. Anyway, don't make them the same port. Maybe nothing will happen, but it is confusing for me (smile).

So, the ADSCast program builds tracks, and then sends these tracks to all the machines on your LAN with just one broadcast. Included is an optional unicast broadcast that you can send to your fellow spotters. You don't have to use this, and if you comment out the particulars the caster won't waste time on it. The IP address or hostname you enter here, will be an address outside your LAN. Like in another county, across the city, or maybe Japan. Just not on your LAN (smile).

Here's the picture I have: You have just parachuted in to a remote location. You put up your tent with 20 computers on the LAN, and plug your SBS-1 into the LAN router. One of the computers runs basestation and ADSCast and then all the computers inside the tent see the same tracks at the same time via multicast and ADSViewer. Then this guy hooks up a radio to the router and aims it at a satellite that hooks onto the Internet. Then you can add your Internet friends onto the Unicast config line. ADSCast will send the tracks to each computer in the unicast list, one after the other.

Hope this helps :-)

edgy31

Re: The Java Feeder

Post by edgy31 » March 14th, 2010, 4:29 pm

Back in the early Internet days, a person could broadcast Multicast packets great distances. I remember my college could multicast to another college.

Alas, the Internet is such a hostile place today, that many ISP block multicast packets. So multicast is pretty much something you do inside your LAN, and you would probably have to set up a tunnel between LAN's to exchange multicast packets with someone on the Internet.

That's the reason I have the Unicast configuration. It sends the same packet to each computer, one after the other.

Not as neat as multicast, but works with your ISP.

Another note, you may not like, is that some ISP's also block UDP packets. So, this whole scheme may not work for you, if your ISP is scared easily.

It's a hostile world out there....

La Terre Promise it is NOT! :-)

User avatar
bones
Posts: 9737
Joined: August 8th, 2005, 4:44 am
Location: Isle of Man
Contact:

Re: The Java Feeder

Post by bones » March 16th, 2010, 5:27 am

Working very nicely. I have ADSViewer running on my laptop and network utilization is down at 0.25%.

I like seeing the aircraft change to QNH height correctly as they pass through the Transition Level. Neat.

edgy31

Re: The Java Feeder

Post by edgy31 » March 16th, 2010, 11:33 am

I uploaded a new version of ADSViewer.jar as Bones found a bug where the config line display.metric wasn't read properly. Now you don't have to manually set your Metar display to metric anymore (argh). Being a non-metric user, this one layed dormant.

By the way, the program get's it's metar data from:

ftp://tgftp.nws.noaa.gov/data/observati ... r/decoded/

User avatar
bones
Posts: 9737
Joined: August 8th, 2005, 4:44 am
Location: Isle of Man
Contact:

Re: The Java Feeder

Post by bones » March 16th, 2010, 2:06 pm

Yep - that is working fine now..

I've changed the colour sets to look similar to my BaseStation display. If anyone is curious to try here is the rewritten adsviewer.conf file. It also changes the VFR squawk to 7000 and sets a Transition Altitude of 6000ft. Station defaults to EGNS so change to your preferred airfield.
  • #
    # ADSViewer Configuration File
    #
    # 2010-02-13 17:42:34.695
    #
    multicast.nicaddress = 192.168.0.17
    server.port = 30339
    station.name = Ronaldsway
    station.alt = 33
    station.latitude = 54.07294
    station.longitude = -4.656558
    station.metar = EGNS
    screen.height = 750
    screen.width = 960
    screen.scale = 0.0014399999999999999
    display.map_artcc_low = true
    display.map_runway = true
    display.map_airport_freq = false
    display.map_artcc_high = true
    display.map_ndb_labels = false
    display.map_fix = true
    display.map_vor = true
    display_map_airport_labels = false
    display.map_ndb = true
    display.map_runway_centerline = false
    display.map_artcc = false
    display.map_vor_freq = false
    display.map_geo = false
    display.map_airport = false
    display.map_vor_labels = false
    display.map_fix_labels = false
    display.map_ndb_freq = false
    display.latlon = false
    display.metric = true
    display.track = true
    display.ca = false
    display.low = 0 10 0 995
    display.ca-alt = 1100 100 100 9900
    display.leader = 5 0 5
    display.high = 995 10 0 995
    display.block = 0 0 8
    display.echosize = 1 1 4
    display.vfr = 7000 0 7777
    display.ca-range = 10 5 5 100
    display.vector = 2 0 60
    display.transition = 60 5 5 600
    display.echoes = 5 0 60
    display.track_font = Tahoma,10
    display.font = Tahoma,10
    display.color_geo = 51 102 0
    display.color_metar = 204 204 204
    display.color_normal_beacon = 255 255 255
    display.color_track = 204 204 204
    display.color_track_descend = 181 181 116
    display.color_track_climb = 132 204 255
    display.color_track_history = 204 204 204
    display.color_track_descend_history = 153 153 0
    display.color_track_climb_history = 153 204 255
    display.color_vor = 180 0 0
    display.color_vor_labels = 180 0 0
    display.color_ndb = 102 153 0
    display.color_ndb_labels = 102 153 0
    display.color_fix = 0 102 102
    display.color_fix_labels = 0 102 102
    display.color_airport = 0 180 0
    display.color_airport_labels = 0 180 0
    display.color_artcc = 0 204 0
    display.color_artcc_low = 0 51 51
    display.color_artcc_high = 115 0 0
    display.color_background = 0 0 40
    display.color_runways = 0 51 102
    display.color_runway_centerline = 127 127 0
Last edited by bones on March 16th, 2010, 3:12 pm, edited 1 time in total.

edgy31

Re: The Java Feeder

Post by edgy31 » March 16th, 2010, 3:02 pm

I've been spending most of my time decoding raw packets, and working on a database based program that is also web based. Last night I thought I'd start throwing together a little program that like ADSViewer sniff's the network for UDP tracks, but instead of displaying them, it just populates a mysql database.

I've gone through most of the databases, and still feel that MySQL is probably the best client/server database for home use. I run oracle stuff at work, and while I like it, it is a real mess to install. MySQL isn't much better, but it isn't hard. I've never considered the SQLite useful in this regard. Since my hosted web site comes with a free MySQL, you can see what pushed me over the edge.

Anyway, I hope to add ADSmysql.jar to the toolbox soon :-)

I'm thinking a table of ICAO ID's and detection timestamps (first, last), a table of tracks in detection order, a table of hostnames, metric counters, and timestamps in detection order. Hmm, that sort of thing.

The idea comes from my Unix background of processes that do only one thing well (hopefully), and not some monolithic program.

User avatar
bones
Posts: 9737
Joined: August 8th, 2005, 4:44 am
Location: Isle of Man
Contact:

Re: The Java Feeder

Post by bones » March 18th, 2010, 2:08 am

I'd forgotten that you have some nice touches in ADSViewer.

Aircraft changing to QNH height is mentioned below but another nicety is seeing COA91 crossing the UK right now with speed readout. In BaseStation it is sending no speed data so the reading is zero but your viewer shows a more healthy 487kts..

edgy31

Re: The Java Feeder

Post by edgy31 » March 18th, 2010, 9:37 am

Pretty common around here to see aircraft with no groundspeed. The thought came to me, that I could calculate the groundspeed and groundtrack using the history. It's an area that can be improved though, as the speeds seem to jump around even with averaging the last 10 echos. The algorithm I use is to measure the distance in nautical miles between the present position and the last echo, then divide that by the number of seconds it took to travel that far, and come up with knots. It does this calculation for every target every three seconds as it checks to see which tracks can be dropped.

It's kind of neat to watch an airplane turning to land and the heading prediction update to keep up. Reminds me of the old air defense radar :-)

edgy31

Re: The Java Feeder

Post by edgy31 » March 18th, 2010, 11:55 pm

Well poo-poo, Bones and others have discovered a unicast bug. I'm working on it Captain!

User avatar
bones
Posts: 9737
Joined: August 8th, 2005, 4:44 am
Location: Isle of Man
Contact:

Re: The Java Feeder

Post by bones » March 19th, 2010, 10:49 am

And working well too.

This ADSViewer screenshot shows coverage from just two feeds. Mine and one near Nottingham.

Sorry for the big shot but if I place it inline the quality is awful. It's pretty grim as it is - very low resolution compared to the screenshot gif.
Attachments
ADSViewer2.gif
ADSViewer2.gif (69.75 KiB) Viewed 11033 times

edgy31

Re: The Java Feeder

Post by edgy31 » March 22nd, 2010, 4:36 pm

ADSCast is being modified to a new program called ADSNet. A limitation of the unicast method, is that your port forwarding of a packet through your firewall can only address one machine. Not all the machines on your LAN. Thus, we need to make a more complex broadcaster.

I've decided to echo the unicast packets onto the multicast stream, and vice versa. So the unicast connection is sort of a tunnel for the two LAN's to be connected.

That's the plan anyway.

Post Reply