Browse Source

Dodan midi, resetiranje povezave WIP

main
Jurij Podgoršek 4 weeks ago
parent
commit
ae2e8d093d
  1. 4
      .gitignore
  2. 4282
      package-lock.json
  3. 4
      package.json
  4. 4
      server.js

4
.gitignore

@ -1 +1,5 @@
node_modules
.~*~
.*~undo-tree~
.~lock*#
.*.swp

4282
package-lock.json
File diff suppressed because it is too large
View File

4
package.json

@ -4,13 +4,13 @@
"description": "epilepsija",
"dependencies": {
"express": "^4.17.1",
"midi": "^2.0.0",
"nodemon": "^2.0.12",
"nouislider": "14.6.2",
"osc": "^2.4.2",
"pm2": "^5.1.0",
"three": "0.135.0",
"ws": "^7.3.1",
"hydra-osc": "dev-master"
"ws": "^7.3.1"
},
"scripts": {
"start": "npx nodemon server.js /dev/ttyUSB0"

4
server.js

@ -57,7 +57,6 @@ function openSerial() {
autoOpen: true,
useSLIP: true
})
scon.open()
scon.on('open', e => {
console.log('serial connection opened')
@ -69,6 +68,7 @@ function openSerial() {
})
scon.on('close', e => {
console.warn('serial connection closed, restarting in 1 second')
setTimeout(openSerial, 1000)
})
// Arduino OSC gre v web
@ -81,6 +81,8 @@ function openSerial() {
sendAll(msg, null, null, osclients)
})
scon.open()
if (scon._closeCode) {
scon = null
console.log('restarting serial connection')

Loading…
Cancel
Save