FlightAware Discussions

Feed data to PiAware in AVR Format from External ADS-B Receiver

Hi All,

I have a MicroADSB Version 4, Option 3 external ADS-B receiver that outputs data in AVR format over TCP based I.P. I also have a Raspberry Pi 3 running PiAware.

I’ve modified the piaware-config.txt file as per the Advanced Configuration file to use an: ‘external receiver - relayed connection’ but FlightAware doesn’t see any data. I suspect it’s because my device is outputting data in AVR format and the PiAware expecting Beast format.

Is there a way for PiAware to accept AVR data?

Thanks.

Unfortunately that’s not directly supported currently.

You could perhaps try using modesmixer2 to convert AVR to Beast format.

1 Like

How to install ModeSMixer2 on RPi

1 Like

Modify file mm2.sh, and replace following:lines

--inConnectId 127.0.0.1:30005:ADSB \ 
--inConnectId 127.0.0.1:30105:MLAT \ 

By following lines

--inConnect ip:port of your microADSB \
--outConnect beast:127.0.0.1:30005 \

file mm2.sh, which should be modified as noted above

pi@raspberrypi:~/mm2 $ sudo nano mm2.sh

#!/bin/sh
/home/pi/mm2/modesmixer2 \
 --inConnectId 127.0.0.1:30005:ADSB \
 --inConnectId 127.0.0.1:30105:MLAT \
 --web 8787 \
 --location xx.xxxx:yy.yyyy \

.

Available arguments & their possible values:

pi@raspberrypi:~/mm2 $ ./modesmixer2 --help

ModeSMixer2 v.20190223
Program options:
  -h [ --help ]             This help message
  --inConnect arg           Input connector. Format: host:port
  --inConnectId arg         Input connector with ID. Format: host:port:id
  --inServer arg            Input server. Format: port
  --inServerId arg          Input server with Id. Format: port:id
  --inServerUdp arg         Input udp server. Format: port
  --inSerial arg            Input serial. Format: port[:speed[:flow_control]]
                            FlowControl: none,software,hardware
  --outConnect arg          Output connector. Format: type:host:port
                            Types: beast,avr,avrmlat,msg,sbs30006,beastmlat,msg
                                  mlat
  --outConnectId arg        Output connector with Id.
                            Format: host:port[:name:lat:lon:TEXT:freq]
  --outConnectUdp arg       Output udp connector. Format: type:host:port
                            Types: beast,avr,avrmlat,msg,sbs30006
  --outServer arg           Output server. Format: type:port
                            Types: beast,avr,avrmlat,msg,sbs30006,sbs10001,fats
                                  v,beastmlat,msgmlat
  --globes arg              Enable Globe-S server. Format
                            port:tablename:stationid
  --web arg                 Enable Web Server on port (default: off)
  --google-key arg          Google Maps key
  --web-auth arg            Enable web auth username:password (default: off)
  --disable-web-log         Disable Web Log (default: on)
  --silhouettes arg         Set Silhouettes directory
  --pictures arg            Set Aircraft Pictures directory
  --db arg                  Set DB Filename
  --dbro arg                Set DB filename for read-only using
  --keep                    Enable Beast output keepalive message (default:
                            off)
  --frdb arg                Set FlightRoute DB Filename  --location arg            Receiver location Lat:Lon
                            Example: --location 36.2:-115.3
  --add-reference-point arg Add a new reference point for calculating distance
                            and azimuth on a Google map                            Example: --add-reference-point 38.5:-114.6:[Label]
  --add-points arg          Add an additional point (one or more) with
                            coordinates on a Google map                            Example: --add-points 36.2:-115.3:[Label1]
                            [38.5:-112.6:[Label2]] ...
  --localtime               Set a Local time in output messages in MSG format
                            (default: UTC)
  --filter-expire arg       Filter expire time, sec (default: 20)
  --valid-adsb arg          Set parameters of validation for ADS-B messages:
                            msgs/seconds
                            Example: --valid-adsb 1:2 (default 6:12, max 10:60)
  --valid-modes arg         Set parameters of validation for Mode S messages:
                            msgs/seconds
                            If count set to 0, then only messages with correct
                            parity will be accepted as valid
                            Example: --valid-modes 10:4 (default 0:5, max
                            100:30)
  --filter-nocountry        Allow messages with unassigned ICAO24 addresses
                            (default: off)
  --filter-dup arg          Enable Duplicate filter (default: off)
  --flight-expire-time arg  Flight expire time, seconds (default: 3600)
  --log-noconsole           Disable logging to console (default: on)
  --log-file arg            Enable logging to file (default: off)
  --log-level arg           Set logging level 0..5 (default: 4)
                            0 disabled, 1 error, 2 warning, 3 notice, 4 info
                            5 debug

  --metric                  Switch to metric system of distance measurement
                            (default: imperial)

Normally you should be able to use dump1090-fa as a relay for the data.
But you can’t modify the main dump1090-fa configuration file on a piaware sd-card installation.
So you need to run a 2nd dump1090-fa for which you can change the settings.

Edit: For piaware sd-card you can run a 2nd dump1090-fa independently, for example with combine1090:

https://github.com/wiedehopf/combine1090#combine1090

Install it and open the configuration as shown on the github page.

Change the target to localhost:29001
TARGET=127.0.0.1:29001

Modify source and port accordingly to where your microadsb receiver is offering AVR data.
SOURCES=192.168.2.44
(Ip address where your microADSB is offering data
PORTS=30002

Make sure the settings are active:
sudo systemctl restart combine1090

Point piaware at localhost:29005 for the beast data.

sudo piaware-config receiver-host localhost
sudo piaware-config receiver-port 29005

Hello abcd567,

Thank you for your instructions.

I’m getting a ‘Connection Refused’ error in my logs on the outConnect from modesmixer2.

This is strange, as it’s running on the RaspberryPi loopback. Do you have any suggestions on how to fix this?

Copy of the modesmixer2 config shown below:

sudo nano ~/mm2/mm2.sh
#!/bin/sh
/home/pi/mm2/modesmixer2
–inConnect 192.168.1.7:30005
–outConnect beast:127.0.0.1:30006
–web 8787
–location (removed):(removed) \

Modesmixer2 Log:

019-07-18 17:16:39.960 INFO Magnetic declination calculated
2019-07-18 17:16:39.992 INFO outConnect(beast:127.0.0.1:30006) connecting 127.0.0.1:30006
2019-07-18 17:16:39.996 INFO inConnect(192.168.1.7:30005) connecting 192.168.1.7:30005
2019-07-18 17:16:39.999 ERROR outConnect(beast:127.0.0.1:30006) connect host 127.0.0.1:30006 error Connection refused
2019-07-18 17:16:40.002 INFO outConnect(beast:127.0.0.1:30006) reconnect in 10 seconds
2019-07-18 17:16:40.006 INFO inConnect(192.168.1.7:30005) connected
2019-07-18 17:16:50.007 INFO outConnect(beast:127.0.0.1:30006) connecting 127.0.0.1:30006
2019-07-18 17:16:50.013 ERROR outConnect(beast:127.0.0.1:30006) connect host 127.0.0.1:30006 error Connection refused

You need to run a listening port for piaware to connect to.

--outServer beast:30006

Hi wiedehopf,

Thanks for your reply. I’ve made the changes to the configuration file you requested and it has resolved the issue with modesmixer2. Thank You. The current modesmixer2 config file shown below:

#!/bin/sh
/home/pi/mm2/modesmixer2
–inConnect 192.168.1.7:30005
–outServer beast:30006
–web 8787
–location (removed) \

I’ve now installed PiAware via this this link to use the loopback IP and the outServer port: 30006 of modesmixer2. My PiAware config is shown below:

sudo nano /etc/piaware.conf
allow-manual-updates yes # updated by fa_piaware_config
receiver-host 127.0.0.1
receiver-port 30006
receiver-type other

The problem is now that according to piaware 127.0.0.1:30006 isn’t producing any data? Should I change the ‘receiver-type - other’ to ‘receiver-type relay’?

It should be noted though that I live in a remote area, currently without any aircraft overhead. A copy of the piaware logs is shown below:

sudo piaware-status
PiAware master process (piaware) is running with pid 522.
PiAware ADS-B client (faup1090) is running with pid 548.
PiAware ADS-B UAT client (faup978) is not running.
PiAware mlat client (fa-mlat-client) is not running.

modesmixer2 (pid 527) is listening for connections on port 30006.
no program appears to be listening for connections on port 30978.
faup1090 is connected to the ADS-B receiver.
faup978 is NOT connected to the ADS-B UAT receiver.
piaware is connected to FlightAware.
got ‘couldn’t open socket: connection refused’
the ADS-B data program at 127.0.0.1/30006 is NOT producing data on 127.0.0.1:30006.

With Thanks.

Well without any aircraft, how can there be data :slight_smile:

Looks good:

Not producing data can also mean no aircraft in range.

This solution of course disables dump1090-fa.
But if you are okay with the mode s mixer map, it should work.

Also i believe normal dongles produce better results than microADSB.
But it works i guess :slight_smile:

Do you see any planes on map of modesmixer2?
Go to following address in your browser:
IP-of-PI:8787

Yo will see Charts. On menu bar click MAP to see the map. Map may be near Africa. Move the map to center at your location.

.

(1) Did it start feeding Flightaware after you changed --outConnect to --outServer ?

.

(2) Did you see any planes on the modesmixer2 map? To see a map you have to
(a) enter --location xx.xxx:yy.yy
(b) put a space then backward slash \ after --web 8787

Hi abcd567,

Do you see any planes on map of modesmixer2?

No, I cannot see any planes on the modesmixer2 map.

(1) Did it start feeding Flightaware after you changed --outConnect to --outServer ?

Flightaware is connected to the feed from the RaspberryPi but the RaspberryPi it is not outputting any data. Please see my logs below.

(a) enter --location xx.xxx:yy.yy (b) put a space then backward slash \ after --web 8787

This was removed by the copy and paste I used. The dashes and backslashes are already in the configuration. Sorry about that.

FlightAware Logs:

[2019-07-19 16:23 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 16:28 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 16:33 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 16:43 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 16:48 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 16:53 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 17:03 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 17:08 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 17:23 +0630] no new messages received in 3889 seconds, it might just be that there haven’t been any aircraft nearby but I’m going to try to restart everything, just in case…
[2019-07-19 17:23 +0630] faup1090 exited with SIG SIGHUP
[2019-07-19 17:23 +0630] ADS-B data program ‘modesmixer2’ is listening on port 30006, so far so good
[2019-07-19 17:23 +0630] Starting faup1090: /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr 127.0.0.1 --net-bo-port 30006 --stdout
[2019-07-19 17:23 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 17:28 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 17:33 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 17:38 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 17:43 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 17:48 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 17:53 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 17:58 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 18:03 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 18:08 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 18:13 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 18:18 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 18:23 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 18:28 +0630] no new messages received in 3889 seconds, it might just be that there haven’t been any aircraft nearby but I’m going to try to restart everything, just in case…
[2019-07-19 18:28 +0630] faup1090 exited with SIG SIGHUP
[2019-07-19 18:28 +0630] Started faup1090 (pid 2443) to connect to modesmixer2
[2019-07-19 18:28 +0630] ADS-B data program ‘modesmixer2’ is listening on port 30006, so far so good
[2019-07-19 18:28 +0630] Starting faup1090: /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr 127.0.0.1 --net-bo-port 30006 --stdout
[2019-07-19 18:28 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 18:38 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 18:48 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 18:58 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 19:03 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 19:08 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 19:13 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware
[2019-07-19 19:18 +0630] 0 msgs recv’d from modesmixer2 (0 in last 5m); 0 msgs sent to FlightAware

pi@raspberrypi:~ $ sudo piaware-status
PiAware master process (piaware) is running with pid 518.
PiAware ADS-B client (faup1090) is running with pid 2443.
PiAware ADS-B UAT client (faup978) is not running.
PiAware mlat client (fa-mlat-client) is not running.
modesmixer2 (pid 520) is listening for connections on port 30006.
no program appears to be listening for connections on port 30978.
faup1090 is connected to the ADS-B receiver.
faup978 is NOT connected to the ADS-B UAT receiver.
piaware is connected to FlightAware.
got ‘couldn’t open socket: connection refused’

ModeSmixer2 Logs:

2019-07-18 18:08:02.814 INFO Magnetic declination calculated
2019-07-18 18:08:02.839 INFO outServer(beast:30006) started
2019-07-18 18:08:02.849 INFO inConnect(192.168.1.7:30005) connecting 192.168.1.7:30005
2019-07-18 18:08:02.853 INFO inConnect(192.168.1.7:30005) connected
2019-07-18 18:08:06.249 INFO outServer(beast:30006) 127.0.0.1:37312 connected
2019-07-18 19:08:07.667 INFO outServer(beast:30006) 127.0.0.1:37312 disconnected
2019-07-18 19:08:18.825 INFO outServer(beast:30006) 127.0.0.1:37318 connected
2019-07-18 19:36:59.453 INFO outServer(beast:30006) 127.0.0.1:37320 connected
2019-07-18 19:37:00.594 INFO outServer(beast:30006) 127.0.0.1:37320 disconnected
2019-07-18 19:38:15.626 INFO outServer(beast:30006) 127.0.0.1:37318 disconnected
2019-07-18 19:38:16.774 INFO outServer(beast:30006) 127.0.0.1:37324 connected
2019-07-18 20:43:07.673 INFO outServer(beast:30006) 127.0.0.1:37324 disconnected
2019-07-18 20:43:18.852 INFO outServer(beast:30006) 127.0.0.1:37330 connected
2019-07-18 21:48:07.676 INFO outServer(beast:30006) 127.0.0.1:37330 disconnected
2019-07-18 21:48:18.856 INFO outServer(beast:30006) 127.0.0.1:37332 connected
2019-07-18 22:53:07.681 INFO outServer(beast:30006) 127.0.0.1:37332 disconnected
2019-07-18 22:53:17.861 INFO outServer(beast:30006) 127.0.0.1:37334 connected
2019-07-18 23:58:07.686 INFO outServer(beast:30006) 127.0.0.1:37334 disconnected
2019-07-18 23:58:17.860 INFO outServer(beast:30006) 127.0.0.1:37336 connected
2019-07-19 01:03:07.691 INFO outServer(beast:30006) 127.0.0.1:37336 disconnected
2019-07-19 01:03:18.843 INFO outServer(beast:30006) 127.0.0.1:37338 connected
2019-07-19 02:08:07.696 INFO outServer(beast:30006) 127.0.0.1:37338 disconnected
2019-07-19 02:08:18.873 INFO outServer(beast:30006) 127.0.0.1:37344 connected
2019-07-19 03:13:07.700 INFO outServer(beast:30006) 127.0.0.1:37344 disconnected
2019-07-19 03:13:18.854 INFO outServer(beast:30006) 127.0.0.1:37346 connected
2019-07-19 04:18:07.705 INFO outServer(beast:30006) 127.0.0.1:37346 disconnected
2019-07-19 04:18:18.884 INFO outServer(beast:30006) 127.0.0.1:37348 connected
2019-07-19 05:23:07.708 INFO outServer(beast:30006) 127.0.0.1:37348 disconnected
2019-07-19 05:23:18.893 INFO outServer(beast:30006) 127.0.0.1:37350 connected
2019-07-19 06:28:07.712 INFO outServer(beast:30006) 127.0.0.1:37350 disconnected
2019-07-19 06:28:18.893 INFO outServer(beast:30006) 127.0.0.1:37352 connected
2019-07-19 07:33:07.716 INFO outServer(beast:30006) 127.0.0.1:37352 disconnected
2019-07-19 07:33:18.903 INFO outServer(beast:30006) 127.0.0.1:37354 connected
2019-07-19 08:38:07.720 INFO outServer(beast:30006) 127.0.0.1:37354 disconnected
2019-07-19 08:38:18.900 INFO outServer(beast:30006) 127.0.0.1:37356 connected
2019-07-19 09:43:07.727 INFO outServer(beast:30006) 127.0.0.1:37356 disconnected
2019-07-19 09:43:18.915 INFO outServer(beast:30006) 127.0.0.1:37358 connected
2019-07-19 10:48:07.727 INFO outServer(beast:30006) 127.0.0.1:37358 disconnected
2019-07-19 10:48:18.907 INFO outServer(beast:30006) 127.0.0.1:37360 connected
2019-07-19 11:53:07.731 INFO outServer(beast:30006) 127.0.0.1:37360 disconnected
2019-07-19 11:53:18.912 INFO outServer(beast:30006) 127.0.0.1:37362 connected
2019-07-19 12:58:07.735 INFO outServer(beast:30006) 127.0.0.1:37362 disconnected
2019-07-19 12:58:18.908 INFO outServer(beast:30006) 127.0.0.1:37364 connected
2019-07-19 13:53:49.529 INFO outServer(beast:30006) 127.0.0.1:35473 connected
2019-07-19 13:54:49.533 INFO outServer(beast:30006) 127.0.0.1:35473 disconnected

Any ideas on what’s going wrong?

Do you see any output (text or garbled) at following address in your browser?

192.168.1.7:30005

And in ssh window of RPi
nc 192.168.1.7 30005

I assume 192.168.1.7 30005 is host: port of you microAdsb

Hi abcd567,

No, I cannot connect to port 30005 on 192.168.1.7

I noticed that in the ModeSMixer2 logs shows that it’s already connected to the port:

2019-07-18 18:08:02.849 INFO inConnect(192.168.1.7:30005) connecting 192.168.1.7:30005
2019-07-18 18:08:02.853 INFO inConnect(192.168.1.7:30005) connected

I can see no disconnection on the ‘inConnect’ side so I assume this is normal operation?

pi@raspberrypi:~ $ netstat -natu
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:8787 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:30006 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 192.168.1.109:36235 70.42.6.224:1200 ESTABLISHED
tcp 0 0 192.168.1.109:60328 192.168.1.7:30005 ESTABLISHED
tcp 0 0 127.0.0.1:48715 127.0.0.1:51296 ESTABLISHED
tcp 0 0 127.0.0.1:37374 127.0.0.1:30006 ESTABLISHED
tcp 0 0 127.0.0.1:51296 127.0.0.1:48715 ESTABLISHED
tcp 0 256 192.168.1.109:22 192.168.1.107:63890 ESTABLISHED
tcp 0 0 127.0.0.1:30006 127.0.0.1:37374 ESTABLISHED
tcp6 0 0 :::22 :::* LISTEN
udp 0 0 0.0.0.0:68 0.0.0.0:*
udp 0 0 0.0.0.0:58006 0.0.0.0:*
udp 0 0 0.0.0.0:5353 0.0.0.0:*
udp6 0 0 :::5353 :::*
udp6 0 0 :::51448 :::*

And in ssh window of RPi
nc 192.168.1.7 30005

This command performed no visible function.

That means your microADSB is not producing any data.
Are you sure port 30005 is correct?

AVR is usually offered on 30002.

Let’s try:

nc -v 192.168.1.7 30002

Hi wiedehopf,

Yes, the microADSB is currently not producing any data as there’s no planes nearby. In a little while QFA9 will be close enough. When I’m normally feeding to FlightRadar, I typically see about 20 aircraft per day.

Are you sure port 30005 is correct?

Yes, port 30005 is correct. It is what I used in my previous setup.

1 Like

The connection was refused.

Yeah it’s also showing connected in the logs.

Looks to me like it should work if you receive aircraft.

Yes, I think that the issue is on the --output of the ModeSMixer2.