Notifies via Telegram when an aircraft passes over a certain area.

Overview

adsbTelegramNotifier

Notifies via Telegram when an aircraft passes over a certain area.
The script gets the data from an existing readsb or dump1090 installation (aircraft.json).

Telegram message

Photo Source

Dependencies

Install the dependencies via:
sudo apt install curl php-cli php-json php-curl -y
You also need a decoder instance, such as readsb or dump1090.

Install

Go to the directory where you want to install the notifier, clone Repository, rename config.template.php to config.php and edit the config file.

cd ~
git clone https://github.com/RundesBalli/adsbTelegramNotifier.git
cd adsbTelegramNotifier
mv includes/config.template.php includes/config.php
nano includes/config.php

Telegram Bot

  1. Create a bot with the BotFather and note the bot auth token.
  2. Get the chat ID: Decide if you want to get notifications via private chat or in a group chat.
  • Private: Send a message to the Chat ID Bot.
  • Group: Invite the Chat ID Bot to your group (can be kicked immediately after that).
  1. Enter the bot auth token and the chat ID in the includes/config.php.
  2. Initialize the bot:
  • Private: you must first send a message to your bot (e.g. /start or click the start button in the bot) to initialize the chat with the bot. Otherwise it will fail until first contact from you (antispam reasons). Note that the bot will not reply to your message.
  • Group: You have to invite the bot to your group. Thats it.

Test the Bot / Debug / Troubleshooting

To test the bot, you can simply run it with PHP in the CLI:
php notifier.php

If you just want to know if the telegram chat ID and bot token is correct, you can run:
php notifier.php --test-telegram
It will send a test message to the configured chat ID.

The bot has a detailed output in the CLI, which makes debugging extremely easy:
Output

Cron / automatic notifications

  1. Edit the crontab with crontab -e
  2. Enter a new line with the following contents:
    * * * * * /usr/bin/php /path/to/your/notifier.php >/dev/null 2>&1
    Don't forget to edit the path and to add a new line at the end of the crontab. Make sure, that you have the >/dev/null 2>&1 at the end of the line, or the script will spam your systemlog.
  3. If you don't want to get notifications every minute around the clock, you can simply edit the crontab times with the crontab generator. If you only want notifications between 5 and 16 o'clock (5am to 4pm) and only Monday to Friday, you can use * 5-16 * * 1-5
  4. Note: The update check is only executed every 15 minutes (0, 15, 30, 45)! So if you dont execute the notifier every minute, you have to check for updates yourself!

More information (readsb/tar1090 only)

The default setup shows the HEX Code (ICAO) and the Flightnumber/Callsign if available.
If you want to know more information about the aircraft (registration, aircraft-type, dbFlags) you can add more data to the aircraft.json.
As seen in wiedehopfs tutorial you can download a aircraft.csv file and include it into readsb to get more data.

sudo wget -O /usr/local/share/tar1090/aircraft.csv.gz https://github.com/wiedehopf/tar1090-db/raw/csv/aircraft.csv.gz
sudo nano /etc/default/readsb

Add the following line in one of the readsb parameter lines:
--db-file /usr/local/share/tar1090/aircraft.csv.gz --db-file-lt

For example:

DECODER_OPTIONS="--max-range 450 --write-json-every 1"

becomes:

DECODER_OPTIONS="--max-range 450 --write-json-every 1 --db-file /usr/local/share/tar1090/aircraft.csv.gz --db-file-lt"

Restart readsb:
sudo systemctl restart readsb

Contribute

If you want to contribute to the project, you are welcome to do the translations into your local language. But no matter what you want to contribute, just send a PR and I'll take a look at it.

You might also like...
telegram bot for sell virtual number

Telefake Telegram bot for sell virtual number (fully automatic) Installation create bot in telegram upload script in website with php and ssl (https)

laravel package untuk memudahkan penggunaan MCA dengan Telegram Bot USDI di aplikasi Universitas Udayana.

MCA KubeMQ Laravel laravel package untuk memudahkan penggunaan MCA dengan Telegram Bot USDI di aplikasi Universitas Udayana. Motivasi Proyek ini berfu

 Telegram bot for CC Checker with hella lotta features.
Telegram bot for CC Checker with hella lotta features.

SDMN CHECKER BOT Telegram bot for CC Checker with hella lotta features. 📝 Table of Contents Dependencies / Limitations Future Scope Setting up a Hero

Telegram API made for php (Simple usage)

Telegram Telegram API made for php (Simple usage) How to use? Download the project & place Telegram folder tp your project directory (For example i se

Integrate Your PHP Code With Telegram Bot API for Beginner

Documentation[https://core.telegram.org/bots/api] Resource[https://github.com/bachors/KBBI.sql] Integrate Your PHP Code With Telegram Bot API for Begi

Create and manage advanced polls with this Telegram Bot which has many features available!
Create and manage advanced polls with this Telegram Bot which has many features available!

MasterPollBot Create and manage advanced polls with this Telegram Bot which has many features available! Requirements Local Telegram Bot API or a webh

Simple telegram auto reminder BOT with PHP

Telebot Script Telegram BOT Auto Reminder Dibuat pake PHP OOP Sebenernya bukan buat dipublish sih, ini cuma buat praktek PHP OOP sama praktek Commit &

Simple php telegram bot.
Simple php telegram bot.

PHPTGBot Description Simple php telegram bot. Just for fun 🚧 Work In Progress 🚧 Maybe found error, since im not tested yet! Still on working, so be

A simple php telegram bot to check if the bin is valid or not!

Bin-Checker A simple php telegram bot to check if the bin is valid or not! Deploy FORK the Repo by clicking HERE Add your bot token in LINE 12 THEN DE

Comments
  • Run as a Docker image, docker compose file, calculate distance if not provided ads-b

    Run as a Docker image, docker compose file, calculate distance if not provided ads-b

    Provide file to create Docker image where notifier is run every minute using cron. An example docker-compose file is provided which can be used in e.g. Portainer, the config file, and ads-b decoded files can be mapped in.

    When the ads-b decoded files don't contain the distance (like in my case) it can be calculated by providing the base station location in the config file.

    Fix minor annoyance where the decimal point is used as a thousands separator and in South Africa that reads then funky.

    opened by diepeterpan 1
  • Using readsb API

    Using readsb API

    Using readsb api (--net-api-port 8042) as source of the data would be more useful for setting below altitude + above altitude, or box instead of circle... For logging planes to csv (airport area) I'm using api: http://<ip>:8042/?box=<lat south>,<lat north>,<lon west>,<lon east>&above_alt_baro=1&below_alt_baro=6000

    enhancement wontfix 
    opened by om3wuc 1
Owner
RundesBalli
PHP without OOP
RundesBalli
Robot increase telegram post 👁‍🗨Telegram Fake Posts Viewer👁‍🗨

Program Features - ?? Very and stylish design. - ?? It has glass buttons. - ?? Has a professional management panel. - ?? Has a user area. - ?? Free di

hack4lx 4 Nov 25, 2022
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.

Telegram Bot API - PHP SDK Telegram Bot PHP SDK lets you develop Telegram Bots in PHP easily! Supports Laravel out of the box. Telegram Bot API is an

Irfaq Syed 2.5k Jan 6, 2023
PHP Telegram Bot based on the official Telegram Bot API

PHP Telegram Bot based on the official Telegram Bot API

null 4 Dec 8, 2021
DNS over HTTPS executor for ReactPHP/dns

DNS over HTTPS client for ReactPHP Resolve DNS queries over HTTPS, provides secure DNS resolution over untrusted or shared networks (eg Serverless dep

James Lucas 6 Oct 7, 2022
A telegram bot to check credit cards. written in php & py

MRBANKER BOT A telegram bot to check credit cards. written in php & py. You can find me on telegram STEP1: goto botfather create a bot copy the token

Nitin1818 48 Dec 30, 2022
NovaGram - An elegant, Object-Oriented, reliable PHP Telegram Bot Library

An elegant, Object-Oriented, reliable PHP Telegram Bot Library Full Documentation • Public support group Examples • Features • Installation ?

Gaetano 165 Jan 6, 2023
TeleBot - Easy way to create Telegram-bots in PHP. Rich Laravel support out of the box.

TeleBot is a PHP library for telegram bots development. Rich Laravel support out of the box. Has an easy, clean, and extendable way to handle telegram Updates.

WeStacks 206 Jan 6, 2023
A tool for sending fast and managed messages to Telegram bot users

???? HiToAll A tool for sending fast and managed messages to Telegram bot users About In some telegram bots programmed with php language, if there are

Matin Najafi 3 Oct 3, 2021
can be found on telegram as https://t.me/ZedgeImagesBot

Zedge Images Bot Installation Instruction copy the PHP files to your webhost. Rename config.sample.php to config.php Edit config.php Now, go to https:

Shrimadhav U K 12 Aug 26, 2022
SDK for latest version of Telegram bots API

SDK for latest version of Telegram bots API (from April 24, 2020) Using Examples Installing composer require "DiyorbekUz/Telelib: dev-master" Init bot

Diyorbek 2 Sep 5, 2021