Git Product home page Git Product logo

strangenet's Introduction

StrangeBox

A free software solution for wireless IP networking over Digi's XBee API.

XBee Setup

Set to "API mode (with Escapes)".

Minimal Working Examples

Note: These have been verified on Ubuntu 18.04 with XBee-PRO 900HP units . If you can add instructions to broaden the scope of these examples, please do so.

There are two machines in the required setup that I will call "Client" and "Server". It does not matter which XBee is connected where. It only matters that openssh-client is installed on "Client", and openssh-server _is installed on "Server".

Dependencies

On both "Client" and "Server", satisfy dependencies of StrangeNet with:

sudo apt update && sudo apt install -y libpython3-dev python3-pip
sudo python3 -m pip install digi-xbee
sudo python3 -m pip install pypacker
sudo python3 -m pip install python-pytun
sudo apt install openssh-{client|server}  # client on "Client", server on "Server"

Next, navigate to the strangenet folder in your local checkout of this repo. Before running, make sure that you have set the following environment variables correctly:

STRANGENET_XBEE_PORT
STRANGENET_XBEE_BAUD
STRANGENET_IP

The first two environment variables are determined by the tty device descriptor (e.g. /dev/ttyUSB0) and the baud rate specified in the XBee configuration (e.g. 230400), respectively. The third environment variable is whatever IPv4 descriptor you want for the StrangeNet interface.

For example, on the "Client", setup STRANGENET_IP by executing in your terminal window:

export STRANGENET_IP=10.0.0.1

Give the "Server" interface a different name on the same subnet:

export STRANGENET_IP=10.0.0.2

Launch strangenet

From the current folder, navigate to the strangenet folder and then execute the following to launch strangenet:

python3 main.py

Now, you are setup to run a couple of quick IP networking commands: ping and ssh.

ping

On either "Client" or "Server", try to ping the other machine with:

ping 10.0.0.{1|2}  # 1 if pinging "Client" from "Server", 2 otherwise

ssh

From "Client", connect to "Server" over ssh with:

ssh {username-on-server}@10.0.0.2  # username-on-server is whatever your username is on "Server"

strangenet's People

Contributors

aidanbh avatar dependabot[bot] avatar jwdinius avatar penguinsnail avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

strangenet's Issues

Use newer version of digi-xbee to fix performance issue

The digi-xbee library on pip was last released April 2018. This code leaks StreamHandlers which results in logging messages being duplicated. I believe this is the source of an issue which causes CPU usage to massively spike when a lot of packets are queued for transmit, creating a large interval between bursts of serial Tx/Rx during which the screens is filled with logged byte messages. A few weeks ago, digidotcom/xbee-python#57 was discussed at digi upstream which revealed that a patch (digidotcom/xbee-python@dad8aae) came out in August that fixed this, but one one ever uploaded to pip. So we'll need to pull from git.

When I get home today I'll update the Pipfile and test it out.

Since it is already quite wasteful to log every packet sent/recd (doubling xfer times, bc TUN and stdout together are just two file descriptors instead of one), I'm going to go ahead and turn it off entirely. It would be nice if they had a way to disable their logs while still letting me use whatever log levels I want in my code, but their response (digidotcom/xbee-python#61) was to call logging.disable(). I'll dig around and see if there's another way.

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.