Pure Python implementation of a TNC (Terminal Node Controller).
On Linux (including Raspbian) install Python 3.7, pip, and virtualenv
sudo apt-get install python3.7 python3-pip
pip3 install virtualenvOn Mac OS:
brew install python3
pip3 install virtualenvCreate an installation directory under /opt and set it up as a Python virtual environment.
These instructions assume an installation directory of /opt/tarpn. However, the software can be installed at any user-writeable location
sudo mkdir /opt/tarpn-core
sudo chown pi:pi /opt/tarpn-core
python3 -m virtualenv /opt/tarpn-core
cd /opt/tarpn-coreInstall a release
/opt/tarpn-core/bin/pip install --upgrade https://github.com/tarpn/tarpn-node-controller/releases/download/v0.1.4/tarpn-core-0.1.4.tar.gzA sample config file is included at /opt/tarpn-core/config/node.ini.sample. Make a copy of it at /opt/tarpn-core/config/node.ini
cp /opt/tarpn-core/config/node.ini.sample /opt/tarpn-core/config/node.iniEdit this file and, at a minimum, set mycall, node.alias, and node.locator.
One or more ports should also be configured. An example [port:1] is included.
The mesh.address must be coordinated within your network to be unique.
node.ini.sample:
[default]
mycall = N0CALL ; Your callsign
[node]
node.alias = MyNode ; A name for your node
node.locator = FM05 ; Your maidenhead locator
[port:1]
port.enabled = False
port.type = serial
port.framing = kiss
kiss.checksum = false
serial.device = /dev/ttyUSB0
serial.speed = 57600
[network]
mesh.address = 00.aaInstall the systemd service file. This assumes that you've configured tarpn-node
wget https://raw.githubusercontent.com/tarpn/tarpn-node-controller/scripts/tarpn-core.service
sudo mv tarpn-core.service /etc/systemd/system/tarpn-core.service
sudo systemctl reload-daemon
sudo systemctl enable tarpn-core
sudo systemctl start tarpn-coreThese instructions will install the software into what is known as a Python virtual environment (sometimes called a "venv"). This is a directory that contains an isolated set of libraries for Python to use. This way, a project can use different versions of libraries than the ones that are installed in the system-wide Python environment (as you would get from doing apt-get install python-serial, for example).
Additional information:
- https://docs.python.org/3/tutorial/venv.html
- https://realpython.com/python-virtual-environments-a-primer/
Run the core packet engine
/opt/tarpn-core/bin/tarpn-nodeIn a separate shell, run the demo app.
/opt/tarpn-core/bin/tarpn-app demoThis app is a simple terminal chat program that lets you easily test out the network with other participants.
Create a virtualenv, activate, and install deps (using Python 3)
make init
make depsRun the tests
make testNow some "tarpn-" scripts are in your path. E.g.,
tarpn-packet-dump /tmp/vmodem0 9600Run flake8
flake8 tarpndocker build . -t tarpn/tarpn-core
docker run tarpn/tarpn-core:latest