2

I have succesfully established a Wifi-Connection with my Arduino DUE and an ESP8266-01 Module attached to it. I now want to establish a connection to an IoT Platform (e.g io.adafruit.com) with a MQTT Protocol. However the MQTT Library provided by the IoT Platform does not support the Arduino DUE. When searching for a fitting library I always come across libraries that use the ESP8266 module directly without the Arduino DUE. Is there a library that I can use for this special application ?

Kev1n91
  • 3,553
  • 8
  • 46
  • 96
  • Have you gave a try for the answer? – cagdas Dec 06 '16 at 07:06
  • Sry we did not have the time to check wether it worked or not. We simply used the REST APi and made our own headers that were sendt. I am not quite sure about the PubSubClient; but I think it may only work if you are flashing the ESP directly from the Arduino IDE and not like you are using and Arduino DUE to connect to the ESP - but this is just a guess from a far away project. Sry that I cannot give you an upvote at the moment since I am not able to verify it – Kev1n91 Dec 16 '16 at 13:27

1 Answers1

1

Current libraries fairly requires Ethernet or WiFi client instances to use their protocol implementation and connect to the MQTT. In AT mode, you are posting a raw text data and it is not appropriate to create protocol depended headers etc. I thought that you need another serial firmware to include it and found this :

http://www.esp8266.com/wiki/doku.php?id=espduino

As it denotes, required library has a different communication method but no harm, you can still send data to it via AT commands.

Here is another serial arduino library to work with ESP. It declares a client called ESPWiFiClient and looks like you need to give it as parameter to the PubSubClient's constructor.

WiFiEspClient espClient;
PubSubClient client(espClient );

Good luck!

cagdas
  • 1,634
  • 2
  • 14
  • 27