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

No response from MQTT Binding readProperty method #1241

Open
hidetak opened this issue Feb 13, 2024 · 2 comments
Open

No response from MQTT Binding readProperty method #1241

hidetak opened this issue Feb 13, 2024 · 2 comments
Assignees
Labels
binding-mqtt Issues related to mqtt protocol binding need-investigation

Comments

@hidetak
Copy link
Contributor

hidetak commented Feb 13, 2024

I apologize for the inconvenience, but I need your confirmation on the following issues.

Problem

There is no response when I call readProperty on MQTT Binding.
A sample program is placed below.
https://github.com/hidetak/test-node-wot/tree/main/no-response-mqtt-read-property

Also, if observeProperty is executed and then writeProperty is executed, the written value can be retrieved, but sometimes it is retrieved twice.

environment

  • Mac(Apple siicon)
  • OS: Sonoma 14.1
  • nodejs: v18 or v20
  • node-wot: 0.8.12

Steps to reproduce

get the following code

https://github.com/hidetak/test-node-wot/tree/main/no-response-mqtt-read-property

  1. $ npm install
  2. $ npm run start:server
  3. open new terminal
  4. $ npm run start:client

When executed, the following string is output.

write property 100
observed count value is:  100

Expectations are as follows.

count value is: 0
write property 100
observed count value is:  100

Sometimes observed count value is: 100 is output twice

write property 100
observed count value is:  100
observed count value is:  100

I apologize if there is a problem with my usage.

@danielpeintner
Copy link
Member

@egekorkan can you take a look?

@egekorkan
Copy link
Member

There is no good solution here at the moment. The following scenarios are possible:

  1. Consumer subscribes and by chance the Thing publishes a new value
  2. Consumer subscribes and gets a value that is published some time ago with retain. The issue is how to give the timestamp of the published payload to the application level. The message can be very old
  3. The request-response mechanism is implemented in all sides where the Consumer forces the Thing to publish to a topic given by the Consumer.

There are issues in the specification level to solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding-mqtt Issues related to mqtt protocol binding need-investigation
Projects
None yet
Development

No branches or pull requests

4 participants