serial device (/dev/tty.*.usbserial) <---> TCP Socket
Ruby Java
Switch branches/tags
Nothing to show
Permalink
Failed to load latest commit information.
arduino/serial-echo add arduino serial-echo code Jul 27, 2011
samples EM::Connection client sample Jul 27, 2011
tools update serialterm Jul 27, 2011
.gitignore add ignore Oct 5, 2010
README.md obsolete -> use serialport-server May 19, 2012
serial-socket-gateway fix Jul 27, 2011

README.md

!!OBSOLETED!!

use serialport-server

serial socket gateway

serial device (/dev/tty.*.usbserial) <---> TCP Socket

  • multi client support.
  • each client can read/write.
  • forwards strings from serial device to all socket clients.
  • split by '\n'
  • testing on Mac and Linux.

Dependencies

  • serialport, eventmachine, ArgsParser (rubygems)
  • your serial device (arduino, mbed ...)

Install gems

% gem install serialport eventmachine ArgsParser

Run

Connect serial device, then

% ./serial-socket-gateway /dev/tty.your-device

or

% ./serial-socket-gateway COM1

Use

% telnet localhost 8782

Make client using TCP Socket

see "samples" directory.

## connect
% require 'socket'
% s = TCPSocket.open("192.168.1.100", 8782)

## write to serial device
% s.puts "abc abc"

## read
% puts s.gets