BUG REPORT I updated my repo today and now I can't interact with my

BUG REPORT

I updated my repo today and now I can’t interact with my smoothie, this only happened with this update.

Sent: G91 Q: 3
3,72.0000,0.0000,WPos:76.9963,72.0000,0.0000>9963,72.0000,0.0000>
/home/pi/LaserWeb3/server-smoothie.js:240
connections[i].emit(“data”, data);
^

TypeError: Cannot read property ‘emit’ of undefined
at SerialPort. (/home/pi/LaserWeb3/server-smoothie.js:240:28)
at emitOne (events.js:77:13)
at SerialPort.emit (events.js:169:7)
at /home/pi/LaserWeb3/node_modules/serialport/lib/parsers.js:24:17
at Array.forEach (native)
at SerialPort. (/home/pi/LaserWeb3/node_modules/serialport/lib/parsers.js:23
:13)
at SerialPort._emitData (/home/pi/LaserWeb3/node_modules/serialport/lib/serialport.js:3
10:18)
at SerialPort. (/home/pi/LaserWeb3/node_modules/serialport/lib/serialport.js
:290:14)
at SerialPort. (/home/pi/LaserWeb3/node_modules/serialport/lib/serialport.js
:303:7)
at FSReqWrap.wrapper [as oncomplete] (fs.js:576:17)

any thoughts?

@Tiago_Vale I just updated my Pi to the latest commit and it loads fine for me. Delete the node_modules folders and run “npm Install” inside the laserweb folder , then execute laserweb again

can I just delete the node_modules folder? Or I have to empty it?

Just delete the folder

Its working!!! Yeah!!!

It seems there is something else.

No laserweb again :(, the strange thing is that the serial port component is compiled instead of downloaded, and its where the fault resides.

pi@octopi ~/LaserWeb3 $ node server-smoothie.js


---- LaserWeb Started ----

Access the LaserWeb User Interface:

  1. Open Chrome
  2. Go to : http://127.0.1.1:8000/
    *************************************************************
  • Updates:
    Remember to check the commit log on
    Commits · LaserWeb/deprecated-LaserWeb3 · GitHub
    regularly, to know about updates and fixes, and then when ready
    update LaserWeb3 accordingly by running git pull

  • Support:
    If you need help / support, come over to
    Google Workspace Updates: New community features for Google Chat and an update on Currents
    WARN: Connecting to Port /dev/ttyACM0,250000
    Connected to /dev/ttyACM0at 250000
    Recv: 0,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: le,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: le,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: le,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: ,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: 0,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: le,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.00le,MPos:-72.0000,0.0000,1
    16.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: dle,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: le,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: 000,116.0000>
    Recv: dle,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: dle,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: dle,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: <Idle,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.00le,MPos:-72.0000,0.000
    0,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: le,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: le,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: dle,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: le,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: le,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: le,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Sent: M105 Q: 0
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    /home/pi/LaserWeb3/server-smoothie.js:240
    connections[i].emit(“data”, data);
    ^

TypeError: Cannot read property ‘emit’ of undefined
at SerialPort. (/home/pi/LaserWeb3/server-smoothie.js:240:28)
at emitOne (events.js:77:13)
at SerialPort.emit (events.js:169:7)
at /home/pi/LaserWeb3/node_modules/serialport/lib/parsers.js:24:17
at Array.forEach (native)
at SerialPort. (/home/pi/LaserWeb3/node_modules/serialport/lib/parsers.js:23
:13)
at SerialPort._emitData (/home/pi/LaserWeb3/node_modules/serialport/lib/serialport.js:3
10:18)
at SerialPort. (/home/pi/LaserWeb3/node_modules/serialport/lib/serialport.js
:290:14)
at SerialPort. (/home/pi/LaserWeb3/node_modules/serialport/lib/serialport.js
:303:7)
at FSReqWrap.wrapper [as oncomplete] (fs.js:576:17)
pi@octopi ~/LaserWeb3 $ sudo rm -r node_modules
pi@octopi ~/LaserWeb3 $ npm install
\

serialport@4.0.1 install /home/pi/LaserWeb3/node_modules/serialport
node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download: https://github.com/EmergingTechnologyAdvisors/node-ser ialport/releases/download/4.0.1/serialport-v4.0.1-node-v46-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for serialport@4.0.1 and node@4.4.5 (node-v4
6 ABI) (falling back to source compile with node-gyp)
make: Entering directory ‘/home/pi/LaserWeb3/node_modules/serialport/build’
CXX(target) Release/obj.target/serialport/src/serialport.o
CXX(target) Release/obj.target/serialport/src/serialport_unix.o
CXX(target) Release/obj.target/serialport/src/serialport_poller.o
SOLINK_MODULE(target) Release/obj.target/serialport.node
COPY Release/serialport.node
make: Leaving directory ‘/home/pi/LaserWeb3/node_modules/serialport/build’
dotenv@2.0.0 node_modules/dotenv

chalk@1.1.3 node_modules/chalk
±- supports-color@2.0.0
±- escape-string-regexp@1.0.5
±- ansi-styles@2.2.1
±- has-ansi@2.0.0 (ansi-regex@2.0.0)
±- strip-ansi@3.0.1 (ansi-regex@2.0.0)

node-static@0.7.8 node_modules/node-static
±- mime@1.3.4
±- colors@1.1.2
±- optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)

socket.io@1.4.8 node_modules/http://socket.io
±- has-binary@0.1.7 (isarray@0.0.1)
±- debug@2.2.0 (ms@0.7.1)
±- socket.io-parser@2.2.6 (isarray@0.0.1, json3@3.3.2, component-emitter@1.1.2, benchmark@
1.0.0)
±- socket.io-adapter@0.4.0 (socket.io-parser@2.2.2)
±- engine.io@1.6.11 (base64id@0.1.0, accepts@1.1.4, ws@1.1.0, engine.io-parser@1.2.4)
±- socket.io-client@1.4.8 (to-array@0.1.4, component-emitter@1.2.0, indexof@0.0.1, backo2@
1.0.2, object-component@0.0.3, component-bind@1.0.0, parseuri@0.0.4, engine.io-client@1.6.1
1)

request@2.74.0 node_modules/request
±- aws-sign2@0.6.0
±- tunnel-agent@0.4.3
±- oauth-sign@0.8.2
±- forever-agent@0.6.1
±- is-typedarray@1.0.0
±- caseless@0.11.0
±- stringstream@0.0.5
±- aws4@1.4.1
±- isstream@0.1.2
±- json-stringify-safe@5.0.1
±- extend@3.0.0
±- tough-cookie@2.3.1
±- qs@6.2.1
±- node-uuid@1.4.7
±- combined-stream@1.0.5 (delayed-stream@1.0.0)
±- mime-types@2.1.11 (mime-db@1.23.0)
±- hawk@3.1.3 (cryptiles@2.0.5, boom@2.10.1, sntp@1.0.9, hoek@2.16.3)
±- bl@1.1.2 (readable-stream@2.0.6)
±- http-signature@1.1.1 (assert-plus@0.2.0, jsprim@1.3.0, sshpk@1.10.0)
±- har-validator@2.0.6 (pinkie-promise@2.0.1, commander@2.9.0, is-my-json-valid@2.13.1)
±- form-data@1.0.1 (async@2.0.1)

serialport@4.0.1 node_modules/serialport
±- bindings@1.2.1
±- es6-promise@3.2.1
±- commander@2.9.0 (graceful-readlink@1.0.1)
±- debug@2.2.0 (ms@0.7.1)
±- nan@2.4.0
±- object.assign@4.0.4 (function-bind@1.1.0, object-keys@1.0.11, define-properties@1.1.2)
pi@octopi ~/LaserWeb3 $ node server-smoothie.js


---- LaserWeb Started ----

Access the LaserWeb User Interface:

  1. Open Chrome
  2. Go to : http://127.0.1.1:8000/
    *************************************************************
  • Updates:
    Remember to check the commit log on
    Commits · LaserWeb/deprecated-LaserWeb3 · GitHub
    regularly, to know about updates and fixes, and then when ready
    update LaserWeb3 accordingly by running git pull

  • Support:
    If you need help / support, come over to
    Google Workspace Updates: New community features for Google Chat and an update on Currents
    WARN: Connecting to Port /dev/ttyACM0,250000
    Connected to /dev/ttyACM0at 250000
    Recv: z
    Recv: os:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: le,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: dle,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    […]
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: ,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: e,MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    Recv: MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.00,MPos:-72.0000,0.0000,116.00
    00,WPos:-72.0000,0.0000,116.0000>
    Sent: M105 Q: 0
    Recv: MPos:-72.0000,0.0000,116.0000,WPos:-72.0000,0.0000,116.0000>
    /home/pi/LaserWeb3/server-smoothie.js:240
    connections[i].emit(“data”, data);
    ^

TypeError: Cannot read property ‘emit’ of undefined
at SerialPort. (/home/pi/LaserWeb3/server-smoothie.js:240:28)
at emitOne (events.js:77:13)
at SerialPort.emit (events.js:169:7)
at /home/pi/LaserWeb3/node_modules/serialport/lib/parsers.js:24:17
at Array.forEach (native)
at SerialPort. (/home/pi/LaserWeb3/node_modules/serialport/lib/parsers.js:23
:13)
at SerialPort._emitData (/home/pi/LaserWeb3/node_modules/serialport/lib/serialport.js:3
10:18)
at SerialPort. (/home/pi/LaserWeb3/node_modules/serialport/lib/serialport.js
:290:14)
at SerialPort. (/home/pi/LaserWeb3/node_modules/serialport/lib/serialport.js
:303:7)
at FSReqWrap.wrapper [as oncomplete] (fs.js:576:17)
pi@octopi ~/LaserWeb3 $

+Peter van der Walt​ any idea?

I’m using raspbian lite, just upgraded, and heres my npm install output

\

serialport@4.0.1 install /home/pi/LaserWeb3/node_modules/serialport
node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download: https://github.com/EmergingTechnologyAdvisors/node-seri alport/releases/download/4.0.1/serialport-v4.0.1-node-v46-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for serialport@4.0.1 and node@4.4.5(node-v46
ABI) (falling back to source compile with node-gyp)
make: Entering directory ‘/home/pi/LaserWeb3/node_modules/serialport/build’
CXX(target) Release/obj.target/serialport/src/serialport.o
CXX(target) Release/obj.target/serialport/src/serialport_unix.o
CXX(target) Release/obj.target/serialport/src/serialport_poller.o
SOLINK_MODULE(target) Release/obj.target/serialport.node
COPY Release/serialport.node
make: Leaving directory ‘/home/pi/LaserWeb3/node_modules/serialport/build’
dotenv@2.0.0 node_modules/dotenv

chalk@1.1.3 node_modules/chalk
±- supports-color@2.0.0
±- escape-string-regexp@1.0.5
±- ansi-styles@2.2.1
±- has-ansi@2.0.0(ansi-regex@2.0.0)
±- strip-ansi@3.0.1(ansi-regex@2.0.0)

node-static@0.7.8 node_modules/node-static
±- mime@1.3.4
±- colors@1.1.2
±- optimist@0.6.1(wordwrap@0.0.3, minimist@0.0.10)

socket.io@1.4.8 node_modules/http://socket.io
±- has-binary@0.1.7(isarray@0.0.1)
±- debug@2.2.0(ms@0.7.1)
±- socket.io-parser@2.2.6(isarray@0.0.1, json3@3.3.2, component-emitter@1.1.2, benchmark@1
.0.0)
±- socket.io-adapter@0.4.0(socket.io-parser@2.2.2)
±- engine.io@1.6.11(base64id@0.1.0, ws@1.1.0, accepts@1.1.4, engine.io-parser@1.2.4)
±- socket.io-client@1.4.8(to-array@0.1.4, component-emitter@1.2.0, indexof@0.0.1, backo2@1
.0.2, object-component@0.0.3, component-bind@1.0.0, parseuri@0.0.4, engine.io-client@1.6.11)

request@2.74.0 node_modules/request
±- aws-sign2@0.6.0
±- tunnel-agent@0.4.3
±- oauth-sign@0.8.2
±- forever-agent@0.6.1
±- is-typedarray@1.0.0
±- caseless@0.11.0
±- stringstream@0.0.5
±- isstream@0.1.2
±- aws4@1.4.1
±- json-stringify-safe@5.0.1
±- extend@3.0.0
±- tough-cookie@2.3.1
±- qs@6.2.1
±- node-uuid@1.4.7
±- combined-stream@1.0.5(delayed-stream@1.0.0)
±- mime-types@2.1.11(mime-db@1.23.0)
±- hawk@3.1.3(cryptiles@2.0.5, boom@2.10.1, sntp@1.0.9, hoek@2.16.3)
±- bl@1.1.2(readable-stream@2.0.6)
±- http-signature@1.1.1(assert-plus@0.2.0, jsprim@1.3.0, sshpk@1.10.0)
±- har-validator@2.0.6(pinkie-promise@2.0.1, commander@2.9.0, is-my-json-valid@2.13.1)
±- form-data@1.0.1(async@2.0.1)

serialport@4.0.1 node_modules/serialport
±- bindings@1.2.1
±- es6-promise@3.2.1
±- commander@2.9.0(graceful-readlink@1.0.1)
±- debug@2.2.0(ms@0.7.1)
±- nan@2.4.0
±- object.assign@4.0.4(object-keys@1.0.11, function-bind@1.1.0, define-properties@1.1.2)
pi@octopi~/LaserWeb3 $

Same result

Sorry Pi is built in the printer
Is the telnet solution working?

Why not upload the gcode directly to smooth and then play?

Evaluating the connections array

     } else {
            if(typeof connections[i] != "undefined"){
                    connections[i].emit("data", data);
            } else {
                    console.log("COUNT ", connections.length);
            }
     }

prevents the crash but I don’t know whats erasing connections[i] at first time.