Coder Social home page Coder Social logo

tcp-v-serial's Introduction

TCP-V-Serial

This is a small Rust program which relays data between a raw tcp socket (can act as server or client) and a virtual USB-ACM serial converter.

It takes many parts from the usbip crate example

How to use

  1. You need to install usbip on your system. Packages are usually in the repos on Linux Distributions

  2. Make sure you have Rust installed.

  3. Clone and build this project

$ git clone [email protected]:voidfield101/TCP-V-Serial.git
$ cd TCP-V-Serial
$ cargo build --release
  1. Run the virtual serial server. This example sets up a TCP server on 8888 and a USB/IP Server on 9999
$ RUST_LOG="info" ./target/release/tcpvserial -l -a 127.0.0.1:8888 -p 9999
  1. Connect bind the USB/IP device
$ sudo usbip --tcp-port 9999 attach -r localhost -b 0
  1. Done. You can now connect to the TCP/Telnet server and use the serial device (example using netcat, cat and echo):
$ netcat localhost 8888
Hello World
Hi
Hi
$ echo "Hello World" > /dev/ttyACM0
$ cat /dev/ttyACM0
Hi

tcp-v-serial's People

Contributors

voidfield101 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.