Viewing MQTT messages
Viewing MQTT messages
Is there a way to view the MQTT messages sent by the node and received by the Rainmaker broker during development?
-
- Posts: 198
- Joined: Sun Jun 23, 2024 6:18 pm
Re: Viewing MQTT messages
You need to install the rainmaker CLI
Code: Select all
pip install espressif-rainmaker-cli
Re: Viewing MQTT messages
Thank you.
Which of the commands below allows me to do that?
Which of the commands below allows me to do that?
Code: Select all
\usage: esp-rainmaker-cli [-h]
{configure,signup,login,logout,forgotpassword,getnodes,getnodeconfig,getnodestatus,setparams,getparams,removenode,provision,getmqtthost,claim,test,otaupgrade,getuserinfo,sharing,create_cmd_request,get_cmd_requests} ...
positional arguments:
{configure,signup,login,logout,forgotpassword,getnodes,getnodeconfig,getnodestatus,setparams,getparams,removenode,provision,getmqtthost,claim,test,otaupgrade,getuserinfo,sharing,create_cmd_request,get_cmd_requests}
Functions
configure Configure ESP RainMaker
signup Sign up for ESP RainMaker
login Login to ESP RainMaker
logout Logout current (logged-in) user
forgotpassword Reset the password
getnodes List all nodes associated with the user
getnodeconfig Get node configuration
getnodestatus Get online/offline status of the node
setparams Set node parameters
Note: Enter JSON data in single quotes
getparams Get node parameters
removenode Remove user node mapping
provision Provision the node to join Wi-Fi network
getmqtthost Get the MQTT Host URL to be used in the firmware
claim Claim the node connected to the given serial port
(Get cloud credentials)
test Test commands to check user node mapping
otaupgrade Upload OTA Firmware image and start OTA Upgrade
getuserinfo Get details of current (logged-in) user
sharing Node Sharing Operations
create_cmd_request Create a Command Response Request (Beta)
get_cmd_requests Get Command Response Requests (Beta)
options:
-h, --help show this help message and exit
-
- Posts: 309
- Joined: Wed Feb 20, 2019 7:02 am
Re: Viewing MQTT messages
You cannot check the messages received by the MQTT broker with public RainMaker, but you can see the messages being published by your device by adding a print here.
Re: Viewing MQTT messages
Thank you Piyush, I'll do that
Re: Viewing MQTT messages
Thank you Piyush. I have done as you suggested and it seems to me that Rainmaker is not using MQTT very efficiently.
As an example, say I want to send battery voltage = 12V
Rainmaker publishes the following to MQTT
We may assume that topic aliasing in MQTT5 might reduce the topic to 2 bytes, but since the payload is JSON encoded, a single integer value of 12 takes ~30 bytes, and I have many such values to send.
True, I could send "b" for Battery and "v" for voltage, but then the App display would not be correct, and it will still be ~15bytes.
Our current system makes use of MQTT topics
which is about 10X more efficient.
This is a show stopper for the use of Rainmaker in any metered application that uses cellular IoT services such as Hologram etc, ie for things like agriculture, object tracking etc.
Do you have any plans to reduce this overhead, or am I missing something here (like you are using Protobuf https://aws.amazon.com/blogs/iot/how-to ... -iot-core) or something)?
As an example, say I want to send battery voltage = 12V
Rainmaker publishes the following to MQTT
Code: Select all
topic: $aws/rules/esp_set_params/node/F412FA68E350/params/local,
data: {"Battery":{"Voltage (V)":12}}
True, I could send "b" for Battery and "v" for voltage, but then the App display would not be correct, and it will still be ~15bytes.
Our current system makes use of MQTT topics
Code: Select all
topic: account/user/node/metric/device/battery/voltage => 2 bytes with MQTT5 topic aliasing
data: 12
This is a show stopper for the use of Rainmaker in any metered application that uses cellular IoT services such as Hologram etc, ie for things like agriculture, object tracking etc.
Do you have any plans to reduce this overhead, or am I missing something here (like you are using Protobuf https://aws.amazon.com/blogs/iot/how-to ... -iot-core) or something)?
Who is online
Users browsing this forum: No registered users and 71 guests