FlightAware Discussions

UAT Translation from Dump978-fa

If i knew you had a clue i would’ve pointed you in the right direction earlier :slight_smile:
But i didn’t feel like actually writing a script and testing it.

You could just delete most from the combine1090.sh script in my the github repository i linked.

socat has a mode to connect to stdout and the timeouts should already be in place, the while loop as well.

3 Likes

Works! :slight_smile: MUCH MUCH simpler.

3 Likes

Is it possible to make this simple enough for a noob like me to install? I have VRS running on the same Pi as 3.7.1 operates from.
Thanks,
Glenn

1 Like

socat -u tcp4-connect:127.0.0.1:30978,forever,interval=5,fork STDOUT | exec /home/pi/builds/dump978/uat2esnt | socat -u STDIN tcp4-listen:30977,forever,interval=5,fork

This should do it a bit better with socat like you said. Like Rick Astly it will never give up, not let you down, and will keep listening forever, retrying every 5 seconds until it reconnects. Tested running it against my dump1090 message log, restarting the Pi and Dump1090.

while true
do
socat -v -u tcp4-connect:127.0.0.1:30978,forever,interval=5,fork STDOUT | exec /home/pi/builds/dump978/uat2esnt | socat -v -u STDIN tcp4-listen:30977,forever,interval=5,fork
sleep 5
done

This looks right? Maybe.

And to others interesting I will try and make this easier to setup soon…

2 Likes

30978 doesn’t produce Basestation format output, 30978 emits the raw UAT messages.

More generally, the reason why dump978-fa doesn’t include uat2esnt is that I’m trying to get away from that translation step - it will cause some minor problems if the data ever gets looped back to a feeder (either piaware or another feeder) and it naturally loses information.

Ideally what would happen is that more software like VRS would start adding native UAT support. But I appreciate that this doesn’t help you right away!

A middle ground might be to produce a kinda-like-Basestation format output on a separate port (i.e. decoded data) as that is less likely to be misinterpreted as “real” 1090MHz data further downstream. I just don’t want to patch this up so much that it becomes the expected way of doing things and so nobody builds proper support for UAT. It’s way better if you can use software that directly understands UAT, because UAT’s message layouts are fundamentally different to 1090MHz ADS-B and you’re always going to lose information converting between them.

4 Likes

Ah yes I meant raw. Sorry about that! Everything else is perfectly understandable. If UAT is going to be used, programs like VRS and such should understand UAT data as it does contain a lot more info than most ADS-B and 1090mhz data generally, and like you said you lose info in the translation down to the most common level. However I see this as coming very slow, as UAT is only supported in the United States for now. For now, this translation works to just get the planes on my VRS map… a basestation output would be VERY helpful so custom scripting wouldn’t be needed, not that running one command is hard for now.

FYI, this is the final command you want to run. The other one I had I slipped “fork” option in accidentally, which ran a new socat process. After a few days I had a hundred or so socat processes, which sent my Pi’s CPU close to 70C :slight_smile: I also added a loop. Simply follow Step #1 above to compile uat2esnt, then write this file somewhere. chmod u+x it, and you’re good! It will output AVR Beast data on port 30977 in this example.

#!/bin/bash
while true
do
socat -u tcp4-connect:127.0.0.1:30978,forever,interval=5 STDOUT | /home/pi/builds/dump978/uat2esnt | socat -u STDIN tcp4-listen:30977,forever,interval=5
sleep 1
done

1 Like

Using the script, i can get VRS to connect to it, but it never sees any messages or planes.
Very weird.
I’ve run the first part of the command with the pipe to uat2esnt or uat2text and it spews tons of lines, for some reason VRS doesn’t like the data I guess.
I have the receiver in VRS set to AVR or Beast, and it does show connected.
Only difference is my VRS is on a different host, but it connects to the pi fine for 1090 or MLAT, so not sure why the 978 connection isn’t working.

Can you post a sample output?

$ socat -u tcp4-connect:127.0.0.1:30978,forever,interval=5 STDOUT |  uat2esnt

<000000000000FF922B0E599107715EB01459019FAE;
<000000000000FF922B0E59910774F272C236476D6E;
<000000000000FF922B0E5999800580A00400FF36F4;
<000000000000FF922B01E9911B7163061A5456FE3E;
<000000000000FF922B01E9911B74F6B4C81070EFED;
<000000000000FF922B01E999805E0200040080D65E;
<000000000000FF922B01E9911B8163061A60BE32C9;
<000000000000FF922B01E9911B84F6B4C81C99721E;
<000000000000FF922B01E999805E01C004009C2D54;
<000000000000FF922B0C469109F102F622A0284B2F;
<000000000000FF922B0C469109F49840D02F8FBE07;
<000000000000FF922B0C4699845602600400C720D8;
<000000000000FF922B0E38911D60E4104034F0787A;
<000000000000FF922B0E38911D6479DCED23213522;
<000000000000FF922B0E3899805B8D200400C2A559;
<000000000000FF922B0947912951322E4228044F46;
<000000000000FF922B0947912954C6AEEF0C0F77DE;
<000000000000FF922B09479980549348E000ED7742;
<000000000000FF922B09479127E131EA42346C0320;
<000000000000FF922B09479127E4C66AEF17E4EC69;
<000000000000FF922B094799803E9468E400FE667E;
<000000000000FF922B09F4910BB119BE20DA7AC0FF;
<000000000000FF922B09F4910BB4AEA6CE74C2D1B5;
<000000000000FF922B09F499843688482000A3D8F7;
<000000000000FF922B0E38911D70E3CE4052EEA3BF;
<000000000000FF922B0E38911D74799CED4066CB52;
<000000000000FF922B0E3899805C8CE0040080909F;
<000000000000FF922B0E38911D60E3B2405D6A9C70;
<000000000000FF922B0E38911D647980ED4B2D48D0;
<000000000000FF922B0E3899805B8D00040087D970;
<000000000000FF922B09479127C131D842537358AF;
<000000000000FF922B09479127C4C658EF36F810AB;
<000000000000FF922B094799805C9228E80061341A;
<000000000000FF922B0782910F419379F6FB2298FA;
<000000000000FF922B0782910F452658A578AA91E6;
<000000000000FF922B0782998442080004004D0D4A;
<000000000000FF922B0947912721316A425A3C3195;
<000000000000FF922B0947912724C5EEEF3C03C772;
<000000000000FF922B09479980329468F00032F536;
<000000000000FF922B09F4910B91197820C2570CF2;
<000000000000FF922B09F4910B94AE60CE5CEE3CD0;
<000000000000FF922B09F499843588682400DB8D8C;
<000000000000FF922B094791272131504256D14B7C;
<000000000000FF922B0947912724C5D4EF391139FE;
<000000000000FF922B09479980289468F0001C1A3A;
<000000000000FF922B0DF59113412B8E2532493589;
<000000000000FF922B0DF5911344C02AD2B3F52962;
<000000000000FF922B0DF599804C09402000A314C9;
<000000000000FF922B09F4910B81196820B0B85A11;
<000000000000FF922B09F4910B84AE50CE4A466CFC;
<000000000000FF922B09F499843887E828001D488F;
<000000000000FF922B0C46910B010396225C35B311;
<000000000000FF922B0C46910B0498DCCFEDA36D09;
<000000000000FF922B0C4699844106600400514D1E;
<000000000000FF922B09479125C1310C425BEC7905;
<000000000000FF922B09479125C4C590EF3E9F81E8;
<000000000000FF922B094799801B94A8F000280CB7;
<000000000000FF922B094791257130E8425DFE1780;
<000000000000FF922B0947912574C56CEF40172642;
<000000000000FF922B094799800F94C8F000DB0F14;
<000000000000FF922B09F4910B71194C20A7DC9269;
<000000000000FF922B09F4910B74AE36CE424CB4C4;
<000000000000FF922B09F499843788282400576042;
<000000000000FF922B0C46910B0103AC2250D8C9F8;
<000000000000FF922B0C46910B0498F2CFE1A402F4;
<000000000000FF922B0C469984410680040074CDC8;
<000000000000FF922B0947912501308A426647C4CF;
<000000000000FF922B0947912504C510EF48CF23E9;
<000000000000FF922B094799800A9488EC00F654B0;

That looks strange for an AVR type message.

Which version for uat2esnt are you using?

Can you try using this switch:
uat2esnt -t
(it excludes tis-b messages, those are not recognized by VRS)

uat2esnt is the current version from git - up to date ( the -t option was the last add) 9aea4f4a2a5acf07e3d428e365ae330676bed8b9

$ socat -u tcp4-connect:127.0.0.1:30978,forever,interval=5 STDOUT | uat2esnt -t

<000000000000FF96ACA651902B00F7120770E7F560;

<000000000000FF96ACA651902B048C8EB594A70845;

<000000000000FF96ACA65199005C8EB80800E5FEFF;

<000000000000FF96ACA651902B00F6FA077978AE88;

<000000000000FF96ACA651902B048C76B59DCEEAEE;

<000000000000FF96ACA65199005C8EB808091A7A9A;

Blockquote

And

$ socat -u tcp4-connect:127.0.0.1:30978,forever,interval=5 STDOUT | uat2text
HDR:
MDB Type: 0
Address: ACA651 (ICAO address via ADS-B)
SV:
NIC: 9
Latitude: +37.4383
Longitude: -122.4326
Altitude: 7400 ft (barometric)
N/S velocity: -112 kt
E/W velocity: 88 kt
Track: 141
Speed: 142 kt
Vertical rate: 192 ft/min (from geometric altitude)
UTC coupling: yes
TIS-B site ID: 0
RSSI: 0.0 dBFS

HDR:
MDB Type: 1
Address: ACA651 (ICAO address via ADS-B)
SV:
NIC: 9
Latitude: +37.4379
Longitude: -122.4322
Altitude: 7400 ft (barometric)
N/S velocity: -111 kt
E/W velocity: 88 kt
Track: 141
Speed: 141 kt
Vertical rate: 192 ft/min (from geometric altitude)
UTC coupling: yes
TIS-B site ID: 0
MS:
Emitter category: Light <= 7000kg
Callsign: squawk 3354
Emergency status: No emergency
UAT version: 2
SIL: 3
Transmit MSO: 62
NACp: 10
NACv: 2
NICbaro: 0
Capabilities: CDTI
Active modes:
Target track type: true heading
AUXSV:
Sec. altitude: 7625 ft (geometric)
RSSI: 0.0 dBFS

HDR:
MDB Type: 1
Address: ACA651 (ICAO address via ADS-B)
SV:
NIC: 9
Latitude: +37.4369
Longitude: -122.4313
Altitude: 7400 ft (barometric)
N/S velocity: -111 kt
E/W velocity: 88 kt
Track: 141
Speed: 141 kt
Vertical rate: 192 ft/min (from geometric altitude)
UTC coupling: yes
TIS-B site ID: 0
MS:
Emitter category: Light <= 7000kg
Callsign: N914JB
Emergency status: No emergency
UAT version: 2
SIL: 3
Transmit MSO: 34
NACp: 10
NACv: 2
NICbaro: 0
Capabilities: CDTI
Active modes:
Target track type: true heading
AUXSV:
Sec. altitude: 7625 ft (geometric)
RSSI: 0.0 dBFS

HDR:
MDB Type: 2
Address: ACA651 (ICAO address via ADS-B)
SV:
NIC: 9
Latitude: +37.4362
Longitude: -122.4306
Altitude: 7400 ft (barometric)
N/S velocity: -111 kt
E/W velocity: 88 kt
Track: 141
Speed: 141 kt
Vertical rate: 128 ft/min (from geometric altitude)
UTC coupling: yes
TIS-B site ID: 0
AUXSV:
Sec. altitude: 7625 ft (geometric)
RSSI: 0.0 dBFS

Can you provide a sample output for this part of the command?

$ socat -u tcp4-connect:127.0.0.1:30978,forever,interval=5 STDOUT
-80b7970335c96d4cc13cfa47ae2f1df19f29297378370c80f9b3e2b3dc887329ab99;rs=7;rssi=-20.3;t=1563142073.269;
-eb1e6d2152ee0002ff00fbdd7a61012fe6f2db775c59268aebce6df34e60700aec24;rs=6;rssi=-20.2;t=1563142935.181;

echo '-80b7970335c96d4cc13cfa47ae2f1df19f29297378370c80f9b3e2b3dc887329ab99;rs=7;rssi=-20.3;t=1563142073.269;' | ./uat2esnt 
*96B79703000000000000001077F0;

This is my output for feeding that into uat2esnt.

I’m not sure where that <0000000 comes from.
It seems to be an error.

Which git do you get the uat2esnt from?
(Mine is from https://github.com/mutability/dump978.git and i just typed make to compile it)

built it on the pi.
Looks like unicode support of some type is messing with it to me.

I can rebuilt it and play with thing.

Ironically, I just finally got FlightAirMap working hosted on my mac, so probably going to drop VRS now.

Hmm that might be why it’s a problem when you try and paste it here.

But it should be recognized as AVR by VRS.
Be sure to set the type to AVR.

1 Like

Just because this came up in another thread, compiling uat2esnt:

git clone https://github.com/flightaware/dump978.git /tmp/dump978 --depth 1
cd /tmp/dump978/legacy
make uat2esnt
sudo mkdir -p /usr/local/bin
sudo cp uat2esnt /usr/local/bin

You can now use uat2esnt either using the full path /usr/local/bin/uat2esnt or probably just by using the command uat2esnt
I’d recommend using the -t option to suppress TIS-B messages.

1 Like

Great command to see the live output

Or just connect to 30979 for json-format output (which is somewhat human-readable)

1 Like

It does show rssi…
socat -u tcp4-connect:127.0.0.1:30979,forever,interval=5 STDOUT
{“address”:“a555bc”,“address_qualifier”:“adsb_icao”,“airground_state”:“airborne”,“callsign”:“N44295”,“capability_codes”:{“es_in”:false,“tcas_operational”:false,“uat_in”:true},“east_velocity”:-10,“emergency”:“none”,“emitter_category”:“A1”,“geometric_altitude”:1075,“ground_speed”:134,“gva”:2,“metadata”:{“errors”:1,“received_at”:1567187728.264,“rssi”:-26.9},“mops_version”:2,“nac_p”:10,“nac_v”:2,“nic”:10,“nic_baro”:1,“nic_supplement”:false,“north_velocity”:-134,“operational_modes”:{“atc_services”:false,“ident_active”:false,“tcas_ra_active”:false},“position”:{“lat”:26.04828,“lon”:-80.37089},“pressure_altitude”:1200,“sda”:2,“sil”:3,“sil_supplement”:“per_hour”,“single_antenna”:true,“transmit_mso”:41,“true_track”:184.3,“uplink_feedback”:1,“utc_coupled”:false,“vertical_velocity_geometric”:64,“vv_src”:“geometric”}

A more readable version that alerts you something might show up in skyview978 - and also doesn’t disappear when the signal goes away
socat -u tcp4-connect:127.0.0.1:30979,forever,interval=5 STDOUT | grep -C “rssi”

{“address”:“a501da”,“address_qualifier”:“adsb_icao”,“airground_state”:“airborne”,“east_velocity”:-109,“ground_speed”:110,“metadata”:{“errors”:1,“received_at”:1567284218.572,“rssi”:-18.7},“nic”:9,“north_velocity”:-16,“position”:{“lat”:26.01537,“lon”:-80.19221},“pressure_altitude”:1000,“true_track”:261.6,“uplink_feedback”:0,“utc_coupled”:true,“vertical_velocity_geometric”:64,“vv_src”:“geometric”}
{“address”:“a501da”,“address_qualifier”:“adsb_icao”,“airground_state”:“airborne”,“east_velocity”:-108,“ground_speed”:108,“metadata”:{“errors”:5,“received_at”:1567284220.4,“rssi”:-21.6},“nic”:9,“north_velocity”:-14,“position”:{“lat”:26.01522,“lon”:-80.19333},“pressure_altitude”:900,“true_track”:262.6,“uplink_feedback”:0,“utc_coupled”:true,“vertical_velocity_geometric”:-64,“vv_src”:“geometric”}