MQTT - knolleary or ESP8266 library, where am I going wrong ?

Hi,

I am trying to use MQTT using the following:
Ethernet Arduino
Using ESP2866

For the past 3 years I have been using this library, GitHub - knolleary/pubsubclient: A client library for the Arduino Ethernet Shield that provides support for MQTT. this has worked well.

I now wish to use the ESP8266 with MQTT using this library, GitHub - Imroy/pubsubclient: A client library for the ESP8266 that provides support for MQTT

Both of these use PubSubClient.h

My problem is when I compile my code for Ethernet Arduino it will only compile error free using the knolleary library and the ESP8266 will only compile error free using the Imroy library.

This gives me the problem of installing the correct library every time I use ESP8266 or Ethernet Arduino code.

Am I missing something surely i should have one library to be able to do both ?

Thanks

Regards

Gary

Am I missing something surely i should have one library to be able to do both ?

Which one library do you want to do both? Both what?

You could always re-name one of the two libraries and reference the library that works for your target build platform.