Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23

Thread: How to Feed Data to Multiple Sites - A Brief Guide

  1. #21
    Captain abcd567's Avatar
    Join Date
    Sep 2013
    Location
    Toronto CYYZ
    Posts
    2,579
    Installed OpenSky Network Data Feeder on MX-Linux on Intel PC

    OpenSky-feeder Map+Max Range.png . Opensky-network-1000.png

    STEP-BY-STEP METHOD

    STEP-1

    Code:
    wget https://opensky-network.org/files/firmware/opensky-feeder_latest_i386.deb
    
    sudo dpkg --install opensky-feeder_latest_i386.deb
    The 2nd command above will install opensky-feeder. and then open a dialogue to configure it (latitude, longitude, height of antenna, opensky user name etc).

    You should sign-up with opensky-network.org and obtain a user name before starting installation.


    If at any srtage you want to make changes to settings, give foillowing command and enter new values.

    Code:
    sudo dpkg-reconfigure opensky-feeder

    STEP-2
    Although MX-Linux is shipped with both systemd and sysvinit, by default systemd is disabled. The developers of MX-Linux recommend to keep systemd disabled, and use sysvinit.

    Dump1090-mutability, FR24Feeder, Plane Finder Feeder, and FlightAware Feeder detect that systemd has been disabled, and install startup files in /etc/init.d folder for sysvinit. Unfortunately Opensky network feeder does not install the init file needed by sysvinit. It installs only .service files for systemd. As a result, Opensky feeder does not start at boot, and cannot be started manually as well by command "sudo service opensky start". This situation can be overcome either by enabling systemd OR manually creating init file.

    The systemd can be enabled at boot when Grub is displayed. Choose advanced boot option, and in that option enable systemd.

    Since the MX-Linux team recommends NOT to enable systemd and instead use sysvinit, I did NOT enable systemd. Instead I created
    an init file inside folder /etc/init.d. The details are as follows:

    Code:
    #Create a blank file in folder /etc/init.d
    sudo touch /etc/init.d/opensky
    
    
    #Make this new file Executeable
    sudo chmod +x /etc/init.d/opensky
    
    
    #Open new blank file in nano to edit it
    sudo nano /etc/init.d/opensky
    In the file opened above, copy-paste following code
    NOTE: Full code is not directly visible in the window below. Please scroll down to see full code.

    Code:
    #!/bin/bash
    ### BEGIN INIT INFO
    # Provides:          opensky
    # Required-Start:    $remote_fs $network
    # Required-Stop:     $remote_fs $network
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: opensky daemon
    # Description:       Receives ADS-B messages from a decoder like dump1090
    #                    and sends to opensky network via internet
    ### END INIT INFO
    
    # Do NOT "set -e"
    
    # PATH should only include /usr/* if it runs after the mountnfs.sh script
    PATH=/sbin:/usr/sbin:/bin:/usr/bin
    DESC="opensky-feeder daemon"
    NAME=opensky
    DAEMON=/usr/bin/openskyd-dump1090
    ARGS=""
    PIDFILE=/var/run/$NAME.pid
    SCRIPTNAME=/etc/init.d/$NAME
    OSUSER=openskyd
    LOGFILE=/var/log/opensky.log
    
    # Exit if the package is not installed
    [ -x "$DAEMON" ] || exit 0
    
    
    # Load the VERBOSE setting and other rcS variables
    . /lib/init/vars.sh
    
    # Define LSB log_* functions.
    # Depend on lsb-base (>= 3.2-14) to ensure that this file is present
    # and status_of_proc is working.
    . /lib/lsb/init-functions
    
    #
    # Function that starts the daemon/service
    #
    do_start()
    {
            # Return
            #   0 if daemon has been started
            #   1 if daemon was already running
            #   2 if daemon could not be started
    
    
            start-stop-daemon --start --pidfile $PIDFILE --user "$OSUSER" --exec $DAEMON --test > /dev/null \
                    || return 1
    
    
            # create logfile with the appropriate permissions if not already there
            touch $LOGFILE
            chown "$OSUSER":root $LOGFILE
    
            start-stop-daemon --start  --pidfile $PIDFILE --user "$OSUSER" --chuid "$OSUSER" --make-pidfile --background --no-close --exec $DAEMON -- \
                     >$LOGFILE 2>&1 \
                    || return 2
            sleep 1
    }
    
    #
    # Function that stops the daemon/service
    #
    do_stop()
    {
            # Return
            #   0 if daemon has been stopped
            #   1 if daemon was already stopped
            #   2 if daemon could not be stopped
            #   other if a failure occurred
            start-stop-daemon --stop --retry=TERM/30/KILL/5 --pidfile $PIDFILE --user "$OSUSER" --exec $DAEMON
            RETVAL="$?"
            [ "$RETVAL" = 2 ] && return 2
            sleep 1
            # Many daemons don't delete their pidfiles when they exit.
            rm -f $PIDFILE
            return "$RETVAL"
    }
    
    case "$1" in
      start)
            [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
            do_start
            case "$?" in
                    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
            esac
            ;;
      stop)
            [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
            do_stop
            case "$?" in
                    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
            esac
            ;;
      status)
            status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
            ;;
      restart|force-reload)
            log_daemon_msg "Restarting $DESC" "$NAME"
            do_stop
            case "$?" in
              0|1)
                    do_start
                    case "$?" in
                            0) log_end_msg 0 ;;
                            1) log_end_msg 1 ;; # Old process is still running
                            *) log_end_msg 1 ;; # Failed to start
                    esac
                    ;;
              *)
                    # Failed to stop
                    log_end_msg 1
                    ;;
            esac
            ;;
      *)
            echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
            exit 3
            ;;
    esac
    
    :
    
    #
    Save file (Ctrl+o) and close (Ctrl+x)

    Enable opensky init script to start at boot, and reboot computer
    Code:
    sudo update-rc.d opensky defaults
    
    sudo reboot

    During normal use, you can use following commands

    Code:
    sudo service opensky start
    
    sudo service opensky restart
    [ ok ] Restarting opensky-feeder daemon: opensky.
    
    sudo service opensky status
    [ ok ] opensky is running.
    
    sudo service opensky stop
    LOG:

    Code:
    cat /var/log/opensky.log
    
    [INFO] [COMP] Initialize STAT
    [INFO] [COMP] Initialize POS
    [INFO] [COMP] Initialize DEVTYPE
    [INFO] [COMP] Initialize NET
    [INFO] [COMP] Initialize TB
    [INFO] [COMP] Initialize SERIAL
    [INFO] [COMP] Initialize BUF
    [INFO] [COMP] Initialize RELAY
    [INFO] [COMP] Initialize RC
    [INFO] [COMP] Initialize FILTER
    [INFO] [COMP] Initialize RECV
    [INFO] [COMP] Start STAT
    [INFO] [COMP] Start POS
    [INFO] [COMP] Start DEVTYPE
    [INFO] [COMP] Start NET
    [INFO] [COMP] Start TB
    [INFO] [COMP] Start SERIAL
    [INFO] [COMP] Start RELAY
    [INFO] [COMP] Start RC
    [INFO] [COMP] Start FILTER
    [INFO] [COMP] Start RECV
    [WARN] [NET] Could not resolve host 'collector.opensky-network.org': System error
    [WARN] [NET] Tried all addresses of 'collector.opensky-network.org': could not connect
    [INFO] [INPUT] Trying to connect to 'localhost': [::1]:30005
    [WARN] [INPUT] Could not connect: Connection refused (111)
    [INFO] [INPUT] Trying to connect to 'localhost': [127.0.0.1]:30005
    [WARN] [INPUT] Could not connect: Connection refused (111)
    [WARN] [INPUT] Tried all addresses of 'localhost': could not connect
    [WARN] [NET] Could not resolve host 'collector.opensky-network.org': System error
    [WARN] [NET] Tried all addresses of 'collector.opensky-network.org': could not connect
    [INFO] [INPUT] Trying to connect to 'localhost': [::1]:30005
    [INFO] [INPUT] connected to 'localhost'
    [INFO] [NET] Trying to connect to 'collector.opensky-network.org': [194.209.200.6]:10004
    [INFO] [NET] connected to 'collector.opensky-network.org'
    [INFO] [LOGIN] Sending Device ID 5, Version 2.1.7
    [INFO] [LOGIN] Sending Serial Number 1000
    [INFO] [GPS] Sending position +43.xxxx, -79.xxxx, +150m
    [INFO] [LOGIN] Sending Username 'abcd567'
    [INFO] [TB] Setting sync filter: 0
    [INFO] [TB] Setting ext squitter only filter: 0
    Last edited by abcd567; 2018-11-17 at 22:59.

  2. #22
    Captain abcd567's Avatar
    Join Date
    Sep 2013
    Location
    Toronto CYYZ
    Posts
    2,579
    Updated post #1 today (April 12, 2019)

  3. #23
    Passenger TomNJerry's Avatar
    Join Date
    Nov 2017
    Posts
    3
    The first post of this thread deservers to be sticky.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •