josephdadams / midi-relay

Listens for HTTP request with JSON payload and relays MIDI/MSC commands on local ports.
MIT License
58 stars 9 forks source link

fail to get v2.0.1 to run; node main.js throws exception, after (maybe) fix, can't see MIDI device #45

Closed mark-epstein closed 10 months ago

mark-epstein commented 1 year ago

Describe the bug

levpres@CompanionPi:~/source/midi-relay-2.0.1 $ node main.js
node:internal/modules/cjs/loader:1051
  throw err;
  ^

Error: Cannot find module 'request'
Require stack:
- /home/levpres/source/midi-relay-2.0.1/main.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/home/levpres/source/midi-relay-2.0.1/main.js:6:17)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/levpres/source/midi-relay-2.0.1/main.js' ]
}

Node.js v20.6.0

To Reproduce installed mid-relay v2.0.1 also occurred on 2.0

I got midi-relay to run by running npm install request but I have no idea if that's right. midi-relay seems to be running but won't recognize my MIDI hardware image

os: Debian GNU/Linux 11 (bullseye) Raspberry Pi 4 Model B Rev 1.4

mark-epstein commented 1 year ago

Also, Companion v3.1.0 doesn't seem to connect to midi-relay. The log shows this if I stop and start the connection, but the Connections page never advances past "Connecting"

system: ** Connection stopped **
system: ** Starting Connection from "/opt/companion/bundled-modules/techministry-midirelay/main.js" **
system: ** Connection started **
Starting up module class: 
Sentry disabled
Module-host accepted registration
info: Verbose mode enabled. Log entries will contain detailed information.
debug: Using protocol for midi-relay v2
mark-epstein commented 1 year ago

sorry last comment of the night. Same Pi, same USB-MIDI hardware, works fine with an older SD card that has Companion v2.3.1 on it. I don't know how to determine the midi-relay version, I lost the SSH credentials. image

mark-epstein commented 1 year ago

Maybe this info is useful

image

image

mark-epstein commented 1 year ago

OK, I just saw this.

Screenshot 2023-09-07 011214 If I can't run midi-relay at all with Companion v3 that will make me very sad. I have invested tons of time researching and planning a move to v3. But the option to select lower (2.x) protocol versions confuses me if this is the case; I'm hoping the "only compatible with midi-relay v3.0 or greater" is incorrect?

josephdadams commented 11 months ago

At some point if I can find the time (or if someone hires me to find the time) I will make the current midi-relay v3.x codebase be able to run on a Pi. And eventually I will deprecate and remove the v2.x functionality within the companion module entirely.

Unless you particularly need this to run on a Pi, just download midi-relay v3.x and run it on a desktop computer with that USB midi interface.