Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The status of the rule is Stopped #596

Closed
zhu-zyq opened this issue Nov 11, 2020 · 6 comments
Closed

The status of the rule is Stopped #596

zhu-zyq opened this issue Nov 11, 2020 · 6 comments

Comments

@zhu-zyq
Copy link

zhu-zyq commented Nov 11, 2020

1、create stream

curl -X POST \
  http://192.168.0.120:9081/streams \
  -H 'Content-Type: application/json' \
  -d '{"sql": "create stream demo() WITH (FORMAT=\"JSON\", TYPE=\"edgex\")"}'

2、create rule

curl -X POST \
  http://192.168.0.120:9081/rules \
  -H 'Content-Type: application/json' \
  -d '{
  "id": "rule1",
  "sql": "SELECT uint8 FROM demo WHERE uint8 > 20",
  "actions": [
    {
      "rest": {
        "url": "http://localhost:48082/api/v1/device/7d80374d-cb55-4cab-ab68-358d2b9d1538/command/a02b8dbb-61cf-4e5d-9fae-2838105a24ff",
        "method": "put",
        "dataTemplate": "{\"Bool\":\"true\", \"EnableRandomization_Bool\": \"true\"}",
        "sendSingle": true
      }
    },
    {
      "log":{}
    }
  ]
}'

3、show rule status
Connecting to 127.0.0.1:20498...

[
  {
    "id": "rule1",
    "status": "Stopped: cannot get the plugin file path: invalid name edgex: not exist."
  }
]

Question:
When creating a stream,TYPE="edgex",What is the meaning of “TYPE” ,and “ cannot get the plugin file path: invalid name edgex: not exist”,the “edgex” is the file “edgex.yaml” in etc/source?? this file is exists.

@jinfahua
Copy link
Collaborator

Could you please refer to this link - #569? It can be solved by compile a native build with edgex support.

@zhu-zyq
Copy link
Author

zhu-zyq commented Nov 11, 2020

I was build kuiper with "make build_with_edgex",so Kuiper should support EdgeX. Kuiper's plugins/source folder is empty.

@jinfahua
Copy link
Collaborator

jinfahua commented Nov 11, 2020

The edgex will be compiled into kuiperd binary file, it will not be a separated so file in plugins/source folder. From your log, it shows that the edgex has not been compiled into kuiperd binary file.

@zhu-zyq
Copy link
Author

zhu-zyq commented Nov 11, 2020

Shouldn't Kuiper be compiled into edgex enabled binaries?
How can I check whether edgex is compiled into kuiperd binary?

build kuiper with "make build_with_edgex" ,return "Build successfully"
_build/log/ stream.log file shows "Listen error: listen tcp :20498: bind: address already in use" file="server.go:72"
Thank you very much.

@jinfahua
Copy link
Collaborator

Shouldn't Kuiper be compiled into edgex enabled binaries?
How can I check whether edgex is compiled into kuiperd binary?

The separated binary version of Kuiper does not include EdgeX source because EdgeX requires additional libraries (zeromq library), and Kuiper cannot be started without installing the lib. Kuiper is not only for EdgeX, so it will confuse user that do not use EdgeX.

build kuiper with "make build_with_edgex" ,return "Build successfully"
_build/log/ stream.log file shows "Listen error: listen tcp :20498: bind: address already in use" file="server.go:72"
Thank you very much.

It seems there already have an existed kuiperd process, you need to kill it.

@zhu-zyq
Copy link
Author

zhu-zyq commented Nov 11, 2020

Thank you very much for your patient answers . I understand what you mean. But I think it’s not a compilation problem . Because I ran the source code of edgex-go, installed zeromq, and compiled and ran successfully. The readme file under kuiper is written to be compiled with "make build_with_edgex", which means that this version of kuiper contains the source of Edgex.
When I get data from the EdgeX Message bus(MQTT server) when creating a stream, the rule state is running.

@zhu-zyq zhu-zyq closed this as completed Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants