ditto icon indicating copy to clipboard operation
ditto copied to clipboard

Cannot send to inbox/outbox messages

Open vitlinda opened this issue 3 years ago • 1 comments

Hi, I've tried to use this API specification with this values:

thingId: io.eclipseprojects.ditto:floor-nf featureId: SmokeDetection messageSubject: smoke-detector

hitting "execute" it hangs for 60 seconds and returns a 408 with a timeout message.

The thing is created in the sandbox and the account is the one with name ditto and password ditto.

I've tried also to listen to the messages with a script that uses sse but nothing is received. However, attributes update are correctly intercepted.

What am I doing wrong?

Thanks for your help

vitlinda avatar Sep 29 '22 13:09 vitlinda

What do you expect to happen? The request is waiting for a response to that message from "the device" behind the twin.

When sending a message via HTTP, someone needs to receive that message and respond with a correlated message response. This response is sent back using the "open" HTTP request .. If no response is sent during the default timeout of 60 seconds, the request will terminate with 408 (request timeout).

So you need to subscribe for messages, e.g. using WebSocket or a connection or SSE - and once receiving the message, send back a message response. I think that however sending back a response via SSE is not possible, so I would recommend to use the WebSocket. Or even the Ditto Java or JavaScript client.

thjaeckle avatar Sep 29 '22 14:09 thjaeckle