Code Monkey home page Code Monkey logo

inrcot's Introduction

Garmin inReach to Cursor on Target Gateway

Screenshot of INRCOT being used on a Search & Rescue mission in Arizona.
  • Pictured: Screenshot of INRCOT being used on a Search & Rescue mission in Arizona.

The inReach to Cursor on Target Gateway (INRCOT) transforms Garmin inReach position messages into Cursor on Target (CoT) for display on TAK Products such as ATAK, WinTAK, iTAK, et al. Single or multi-device feeds are supported.

Other situational awareness products, including as RaptorX, TAKX & COPERS have been tested.

INRCOT requires a Garmin inReach device with service.

Diagram of INRCOT's Concept of Operations (CONOP).
  • Pictured: Diagram of INRCOT's Concept of Operations (CONOP).

Support Development

Support Development: Buy me a coffee!

Use Cases

There are numerous applications for satellite based position location information, including:

  1. Wildland fire unit tracking
  2. Blue Force Tracking
  3. Search & Rescue (SAR)
  4. Partner Forces PLI
  5. Asset Tracking
  6. Data diode, CDS & cybersecurity considerations

See also Section 1114.d of the Dingell Act:

Location Systems for Wildland Firefighters.--
(1) In general.--Not later than 2 years after the date of
    enactment of this Act, subject to the availability of
    appropriations, the Secretaries, in coordination with State
    wildland firefighting agencies, shall jointly develop and
    operate a tracking system (referred to in this subsection as the
    ``system'') to remotely locate the positions of fire resources
    for use by wildland firefighters, including, at a minimum, any
    fire resources assigned to Federal type 1 wildland fire incident
    management teams.

Requirements

INRCOT uses the Garmin Explore "MapShare" feature.

  1. Login to Garmin Explore: https://explore.garmin.com/
  2. Browse to the "MY INFO" page: https://explore.garmin.com/Inbox
  3. Click "Social".
  4. Under MapShare > Enable MapShare click to enable 'MapShare: On'.
  5. Click "Feeds" and note the "Raw KML Data" URL, we'll use this URL, write it down.

For more information on inReach KML Feeds see: https://support.garmin.com/en-US/?faq=tdlDCyo1fJ5UxjUbA9rMY8

Install

INRCOT functionality is provided via a command-line tool named inrcot. To install inrcot:

Debian, Ubuntu, Raspbian, Raspberry OS:

$ sudo apt update
$ 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/inrcot/releases/latest/download/python3-inrcot_latest_all.deb
$ sudo apt install -f ./python3-inrcot_latest_all.deb

CentOS, et al:

$ sudo python3 -m pip install inrcot

Install from source:

$ git clone https://github.com/ampledata/inrcot.git
$ cd inrcot/
$ python3 setup.py install

Usage

The inrcot program has two command-line arguments:

$ inrcot -h
usage: inrcot [-h] [-c CONFIG_FILE] [-p PREF_PACKAGE]

optional arguments:
-h, --help            show this help message and exit
-c CONFIG_FILE, --CONFIG_FILE CONFIG_FILE
                        Optional configuration file. Default: config.ini
-p PREF_PACKAGE, --PREF_PACKAGE PREF_PACKAGE
                        Optional connection preferences package zip file (aka data package).

Configuration

Configuration parameters can be specified either via environment variables or in a INI-stile configuration file. An example configuration file, click here for an example configuration file example-config.ini.

Global Config Parameters:

  • POLL_INTERVAL: How many seconds between checking for new messages at the Spot API? Default: 120 (seconds).
  • COT_STALE: How many seconds until CoT is stale? Default: 600 (seconds)
  • COT_TYPE: CoT Type. Default: a-f-g-e-s

For each feed (1 inReach = 1 feed, multiple feeds supported), these config params can be set:

  • FEED_URL: URL to the MapShare KML.
  • COT_STALE: How many seconds until CoT is stale? Default: 600 (seconds)
  • COT_TYPE: CoT Type. Default: a-f-g-e-s
  • COT_NAME: CoT Callsign. Defaults to the MapShare KML Placemark name.
  • COT_ICON: CoT User Icon. If set, will set the CoT usericon element, for use with custom TAK icon sets.
  • FEED_USERNAME: MapShare username, for use with protected MapShare.
  • FEED_PASSWORD: MapShare password, for use with protected MapShare.

TLS & other configuration parameters available via PyTAK.

Example Configurations

An example config:

[inrcot]
COT_URL = tcp://takserver.example.com:8088
POLL_INTERVAL = 120

[inrcot_feed_aaa]
FEED_URL = https://share.garmin.com/Feed/Share/aaa

Multiple feeds can be added by creating multiple inrcot_feed sections:

[inrcot]
COT_URL = tcp://takserver.example.com:8088
POLL_INTERVAL = 120

[inrcot_feed_xxx]
FEED_URL = https://share.garmin.com/Feed/Share/xxx

[inrcot_feed_yyy]
FEED_URL = https://share.garmin.com/Feed/Share/yyy

Individual feeds CoT output can be customized as well:

[inrcot]
COT_URL = tcp://takserver.example.com:8088
POLL_INTERVAL = 120

[inrcot_feed_zzz]
FEED_URL = https://share.garmin.com/Feed/Share/zzz
COT_TYPE = a-f-G-U-C
COT_STALE = 600
COT_NAME = Team Lead
COT_ICON = my_package/team_lead.png

Protected feeds are also supported:

[inrcot]
COT_URL = tcp://takserver.example.com:8088
POLL_INTERVAL = 120

[inrcot_feed_ppp]
FEED_URL = https://share.garmin.com/Feed/Share/ppp
FEED_USERNAME = secretsquirrel
FEED_PASSWORD = supersecret

Source

INRCOT Source can be found on Github: https://github.com/ampledata/inrcot

Author

INRCOT is written and maintained by Greg Albrecht W2GMD [email protected]

https://ampledata.org/

Copyright

INRCOT is Copyright 2023 Greg Albrecht

License

Copyright 2023 Greg Albrecht <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

inrcot's People

Contributors

ampledata avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

inrcot's Issues

Set a custom icon for an InReach

Add the ability to set a custom icon for a specific InReach device. The icon setting should support specifying an icon from a usericon/custom icon datapackage, i.e. ABC123-123/icon.png, where ABC123-123 is the UUID of the custom icon/usericon Data Package.

Expecting any private key

Steps to reproduce

  • Make a client for INRCOT, named clientA.
  • You will have files clientA.csr/jks/key/p12/pem/trusted.pem
  • Run: openssl rsa -in inreach.pem -out inreach_clear.pem

Expected result

You should get a decrypted private key.

Actual result

I don't get a prompt for the passphrase, and the command fails, saying its expecting any private key.

TypeError: BasicAuth() tuple is required instead

Mar 10 01:14:33 cotgateway inrcot[436065]: 2023-03-10 01:14:33,460 pytak ERROR pytak.classes.get_inreach_feeds:74 - BasicAuth() tuple is required instead
Mar 10 01:14:33 cotgateway inrcot[436065]: Traceback (most recent call last):
Mar 10 01:14:33 cotgateway inrcot[436065]:   File “/usr/lib/python3/dist-packages/inrcot/classes.py”, line 69, in get_inreach_feeds
Mar 10 01:14:33 cotgateway inrcot[436065]:     response = await session.request(
Mar 10 01:14:33 cotgateway inrcot[436065]:   File “/usr/lib/python3/dist-packages/aiohttp/client.py”, line 464, in _request
Mar 10 01:14:33 cotgateway inrcot[436065]:     req = self._request_class(
Mar 10 01:14:33 cotgateway inrcot[436065]:   File “/usr/lib/python3/dist-packages/aiohttp/client_reqrep.py”, line 290, in __init__
Mar 10 01:14:33 cotgateway inrcot[436065]:     self.update_auth(auth)
Mar 10 01:14:33 cotgateway inrcot[436065]:   File “/usr/lib/python3/dist-packages/aiohttp/client_reqrep.py”, line 468, in update_auth
Mar 10 01:14:33 cotgateway inrcot[436065]:     raise TypeError(‘BasicAuth() tuple is required instead’)
Mar 10 01:14:33 cotgateway inrcot[436065]: TypeError: BasicAuth() tuple is required instead```

Malformed COT

image

Feed is read and sent toward WinTAK-civ v4.7.0.163. A malformed COT error is emitted and nothing is displayed.

AttributeError: 'NoneType' object has no attribute 'run_until_complete'

https://github.com/ampledata/inrcot/blob/441260880b5563986327d3d4fc002db5c7941784/inrcot/commands.py#L75

[tak@localhost ~]$ inrcot -c /home/tak/inrcot/config.ini
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/inrcot-1.0.3-py3.6.egg/inrcot/commands.py", line 77, in cli
    loop.run_until_complete(main(config))
AttributeError: 'NoneType' object has no attribute 'run_until_complete'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/bin/inrcot", line 11, in <module>
    load_entry_point('inrcot==1.0.3', 'console_scripts', 'inrcot')()
  File "/usr/local/lib/python3.6/site-packages/inrcot-1.0.3-py3.6.egg/inrcot/commands.py", line 79, in cli
    loop.close()
AttributeError: 'NoneType' object has no attribute 'close'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.