Giter Site home page Giter Site logo

oh-plg-lowboard's Introduction

Introduction

Plugin for a custom WebSocket API on a Raspberry Pi that controlls a WS2801 light strip.

Development

Add plugin item via HTTP API:
[PUT] http://{{HOST}}:{{PORT}}/api/plugins/

{
    "name": "Lowboard WebSocket API",
    "enabled": true,
    "version": 1,
    "intents": [
        "devices", 
        "endpoints", 
        "ssdp", 
        "vault", 
        "store"
    ]
}

Response:

{
    "_id": "63a09fe041d049eca2f93ac6",
    "name": "Lowboard WebSocket API",
    "enabled": true,
    "version": 1,
    "intents": [
        "devices",
        "endpoints",
        "ssdp",
        "vault",
        "store"
    ],
    "timestamps": {
        "created": 1671471072269,
        "updated": null
    },
    "uuid": "13eb86e9-c14e-48c3-96e0-532cd49ec9dd",
    "autostart": true
}

Mount the source code into the backend plugins folder

sudo mount --bind ~/projects/OpenHaus/plugins/oh-plg-lowboard/ ~/projects/OpenHaus/backend/plugins/13eb86e9-c14e-48c3-96e0-532cd49ec9dd/

oh-plg-lowboard's People

Contributors

mstirner avatar

Watchers

 avatar

oh-plg-lowboard's Issues

RangeError: Invalid WebSocket frame: RSV1 must be clear

[ws://lowboard.lan:8080] RangeError: Invalid WebSocket frame: RSV1 must be clear
    at Receiver.getInfo (/home/marc/projects/OpenHaus/backend/node_modules/ws/lib/receiver.js:184:14)
    at Receiver.startLoop (/home/marc/projects/OpenHaus/backend/node_modules/ws/lib/receiver.js:131:22)
    at Receiver._write (/home/marc/projects/OpenHaus/backend/node_modules/ws/lib/receiver.js:78:10)
    at writeOrBuffer (node:internal/streams/writable:391:12)
    at _write (node:internal/streams/writable:332:10)
    at Receiver.Writable.write (node:internal/streams/writable:336:10)
    at Duplexify.socketOnData (/home/marc/projects/OpenHaus/backend/node_modules/ws/lib/websocket.js:1153:35)
    at Duplexify.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9) {
  code: 'WS_ERR_UNEXPECTED_RSV_1',
  [Symbol(status-code)]: 1002
}

OpenHausIO/backend#199

Stopped working after long time running (since creating this repo)

After working a long time, today the plugins does not what it should.

Server:

Jan 14 18:13:50 open-haus.lan node[142375]: User request: null false false 127.0.0.1 POST /endpoints/63a0ce5b33d59ec69d8ffe18/commands/63a0ce5b33d59ec69d8ffe1c
Jan 14 18:13:50 open-haus.lan node[142375]: Command handler executed 0 [
Jan 14 18:13:50 open-haus.lan node[142375]:   Error: NOT_READY
Jan 14 18:13:50 open-haus.lan node[142375]:       at a.<anonymous> (/opt/OpenHaus/backend-v2.0.1/plugins/32ae791a-a073-4c2c-a2e9-1a9ca0d572ed/index.js:74:42)
Jan 14 18:13:50 open-haus.lan node[142375]:       at a.trigger (/opt/OpenHaus/backend-v2.0.1/components/endpoints/class.command.js:1:1167)
Jan 14 18:13:50 open-haus.lan node[142375]:       at /opt/OpenHaus/backend-v2.0.1/routes/router.api.endpoints.js:1:431
Jan 14 18:13:50 open-haus.lan node[142375]:       at Layer.handle [as handle_request] (/opt/OpenHaus/backend-v2.0.1/node_modules/express/lib/router/layer.js:95:5)
Jan 14 18:13:50 open-haus.lan node[142375]:       at next (/opt/OpenHaus/backend-v2.0.1/node_modules/express/lib/router/route.js:144:13)
Jan 14 18:13:50 open-haus.lan node[142375]:       at Route.dispatch (/opt/OpenHaus/backend-v2.0.1/node_modules/express/lib/router/route.js:114:3)
Jan 14 18:13:50 open-haus.lan node[142375]:       at Layer.handle [as handle_request] (/opt/OpenHaus/backend-v2.0.1/node_modules/express/lib/router/layer.js:95:5)
Jan 14 18:13:50 open-haus.lan node[142375]:       at /opt/OpenHaus/backend-v2.0.1/node_modules/express/lib/router/index.js:284:15
Jan 14 18:13:50 open-haus.lan node[142375]:       at param (/opt/OpenHaus/backend-v2.0.1/node_modules/express/lib/router/index.js:365:14)
Jan 14 18:13:50 open-haus.lan node[142375]:       at paramCallback (/opt/OpenHaus/backend-v2.0.1/node_modules/express/lib/router/index.js:412:21)
Jan 14 18:13:50 open-haus.lan node[142375]: ]

Connector

[connected] tcp://lowboard.lan:8080
[error] tcp://lowboard.lan:8080 Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'read'
}
Coult not connect, half open: true Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'read'
}
[closed] tcp://lowboard.lan:8080

On my workstion, in dev mode it works again.
But not on my test/"prod" system.

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.