TAK-Meshtastic-Gateway


NameTAK-Meshtastic-Gateway JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/brian7704/TAK_Meshtastic_Gateway
SummarySend and receive data from ATAK, WinTAK, or iTAK over Meshtastic
upload_time2024-06-19 19:07:30
maintainerNone
docs_urlNone
authorOpenTAKServer
requires_pythonNone
licenseGPL-3.0-or-later
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Join us on the OpenTAKServer [Discord server](https://discord.gg/6uaVHjtfXN)

# TAK Meshtastic Gateway

TAK Meshtastic Gateway listens for multicast data from TAK clients (ATAK, WinTAK, and iTAK) and forwards it to
a Meshtastic device which transmits it to a Meshtastic network. It will also forward messages from Meshtastic to 
TAK clients via multicast. Additionally, it enables sending and receiving chat messages and locations between TAK clients
and the Meshtastic app. For example, someone using WinTAK can send a message over a Meshtastic network to someone using 
the Meshtastic app and vice versa.

## Features

- Send chat and PLI messages from TAK clients (ATAK, WinTAK, and iTAK) over a Meshtastic network
- Receive chat and PLI messages from a Meshtastic network and display them in a TAK client
- See Meshtastic devices on the TAK client's map
- See the TAK client on the Meshtastic app's map
- Send and receive chat messages between the TAK client and Meshtastic app

TAK Meshtastic Gateway currently only supports sending and receiving chat and PLI messages. Other data types such as
data packages, markers, images, etc, are not supported due to the limited bandwidth of Meshtastic networks.

## Python Requirements

Due to an issue with the unishox2-py3 package, Windows requires Python version 3.12. Linux and macOS will work with Python
versions 3.8 and up.

## Known Issues

There is a bug in the takproto library which causes an exception in TAK Meshtastic Gateway when parsing XML CoT data.
There is a [PR](https://github.com/snstac/takproto/pull/16) that will fix the issue once it is merged. Until it is merged,
you will need to manually install from the pull request using the installation instructions below.

On Windows, the `unishox2-py3` library fails to build from the source distribution with the command `pip install unishox2-py3`.
TAK Meshtastic Gateway will instead install [this wheel](https://github.com/brian7704/OpenTAKServer-Installer/blob/master/unishox2_py3-1.0.0-cp312-cp312-win_amd64.whl).
As a result, Python 3.12 is required when running TAK Meshtastic Gateway on Windows.

## Installation

For installation you only need to create a Python virtual environment, activate the virtual environment, and install using pip.

### Linux/macOS

The unishox2-py3 Python library requires C build tools. In Debian based distros (i.e. Ubuntu) they can be installed with
`apt install build-essential`.

```shell
python3 -m venv tak_meshtastic_gateway_venv
. ./tak_meshtastic_gateway_venv/bin/activate
pip install git+https://github.com/snstac/takproto@refs/pull/16/merge
pip install tak-meshtastic-gateway
```

### Windows

```powershell
python -m venv tak_meshtastic_gateway_venv
.\tak_meshtastic_gateway_venv\Scripts\activate
pip install https://github.com/brian7704/OpenTAKServer-Installer/raw/master/unishox2_py3-1.0.0-cp312-cp312-win_amd64.whl
pip install git+https://github.com/snstac/takproto@refs/pull/16/merge
pip install tak-meshtastic-gateway
```

## Usage

When your virtual environment active, run the `tak-meshtastic-gateway` command

## Architecture

In most scenarios, the user will run TAK Meshtastic Gateway on the same computer that runs WinTAK. The Meshtastic node
can either be connected to the same computer via USB, or be on the same LAN as the computer. Connecting to the Meshtastic
node over the LAN allows it to be mounted in a spot outside with good mesh reception while the computer is inside.

## Meshtastic Node Configuration

The Meshtastic node should be set to the TAK role. TAK Meshtastic Gateway will automatically change the node's long name 
to the TAK client's callsign and the short name to the last four characters of the TAK client's UID. This ensures that 
the callsign shows up correctly for mesh users who are only using the Meshtastic app as well as ATAK plugin users.
TAK Meshtastic Gateway will also update the Meshtastic node's location with the location of the EUD.

## ATAK Plugin Settings

For best results, use the following settings on devices using the [Meshtastic ATAK Plugin.](https://meshtastic.org/docs/software/integrations/integrations-atak-plugin/).
You can find the settings in ATAK by clicking the Settings tool -> Tool Preferences -> Specific Tool Preferences ->
Meshtastic Preferences.

- Show all Meshtastic devices: On
- Don't sshow Meshtastic devices without GPS: On
- Do not show your local Meshtastic device: On

The rest of the settings can be changed as needed.

## Usage

All arguments are optional. If an argument is not specified its default value will be used.

| Flag | Parameter          | Description                                                                                                                                   | Default                                                                                          |
|------|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
| `-i` | `--ip-address`     | The private IP address of the machine running TAK Meshtastic Gateway.                                                                         | TAK Meshtastic Gateway will attempt to automatically find the IP of the computer it's running on |
| `-s` | `--serial-device`  | The serial device of the Meshtastic node (i.e. `COM3` or `/dev/ttyACM0`). Cannot be used simultaneously with `--mesh-ip`                      | TAK Meshtastic Gateway will attempt to automatically determine the serial device                 |
| `-m` | `--mesh-ip`        | The IP address or DNS name of the gateway Meshtastic node. Cannot be used simultaneously with `--serial-device`                               | Uses a serial connection                                                                         |
| `-c` | `--tak-client-ip`  | The IP address of the device running the TAK client (ATAK, WinTAK, or iTAK)                                                                   | `localhost`                                                                                      |
| `-p` | `--dm-socket-port` | TCP Port to listen on for DMs                                                                                                                 | `4243`                                                                                           |
| `-t` | `--tx-interval`    | Minimum time (in seconds) to wait between PLI transmissions from the TAK client to the mesh network. This reduces strain on the mesh network. | `30`                                                                                             |
| `-l` | `--log-file`       | Save log messages to a file.                                                                                                                  | `None` (disabled)                                                                                |
| `-d` | `--debug`          | Enable debug log messages                                                                                                                     | `Disabled` Only messages at the `INFO` level or higher will be logged                            |

## Permissions

When the Meshtastic node is connected via USB, TAK Meshtastic Gateway needs to be run as root (or via `sudo`) in Linux
and in an administrator PowerShell or Command Prompt in Windows. Connecting to the Meshtastic node via TCP does
not require elevated permissions.

## Example Usage Scenarios

### Scenario 1

- WinTAK on a PC
- Meshtastic node connected to the PC via USB
- TAK Meshtastic Gateway running on the same PC
- Command: `tak_meshtastic_gateway`

### Scenario 2

- WinTAK on a PC
- Meshtastic node on the same LAN as the PC
- TAK Meshtastic Gateway running on the same PC as WinTAK
- Command: `tak_meshtastic_gateway --mesh-ip MESHTASTIC_NODE_IP` Note: Substitute `MESHTASTIC_NODE_IP` with
the node's actual IP (i.e. `192.168.1.10`)

### Scenario 3

- ATAK or iTAK on a mobile device connected to a Wi-Fi network
- Meshtastic node connected to the same network
- TAK Meshtastic Gateway running on a computer or VM on the same network
- Command: `tak_meshtastic_gateway --mesh-ip MESHTASTIC_NODE_IP --tak-client-ip TAK_CLIENT_IP` Note: Substitute
`MESHTASTIC_NODE_IP` and `TAK_CLIENT_IP` with their actual IPs (i.e. `192.168.1.10` and `192.168.1.11`)
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/brian7704/TAK_Meshtastic_Gateway",
    "name": "TAK-Meshtastic-Gateway",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "OpenTAKServer",
    "author_email": "opentakserver@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3b/db/7682517b510a233427836779b6b1ed486ecbf1e57ad924818e210bad101b/tak_meshtastic_gateway-1.0.0.tar.gz",
    "platform": null,
    "description": "Join us on the OpenTAKServer [Discord server](https://discord.gg/6uaVHjtfXN)\n\n# TAK Meshtastic Gateway\n\nTAK Meshtastic Gateway listens for multicast data from TAK clients (ATAK, WinTAK, and iTAK) and forwards it to\na Meshtastic device which transmits it to a Meshtastic network. It will also forward messages from Meshtastic to \nTAK clients via multicast. Additionally, it enables sending and receiving chat messages and locations between TAK clients\nand the Meshtastic app. For example, someone using WinTAK can send a message over a Meshtastic network to someone using \nthe Meshtastic app and vice versa.\n\n## Features\n\n- Send chat and PLI messages from TAK clients (ATAK, WinTAK, and iTAK) over a Meshtastic network\n- Receive chat and PLI messages from a Meshtastic network and display them in a TAK client\n- See Meshtastic devices on the TAK client's map\n- See the TAK client on the Meshtastic app's map\n- Send and receive chat messages between the TAK client and Meshtastic app\n\nTAK Meshtastic Gateway currently only supports sending and receiving chat and PLI messages. Other data types such as\ndata packages, markers, images, etc, are not supported due to the limited bandwidth of Meshtastic networks.\n\n## Python Requirements\n\nDue to an issue with the unishox2-py3 package, Windows requires Python version 3.12. Linux and macOS will work with Python\nversions 3.8 and up.\n\n## Known Issues\n\nThere is a bug in the takproto library which causes an exception in TAK Meshtastic Gateway when parsing XML CoT data.\nThere is a [PR](https://github.com/snstac/takproto/pull/16) that will fix the issue once it is merged. Until it is merged,\nyou will need to manually install from the pull request using the installation instructions below.\n\nOn Windows, the `unishox2-py3` library fails to build from the source distribution with the command `pip install unishox2-py3`.\nTAK Meshtastic Gateway will instead install [this wheel](https://github.com/brian7704/OpenTAKServer-Installer/blob/master/unishox2_py3-1.0.0-cp312-cp312-win_amd64.whl).\nAs a result, Python 3.12 is required when running TAK Meshtastic Gateway on Windows.\n\n## Installation\n\nFor installation you only need to create a Python virtual environment, activate the virtual environment, and install using pip.\n\n### Linux/macOS\n\nThe unishox2-py3 Python library requires C build tools. In Debian based distros (i.e. Ubuntu) they can be installed with\n`apt install build-essential`.\n\n```shell\npython3 -m venv tak_meshtastic_gateway_venv\n. ./tak_meshtastic_gateway_venv/bin/activate\npip install git+https://github.com/snstac/takproto@refs/pull/16/merge\npip install tak-meshtastic-gateway\n```\n\n### Windows\n\n```powershell\npython -m venv tak_meshtastic_gateway_venv\n.\\tak_meshtastic_gateway_venv\\Scripts\\activate\npip install https://github.com/brian7704/OpenTAKServer-Installer/raw/master/unishox2_py3-1.0.0-cp312-cp312-win_amd64.whl\npip install git+https://github.com/snstac/takproto@refs/pull/16/merge\npip install tak-meshtastic-gateway\n```\n\n## Usage\n\nWhen your virtual environment active, run the `tak-meshtastic-gateway` command\n\n## Architecture\n\nIn most scenarios, the user will run TAK Meshtastic Gateway on the same computer that runs WinTAK. The Meshtastic node\ncan either be connected to the same computer via USB, or be on the same LAN as the computer. Connecting to the Meshtastic\nnode over the LAN allows it to be mounted in a spot outside with good mesh reception while the computer is inside.\n\n## Meshtastic Node Configuration\n\nThe Meshtastic node should be set to the TAK role. TAK Meshtastic Gateway will automatically change the node's long name \nto the TAK client's callsign and the short name to the last four characters of the TAK client's UID. This ensures that \nthe callsign shows up correctly for mesh users who are only using the Meshtastic app as well as ATAK plugin users.\nTAK Meshtastic Gateway will also update the Meshtastic node's location with the location of the EUD.\n\n## ATAK Plugin Settings\n\nFor best results, use the following settings on devices using the [Meshtastic ATAK Plugin.](https://meshtastic.org/docs/software/integrations/integrations-atak-plugin/).\nYou can find the settings in ATAK by clicking the Settings tool -> Tool Preferences -> Specific Tool Preferences ->\nMeshtastic Preferences.\n\n- Show all Meshtastic devices: On\n- Don't sshow Meshtastic devices without GPS: On\n- Do not show your local Meshtastic device: On\n\nThe rest of the settings can be changed as needed.\n\n## Usage\n\nAll arguments are optional. If an argument is not specified its default value will be used.\n\n| Flag | Parameter          | Description                                                                                                                                   | Default                                                                                          |\n|------|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|\n| `-i` | `--ip-address`     | The private IP address of the machine running TAK Meshtastic Gateway.                                                                         | TAK Meshtastic Gateway will attempt to automatically find the IP of the computer it's running on |\n| `-s` | `--serial-device`  | The serial device of the Meshtastic node (i.e. `COM3` or `/dev/ttyACM0`). Cannot be used simultaneously with `--mesh-ip`                      | TAK Meshtastic Gateway will attempt to automatically determine the serial device                 |\n| `-m` | `--mesh-ip`        | The IP address or DNS name of the gateway Meshtastic node. Cannot be used simultaneously with `--serial-device`                               | Uses a serial connection                                                                         |\n| `-c` | `--tak-client-ip`  | The IP address of the device running the TAK client (ATAK, WinTAK, or iTAK)                                                                   | `localhost`                                                                                      |\n| `-p` | `--dm-socket-port` | TCP Port to listen on for DMs                                                                                                                 | `4243`                                                                                           |\n| `-t` | `--tx-interval`    | Minimum time (in seconds) to wait between PLI transmissions from the TAK client to the mesh network. This reduces strain on the mesh network. | `30`                                                                                             |\n| `-l` | `--log-file`       | Save log messages to a file.                                                                                                                  | `None` (disabled)                                                                                |\n| `-d` | `--debug`          | Enable debug log messages                                                                                                                     | `Disabled` Only messages at the `INFO` level or higher will be logged                            |\n\n## Permissions\n\nWhen the Meshtastic node is connected via USB, TAK Meshtastic Gateway needs to be run as root (or via `sudo`) in Linux\nand in an administrator PowerShell or Command Prompt in Windows. Connecting to the Meshtastic node via TCP does\nnot require elevated permissions.\n\n## Example Usage Scenarios\n\n### Scenario 1\n\n- WinTAK on a PC\n- Meshtastic node connected to the PC via USB\n- TAK Meshtastic Gateway running on the same PC\n- Command: `tak_meshtastic_gateway`\n\n### Scenario 2\n\n- WinTAK on a PC\n- Meshtastic node on the same LAN as the PC\n- TAK Meshtastic Gateway running on the same PC as WinTAK\n- Command: `tak_meshtastic_gateway --mesh-ip MESHTASTIC_NODE_IP` Note: Substitute `MESHTASTIC_NODE_IP` with\nthe node's actual IP (i.e. `192.168.1.10`)\n\n### Scenario 3\n\n- ATAK or iTAK on a mobile device connected to a Wi-Fi network\n- Meshtastic node connected to the same network\n- TAK Meshtastic Gateway running on a computer or VM on the same network\n- Command: `tak_meshtastic_gateway --mesh-ip MESHTASTIC_NODE_IP --tak-client-ip TAK_CLIENT_IP` Note: Substitute\n`MESHTASTIC_NODE_IP` and `TAK_CLIENT_IP` with their actual IPs (i.e. `192.168.1.10` and `192.168.1.11`)",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "Send and receive data from ATAK, WinTAK, or iTAK over Meshtastic",
    "version": "1.0.0",
    "project_urls": {
        "Documentation": "https://docs.opentakserver.io",
        "Homepage": "https://github.com/brian7704/TAK_Meshtastic_Gateway",
        "Repository": "https://github.com/brian7704/TAK_Meshtastic_Gateway"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f2027aa0a72238b39dbf35fa31ba66f70aba1421badeeafab18cca3df98ce45f",
                "md5": "ccdfd57ef26c700fe8679f25181f2187",
                "sha256": "42c16579426f88f0b82dfd95aa689e2516a7ede9b85c9487e11f3fba70db312d"
            },
            "downloads": -1,
            "filename": "tak_meshtastic_gateway-1.0.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ccdfd57ef26c700fe8679f25181f2187",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 28833,
            "upload_time": "2024-06-19T19:07:28",
            "upload_time_iso_8601": "2024-06-19T19:07:28.787686Z",
            "url": "https://files.pythonhosted.org/packages/f2/02/7aa0a72238b39dbf35fa31ba66f70aba1421badeeafab18cca3df98ce45f/tak_meshtastic_gateway-1.0.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3bdb7682517b510a233427836779b6b1ed486ecbf1e57ad924818e210bad101b",
                "md5": "6ca0aabf37324b035a01499584c31514",
                "sha256": "b13d80639050d07d7f6dfab2eece68da754a0bba6988ba01225164ef994869ef"
            },
            "downloads": -1,
            "filename": "tak_meshtastic_gateway-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6ca0aabf37324b035a01499584c31514",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 29249,
            "upload_time": "2024-06-19T19:07:30",
            "upload_time_iso_8601": "2024-06-19T19:07:30.078068Z",
            "url": "https://files.pythonhosted.org/packages/3b/db/7682517b510a233427836779b6b1ed486ecbf1e57ad924818e210bad101b/tak_meshtastic_gateway-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-19 19:07:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "brian7704",
    "github_project": "TAK_Meshtastic_Gateway",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "tak-meshtastic-gateway"
}
        
Elapsed time: 0.42086s