Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By ridge
#28625 Edit:
I also installed this into the Arduino15 dir

Please keep going down the directory chain on your Windows machine into the /libraries/ folder to copy the pubsubclient library into. I mentioned the Arduino15 directory as a good search term to find the directory tree on a Windows machine, not as the directory to install into. Sorry for the confusion.


I did a .zip download of https://github.com/Imroy/pubsubclient, expanded it and copied it to the location I mentioned. No changes to the library contents were needed.

This is the first paragraph of my /home/ridge/.arduino15/packages/esp8266/hardware/esp8266/1.6.5-1044-g170995a/libraries/PubSubClient/CHANGES.txt file to have something to compare against for version control:

Code: Select all1.9
   * Do not split MQTT packets over multiple calls to _client->write()
   * API change: All constructors now require an instance of Client
      to be passed in.
   * Fixed example to match 1.8 api changes - dpslwk
   * Added username/password support - WilHall
   * Added publish_P - publishes messages from PROGMEM - jobytaffey

1.8
    * KeepAlive interval is configurable in PubSubClient.h
    * Maximum packet size is configurable in PubSubClient.h
    * API change: Return boolean rather than int from various functions
    * API change: Length parameter in message callback changed
       from int to unsigned int
    * Various internal tidy-ups around types
Last edited by ridge on Tue Sep 08, 2015 12:00 pm, edited 1 time in total.
User avatar
By krzychb
#28634 I got the same error as in post #28559 using code from post #27767.

To fix it I replaced
Code: Select allPubSubClient mqttClient(mqttServer);

with
Code: Select allPubSubClient mqttClient(wifiClient, mqttServer);

After this change it compiles and works correctly.

BTW: I recommend http://kamilfb.github.io/mqtt-spy/ for testing of MQTT communication.

Hope it helps :D

Regards, Krzysztof