Skip to content

Can't invoke an action with the current MQTT implementation #463

Open
@relu91

Description

@relu91

As well described by @alvarogar23 in #456 (comment), it seems that with the current implementation is not possible to invoke actions using MQTT. In the comment above he pinpointed a particular line that is causing the issue: var topic = requestUri.pathname.slice(1)

Checking the git blame it seems that it was updated by @JKRhb. I vaguely remember the reasons why we applied these changes, maybe @JKRhb would you like to refresh my memory? was it something about how we handle topics, right?

For reference here's one of @alvarogar23's TDs:

{
    "@context": "https://www.w3.org/2019/wot/td/v1",
    "title": "AireAcondicionado",
    "id": "urn:dev:wot:mqtts:AireAcondicionado",
    "actions" : {
        "OnOff": {
            "forms": [
                {"href": "mqtts://localhost:8443/AireAcondicionado/actions/OnOff"}
            ]
        },
        "incrementar": {
            "forms": [
                {"href": "mqtts://localhost:8443/AireAcondicionado/actions/incrementar"}
            ]
        },
        "decrementar": {
            "forms": [
                {"href": "mqtts://localhost:8443/AireAcondicionado/actions/decrementar"}
            ]
        },
        "leerTemperatura": {
            "forms": [
                {"href": "mqtts://localhost:8443/AireAcondicionado/actions/leerTemperatura"}
            ]
        }
    }, 
    "events": {
        "estadoTemperatura": {
            "type": "integer",
            "forms": [
                {"href": "mqtts://localhost:8443/AireAcondicionado/events/estadoTemperatura"}
            ]
        } 
    } 
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    binding-mqttIssues related to mqtt protocol binding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions