Sample MQTT program - simple send and receive

Dependencies:   C12832 MQTT

Dependents:   MQTT_G_SENSOR

Yield function call not working

Yield now works with timeout, it was due to the socket blocking mode (reading)

Yield function call with timeout works, there was an issue with blockant socket.

2 comments:

13 Feb 2018

The yield function still does not work with the timeout. Nucleo-F746ZG, Ethernet. What did you do to solve it?

06 Apr 2018

Jack Berkhout wrote:

The yield function still does not work with the timeout. Nucleo-F746ZG, Ethernet. What did you do to solve it?

Problem is in the MQTTNetwork.h is not passing the timeout correctly to socket:

After line 16: `int read(unsigned char* buffer, int len, int timeout)`

  • Add line "socket->set_timeout(timeout);"

This fixes the problem of socket not timing out correctly.