Coder Social home page Coder Social logo

arduino-tcp-bridge's Introduction

arduino-tcp-bridge

This tool make a tcp-to-serial bridge to communicate to an arduino wih multiples clients.

It does just writes anything that come on the server sockets to the arduino an write to sockets clients anythings that is readed from the arduino.

Read and writes are done line by line.

Compatibility

Developped and tested with ruby 1.9.2. Not tested with upper version, something may break :)

Install it

bundle install

Configure it

Configuration is located in conf/arduino-tcp-bridge/arduino-tcp-bridge.conf. The config file can be copyed to ~/.config/arduino-tcp-bridge/ or in /etc/default/arduino-tcp-bridge/.

These files will be readed in this order :

  • local config file (in conf/arduino-tcp-bridge/)
  • system wide configuration (in /etc/default/arduino-tcp-bridge/)
  • current user configuration (in ~/.config/arduino-tcp-bridge/)

These file will be merged, so you can put a arduino-tcp-bridge.conf in these location with just the changes you need. Only the first is mandatory.

By default :

  • the daemon bind to 0.0.0.0 on the port 20000
  • the serial communication is established throught /dev/ttyACM0

Run it

Thanks to the gem daemons, the script can be run as a service :

ruby arduino-tcp-bridge.rb start # will fork in the background
ruby arduino-tcp-bridge.rb run # will stay in the foreground

ruby arduino-tcp-bridge.rb stop # stops the daemon

Test it

You can then open multiples connection on the bridge, with telnet for example :

telnet thebridge 20000 # replace "thebridge" with your host
rying 192.168.0.7...
Connected to arduino.lan.
Escape character is '^]'.
something you want to forward; #This is sent to the arduino.
3,Unknown command;            # This is readed from the arduino.

Logs

Logs are by default located in '/tmp/log.txt'.

arduino-tcp-bridge's People

Contributors

jcsaaddupuy avatar

Watchers

 avatar  avatar

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.