HTTP error -304 when using api.thingspeak.com from a Wemos D1 mini | ThingSpeak API | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
HTTP error -304 when using api.thingspeak.com from a Wemos D1 mini
No permission to create posts
March 14, 2019
2:13 pm
Avatar
obod0002
New Member
Members
Forum Posts: 3
Member Since:
March 13, 2019
sp_UserOfflineSmall Offline

Hi,
I'm kind of a newbie to ESP and ThingSpeak.
During the last few days I managed to set up arduino development IDE, read data from a bme_280 sensor using that Wemos D1 mini, connect it to my local WiFi, send HTTP GET requests to my raspberry and send mails.

But I'm completely lost now as I don't get the connection to Thingspeak to work.
I set up a channel at TS and I'm able to upload data using the URL https://api.thingspeak.com/update?api_key=&field1=

But when using the ESP I'll always receive error -304 - regardless whether I try to upload a new value or read an existing one.

Shouldn't be that tough, but ... also searching the Web doesn't help me much.

After the WiFi is connected I'm executing only few commands:

ThingSpeak.begin(client);
ThingSpeak.setField(1, voltage);
ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);

I copied the Write API Key out of ThingSpeak.com, same for the Channel Id

What am I missing? Any strange combination of libs which won't work ...

Thanks a lot for your help

March 15, 2019
7:38 am
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 610
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

I agree, you seem to be doing everything correct.

I assume you are using the api key in the URL when you try it through the web browser:
https://api.thingspeak.com/update?api_key=XXXXXXXXXXXXXXXX&field1=21.3

You wouldn't get a 304 error if you had the wrong API key, but its just one thing to check. Make sure you are using the write API key for your channel and not the user API key.

I am suspecting its a network issue. Do you have the ability to try the same device on another WiFi network?

March 17, 2019
6:51 am
Avatar
obod0002
New Member
Members
Forum Posts: 3
Member Since:
March 13, 2019
sp_UserOfflineSmall Offline

cstapels said
I am suspecting its a network issue.

I checked using my private WiFi instead of the guest's WiFi - and it worked.
Thanks a lot for that hint, cstapels

I've placed a request at the manufacturer of my FRITZ!Box 7490 as I don't have any setting I know of restricting the guest's WiFi.
In case something helpful is returned, I'll update this topic.

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
30 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

adeeeban, theweddingties, Vasant Gosai, pavithra, shivaniprakash, Akeyan

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457