0.0.2 • Published 8 years ago

etherserial v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

EtherSerial

Build Status

EtherSerial is a transport layer that works in conjunction with Firmata.js to enable communication with serial devices over ethernet using tools such as ser2net, or the pySerial bridge examples (It does not, at this point support RFC2217 for setting port properties).

This work is based on Rick Waldron's EtherPort for ethernet/wifi enabled Arduino devices.

Setup

The primary purpose for this is to allow you to connect to devices running Firmata that do not have their own ethernet, but are tethered to something that does. This allows you to run Firmata.js or Johnny-Five on a different machine.

Firstly you will need an Arduino running Standard Firmata, this ships with the latest version of the Arduino IDE.

You will also need to install an application such as ser2net or the pySerial serial bridge (These are the only serial redirectors that have been tested).

After installing StandardFrimata and connecting the Arduino to the remote machine you can start your serial port redirector (tcp_serial_redirect.py on a RaspberryPi in this example):

python tcp_serial_redirect.py --parity N -P 3030 /dev/ttyAMA0 57600

Once the Arduino and remote machine are configured and the serial port redirector is running you can install Johnny-Five and EtherSerial:

npm install johnny-five etherserial

To test:

var five = require("../lib/johnny-five.js");
var EtherSerial = require('etherserial');
var board = new five.Board({
    port: new EtherSerial({
            port: 3030,
            host: "localhost"
    })
});

board.on("ready", function() {
  var led = new five.Led(9);
  led.blink(500);
});

Compatible Shields & Boards

The following shields are those that have been tested and confirmed to work correctly with Etherserial + Firmata.js + Johnny-Five.

License

This project is based on EtherPort by Rick Waldron, and is licensed under the same terms. See LICENSE-MIT file.