Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Problem Arduino YUN continuous duty

Hi Ian,

 

i have a update to Arduino YUN Reconnect problem.

 

The actual YUN implementation to connect to Server over TCP is:

 

void loop() {

  if(!client.connected())

  {client.connect(ip, port);}

}

 

I tested this lines. client.connected is always “false” when broken connection to broker and then reconnected the YUN.

 

The last commit in YunClient.cpp add a stop() for linux side

https://github.com/arduino-org/Arduino/commit/b1b83c09898d2b21ae2e136e4ecba5311f397eab

 

Your Implementation in MQTTClient.h

835 if (rc != SUCCESS)

836      isconnected = false;

837  return rc;

....

850 if (!isconnected)

851      goto exit;

....

905     if (len > 0)

906      rc = sendPacket(len, timer);            // send the disconnect packet

908    isconnected = false;

909    return rc;

 

Is the solution add the stop() in this line?

 

Reiko


Back to the top