https://github.com/faradayrf/faradayio
FaradayRF TUN/TAP adapter
https://github.com/faradayrf/faradayio
Last synced: 4 months ago
JSON representation
FaradayRF TUN/TAP adapter
- Host: GitHub
- URL: https://github.com/faradayrf/faradayio
- Owner: FaradayRF
- License: gpl-3.0
- Created: 2017-11-17T07:49:59.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T00:50:19.000Z (over 3 years ago)
- Last Synced: 2026-03-28T05:05:00.394Z (4 months ago)
- Language: Python
- Homepage: https://www.faradayrf.com
- Size: 144 KB
- Stars: 15
- Watchers: 6
- Forks: 6
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# FaradayIO
[](https://travis-ci.org/FaradayRF/faradayio)
[](https://coveralls.io/github/FaradayRF/faradayio?branch=master)
[](https://gitter.im/FaradayRF/Lobby?utm_source=badge&utm_medium=badge&utm_content=badge)
The `faradayio` module provides a [TUN/TAP](https://en.wikipedia.org/wiki/TUN/TAP) interface which tunnels network traffic in [SLIP](https://en.wikipedia.org/wiki/Serial_Line_Internet_Protocol) format over a serial port. This was originally designed for the [Faraday](https://faradayrf.com/faraday/) radio but the software is radio agnostic. By default this module helps create a TUN/TAP adapter on the `10.0.0.0` network and a simple command line program is also provided to automatically setup a network adapter for a Faraday radio.
## Installation
Installation is simple. If you are just installing to use with a radio then the pypi installation is all you need. However, if you are looking to develop code then you should install from a GitHub repository clone in editable mode. Please note we suggest installing with a [virtual environment](https://github.com/FaradayRF/faradayio/wiki/Working-With-Python3-Virtual-Environments) in all cases!
### PyPi
To install `faradayio` simply install with `pip3`
```
pip3 install faradayio
```
### Git Repository Editable Mode
To install `faradayio` from a git repository in editable mode simple checkout from GitHub and use `pip3` to install in editable mode.
```
$ git clone git@github.com:FaradayRF/faradayio.git
$ cd faradayio
$ pip3 install -e .
```
## Usage
```
import serial
import threading
from faradayio.faraday import Monitor
# Setup serial port
serialPort = serial.Serial('/dev/ttyUSB0', 115200)
# Create threading event for TUN thread control
# set() causes while loop to continuously run until clear() is run
isRunning = threading.Event()
isRunning.set()
# Start TUN, will run until `cntl+c` pressed
tun = Monitor(serialPort=serialPort, name='KB1LQC-1', isRunning=isRunning)
tun.start()
```
For a simple but more robust implementation of `faradayio` please see `faradayio-cli`. This is the [FaradayIO Command Line Client](https://github.com/FaradayRF/faradayio-cli) and is responsible for officially implementing `faradayio` for FaradayRF projects.
## Wiki
Please use our [faradayio wiki](https://github.com/FaradayRF/faradayio/wiki) to find helpful tips on installation, setting up a development environment, and running unit tests.
## FaradayRF
This project is provided by [FaradayRF](https://www.faradayrf.com) as [GPLv3](https://github.com/FaradayRF/faradayio/blob/master/LICENSE) software aimed at the amateur radio (ham radio) community. Please join us on our [Gitter lobby](https://gitter.im/FaradayRF/Lobby) if you have any questions. Send an email to [Support@faradayrf.com](Support@faradayrf.com) if you would like to contact us via email.