Welcome to Radarspotting. Please login or sign up.

April 18, 2024, 03:12:05 AM

Login with username, password and session length

New Members

New Members

You should get an activation email when you join.  If not, please use the Contact option.

ACARSDECO2 help with PI and Plane Plotter

Started by glenn68, July 24, 2018, 02:56:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

glenn68

I need some help. I have installed ACARSDECO2 V20180603 on my Raspberry Pi and it runs great decoding 4 channels of ACARS and providing data to my copy of Plane Plotter as long as I operate it from the command line on PUTTY. Now if I set it up for ad2.sh to run automatically the program runs great except ACARSDECO2 will not feed data to my copy of Plane Plotter.
Here is the .sh set up;

/home/pi/acars/./acarsdeco2 \
--device-index 1 \
--gain 19.7 \
--freq 131550000 131725000 \
--freq 131875000 131125000 \
--http-port 8686 \
--outConnectUdp pp:192.168.0.100:9742 \

if I run it from the command line from putty then this is what I use;

./acarsdeco2 --device-index 1 --http-port 8686 --gain 19.7 --freq 131550000 --freq 131725000 --freq 131875000 --freq 131125000  --outConnectUdp pp:192.168.0.100:9742


What am I doing wrong?

Thanks,

Glenn
Glenn Blum
Central Texas, USA

tonkepen

This problem happens to me, and I've been trying it for a year, I've asked it, but the truth is exactly the same with me.

benipaz

if this setup is good
--freq 131550000 --freq 131725000 --freq 131875000 --freq 131125000
you have to write every frequency on new line like this
--freq 131550000 \
--freq 131725000 \
--freq 131875000 \
--freq 131125000 \

IanH

#3
<deleted>> wrong thread!

glenn68

I think that I had found the problem with acarsdeco2 sending data to PlanePlotter from a Pi. I think that ACARSDECO2 has to have the console window up and running for the program to run properly. I have the program to run automatically from a .sh and no data is shown at Plane Plotter. If I run the program from a console window I get data. The same happens if you run DUMPVDL2. If DUMPVDL2 is run from a console window you get data into PlanePlotter, if you run DUMPVDL2 from a boot and no console window, no data into Plane Plotter. What could be done to allow both programs to run "headless" and provide data to PlanePlotter?

Thanks,
Glenn
Glenn Blum
Central Texas, USA

tonkepen

Glenn, what have you been doing for over a year, trying, and I can not either. and made all possible methods, but effectively this problem is like that, as you tell it.

glenn68

Glenn Blum
Central Texas, USA

acarslogger

Hi Glenn,

It works OK here if you run acarsdeco2 as a background job.

What I did ...

1) Open PuTTY and log in, and cd to acarsdeco2.
2) Create a file 'startacarsdeco2.sh' with the following contents

#!/bin/bash

/home/pi/acarsdeco2/acarsdeco2 --outConnectUdp pp:<ipaddress>:<portno> --gain 38.6 --freq-correction -1 --freq 131525000 --freq 131725000 --freq 131825000 --no-console --logfile /var/log/acarsdeco2/acarsdeco2 >> /home/pi/acarsdeco2/errorfile.log 2>&1 &

exit


You will obvously need to change some of the paramters to configure for your Pi environment.

3) Save the file and make it executable - 'chmod u+x startacarsdeco2.sh'
4) Execute the startup script with

./startacarsdeco2.sh &


5) I also add the startacarsdeco2.sh script to my crontab so that it executes automatically on Pi reboot.
6) You can exit the PuTTY window and acarsdeco2 will run in the background and send data to PP.

Hope it works for you.
Regards
Stuart

sergsero

#8
Hello,

Another way to run a program after system booting is turn acarsdeco2 into a Linux service using systemd. It provides a service manager that runs first (as PID 1) and starts the rest of the system. As a rule, systemd is used by modern versions of Linux.

The main command used to control systemd is 'systemctl'. You can check your system by running command: 'pi@rpi-deb9:~ $ systemctl status'.

For create a Linux service you need to:
1. to create a file called /etc/systemd/system/acarsdeco2.service

pi@rpi-deb9:~ $ sudo touch /etc/systemd/system/acarsdeco2.service
pi@rpi-deb9:~ $ sudo chmod 664 /etc/systemd/system/acarsdeco2.service

for example:
pi@rpi-deb9:~ $ cat /etc/systemd/system/acarsdeco2.service
[Unit]
Description=acarsdeco2 20190622
After=network.target

[Service]
User=pi
Group=pi
Type=simple
ExecStart=/opt/ad2/acarsdeco2 --gain 38.6  --freq-correction -1 --http-port 8088 --silhouettes /home/pi/data/silhouettes --pictures /home/pi/data/pictures --db /home/pi/data/basestation.sqb --frdb /home/pi/data/flightroute.sqb --banners /home/pi/data/logos --vrs-url http://192.168.64.254:8089 --freq 131550000 --freq 131725000 --freq 131825000 --no-console --outConnectUdp pp:192.168.64.254:9742
WorkingDirectory=/opt/ad2
StandardOutput=null
StandardError=inherit
TimeoutSec=30
Restart=on-failure
RestartSec=30
StartLimitInterval=350
StartLimitBurst=10

[Install]
WantedBy=multi-user.target


The purpose of some configuration parameter:
Set your actual username / group after User=xxx / Group=yyy and set the proper full path to your acarsdeco2 and its starting options in ExecStart=.
The After= directive means that your service must be started after the network is ready.
The Type= configures the process start-up type for this service unit and the 'simple' is expected that the process configured with ExecStart= is the main process of the service.

By default, systemd does not restart a service if acarsdeco2 exits for whatever reason. The Restart=on-failure configures whether the service shall be restarted when the process exits with a non-zero exit code, is terminated by a signal (including on core dump), when an operation (such as service reload) times out, and when the configured watchdog timeout is triggered. Setting this to on-failure is the recommended choice for long-running services, in order to increase reliability by attempting automatic recovery from errors.

By default, systemd attempts a restart after 100ms. You can specify the number of seconds to wait before attempting a restart, using, for example, 30 sec: TimeoutSec=30. It's a good idea to set RestartSec to at least 5-10 second though, to avoid putting too much stress on your server when things start going wrong.

2. After creating the new service file acarsdeco2.service, you must restart systemd:
pi@rpi-deb9:~ $ sudo systemctl daemon-reload

3. Now you can start, stop, restart and check the status of the service acarsdeco2:
pi@rpi-deb9:~ $ sudo systemctl start acarsdeco2.service
pi@rpi-deb9:~ $ sudo systemctl stop acarsdeco2.service
pi@rpi-deb9:~ $ sudo systemctl restart acarsdeco2.service
pi@rpi-deb9:~ $ systemctl status acarsdeco2.service


4. Enable the acarsdeco2.service to be started on bootup:
pi@rpi-deb9:~ $ sudo systemctl enable acarsdeco2.service

5. To check the service logs, run:
pi@rpi-deb9:~ $ journalctl -u acarsdeco2.service

You can also run systemctl commands from a remote computer, for example:
sergsero@z270:~$ systemctl --host pi@192.168.64.174 status acarsdeco2.service
pi@192.168.64.174's password:
● acarsdeco2.service - acarsdeco2 20190622
   Loaded: loaded (/etc/systemd/system/acarsdeco2.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2019-06-23 12:57:14 +07; 4h 15min ago
Main PID: 10555
   CGroup: /system.slice/acarsdeco2.service
           └─10555 /opt/ad2/acarsdeco2 --gain 38.6 --freq-correction -1 --http-port 8088 --silhouettes /home/pi/data/silhouettes --pictures /home/


A detailed description of all the properties of systemd are displayed in console using the man command: pi@rpi-deb9:~ $ man systemd.service
Or in the Debian man-pages WEB links: https://manpages.debian.org/stretch/systemd/systemd.unit.5.en.html and https://manpages.debian.org/stretch/systemd/systemd.unit.5.en.html

Best regards,
sergsero

[attachment deleted reduce file load]

glenn68

Quote from: acarslogger on June 22, 2019, 11:55:06 AM
Hi Glenn,

It works OK here if you run acarsdeco2 as a background job.

What I did ...

1) Open PuTTY and log in, and cd to acarsdeco2.
2) Create a file 'startacarsdeco2.sh' with the following contents

#!/bin/bash

/home/pi/acarsdeco2/acarsdeco2 --outConnectUdp pp:<ipaddress>:<portno> --gain 38.6 --freq-correction -1 --freq 131525000 --freq 131725000 --freq 131825000 --no-console --logfile /var/log/acarsdeco2/acarsdeco2 >> /home/pi/acarsdeco2/errorfile.log 2>&1 &

exit


You will obvously need to change some of the paramters to configure for your Pi environment.

3) Save the file and make it executable - 'chmod u+x startacarsdeco2.sh'
4) Execute the startup script with

./startacarsdeco2.sh &


5) I also add the startacarsdeco2.sh script to my crontab so that it executes automatically on Pi reboot.
6) You can exit the PuTTY window and acarsdeco2 will run in the background and send data to PP.

Hope it works for you.
Regards
Stuart

Do you have data running to Plane Plotter? I have ACARSDECO2 output for Plane Plotter to my windows computer but I dont see the data. If I run it from a console then I get data.
Glenn Blum
Central Texas, USA

acarslogger

Hi Glenn,

I don't run PP, but when I run acarsdeco2 as a background job as decribed previously, and with PuTTY disconnected from my Pi, I am receiving PP data on my W10 PC.
I have a small program that monitors a port and for each received UDP packet, it outputs the current date and time, the UDP packet in Hex and the UDP packet in ASCII.
This is what it looks like.

24/06/2019 07:31:01
41 43 47 20 2E 47 2D 4F 42 59 48 20 21 20 35 55 20 38 20 4D 30 36 41 20 42 59 30 33 48 45 20 4C 45 49 42 20 4C 45 50 41 20 4C 45 42 4C 20 4C 46 42 4F 53 41 2F 32 34 30 37 33 30 32 34
ACG .G-OBYH ! 5U 8 M06A BY03HE LEIB LEPA LEBL LFBOSA/24073024

24/06/2019 07:31:03
41 43 47 20 2E 43 2D 46 4F 47 4A 20 21 20 31 32 20 31 20 4D 35 31 41 20 57 53 30 30 30 33 20 4E 20 35 30 2E 36 37 38 2C 57 20 20 32 2E 36 37 30 2C 32 38 35 37 32 2C 30 37 33 30 35 31 2C 20 32 30 38 2C 2E 43 2D 46 4F 47 4A 2C
ACG .C-FOGJ ! 12 1 M51A WS0003 N 50.678,W  2.670,28572,073051, 208,.C-FOGJ,

24/06/2019 07:31:03
41 43 32 20 2E 48 42 2D 4A 42 48 20 46 20 5F 64 20 31 20 53 35 36 41 20 4C 58 30 34 34 4B 20
AC2 .HB-JBH F _d 1 S56A LX044K

24/06/2019 07:31:09
41 43 32 20 2E 48 42 2D 4A 42 48 20 47 20 5F 64 20 32 20 53 35 37 41 20 4C 58 30 34 34 4B 20
AC2 .HB-JBH G _d 2 S57A LX044K

24/06/2019 07:31:12
41 43 58 20 2E 47 2D 45 55 59 4B 20 53 20 5F 64 20 39 20 53 34 34 41 20 42 41 30 38 34 57 20
ACX .G-EUYK S _d 9 S44A BA084W

24/06/2019 07:31:24
41 43 47 20 2E 47 2D 53 54 42 48 20 21 20 42 36 20 31 20 46 30 39 41 20 42 41 30 31 36 35 20 2F 51 55 4B 41 58 42 41 2E 41 44 53 2E 47 2D 53 54 42 48 30 37 32 33 45 30 37 30 30 30 43 30 43 36 34 33 39 44 35 46 39 44 38 42 35 36
ACG .G-STBH ! B6 1 F09A BA0165 /QUKAXBA.ADS.G-STBH0723E07000C0C6439D5F9D8B56


I'm not sure what else to suggest.
Regards
Stuart

glenn68

Maybe I need to run ACARSDEC instead.
How would I check on my windows 10 system that there is data coming in from my Pi?
Glenn Blum
Central Texas, USA

Hobbyd

#12
Hi Glenn,
Just made aware of this thread by Stuart (Acarslogger) so let's give it a go.

Earlier you mentioned that you do see acarsdeco2 (which is running on your RPi) data in PlanePlotter when you run it from console.
Now you ask "How would I check on my windows 10 system that there is data coming in from my Pi?".

Assuming your PC running PP is using IP address 192.168.0.100 then the option
--outConnectUdp pp:192.168.0.100:9742
should do the job.

Make sure that in PlanePlotter, Input/Output settings you have ticked the "UDP/IP data from net" box.

PS. I do run dumpvdl2 and acarsdec on a headless RPi and feed data to Planeplotter sucessfuly.
The advantage of acarsdec above acarsdeco2 is that acarsdec does decode CPDLC messages and acardeco2 (as far as I know) does not.

PS.
Maybe it is better to discuss this using e-mail (we have talked before) and post the solution so that everyone can benefit.

PS.
If you, for whatever reason, prefer acarsdeco2 above acarsdec I can run it on my RPi and see what happens.

Cheers, Dick 

glenn68

Dick,
I appreciate the reply. I would like the ability to have the programs run from the boot and provide data to planeplotter. I run DUMPVDL2 from the console and it shows plots on Planeplotter.
Glenn Blum
Central Texas, USA

Hobbyd

Glenn, 
I have send you an e-mail as I feel these things work best in a 1-to-1 session. It also is much easier to add screenshots (at least for me).

I'm sure we can get you up and running in no time.

Cheers,
Dick