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

Error updating a command to a device self-registered by a group #612

Open
JuanCarlosSecmotic opened this issue Jun 2, 2023 · 4 comments

Comments

@JuanCarlosSecmotic
Copy link

JuanCarlosSecmotic commented Jun 2, 2023

I am trying to be able to receive a command when sending data, everything works fine when I create a device, but when the device is self-registered by a device group this command fails.

Create device group

Post -> http://localhost:4041/iot/services
{ "services": [ { "resource": "/iot/d", "apikey": "801230BJKL23Y9090DSFL123HJK09H324HV8732", "type": "Light", "polling": true, "attributes": [ { "object_id": "c", "name": "count", "type": "Integer" } ], "commands": [ { "name": "ring", "type": "command" } ] } ] }

I generate the device
Post -> http://localhost:7896/iot/d?i=motion1&k=801230BJKL23Y9090DSFL123HJK09H324HV8732
c|3323

then I update the command through the iot
Post -> http://localhost:4041/v2/op/update
{ "actionType": "update", "entities": [ { "type": "Light", "id": "Light:motion1", "polling": true, "ring" : { "type": "command", "value": "44423" } } ] }

it responds 204 but in orion the error has already been logged.

ring_info has this value -> There was an error in the response of a device to a command []:RequestError: Missing url property

I have been testing, the autogenerated device does not have the attribute called polling in the IoT database, if I edit it manually and add it as true, the command works

UPDATE (compose file + config + postman collection added)
environment.zip

@mapedraza
Copy link
Collaborator

mapedraza commented Jun 6, 2023

Please, could you provide more information?

  • IoT agent version you are using
  • Context Broker you are using and version
  • Config file or env variables used

Additionally, could you provide curl like requests for all the steps?

@JuanCarlosSecmotic
Copy link
Author

thanks for answering, I have updated the issue with a zip with the necessary files to test it

@mapedraza
Copy link
Collaborator

@JuanCarlosSecmotic could you please open a PR with providing test case showing this issue failing? This would help a lot.

@AlvaroVega
Copy link
Member

Testing with latests version of iotagent-ul and the following env vars

  • IOTA_APPEND_MODE=true
    IOTA_DEFAULT_EXPRESSION_LANGUAGE=jexl

I've see that this request:
Post -> http://localhost:4041/v2/op/update
{ "actionType": "update", "entities": [ { "type": "Light", "id": "Light:motion1", "polling": true, "ring" : { "type": "command", "value": "44423" } } ] }

should be performed over context broker, not over iotagent (http://localhost:1026/v2/op/update and providing fiware-service and fiware-servicepath). And then "polling":true should not be provided to avoid errors.

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

3 participants