Skip to content

Implementation of Mongoose OS RPC over MQTT protocol

License

Notifications You must be signed in to change notification settings

ALLTERCO/rpc-mqtt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Implementation of Mongoose OS RPC over MQTT protocol

Overview

MQTT RPC channel allows invoking RPC calls via MQTT.

Topics

When rpc.mqtt.enable is true (default), device subscribes to rpc.mqtt.sub_topic (default: ${device.id}/rpc, e.g. esp8266_DA7E15/rpc in the example).

Responses are published to ${src}/rpc, where ${src} is taken from the request's frame, so requests for which a response is expected must include src.

Examples

Request

Published to esp8266_DA7E15/rpc:

{ "id": 123, "src": "foo", "method": "Sys.GetInfo"}

Response will be published to foo/rpc.

mos tool support

mos tool supports RPC over MQTT via the mqtt port schema:

$ mos --port mqtt://iot.eclipse.org/esp8266_DA7E15 call Sys.GetInfo

For brokers that require TLS, mqtts should be used:

$ mos --port mqtts://iot.eclipse.org/esp8266_DA7E15 call Sys.GetInfo

For brokers that require TLS client authentication (e.g. AWS), cert and file should be supplied:

$ mos --port mqtts://XXXXXXXX.iot.REGION.amazonaws.com/esp8266_DA7E15 --cert-file mycert.pem --key-file mykey.pem call Sys.GetInfo

About

Implementation of Mongoose OS RPC over MQTT protocol

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 100.0%