foxxyz / loupedeck

Node.js API for Loupedeck Controllers
MIT License
87 stars 10 forks source link

UnhandledPromiseRejectionWarning: Invalid handshake response #8

Closed META-DREAMER closed 2 years ago

META-DREAMER commented 2 years ago

Getting this error trying to connect with firmware 0.2.5 using path: /dev/cu.usbmodem14101 taken from loupedeck settings: image

foxxyz commented 2 years ago

Thanks for the report! Does it work if you don't provide path but just let it try to find it on its own?

Can you provide additional info on your environment? I.E.:

META-DREAMER commented 2 years ago

@foxxyz Yea doesnt work either way.

OS: MacOS Monterey 12.1. M1 Macbook Pro Node Version: v14.18.2 Device type: Loupedeck Live (LDD-2001) Device Version: Tried with both 0.2.5 and 01.30

foxxyz commented 2 years ago

Hm, looks like that should all work fine.

The Invalid handshake response: error should include additional information - are you able to supply the full stacktrace?

Device Version: Tried with both 0.2.5 and 01.30

Also... device version is the number listed on the back of the Loupedeck device, not the firmware version. Does the back of your device say "Ver: 01.30"?

META-DREAMER commented 2 years ago

yes the device back says 01.30

When I dont specify the host it gives me this error:

Loupedeck Serial Error: Error: Resource busy, cannot open /dev/tty.usbmodem14101

When I specify the host as the value I got from Loupedeck settings instead (/dev/cu.usbmodem14101, different from the autodetected one) I get this error instead:

events.js:377
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND dev
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:71:26)
Emitted 'error' event on WebSocket instance at:
    at emitErrorAndClose (/Users/md/Dev/loupedeck/node_modules/ws/lib/websocket.js:922:13)
    at ClientRequest.<anonymous> (/Users/md/Dev/loupedeck/node_modules/ws/lib/websocket.js:781:5)
    at ClientRequest.emit (events.js:400:28)
    at Socket.socketErrorListener (_http_client.js:475:9)
    at Socket.emit (events.js:400:28)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'dev'
}
foxxyz commented 2 years ago

When I dont specify the host it gives me this error:

Loupedeck Serial Error: Error: Resource busy, cannot open /dev/tty.usbmodem14101

This error means the device is in use. Are you sure the Loupedeck software is not running?

When I specify the host as the value I got from Loupedeck settings instead (/dev/cu.usbmodem14101, different from the autodetected one) I get this error instead:

...
Error: getaddrinfo ENOTFOUND dev
...

This error is because it's incorrectly looking for a network address. The correct parameter for 0.2.X firmware is path. (host is for the 0.1.X firmware, path is for the 0.2.X firmware).

Can you unplug/replug the device, make sure the Loupedeck software is completely shut down, then either run the simple example or manually run:

const { LoupedeckDevice } = require('loupedeck')
const device = new LoupedeckDevice()
// Or include the path yourself
// const device = new LoupedeckDevice{{ path: '/dev/cu.usbmodem14101' })

and attach the full stacktrace of the error you get?

foxxyz commented 2 years ago

Closing due to inactivity. Feel free to reopen if you have more information on reproduction!