GithubHelp home page GithubHelp logo

Comments (10)

cprezzi avatar cprezzi commented on July 21, 2024

lw.comm-server does also identify the firmware by the welcome string. Unfortunately we had to remove the automatic ctrl-x after connection because it causes smoothieware to go into alarm state.
Just press CTRL-X after connecting. This should reset GRBL to get the welcome string.

from lw.comm-server.

cojarbi avatar cojarbi commented on July 21, 2024

from lw.comm-server.

iceblu3710 avatar iceblu3710 commented on July 21, 2024

In the machine setup section we could have an "Reset On Connect" radio box or have it as a header and you choose which reset command you want to send.

For maximum flexibility we could have it as a textbox and let the user do whatever init stuff they wanted.

C^X ;Reset GRBL
M7 ;Turn on ventilation

from lw.comm-server.

cprezzi avatar cprezzi commented on July 21, 2024

I worked very hard to get rid of all the firmware dependency in the frontend and I don't like to put it back now.

This problem is only related to grbl directly connected by serial rx/tx (not USB). We don't have many users with such a configuration.

I will find another elegant (automatic) solution. ;)

from lw.comm-server.

cprezzi avatar cprezzi commented on July 21, 2024

This is related to issue #11

from lw.comm-server.

iceblu3710 avatar iceblu3710 commented on July 21, 2024

When monitoring the serial port on the pi with minicom and I connect to the device I get

ok
error:2
error:2

When I inject C^x I get the reset string but the same error

ok

Grbl 1.1f ['$' for help]
error:2
error:2

What 3 commands are being issues to the device during connection?

from lw.comm-server.

iceblu3710 avatar iceblu3710 commented on July 21, 2024

I struck oil!

So, I hijacked the comm-servers stdout messages to trigger a reset by doing this:

# npm run-script start-server | tee stdout.log
# tail -f stdout.log | grep -q 'INFO: Connecting to USB,/dev/ttyAMA0,115200' && echo -n $'\cx' > /dev/ttyAMA0

When I connect to the device it fires in the reset command before the comms server reads the first bytes.

A minor piping issue that may be an issue below.

pi@raspberrypi:~/Documents/LaserWeb4 $ npm run-script start-server | grep -q 'ttyAMA0' && echo $'\cx' > /dev/ttyAMA0
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at exports._errnoException (util.js:1022:11)
    at WriteWrap.afterWrite (net.js:801:14)

npm ERR! Linux 4.4.50-v7+
npm ERR! argv "/home/pi/.nvm/versions/node/v6.10.0/bin/node" "/home/pi/.nvm/versions/node/v6.10.0/bin/npm" "run-script" "start-server"
npm ERR! node v6.10.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start-server: `node node_modules/lw.comm-server/server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start-server script 'node node_modules/lw.comm-server/server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the laserweb package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node node_modules/lw.comm-server/server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs laserweb
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls laserweb
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/pi/Documents/LaserWeb4/npm-debug.log

from lw.comm-server.

iceblu3710 avatar iceblu3710 commented on July 21, 2024

I can flesh out the RasPi section of the docs as I work through my new machine setup. I wrote a script to start the server and setup the serial trigger so you can connect without caring.

#!/bin/bash
# Copyright (c) 2016 Trevor Johansen Aase
#
# The MIT License (MIT)
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Useage:
#   ./start_server.sh /dev/YOUR-TTY


TTY=${1:-/dev/serial0}

function trigger {
  echo "Firing reset trigger to $TTY !"
  echo -n $'\cx' > $TTY 
}

echo "Starting LaserWeb4 Comms Server..."
npm run-script start-server | tee /tmp/lw.stdout.log &

while true
do
  tail -f /tmp/lw.stdout.log | grep -q --line-buffered "INFO: Connecting to USB,$TTY" && trigger
done

from lw.comm-server.

cprezzi avatar cprezzi commented on July 21, 2024

Just for your info: The two errors you see are the trials to detect other firmware. You could just ignore them, as they should not harm your Grbl.

from lw.comm-server.

 avatar commented on July 21, 2024

I gave @iceblu3710 edit permissions on cncpro.co so I assume we can close this as a documented workaround for now.

Later we'll have an electron app with Pi support as a non-gui app

from lw.comm-server.

Related Issues (20)

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.