mathworks / thingspeak-arduino

ThingSpeak Communication Library for Arduino, ESP8266 and ESP32
https://thingspeak.com
431 stars 231 forks source link

issue: Error http -301 Solved #70

Closed mrwattdiy closed 4 years ago

mrwattdiy commented 4 years ago

Hello, i checked that this module didn't work (error http -301), perheaps ThingSpeak changed something on api server:

I mdified lines 26 and 27 of ThingSpeak.h file from:

define THINGSPEAK_URL "api.thingspeak.com"

define THINGSPEAK_PORT_NUMBER 80

to:

define THINGSPEAK_URL "thingspeak.com"

define THINGSPEAK_PORT_NUMBER 443

My application instead:

include

WiFiClient client; WiFiClientSecure clientsecure;

void setup() { ... // Initialize ThingSpeak ThingSpeak.begin(clientsecure); ...

Sincerely, Simone C.

v-c commented 4 years ago

Since you're using WiFiSecureClient, it needs to connect to port 443. If you used WiFiClient, port 80 is fine, as in v1.5.0 of the library.

The next version of the library will have the ability to use the WiFiSecureClient as well as the WiFiClient.