Giter Site home page Giter Site logo

gordonhart / tinyg-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from giseburt/tinyg-node

0.0 3.0 0.0 1.63 MB

A module to abstract communications and control of the TinyG from node.

License: GNU General Public License v2.0

JavaScript 100.00%

tinyg-node's Introduction

TinyG-node

A library module and commmand-line utility to abstract communications and control of a Synthetos TinyG (or a device running G2 Core). Written and maintained by the Synthetos core team.

Usage as a command line utility

First install the tinyg npm globally, so it'll be in your path:

  # If you run as root you can remove sudo
  sudo npm install -g tinyg

Now you can just execute the g command to get a full "terminal" experience to TinyG. If there is only one TinyG attached, then you don't need to provide any more parameters:

  my_host$ g
  Pos: X=0.00 Y=0.00 Z=0.00 A=0.00 Vel:0.00 (Ended)
  TinyG# g0x10
  Pos: X=10.00 Y=0.00 Z=0.00 A=0.00 Vel:0.00 (Stop)
  TinyG# ^C

Note: Use Ctrl-C to exit.

To send a file with the g utility, simply pass the filename of a gcode file, and it'll give you interactive progress bar:

  my_host$ g my_awesome_project.gcode
  Found command port: '/dev/cu.usbmodem14521' with data port '/dev/cu.usbmodem14523'.
  TinyG# Opening file 'my_awesome_project.gcode' for streaming.
  Progress |=========================================================______|  91%

If you wish to keep a log of the interaction between the TinyG and the g utility, then add the -g LOGFILE parameter to have it save the log in LOGFILE.

  my_host$ g my_awesome_project.gcode -g logfile.log
  Found command port: '/dev/cu.usbmodem14521' with data port '/dev/cu.usbmodem14523'.
  TinyG# Opening file 'my_awesome_project.gcode' for streaming.
  Progress |=========================================================______|  91%

Note: The g command line utility is still a little rough around the edges. It's still in active development, so update often!

##g(1) usage

Usage: q [gcode] [options]

gcode     Gcode file to run

Options:
   -p PORT, --port PORT        Name of serial port. Use -l to see the available ports.
   -d PORT, --dataport PORT    Name of data serial port. Use -l to see the available ports.
   -g LOGFILE, --log LOGFILE   Name of file to log to. Piping STDERR to a file will do the same thing (and trump this option).  [STDERR]
   -l, --list                  Name of data serial port. Use -l to see the available ports.

g TODO

  • Cleanup formatting output -- the status line often overwrites the prompt, leaving the promt in the wrong place.
  • Provide more control over the status line. Possibly go full-screen?

#Usage as a library

// Create a TinyG library object
var TinyG = require("tinyg");

// Then create a TinyG object called 'g'
var g = new TinyG();

Now you have a g object, you need to tell it to connect to a TinyG, then you can interact with the TinyG.

See ./docs/ReadMe.adoc

tinyg-node's People

Contributors

anthonywebb avatar giseburt avatar justinclift avatar ril3y avatar

Watchers

 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.