Internal server error | ThingSpeak API | Forum

The ThingSpeak community site has been upgraded to a new site. This site is currently in read-only mode. You can ask questions or post and read discussions on the new site.
Avatar

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
Internal server error
No permission to create posts
September 14, 2018
11:41 am
Avatar
teratoulis

Gold
Members
Forum Posts: 22
Member Since:
July 20, 2018
sp_UserOfflineSmall Offline

Hello I am trying to send some data from matlab to a thing speak server through a channel, using the thingSpeakWrite command.

However I receive the following error:

"The server returned the message: "Internal Server Error" for URL,
'https://api.thingspeak.com/channels/575425/upload_json/' (with HTTP response code 500)".

can you help me with that?

thanks a lot

Nikolasthingspeak-screenshot.pngImage Enlarger

sp_PlupAttachments Attachments
September 14, 2018
3:22 pm
Avatar
cstapels
Moderator
Members


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

It is possible for the server to be temporarily overloaded. Please pause and then try your request again and it should complete.

September 17, 2018
10:14 am
Avatar
teratoulis

Gold
Members
Forum Posts: 22
Member Since:
July 20, 2018
sp_UserOfflineSmall Offline

thanks for the reply!

however, still getting the same error

probably is something related to the server , but it seems that is still unsolved

thanks again!

September 17, 2018
10:57 am
Avatar
Vinod

MathWorks
Members
Forum Posts: 342
Member Since:
May 1, 2016
sp_UserOfflineSmall Offline

There are no known server issues at this time.

Can you share your MATLAB code (with the API keys redacted)? That will help us diagnose the issue and help you resolve it.

September 17, 2018
7:59 pm
Avatar
nalfaro
New Member
Members
Forum Posts: 1
Member Since:
September 17, 2018
sp_UserOfflineSmall Offline

newbie and tried the tutorial, but getting the same internal server error
server_error2.jpgImage Enlarger

server_error1.jpgImage Enlarger

sp_PlupAttachments Attachments
September 18, 2018
7:43 am
Avatar
teratoulis

Gold
Members
Forum Posts: 22
Member Since:
July 20, 2018
sp_UserOfflineSmall Offline

hi again thanks for the reply!

here is the code:

channelID_re1 = 577227;
writeKey_re1 = '8W0ALLFR811P79BD';

table1=Required_energy(:,1);
tStamps = [datetime('now')-minutes(899/80):minutes(1/80):datetime('now')]';
dataTable = table(tStamps,table1);

thingSpeakWrite(channelID_re1,dataTable,'Fields',[1],'WriteKey',writeKey_re1);

*The Required_energy is a column vector of [900x1]

thanks a lot

Nikolas

September 18, 2018
9:24 am
Avatar
Vinod

MathWorks
Members
Forum Posts: 342
Member Since:
May 1, 2016
sp_UserOfflineSmall Offline

How are you making sure that the dataTable that is being written does not have the same timestamps as data that has been previously written?

If your device sent data at 11:00:23 AM, and you try to write another datapoint that was created at 11:00:23 AM without clearing that channel,the system will reject the second insert. I believe you need to look at what is being written in dataTable and consider that you may not be wanting to write vectors for timestamps that may have already been written.

September 18, 2018
9:37 am
Avatar
teratoulis

Gold
Members
Forum Posts: 22
Member Since:
July 20, 2018
sp_UserOfflineSmall Offline

thanks for the reply,

the timestamps is the same

is there any other way to send vector data?

thanks again

September 18, 2018
10:55 am
Avatar
teratoulis

Gold
Members
Forum Posts: 22
Member Since:
July 20, 2018
sp_UserOfflineSmall Offline

For other people having similar problem I changed the code a bit and it's working now:

channelID_re1 = 577227;
writeKey_re1 = '8W0ALLFR811P79BD';

data_1=Required_energy(:,1);
tStamps = [datetime('now')-minutes(899):minutes(1):datetime('now')]';

thingSpeakWrite(channelID_re1,data_1,'TimeStamp',tStamps,'WriteKey',writeKey_re1)

However, it's weird that it's not working with the other way

thanks

Nikolas

September 18, 2018
5:31 pm
Avatar
cstapels
Moderator
Members


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

The original time stamp array you generated with tStamps = [datetime('now')-minutes(899/80):minutes(1/80):datetime('now')]';
has some repeated points in it.

ThingSpeak requires that all data in a channel and within an update must have a unique timestamp.

You can keep informed with improvements to ThingSpeak by viewing the release notes at https://www.mathworks.com/help/thingspeak/release-notes.html

The new code that you generated: tStamps = [datetime('now')-minutes(899):minutes(1):datetime('now')]';
has all unique points.

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
17 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:

kusmumichael, petersmith99, Rambant, blakeharriss09, optisol, Niyonzima Fils

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457