ESP8266WebServer.h or ESP8266mDNS interfering with ThingSpeak.h ?

Using the latest Aduino 1.8.10  IDE and a Wemos D1 mini board with DHT22 sensor, I can include Thingspeak and upload the data (mulitifield) without any problem.

Using the exact same software and board I can also run a sketch wherein the Wemos acts as LANserver and is approachable using a mDNS address (.local) using the #include <ESP8266mDNS.h> and 
#include <ESP8266WebServer.h> commands.

So all looks rosy.

However, when adding just the line  #include <ThingSpeak.h> into the later sketch, it will not compile anymore and I get the error message 

C:\Users\Pasal Laptop\Documents\Arduino\libraries\ThingSpeak\src/ThingSpeak.h:70:33: error: expected identifier before ‘-’ token

#define ERR_TIMEOUT -304 // Timeout waiting for server to respond

I am puzzled. What is wrong? Or is ThingSpeak not compatible with the two ESP8266 libraries?

did you find any solution?

I believe the two services are fighting over port 80, which they both use. A solution deems to be to use ESP8266WebServer server(81); to ensure the local server uses port 81.

Just note that for accessing the local server you need to add that port info, so use http:\ to access it.

1 Like