Giter Club home page Giter Club logo

usb_tty_ids's Introduction

serial console automation : 
connect direct to any console by name using a single tab-extendable command

LEARN PHASE:
run configTTY.sh
user enters model and serial, configTTY.sh updates the database at /etc/udev/rules.d/90-*

Do this once manually. Sync the updated rules.d data file back to git regularly.
(eg once per batch?)


RUN PHASE:
plug in a usb console ..

udev matches a line like this
SUBSYSTEMS=="usb", ATTRS{serial}=="AM01L39A", SYMLINK+="tty_acq1001_009" RUN+="/usr/local/bin/make-tty-symlink"

1 udev picks it up and makes a match from /etc/udev/rules.d, creates a symlink in /dev
2 then it runs the script make-tty-symlink

example

Plug in console for acq1001_009

First:  SYMLINK+="tty_acq1001_009"
/dev/tty_acq1001_009 -> ttyUSB1

... this is the real value of this system, auto-tracks changing ttyUSBx

Second: RUN+="/usr/local/bin/make-tty-symlink"

script runs with ACTION=add, creates this link
/usr/local/bin/tty_acq1001_009 -> kermit-ttySx-115200

Now simply type tty_acq1001_009 to connect direct to the console with one command.

There are two dynamically created links:
1. The device node itself : /dev/tty_acqxxxx -> /dev/tty_USBx
2. The command hotlink : /usr/local/bin/tty_acqxxxx -> kermit

make-tty-symlink is able to select the correct baud rate based on model type.

On unplug, udev removes the device link and runs the script again. 
This time the command link is removed
(make-tty-symlink runs with ACQTION=remove)



INSTALL on a fresh console server
git clone a working directory in your user
copy rules.d/* host:/etc/udev/rules.d
copy bin/*     host:/usr/local/bin
make sure there's a working copy of kermit on the host machine.
for a user to be able to USE the console, must be a member of groups
dialout
lockers

How it works:
Making it really smooth:
- check you have the correct group membership to use the console
- make a file ~/.kermrc:
cat ~/.kermrc
SET CARRIER-WATCH OFF

Updates:
- make a working directory copy of this git archive in a user directory
(I wasn't brave enough to do this direct from /etc)
- please update /etc/rules.d/90-acq* as we add more uuts
- test, copy back to your user, check in and git-push

WORKING DIRECTORY FOR rpi-002 set to : /root/USB_TTY_IDS


http://rpi-005/cgi-bin/showconsoles.cgi

- install apache2
- a2enmod cgi
- service apache2 restart


usb_tty_ids's People

Contributors

petermilne avatar

Watchers

James Cloos avatar  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.