0

RPC calls over MQTT

Hi, I want to publish a telemetry event by issuing a PUBLISH message(RPC call) to an MQTT topic (${device.id}/rpc)

references: [RPC over MQTT][(ttps://mongoose-os.com/docs/mongoose-os/api/rpc/rpc-mqtt.md) Publishing telemetry events, Google IoT core

I am using below command to call RPC over MQTT

mos --port mqtts://mqtt.2030.ltsapis.goog:8883/projects/PROJECT_NAME/locations/us-central1/registries/iot-registry/devices/esp8266_C7E6AA --cert-file gcp-esp8266_C7E6AA.pub.pem --key-file gcp-esp8266_C7E6AA.key.pem call Sys.GetInfo

But I am getting below response

$ mos --port mqtts://mqtt.2030.ltsapis.goog:8883/projects/PROJECT_NAME/locations/us-central1/registries/iot-registry/devices/esp8266_C7E6AA --cert-file gcp-esp8266_C7E6AA.pub.pem --key-file gcp-esp8266_C7E6AA.key.pem call Sys.GetInfo
Unknown command
Command completed.

Is the above command is correct or am I doing something wrong?

Ramit Dour
  • 91
  • 1
  • 2
  • 8

1 Answers1

1

I am posting this answer to save time of people who might face the same problem.

So mos --port command only works form Command line(CMD).

And if you are on windows it require some special formatting that you can find out here.

Thanks Abhi