# Mlat sync

**URL:** <https://discussions.flightaware.com/t/mlat-sync/54875>\
**Category:** ADS-B Flight Tracking\
**Created:** [September 10, 2019, 9:12am UTC](https://discussions.flightaware.com/t/mlat-sync/54875 "2019-09-10T09:12:12Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [August 10, 2024, 3:09pm UTC](https://discussions.flightaware.com/t/mlat-sync/54875/14 "2024-08-10T15:09:44Z")

</div>

I faced problem of mlat not synchronized when piaware & dump1090-fa were installed in Debian running in Oracle VM on Windows PC. The passthrough of dongle from Windows to VM made clock unstable.

I solved this problem by installing dump1090-win on Windows PC, so there was no problem of dongle passthrough as the dongle was directly accessible to dump1090-win.

In order to transfer data from dump1090-win to dump1090-fa, I created a puller service which used **socat** TCP connection between two dump1090s. In dump1090-fa’s config file, I had to change RECEIVER=rtlsdr to RECEIVER=none to run it in net mode without any dongle.

Below are full details of what I did;

### (1) ON Windows PC

(1.1) Downloaded dump1090-win from github to Windows PC  
**[https://github.com/MalcolmRobb/dump1090/raw/master/dump1090-win.1.10.3010.14.zip](https://github.com/MalcolmRobb/dump1090/raw/master/dump1090-win.1.10.3010.14.zip)**

(1.2) Unzipped the downloaded folder.  
(1.3) Entered the unzipped folder. Inside this folder there is a file named `dump1090.bat`. Double clicked it to start dump1090-win. When done first time, I was asked permission to run it, which I gave. This started a command prompt displaying aircraft data,as shown in screenshot below.

&nbsp;

 ![image](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/a/5/a55cdeab7f1b9750f6e37e61313e35ab0fc1279a.png)

&nbsp;

 ![image](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/4/0/4092e1f1085d9280ad2a6799b78e92cc97bd08a7.png)

&nbsp;

 ![image](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/b/b/bbac3098591a2b9cc3ab33a3a952cc0df01df483.png)

&nbsp;

 ![image](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/d/9/d94cdc747e2d4b870dc5af016f4f152afa1ef47a.png)

&nbsp;

### (2) In Debian running in VM

(2.1) Installed package `socat`  
(2.2) Created necessary folder and file to run the socat TCP connection between `dump1090-win` and `dump1090-fa`

```auto
sudo apt install socat  

sudo mkdir /usr/share/puller 
sudo touch /usr/share/puller/puller.sh  
sudo chmod +x /usr/share/puller/puller.sh  
sudo nano /usr/share/puller/puller.sh  

```

&nbsp;

Copy-pasted following code in newly created blank file `/usr/share/puller/puller.sh `  
NOTE: In line `SOURCE_IP="192.168.12.6"`, replace `192.168.12.6` by IP address of your Windows Computer on which you are running the dump1090-win

```auto
#!/bin/bash 

SOURCE_IP="192.168.12.6"

OPTIONS="keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15"

while true
   do
      echo "CONNECTING TO: dump1090-windows"
      socat --experimental -dd -u TCP:${SOURCE_IP}:30005,${OPTIONS} TCP:127.0.0.1:30004,${OPTIONS}
      echo "LOST CONNECTION TO: dump1090-windows"
      sleep 60
   done

```

&nbsp;

(2.3) Created systemd service to run the puller script

```auto
sudo nano /lib/systemd/system/puller.service  

```

&nbsp;

In the newly created blank service file `/lib/systemd/system/puller.service`, copy-paste following code

```auto
# puller service for systemd
[Unit]
Description=puller service
Wants=network.target
After=network.target
[Service]
##User=puller
RuntimeDirectory=puller
RuntimeDirectoryMode=0755
ExecStart=/usr/share/puller/puller.sh
SyslogIdentifier=puller
Type=simple
Restart=on-failure
RestartSec=30
RestartPreventExitStatus=64
Nice=-5
[Install]
WantedBy=default.target

```

&nbsp;

Enable and start the puller

```auto
sudo systemctl enable puller    

sudo systemctl start puller   

```

&nbsp;

(2.4) Edited file `/etc/default/dump1090-fa` and changed `RECEIVER=rtlsdr` to `RECEIVER=none`.

![image](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/9/2/92bc6fb0b642df6e13247a744a630138d8ad312f.png)

Saved file and restarted dump1090-fa  
`sudo systemctl restart dump1090-fa `

### RESULT:

**_Click on Screenshot to See Larger Size_**

 ![image](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/7/d/7dc58b103e5c01441abf94b8f44a464c05fe74ce.png)

&nbsp;

### Alternative for item (2):

Under item (2), carryout only step (2.4) to run dump1090-fa in net-only mode, and omit steps (2.1), (2.2), & (2.3) which pertain to creation of `socat TCP connector “puller”. Instead issue following commands which will enable piaware to create a connection directly to dump1090-win.

**NOTE:** in the command below, change `192.168.12.6` to IP of your Windows computer running `dump1090-win`.

```auto
sudo piaware-config receiver-type other
sudo piaware-config receiver-port 30005
sudo piaware-config receiver-host 192.168.12.6  

sudo systemctl restart piaware

```

### Comparing above two methods, the Alternative is simpler, but has disadvantage that dump1090-fa will be without data and as a result Skyaware map will be without any aircraft.

Although dump1090-win provides a map in browser in Windows PC at following address:

`localhost:8080 `

but it has Google map with water marks. Also, in some browsers, map will not show, only 2 clocks at top-right corner. This is caused by format of files in unzipped folder dump1090-win/ **public\_html** being in DOS/Windows format ( **CRLF** ) indtead of Unix ( **LF** ). I used `Notepad++` to change Windows {CRLF) to Unix (LF), and map started working OK.

&nbsp;

 ![image](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/d/c/dc0865f8990a0769c9f4396f85ba6e96353f6e57.png)

&nbsp;

 ![image](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/8/1/816c2910a057d63577ccd2086f0eb860a9db6906.png)

&nbsp;

&nbsp;

---

_[View the full topic](https://discussions.flightaware.com/t/mlat-sync/54875)._
