High rise antenna?

Thanks guys. It’s easier to get above the tree line in my area, just curiosity. Still learning antenna theory from all of your posts.

I was hoping dual antennas would allow you to install them at a lower, safer height and still have good coverage.

BTW, I just got on the top of my “neighborhood” list:

Aaaah, being vain feels so good :rofl:

1 Like

I tested locally and it sure does increase the count. I’m on a different antenna with my second receiver though.

Did the socat give any errors? (if your dump1090-fa config file does not have the --net-bi-port option then dump1090-fa will revert to having both ports open)
The timestamp is based on the dongle receiver clock. And those clocks will run slightly different that’s why you can’t do MLAT after combining data streams from two receivers.

I’m pretty sure dump1090-fa has no deduplication method because i accidentally backfed the beast output to the beast input of the same dump1090 instance and my message rate went mad, like 80000 :blush: Quickly turned that off after a few seconds. (Sorry MLAT network for shortly confusing you)

Are you sure you used the correct flightfeeder ip?
Try socat with more options so it will show when it establishes the connection (yes both -d after each other it’s not a typo)

socat -d -d -u TCP:FLIGHTFEEDER:30005 TCP:localhost:30004

It should show establishing 2 connections and then “starting data transfer loop”

2018/10/26 08:33:13 socat[16950] N opening connection to AF=2 192.168.2.78:30005
2018/10/26 08:33:13 socat[16950] N successfully connected from local address AF=2 192.168.2.105:60048
2018/10/26 08:33:13 socat[16950] N opening connection to AF=2 192.168.2.108:29999
2018/10/26 08:33:13 socat[16950] N successfully connected from local address AF=2 192.168.2.105:42522
2018/10/26 08:33:13 socat[16950] N starting data transfer loop with FDs [5,5] and [6,6]

The -49dB are anonymized MLAT results. That signal level is bogus.
The lowest RSSI showing on my pi is around -33. When i reduce the gain that can drop as low as -37.

Hmm, that seemed to work. Don’t know what I did before, probably didn’t have those two -d but it’s too early in the morning here to figure it out :slight_smile:

LE: The While loop doesn’t work from inside rc :frowning:
Also, typing it in the command, with & at the end, noticed that it does not send it to background.

The -d -d is just for displaying more stuff like an established connection. Normally it will only display errors, and not even waiting for the connection.

The script not working is strange i tested it here.
If you just run it on the shell like:
bash socat.sh
does that work?
It will execute and then be done immediately because the two while loops will run in the background (notice & behind done?)

Oh the command may still send output even though it’s in the background.
So it can be seem it’s not in the background while it actually is (background is different on the shell to what you would normally consider background)

I’ve optimized the shell script so that it terminates properly when you press CTRL-C (now the while loops will terminate as well).
Not sure why it wouldn’t run from rc.local.
I’m adding a log file too so you can check it’s running.
Note that the ports and addresses need to be modified to your situation :slight_smile:

#!/bin/bash
exec  &>>/tmp/socat.log

opts="-d -d"

echo -n "Starting data redirection with socat:    "
date

trap "kill 0" SIGINT
trap "kill -2 0" SIGTERM

while true
do
	socat $opts -u TCP:pi:30005 TCP:localhost:29999
	sleep 5
done &

while true
do
	socat $opts -u TCP:pi:30105 TCP:localhost:29999
	sleep 5
done &

wait

I’ll try that when I get home.

LE: What are those commented socats for? To me it looks like you are trying to go “around” via port 29999. I’ll try going directly first.

Oh that’s just on my machine for combining two receivers with piaware/dump1090 into a separate net-only dump1090.
If you want i can walk you through creating another service file for dump1090 that starts a separate instance. You just need another config file, a service file and some lighttpd config that’s it.
Thought it was more complicated before.

I thought i’ll just leave them there because some while loops with a sleep inside don’t hurt.
On the other hand it makes the copy past harder :slight_smile:

I’ll edit them out to make it clearer.

On a separate note i have noticed actually setting max-range to a reasonable value for dump1090-fa can improve the tracks when the planes are far away. It helps the position determining function so it needs only 1 instead of 2 position report messages. Those messages only encode half of the position but if you know that you won’t receive planes further than xyz then that narrows it down.

If you are satisified everything is working you can just comment out the

opts=

line to only output errors to the log file.

I have tried to edit the rc file and somehow I managed to lose all the traffic.
Remember, in there I have the airspy starting sequence too!
I’ll get in later, now looks like I have to go out again for some “honey do” list. In rain :frowning:

The script should be run with & at the end so rc.local can finish.

/bin/bash /home/pi/socat.sh &

Like this for example. That will even work if it’s not executable.

You could also make a cronjob that runs it on reboot.

sudo crontab -e
# insert line at end:
@reboot /bin/bash /home/pi/socat.sh 

good luck and be sure to check /tmp/socat.log

WTH? I tried the cron route and…
I made the socat.sh file, it runs if I type in (or copy/paste) the:

/bin/bash /home/pi/socat.sh &

I need to hit Ctrl-C to get back to prompt, but it still runs. Great.
Changed with crontab -e the file adding at the end exactly that

@reboot /bin/bash /home/pi/socat.sh

Reboot the Pi and… nothing. I still have to run manually the socat.sh !

Can you post your local version of the script please?

socat.sh contains just this like:

socat -d -d -u TCP:192.168.1.236:30005 TCP:localhost:30004 &

If I execute it manually, with the command from above, it works. I have to press Ctrl-C to get back a prompt tough.
Cron at reboot, with the same command, doesn’t work. I bet it has something to do with the SD install, I have it but I guess I’ll have to flash the add-on version.

The while loops are there for a reason.
It will fail if it can’t establish the connection for example dump1090-fa is not yet running etc.
Also you want to be able to restart dump1090-fa right?
That’s why you need the while loops.
They handle a very crude automatic reconnect in case anything fails.
The sleeps are there so it doesn’t hammer anything by trying to quickly.

Thought you were using the whole script from this post :slight_smile:
(High rise antenna? - #46 by wiedehopf)

Also you want the MLAT results from the other feeder too because that really helps with spotty MLAT tracks.

I learn that the hard way. Forgot to add them at some point and… rebooted. Pi was very un-responsive to my commands, to get to edit back that took like 10 minutes. Sometimes would lose network connection, so I restarted the PuTTY like 10 times, all those dropped instances still alive in Pi memory somewhere.
My current rc.local

#!/bin/sh -e

# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo performance > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo performance > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
# sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo /home/pi/airspy_adsb -c 127.0.0.1:30104:BEAST -l 30005:BEAST -g 21 -p -w 4 -x &

exit 0

Did i ask for that, i’m a bit confused that you posted it :slight_smile:
Anyway if you are still trying to make this work modify the ports and IPs of the script i referenced in my last post that should work.

If you want to understand the script feel free to ask what the parts do :stuck_out_tongue:

I decided to blow away the SD card install and start from scratch with add-on piaware. In process right now…

You will want to change

--net-bo-port 30005

to

--net-bo-port 0

TWICE in /etc/default/dump1090-fa (don’t know why it’s duplicated i guess you could just delete one of the two occurences)
Deleting both occurences would mean the port would revert to the default (30005) which would be against the intention.

Then you can just use your airspy command line you are using right now and it should work :wink:

Also add --net-only of course.

Thanks for the help!
Actually I want the 30005 in the dump1090-fa and I will take it out from airspy options.
And yes it is twice in the /etc/default/dump1090-fa, but I have changed the receiver options to:

RECEIVER_OPTIONS="--net-only --net-bo-port 0 --fix"

Now I am up and running, the socat.sh is prepared and working. Wanna try the cron path now…

LE: Nope, still not starting automatically after reboot. Only manual.

Have you checked the log file /tmp/socat.log ?