Updated IDE now PubSubClient is broken

I have a project that uses the PubSubClient software to communicate data to a MQTT broker on my local network. I have started testing some new hardware (ESP8266/NodeMCU board) so I updated my Arduino IDE installation from 1.6.1 to 1.6.7 and allowed it to update as it requested. I tried to apply a small update to the project that was working on an UNO with Ethernet shield but now I cannot get a connection between the UNO and the broker (the serial terminal displays my connection error and I see nothing at the broker). I then uploaded the original project (prior to the update) to the UNO and I still see the same error. I also have a portable installation of 1.6.7 on a flash drive and I get the same error when uploading from there.

I also tried stepping back to the basics. I modified the basic MQTT test sketch included with the PubSubClient library to use the same MAC, Server IP, and Client IP that was being used in my project and was working initially. This produced the same type of error with the connection.

I downloaded 1.6.0 again in zip format so I could try a portable installation for testing but did not have time last night to install. I will try the same basic PubSubClient example again this afternoon when I get a chance.

So, it appears that there is some kind of problem with:

  • my installation (both on my PC and the portable flash drive)
  • Arduino IDE 1.6.7
  • PubSubClient
  • some combination?

Does anyone know of an issue with either PubSubClient, Arduino IDE 1.6.7, or some combination that I should know about? I'm not sure what to do since the code (both my project and the PubSubClient example) worked in the past.

After extensive testing, it appears that PubSubClient has gone through some sort of change that affects its compatibility with Mosquitto 0.15 running on Wheezy on RPiv1 (don't know which is the important item of the configuration). I have found that if I use Arduino IDE 1.6.1 with PubSubClient 1.7 and mqtt_basic example sketch, I can send a message to the broker successfully. If I use IDE 1.6.5 with PubSubClient 2.4.0 and mqtt_basic from that verson, the UNO cannot connect to the server though it is working on Ethernet as I can ping the MCU. I can also use the current version and connect to the Mosquitto test server (test.mosquitto.org) and it works.

I will continue testing to see what I can make work. If someone already has knowledge on this type of setup and could shortcut my research, that would definitely be considered helpful!

I realize that this thread is old, but perhaps somebody else reading it will benefit from this observation. I had a similar problem with not being able to send data to the mosquitto broker. I found that it was necessary to make sure that the connection was maintained until the data had finished being published. The addition of a 20ms delay after the data was published solved my problem. The data packet being published was 61 bytes.

     publishData(p, h, t);
      delay(20); //wait for data to be published.