Bulk data upload from electron - example code gives error 500, 1 or 0. | Particle / Spark | 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
Bulk data upload from electron - example code gives error 500, 1 or 0.
No permission to create posts
July 26, 2017
6:57 am
Avatar
Eight19_FC
New Member
Members
Forum Posts: 1
Member Since:
July 26, 2017
sp_UserOfflineSmall Offline

Being able to upload many data points each associated with a timestamp to ThingSpeak at once is essential for my project. I am finding it hard to implement from the electron. As in the title, I'm getting a "Response code" of 1, 0, or 500 published every time the example code tries to send to ThingSpeak and my thingspeak channel is not updated.

I have tried to use a webhook with a JSON as recommended in the Particle website, but even when I have done my best to format the JSON as it is in the bulk transfer documentation, the response is usually an error 400 or 401 (I am definitely using the correct api key).

Advice on how best to implement this feature for an electron, or an explanation of what the confusing response codes mean would be much appreciated.

July 28, 2017
7:29 pm
Avatar
Vinod

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

Have you considered modifying this example and seeing if this works from your device: 

https://www.mathworks.com/help/thingspeak/bulk-update-a-thingspeak-channel-using-particle-photon-board.html

I believe that your POST does not contain the right fields you will get a 400 or 401 response code.

August 14, 2018
6:33 am
Avatar
dariushbabri
New Member
Members
Forum Posts: 2
Member Since:
December 24, 2017
sp_UserOfflineSmall Offline

I have tried to use a webhook with a JSON as recommended in the Particle website, but even when I have done my best to format the JSON as it is in the bulk transfer documentation, the response is usually an error 400 or 401 (I am definitely using the correct api key).

طراحی سایت

August 14, 2018
5:10 pm
Avatar
cstapels
Moderator
Members


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

The formatting for a bulk update can be tricky. If you can, look over the documentation one more time and then if it still fails then you can try posting the format of your request here and we can try to help you debug it.
https://www.mathworks.com/help/thingspeak/bulkwritejsondata.html

As a side note I have often seen users try bulk write when a regular write will suffice, and the formatting is easier.
Would this fit your needs?
https://www.mathworks.com/help/thingspeak/writedata.html

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
33 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

JudestAboth, concettazx4, lyndarf60, caseybo16, iodiree, emiliacz4

Administrators: Hans: 387, lee: 457