Closed rfsch closed 4 years ago
I have also this kind of problem, sometimes it works great, and sometimes I got 0 message from the 'Listen' keyword
@{response}= MQTTLibrary.Subscribe ${MQTT_SUBSCRIBE_COMMANDS} 0 0 0 # async Start / End / Elapsed: 20200206 05:53:50.408 / 20200206 05:53:50.409 / 00:00:00.001 05:53:50.409 INFO Subscribing to topic: dev/cmd
05:53:50.409 INFO Starting background loop
05:53:50.409 INFO @{response} = [ ]
And 13 seconds after (I should have a message after some little steps)
@{response}= MQTTLibrary.Listen ${MQTT_SUBSCRIBE_COMMANDS} timeout=10 limit=1 Start / End / Elapsed: 20200206 05:54:03.929 / 20200206 05:54:03.930 / 00:00:00.001 05:54:03.930 WARN Cannot listen when not subscribed to a topic
05:54:03.930 INFO @{response} = [ ]
What is this warn ? I subscribed earlier
I have the same issue.
My code contain these lines:
${messages} Subscribe topic=${topic} qos=0 limit=0 timeout=0
${messages} Listen topic=${topic} limit=20 timeout=10s
and the execution ends immediately after the subscription with this warning:
[ WARN ] Cannot listen when not subscribed to a topic
It seems like the subscription is immediately left.
@rfsch @Rodaxfck @deneb78it: can someone please provide a complete test which produces this issue so I can try locally? thanks.
It's really random @randomsync, I had this WARN today but it happens 1 time / 10 attemps. You can try with @deneb78it example, you should have the issue. :/
@deneb78it @Rodaxfck I have a proposed fix in this branch #20. The test I added for this specific scenario passes now, could you please give it a try? That branch has fixes for both the wildcard issue and this issue.
fixed in #20
Hi
I am using subscribe with timeout=0 aka async subscribe But my MQTT client times out due to a 5 minutes delay of the server publishing to the topic subscribed. I tried every possible variation without success.
It seems that the loop() of the connect is not working keeping the client alive ?
How can I solve this problem ?
Thanks