Skip to content

Commit

Permalink
few more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ampledata committed May 25, 2022
1 parent 8dbd8ee commit fb5ab22
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 37 deletions.
71 changes: 37 additions & 34 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,48 @@ aiscot - AIS Cursor-on-Target Gateway.


aiscot receives AIS Sentences from an AIS Receiver, such as ais-decoder,
converts them to Cursor-on-Target Events, and transmits the CoT Events to a destination.
converts them to Cursor-on-Target Events, and transmits the CoT Events to a
destination.

For use with CoT systems such as ATAK, WinTAK, etc. See https://www.civtak.org/ for more information on the TAK
program.
For use with CoT systems such as ATAK, WinTAK, etc. See https://www.civtak.org/
for more information on the TAK program.

Utilized for an open ocean boat race in the Northern Pacific Ocean, as
described in this article: http://ampledata.org/boat_race_support.html

Support AISCoT Development
Support AISCOT Development
==========================

AISCoT has been developed for the Disaster Response, Public Safety and Frontline community at-large. This software
is currently provided at no-cost to our end-users. All development is self-funded and all time-spent is entirely
voluntary. Any contribution you can make to further these software development efforts, and the mission of AISCoT
to provide ongoing SA capabilities to our end-users, is greatly appreciated:
AISCOT has been developed for the Disaster Response, Public Safety and
Frontline community at-large. This software is currently provided at no-cost to
our end-users. All development is self-funded and all time-spent is entirely
voluntary. Any contribution you can make to further these software development
efforts, and the mission of AISCOT to provide ongoing SA capabilities to our
end-users, is greatly appreciated:

.. image:: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png
:target: https://www.buymeacoffee.com/ampledata
:alt: Support AISCoT development: Buy me a coffee!
:alt: Support AISCOT development: Buy me a coffee!

Installation
============


The AIS to Cursor on Target Gateway is provided by a command-line tool
called `aiscot`, which can be installed several ways.
AISCOT functionality is provided by a command-line tool called `aiscot`,
which can be installed several ways.

Installing as a Debian/Ubuntu Package::
Installing as a Debian/Ubuntu Package [USE ME]::

$ wget https://github.com/ampledata/pytak/releases/latest/download/python3-pytak_latest_all.deb
$ sudo apt install -f ./python3-pytak_latest_all.deb
$ wget https://github.com/ampledata/aiscot/releases/latest/download/python3-aiscot_latest_all.deb
$ sudo apt install -f ./python3-aiscot_latest_all.deb

Install from the Python Package Index::
Install from the Python Package Index [Alternative]::

$ pip install aiscot


Install from this source tree::
Install from this source tree [Developer]::

$ git clone https://github.com/ampledata/aiscot.git
$ cd aiscot/
Expand All @@ -57,44 +59,45 @@ Install from this source tree::
Usage
=====

The `aiscot` daemon has several runtime arguments::

$ aiscot -h
usage: aiscot [-h] [-c CONFIG_FILE] [-d] [-U COT_URL] [-P AIS_PORT] [-S COT_STALE] [-F FILTER_CONFIG] [-K KNOWN_CRAFT]
AISCOT can be configured with a INI-style configuration file, or using
environmental variables.

optional arguments:
Command-line options:
-h, --help show this help message and exit
-c CONFIG_FILE, --CONFIG_FILE CONFIG_FILE
-d, --DEBUG Enable DEBUG logging
-U COT_URL, --COT_URL COT_URL
URL to CoT Destination. Must be a URL, e.g. tcp:1.2.3.4:1234 or tls:...:1234, etc.
-P AIS_PORT, --AIS_PORT AIS_PORT
AIS UDP Listen Port.
-S COT_STALE, --COT_STALE COT_STALE
CoT Stale period, in seconds
-F FILTER_CONFIG, --FILTER_CONFIG FILTER_CONFIG
FILTER_CONFIG
-K KNOWN_CRAFT, --KNOWN_CRAFT KNOWN_CRAFT
KNOWN_CRAFT

See example-config.ini for example configuration.

Configuration options:
COT_URL : `str`
URL to CoT Destination. Must be a URL, e.g. tcp:1.2.3.4:1234 or tls:...:1234, etc.
AIS_PORT : `int`
AIS UDP Listen Port.
COT_STALE : `int`
CoT Stale period, in seconds. Default 3600 seconds (1 hour).
KNOWN_CRAFT : `str`
Known Craft hints file. CSV file containing callsign/marker hints.

See example-config.ini in the source tree for example configuration.


Source
======
Github: https://github.com/ampledata/aiscot


Author
======
Greg Albrecht W2GMD [email protected]

http://ampledata.org/


Copyright
=========

* aiscot Copyright 2021 Greg Albrecht, Inc.
* aiscot Copyright 2022 Greg Albrecht
* pyAISm.py Copyright 2016 Pierre Payen


License
=======

Expand Down
2 changes: 1 addition & 1 deletion aiscot/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ async def _get_aishub_feed(self):

async def run(self, number_of_iterations=-1):
"""Runs this Thread, reads AIS & outputs CoT."""
self._logger.info("Running AISWorker")
self._logger.info("Running AISWorker, COT_URL=%s", self.config.get("COT_URL"))
loop = asyncio.get_event_loop()

if self.aishub_url:
Expand Down
8 changes: 6 additions & 2 deletions aiscot/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,13 @@ def cli():
env_vars = os.environ
env_vars["COT_URL"] = env_vars.get("COT_URL", aiscot.DEFAULT_COT_URL)
config = configparser.ConfigParser(env_vars)

config_file = cli_args.get("CONFIG_FILE")
logging.info("Reading configuration from %s", config_file)
config.read(config_file)
if os.path.exists(config_file):
logging.info("Reading configuration from %s", config_file)
config.read(config_file)
else:
config.add_section("aiscot")

if sys.version_info[:2] >= (3, 7):
asyncio.run(main(config), debug=config["aiscot"].getboolean("DEBUG"))
Expand Down

0 comments on commit fb5ab22

Please sign in to comment.