How to change port for compatible work with NKN!

piaware.service

├─1008 /usr/bin/piaware -p /run/piaware/piaware.pid -plainlog -statusfile /run/piaware/status.json
├─1014 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr localhost --net-bo-port 30005 --stdout --lat 34.723 --lon 113.642
└─1023 /usr/lib/piaware/helpers/fa-mlat-client --input-connect localhost:30005 --input-type dump1090 --results beast,connect,localhost:30104 --results beast,listen,30105 --results ext_basestation,listen,30106 --udp-transport 70.42.6.198:18453:1724625068

dump1090-fa.service
└─465 /usr/bin/dump1090-fa --device-index 0 --gain -10 --ppm 0 --max-range 360 --fix --net --net-heartbeat 60 --net-ro-size 1300 --net-ro-interval 0.2 --net-ri-port 0 --net-ro-port 30002 --net-sbs-port 30003 --net-bi-port 30004,30104 --net-bo-port 30005 --json-location-accuracy 1 --lat 34.72260 --lon 113.64156 --write-json /run/dump1090-fa --quiet

The NKN blockchain has Occupy the port 30000-30005.

how can piaware work together with nkn in the raspberry pi !!
[image]

how to !

What sdcard image are you using?

I use raspberry pi4 ,using
sudo apt-get install piaware and dump1090-fa

If install is Raspbian Image with Package Install of dump1090-fa and piaware

1 - Change port numbers of dump1090-fa

1.1 - Edit file /etc/default/dump1090-fa

sudo nano /etc/default/dump1090-fa   
# dump1090-fa configuration
# This is sourced by /usr/share/dump1090-fa/start-dump1090-fa as a
# shellscript fragment.

# If you are using a PiAware sdcard image, this config file is regenerated
# on boot based on the contents of piaware-config.txt; any changes made to this
# file will be lost.

# dump1090-fa won't automatically start unless ENABLED=yes
ENABLED=yes

RECEIVER_OPTIONS="--device-index 0 --gain -10 --ppm 0"
DECODER_OPTIONS="--max-range 360 --fix"
NET_OPTIONS="--net --net-heartbeat 60 --net-ro-size 1300 --net-ro-interval 0.2 --net-ri-port 0 --net-ro-port 30002 --net-sbs-port 30003 --net-bi-port 30004,30104 --net-bo-port 30005"
JSON_OPTIONS="--json-location-accuracy 1"

1.2 - In above file, in the line starting with NET_OPTIONS, make following changes:

change 30002 to 31002
change 30003 to 31003
change 30004 to 31004
change 30005 to 31005

Save (Ctrl+O) and close (Ctrl+) file

1.3 - Restart dump1090-fa

sudo systemctl restart dump1090-fa

 

2 - Change port numbers of piaware

2.1 - Issue piaware-config commands as follows

sudo piaware-config receiver-type other
sudo piaware-config receiver-port 31005
sudo piaware-config receiver-host 127.0.0.1

2.2 - Restart Piaware

sudo systemctl restart piaware

3 - Check status

sudo systemctl status piaware   

should give output like this

Nov 28 22:32:09 ubuntu20 piaware[66394]: Starting multilateration client: /usr/lib/piaware/helpers/fa-mlat-client --input-connect 127.0.0.1:31005 --input-type aut>
Nov 28 22:32:09 ubuntu20 piaware[66394]: mlat-client(66425): fa-mlat-client 0.2.11 starting up
Nov 28 22:32:09 ubuntu20 piaware[66394]: mlat-client(66425): Using UDP transport to 70.42.6.228 port 15658
Nov 28 22:32:09 ubuntu20 piaware[66394]: mlat-client(66425): Listening for Beast-format results connection on port 30105
Nov 28 22:32:09 ubuntu20 piaware[66394]: mlat-client(66425): Listening for Extended Basestation-format results connection on port 30106
Nov 28 22:32:09 ubuntu20 piaware[66394]: mlat-client(66425): Route MTU changed to 1500
Nov 28 22:32:09 ubuntu20 piaware[66394]: mlat-client(66425): Input connected to 127.0.0.1:31005
Nov 28 22:32:10 ubuntu20 piaware[66394]: mlat-client(66425): Detected BEAST format input
Nov 28 22:32:10 ubuntu20 piaware[66394]: mlat-client(66425): Input format changed to BEAST, 12MHz clock
Nov 28 22:32:10 ubuntu20 piaware[66394]: mlat-client(66425): Beast-format results connection with 127.0.0.1:30104: connection established

 

3 - To Revert to Package Install’s Normal Config

3.1 dump1090-fa:

Edit file /etc/default/dump1090-fa and reverse the port number changes made in step 1.1

3.2 piaware:

Issue following commands

pi@piaware:~ $ sudo piaware-config receiver-type rtlsdr   
pi@piaware:~ $ sudo piaware-config receiver-port ""   
pi@piaware:~ $ sudo piaware-config receiver-host ""     

3.3 - Reboot Pi

sudo reboot   
3 Likes

If install is Piaware SD Card Image

1 - Change port numbers of dump1090-fa

1.1 - Edit file /usr/lib/piaware-support/generate-receiver-config

pi@piaware:~ $ sudo nano /usr/lib/piaware-support/generate-receiver-config  

In file opened, press Ctrl+W keys and copy-paste following line in “Search:”, and press Enter Key

dump1090config "NET_OPTIONS=

The cursor will jump to following line:

lappend dump1090config "NET_OPTIONS=\"--net --net-heartbeat 60 --net-ro-size 1300 --net-ro-interval 0.2 --net-http-port 0 --net-ri-port 0 --net-ro-port 30002 --net-sbs-port 30003 --net-bo-port $boPort --net-bi-port 30004,30104\""

In this line make following changes:

change 30002 to 31002
change 30003 to 31003
change 30004 to 31004
change $boPort to 31005

Save (Ctrl+O) and close (Ctrl+) file

1.3 - Reboot RPi

sudo reboot

2 - Change port numbers of piaware

2.1 - Issue piaware-config commands as follows

sudo piaware-config receiver-type other
sudo piaware-config receiver-port 31005
sudo piaware-config receiver-host 127.0.0.1

2.2 - Restart Piaware

sudo systemctl restart piaware

3 - Check logs

pi@piaware:~ $ cat /var/log/piaware.log

Should give output like this:

Nov 29 05:15:18 piaware piaware[5125]: site statistics URL: https://flightaware.com/adsb/stats/user/abcd567#stats-5252
Nov 29 05:15:18 piaware piaware[5125]: multilateration data requested
Nov 29 05:15:18 piaware piaware[5125]: Starting multilateration client: /usr/lib/piaware/helpers/fa-mlat-client --input-connect 127.0.0.1:31005 --input-type auto --results beast,connect,localhost:30104 --results beast,listen,30105 --results ext_basestation,listen,30106 --udp-transport 70.42.6.224:15333:1889653508
Nov 29 05:15:19 piaware piaware[5125]: mlat-client(5226): fa-mlat-client 0.2.11 starting up
Nov 29 05:15:19 piaware piaware[5125]: mlat-client(5226): Using UDP transport to 70.42.6.224 port 15333
Nov 29 05:15:19 piaware piaware[5125]: mlat-client(5226): Listening for Beast-format results connection on port 30105
Nov 29 05:15:19 piaware piaware[5125]: mlat-client(5226): Listening for Extended Basestation-format results connection on port 30106
Nov 29 05:15:19 piaware piaware[5125]: mlat-client(5226): Route MTU changed to 1500
Nov 29 05:15:19 piaware piaware[5125]: mlat-client(5226): Input connected to 127.0.0.1:31005
Nov 29 05:15:20 piaware piaware[5125]: piaware received a message from dump1090-fa!
Nov 29 05:15:20 piaware piaware[5125]: mlat-client(5226): Detected BEAST format input
Nov 29 05:15:20 piaware piaware[5125]: mlat-client(5226): Input format changed to BEAST, 12MHz clock
Nov 29 05:15:20 piaware piaware[5125]: mlat-client(5226): Beast-format results connection with ::1:30104: connection established
Nov 29 05:15:40 piaware piaware[5125]: piaware has successfully sent several msgs to FlightAware!
Nov 29 05:15:48 piaware piaware[5125]: 7 msgs recv'd from dump1090-fa; 7 msgs sent to FlightAware
Nov 29 05:15:48 piaware piaware[5125]: 0 msgs recv'd from dump978-fa; 0 msgs sent to FlightAware

 

3 - To Revert to Piaware’s Normal Config

3.1 dump1090-fa:

Edit file /usr/lib/piaware-support/generate-receiver-config and reverse the port number changes made in step 1.1

3.2 piaware:

issue following commands

pi@piaware:~ $ sudo piaware-config receiver-type rtlsdr   
pi@piaware:~ $ sudo piaware-config receiver-port ""   
pi@piaware:~ $ sudo piaware-config receiver-host ""     

3.3 - Reboot Pi

sudo reboot   

 

Thanks!
The nkn piaware dump1090-fa Works fine together!

@xairwolfcn

Glad to know nkn, dump1090-fa, and piaware are working fine now.

If you have other feeders installed (such as Flightradar24, Radarbox24, Planefinder etc), then in their settings change port 30005 to 31005.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.