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

Moderator: igrr

User avatar
By cherowley
#17766 I was using the oleary pubsub client and trying to now use the lmroy one but am having problems..

I copied over the 4 files into the PubSubClient library folder (overwriting the 2 original files) and started changing my code.

It won't compile now though, get teh following messages:

Code: Select allMQTT.cpp.o:In function `MQTT::Connect::Connect(String)'
MQTT.cpp*:(.text+0x758): undefined reference to `strnlen_P(char const*, unsigned int)'
MQTT.cpp*:(.text+0x79b): undefined reference to `strnlen_P(char const*, unsigned int)'
MQTT.cpp.o:In function `MQTT::ConnectAck::ConnectAck(unsigned char*, unsigned char)'
MQTT.cpp*:(.text+0x7c4): undefined reference to `memcpy_P(void*, void const*, unsigned int)'
MQTT.cpp.o:In function `MQTT::Publish::Publish(String, String)'
MQTT.cpp*:(.text+0x7ed): undefined reference to `memcpy_P(void*, void const*, unsigned int)'
collect2.exe*:error: ld returned 1 exit status
Error creating .elf


Anyone know what I'm doing wrong? Sorry, I'm being a bit of a cut n paste programmer as don't know C etc!

Cheers!

Ah ha! now compiles!

changed:

#include <PubSubClient.h>
#include <ESP8266WiFi.h>

to

#include <ESP8266WiFi.h>
#include <PubSubClient.h>
User avatar
By Tinamore
#17815 The system of ESP8233 is unstable
ESP8266 restart continuously.
MQTT PubSubClient unstable, running for some time and then stopped.
I've tried all the code: basic ESP8266 SDK, Nodemcu, Arduino IDE for ESP8266.
All are running unstable.
Can't do the smarthome.
Disappointed.
User avatar
By madarax64
#20479 Hey all,
Sorry, been busy with work and stuff. Ian, I tested it out, and I really like it! At the moment its on one of my ESP01s as a proof of concept. You're gonna develop it some more?
Tinamore, I'm sorry to hear you're having trouble. Just off the bat (assuming you haven't solved the problem) ensure that your power supply is good for at least 300mA @ 3.3V (don't use an Arduino's 3.3V output to power it, pesky things will happen). If you're sure you might need to create a new thread about your specific problems so that someone can take a look.
Manosv, I'm assuming you meant cherowley's updated code?