Brewskey / spark-server

An API compatible open source server for interacting with devices speaking the spark-protocol
https://www.particle.io/
GNU Affero General Public License v3.0
54 stars 27 forks source link

Function call returns error when firmware function returns zero #290

Closed rkast closed 5 years ago

rkast commented 5 years ago

Some of my device firmware return a zero in a cloud function call. These calls would return from the API with a 'Failed to load resource: the server responded with a status of 400 (Bad Request)', despite having the device respond correctly to the cloud function call.

jlkalberer commented 5 years ago

So the device returns 0 and the server throws an exception?

rkast commented 5 years ago

Correct

jlkalberer commented 5 years ago

Ok, so if your device returns a non-zero it works fine? I'm just trying to zero in on the bug.

rkast commented 5 years ago

Yep, I could get you more details on it tomorrow if you need.

On Wed, Feb 6, 2019, 4:40 PM John Kalberer <notifications@github.com wrote:

Ok, so if your device returns a non-zero it works fine? I'm just trying to zero in on the bug.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Brewskey/spark-server/issues/290#issuecomment-461198617, or mute the thread https://github.com/notifications/unsubscribe-auth/AIx93qKRkyGSgsi9f64EUYIomzkIfo5bks5vK0vfgaJpZM4al1Bp .

jlkalberer commented 5 years ago

@rkast - there should be an exception in the 400 response. Can you get that for me?

You should be able to call the API like this - https://docs.particle.io/reference/device-cloud/api/#call-a-function You can see the access_token when the server starts up.

jlkalberer commented 5 years ago

@rkast - did you resolve this?