Giter Site home page Giter Site logo

Comments (4)

rolljee avatar rolljee commented on June 20, 2024 1

Hello, we are currently working on a new documentation that will be much more precise on how to initialise the device manager plugin.

But you should be able to create an engine using this piece of code.

this.app.sdk
      .query({
        action: 'create',
        controller: `device-manager/engine`,
        group,
        index,
      })
      .catch((error) => {
        this.app.log.error(`[${index}] Cannot ${action} ${plugin} engine: ${error}`);

        throw error;
      });

The device manager is an open source plugin, there is no need to have a paid plugin to setup engine

from kuzzle-device-manager.

xdien avatar xdien commented on June 20, 2024

Thank you @rolljee .
I hope the documentation is completed soon and has more examples.

from kuzzle-device-manager.

xdien avatar xdien commented on June 20, 2024

I tried successfully creating the engine, then I created the asset, maybe I created the correct json content
body

POST http://localhost:7512/_/device-manager/models/assets
Authorization: Bearer xxxx

{
    "engineGroup":"esp",
    "model":"Distiller",
    "measures": [
        {
            "name": "temperature",
            "type": "float"
        },
        {
            "name": "humidity",
            "type": "float"
        }
    ]
}

But the server responded back error, I know index, but I don't know collection and targets on the url?

{
  "action": "writeAsset",
  "controller": "device-manager/models",
  "error": {
    "code": 33619971,
    "id": "api.assert.missing_argument",
    "message": "Missing argument \"index, collection or targets\".",
    "props": [
      "index, collection or targets"
    ],
    "stack": "BadRequestError: Missing argument \"index, collection or targets\".\n      [...Kuzzle internal calls deleted...]\n      at DocumentController.search (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle/lib/api/controllers/documentController.js:92:20)\n      at doAction (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle/lib/api/funnel.js:1079:47)\n      at Funnel.executePluginRequest (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle/lib/api/funnel.js:756:20)\n      at FunnelProtocol.query (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle/lib/core/shared/sdk/funnelProtocol.js:95:51)\n      at Proxy._timeoutRequest (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle-sdk/src/Kuzzle.js:763:34)\n      at Proxy.query (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle-sdk/src/Kuzzle.js:591:21)\n      at Proxy.query (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle/lib/core/shared/sdk/embeddedSdk.js:132:22)\n      at AssetService.refreshModel (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle-device-manager/lib/modules/asset/AssetService.ts:333:35)\n      at async Kuzzle.ask (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle/lib/kuzzle/event/kuzzleEventEmitter.js:229:22)\n      at async ModelService.writeAsset (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle-device-manager/lib/modules/model/ModelService.ts:106:5)\n      at async ModelsController.writeAsset (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle-device-manager/lib/modules/model/ModelsController.ts:115:24)\n      at async Funnel.processRequest (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle/lib/api/funnel.js:668:28)",
    "status": 400
  },
  "headers": {},
  "node": "knode-bored-maugrim-14974",
  "requestId": "7afe4c19-d9d2-417e-907c-90908ff3e827",
  "result": null,
  "status": 400,
  "volatile": null
}

from kuzzle-device-manager.

xdien avatar xdien commented on June 20, 2024

I was able to create the asset but the error was because I filled in the wrong engineGroup

"engineGroup":"esp",

from kuzzle-device-manager.

Related Issues (20)

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.