Reputation: 301
I am working on Raspberry Pi with os "Raspbian GNU/Linux 8 (jessie)".Now what i am trying is to send the simple message from my raspberry pi to the mqtt server which i have created on the "api.cloudmqtt.com". I am able to send (from raspberry pi to my server) and Receive (from server to my raspberry pi) with the following Commands
1.
pi@RevPi100102:~ $ mosquitto_pub -h "farmer.cloudmqtt.com" -p "18989" -u "obvrnnss" -P "xxxxxxxxx" -t "Test check" -m "Hello from RevPi"
2.
pi@RevPi100102:~ $ mosquitto_sub -h "farmer.cloudmqtt.com" -p "18989" -u "obvrnnss" -P "xxxxxxxxx" -t "Test check"
After this i tried to send the same message to server using the -r
and for this i took help from link for mosquitto_pub
pi@RevPi100102:~ $ mosquitto_pub -h "farmer.cloudmqtt.com" -p "18989" -u "obvrnnss" -P "xxxxxxxxxx" -t "Test check" -m "Hello from RevPi" -r --repeat-delay "2"
I am getting the following error,
Error: Unknown option '--repeat-delay'.
Can someone help me to find where i am going wrong and how to use the command -r
and --repeat-delay
.I am not expertise in Linux commands.
Upvotes: 0
Views: 2501
Reputation: 59751
Firstly the -r
flag is not the short version of --repeat
or --repeat-delay
From the mosquitto_pub doc
-r, --retain
If retain is given, the message will be retained as a "last known good" value on the broker. See mqtt(7) for more information.
To get repeating messages you need to use the --repeat
flag. This can then be combined with the --repeat-delay
flag to set the time between each message being published.
Secondly, the repeat functionality is new, it was only added at version 1.6 of mosquitto. You not said what version you are using but if it is the default that ships with raspbian then it is unlikely you have this feature.
Upvotes: 1