Thanks for that information. I’ve been able to enumerate devices, properties, and values of devices. I’ve also been able to enumerate historical events.
I’m currently trying to receive realtime event notifications, attempting to receive events notifications for a Flic button. I’m trying to use the websocket approach ( https://iot.mozilla.org/wot/#protocol-handshake ) and then sending an addEventSubscription message ( https://iot.mozilla.org/wot/#addeventsubscription-message ) to the gateway but it seems as soon as I send any message, the gateway closes the connection.
For the handshake, I tried various approaches to wss://mysubdomain.mozilla-iot.org/things/myflicname , including just a basic connection and also adding Authorization and Accept header fields with the same values that work with the HTTP queries. I consistently receive what appears to be the expected valid response from the gateway on the handshake:
101 Switching Protocols … (1083ms)
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: gWmxRLm4hlE2suUIqJI0QXC4aPA=
After the connection is open, I’ve tried to send various messages, such as:
{
“messageType”: “addEventSubscription”,
“data”: {
“singleClick”: {}
}
}
But whenever I try to send a message to the gateway, the gateway closes the connection with a 1005 response. If I wait several seconds before I send the message, the connection remains open until I try to send the message, but then closes when I try to send the message. I’ve also submitted the exact same handshake and messages to wss://echo.websocket.org , where my messages are successfully received and echoed back to me.
@benfrancis Do you have any suggestions?