All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Pushing data to another machine
PostPosted: Thu Nov 05, 2015 11:35 am 
Offline
psionmark - FlightAware user avatar

Joined: Mon Sep 07, 2015 3:42 pm
Posts: 32
Hi all,

At home, I've got an AirNav Radar box pushing data to FlightAware via PlanePlotter and also to Virtual Radar Server. This all works well.

I've also got a PiAware rig, which I carry around with me to tinker with on my hotel visits (I'm living out of hotels most weeks, so need something to keep me occupied lol).

Is there any way I can push the data from my "mobile" PiAware rig back to my machine at home so I can also plot that data on Virtual Radar Server? I can access the VRS web interface whilst away and it'd be neat to see all traffic from both setups on the one page.

Regards,

Mark


Top
 Profile  
 
 Post subject: Re: Pushing data to another machine
PostPosted: Thu Nov 05, 2015 12:17 pm 
Online
FlightAware Staff
obj - FlightAware user avatar

Joined: Tue Sep 30, 2014 7:14 pm
Posts: 3205
socat or nc are the usual tools for this; you would use them to push data from piaware's port 30005 to your VRS at home.
You'd need to be able to connect to a port on your VRS remotely, but if you can get to the VRS web interface remotely it sounds like you have that mostly sorted out already.

Something like:

Code:
$ socat TCP:localhost:30005 TCP:vrshost:34567


and then set up a listening port 34567 on your VRS, beast binary format.

I don't know if the average hotel wifi is going to play nice with that though..


Top
 Profile  
 
 Post subject: Re: Pushing data to another machine
PostPosted: Thu Nov 05, 2015 12:27 pm 
Offline
psionmark - FlightAware user avatar

Joined: Mon Sep 07, 2015 3:42 pm
Posts: 32
obj wrote:
socat or nc are the usual tools for this; you would use them to push data from piaware's port 30005 to your VRS at home.
You'd need to be able to connect to a port on your VRS remotely, but if you can get to the VRS web interface remotely it sounds like you have that mostly sorted out already.

Something like:

Code:
$ socat TCP:localhost:30005 TCP:vrshost:34567


and then set up a listening port 34567 on your VRS, beast binary format.

I don't know if the average hotel wifi is going to play nice with that though..


Fantastic - thanks for the super quick reply :)

I shall give this a try tonight.

Regards,

Mark


Top
 Profile  
 
 Post subject: Re: Pushing data to another machine
PostPosted: Thu Nov 05, 2015 5:35 pm 
Offline
psionmark - FlightAware user avatar

Joined: Mon Sep 07, 2015 3:42 pm
Posts: 32
Just to let you know that worked a treat :D

I've now got a merged feed, or I can switch between the two.

Thanks for the reply. The support on this forum is just amazing :P


Top
 Profile  
 
 Post subject: Re: Pushing data to another machine
PostPosted: Sat Nov 07, 2015 1:16 pm 
Offline
FlightAware Member
abcd567 - FlightAware user avatar

Joined: Sat Feb 15, 2014 3:08 am
Posts: 1862
Location: Toronto CYYZ
I have 2 RPi with their independent DVB-T and Cantenna.

Both have ONLY following software. NO DATA FEEDERS INSTALLED YET.

(1) Raspbian Jessie
(2) Dump1090-mutability v1.15~dev
(3) lighttpd
(4) sudo apt-get install socat

I want to feed output of raspi-1 (192.168.2.17) to raspi-2 (192.168.2.27), and see the aggregated display on gmap.html of raspi-2.

I tried following commands on raspi-2, but all attempts failed as shown below.
Why socat command does not work? What I did wrong??? I tried sudo socat also, but same results.

Code:
pi@raspi-2 ~ $ socat -u TCP:192.168.2.17:30005 TCP:127.0.0.1:30004 &
[1] 1030
pi@raspi-2 ~ $ 2015/11/07 16:31:20 socat[1030] E connect(5, AF=2 192.168.2.17:30005, 16): Connection refused



Code:
pi@raspi-2 ~ $ socat -u TCP:192.168.2.17:30005 TCP:192.168.2.27:30004 &
[1] 1031
pi@raspi-2 ~ $ 2015/11/07 16:31:57 socat[1031] E connect(5, AF=2 192.168.2.17:30005, 16): Connection refused



Code:
pi@raspi-2 ~ $ socat -u TCP:raspi-1:30005 TCP:raspi-2:30004 &
[1] 1035
pi@raspi-2 ~ $ 2015/11/07 16:32:45 socat[1035] E connect(5, AF=2 192.168.2.17:30005, 16): Connection refused


Top
 Profile  
 
 Post subject: Re: Pushing data to another machine
PostPosted: Sat Nov 07, 2015 5:37 pm 
Online
FlightAware Staff
obj - FlightAware user avatar

Joined: Tue Sep 30, 2014 7:14 pm
Posts: 3205
Have you told dump1090 to bind to the wildcard address? (The default is to bind to localhost only)


Top
 Profile  
 
 Post subject: Re: Pushing data to another machine
PostPosted: Sat Nov 07, 2015 7:23 pm 
Offline
FlightAware Member
abcd567 - FlightAware user avatar

Joined: Sat Feb 15, 2014 3:08 am
Posts: 1862
Location: Toronto CYYZ
obj wrote:
Have you told dump1090 to bind to the wildcard address? (The default is to bind to localhost only)

Thanks Oliver. It worked.
I first told dump1090 on raspi-1 (feeder) only to bind to all addresses, it did not work.
I then told dump1090 on both the raspi-1 (feeder) & raspi-2 (aggregator) to bind to all addresses, and it worked.

Code:
pi@raspi-2 ~ $ socat -u TCP:raspi-1:30005 TCP:raspi-2:30004 &
[1] 914
pi@raspi-2 ~ $



Image


Top
 Profile  
 
 Post subject: Re: Pushing data to another machine
PostPosted: Sun Nov 08, 2015 12:43 pm 
Offline
FlightAware Member
abcd567 - FlightAware user avatar

Joined: Sat Feb 15, 2014 3:08 am
Posts: 1862
Location: Toronto CYYZ
A new problem!
when I give command, a connection between two RPis is established, and the planes picked by (raspi-1 + raspi-2) are shown on gmap.html of raspi-2, and all went well :D
Code:
pi@raspi-2 ~ $ socat -u TCP:raspi-1:30005 TCP:raspi-2:30004 &
[1] 1217
pi@raspi-2 ~ $



Now I have tried to make the process automatic.
(1) In folder "/home/pi/" of raspi-2, placed a bash script "pi1-feeding-pi2-maint.sh" to start & maintain the socat:
Code:
#! /bin/sh
while true
  do
    sleep 30
    socat -u TCP:raspi-1:30005 TCP:raspi-2:30004
  done


(2) Made the bash file executeable by command:
Code:
sudo chmod 755 ./pi1-feeding-pi2-maint.sh


(3) Made the script automatic
Code:
sudo nano /etc/rc.local
#Inserted the following line just before the last line (exit 0) of rc.local file:
/home/pi/pi1-feeding-pi2-maint.sh

(4) Rebooted both raspi-1 & raspi-2 .

CONNECTION DID NOT ESTABLISH :( :cry:

When I tried to run the script manually, response negative :( :cry:
Code:
pi@raspi-2 ~ $ sudo ./pi1-feeding-pi2-maint.sh
./pi1-feeding-pi2-maint.sh: 7: ./pi1-feeding-pi2-maint.sh: Syntax error: end of file unexpected (expecting "do")


Any ideas what went wrong??
.


Top
 Profile  
 
 Post subject: Re: Pushing data to another machine
PostPosted: Sun Nov 08, 2015 3:53 pm 
Offline
FlightAware Member
joelwiley - FlightAware user avatar

Joined: Mon Mar 12, 2012 7:46 pm
Posts: 826
does running the script directly ( sudo ./pi1-feeding-pi2-maint.sh ) run successfully (defined as not throwing up)?
If not, possible errant EOL , CR/LF or similar may be lurking.
Syntax is sooo picky. :?


Top
 Profile  
 
 Post subject: Re: Pushing data to another machine
PostPosted: Mon Nov 09, 2015 2:49 am 
Offline
FlightAware Member
abcd567 - FlightAware user avatar

Joined: Sat Feb 15, 2014 3:08 am
Posts: 1862
Location: Toronto CYYZ
joelwiley wrote:
does running the script directly ( sudo ./pi1-feeding-pi2-maint.sh ) run successfully (defined as not throwing up)?
If not, possible errant EOL , CR/LF or similar may be lurking.
Syntax is sooo picky. :?

Found the cause - The .sh file was created by copy-paste from web pages.
The character-set of web page seems not compatible to the SSH client.
Deleting the .sh file and making a new file with code typed instead of copy-paste, solved the problem.


Top
 Profile  
 
 Post subject: Re: Pushing data to another machine
PostPosted: Sun Mar 19, 2017 7:33 am 
Offline
MikeMathee - FlightAware user avatar

Joined: Sun Sep 11, 2016 12:35 pm
Posts: 47
abcd567 wrote:
obj wrote:
Have you told dump1090 to bind to the wildcard address? (The default is to bind to localhost only)

Thanks Oliver. It worked.
I first told dump1090 on raspi-1 (feeder) only to bind to all addresses, it did not work.
I then told dump1090 on both the raspi-1 (feeder) & raspi-2 (aggregator) to bind to all addresses, and it worked.

Image


How do I tell the latest version of dump-fa to bind to all interfaces?
The latest install scripts does not give me the option to choose to which interfaces dump1090-fa should bind.


Top
 Profile  
 
 Post subject: Re: Pushing data to another machine
PostPosted: Sun Mar 19, 2017 7:51 am 
Offline
NeoDuder - FlightAware user avatar

Joined: Sat Nov 26, 2016 11:17 am
Posts: 25
Location: EGPH
Alternatively you could just run a VPN server on your home network and connect to that. Then your PiAware rig would act as if it was on your local network wherever you were :)


Top
 Profile  
 
 Post subject: Re: Pushing data to another machine
PostPosted: Sun Mar 19, 2017 8:11 am 
Offline
MikeMathee - FlightAware user avatar

Joined: Sun Sep 11, 2016 12:35 pm
Posts: 47
I specifically want to know how to set dump1090-fa to bind to all interfaces, I'm getting connection refused from socat.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot], obj and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to: