I am new to Robot framework and MQTT. I have brought up a subscriber/publisher setup using mosquitto. I have written a code to publish to a subscribed topic. The code for Publish is working fine and I am able to see the output in the subscriber window. However, the subscribe keyword is not working for me.
I have tried both Subscribe and subscribe and validate. For the former, I am getting Messages=[], and for the latter 'The expected payload didn't arrive in the topic'. The screenshot of the codes are attached.
Subscribe and get messages
Subscribe MQTTtest2 qos=2 timeout=1 limit=0
I Publish an MQTT request
${messages}= Subscribe MQTTtest2 qos=2 timeout=5 limit=0
log to console Messages=${messages}
I Publish an MQTT request
connect 127.0.0.1
publish MQTTtest2 testmessage 2 ${false}
disconnect
MQTT_SUBSCRIBE_AND_VALIDATE
[Tags] mqtt
[Setup] Connect 127.0.0.1
I SUBSCRIBE to a Topic
[Teardown] Disconnect
I SUBSCRIBE to a Topic
#connect ${MQTT.hostname}
subscribe and validate ${MQTT.topic} ${MQTT.qos} ${MQTT.message} 5
#disconnect
Can you please let me know what I am doing wrong? Subscribe Publish