rwaldron / particle-io

Particle/Spark Core/Photon IO Plugin for Johnny-Five
http://johnny-five.io
MIT License
173 stars 31 forks source link

Unable to connect to spark cloud 404 error #33

Closed kevinold closed 10 years ago

kevinold commented 10 years ago

Hi,

I wrote 2 scripts a few months ago that were working well with the spark cloud. Yesterday I fired them up again for NodebotsDay and ran into the following error:

Error: Unable to connect to spark cloud.: code: 404 { "ok": false, "error": "Variable not found" } at IncomingMessage. (/Users/kold/spark-io-scripts/node_modules/spark-io/lib/spark.js:246:19) at IncomingMessage.EventEmitter.emit (events.js:117:20) at _stream_readable.js:919:16 at process._tickCallback (node.js:419:13)

This is the code I'm running to generate this:

var Spark = require("spark-io");
var five = require("johnny-five"),
  board, photoresistor;

board = new Spark({
  token: process.env.SPARK_TOKEN,
  deviceId: process.env.SPARK_DEVICE_ID
});

Debugging a bit, it seems that an action of "endpoint" is no longer supported by the Spark Cloud, although I cannot find a deprecation:

https://github.com/rwaldron/spark-io/blob/master/lib/spark.js#L226

I am certain that my device is connecting and reporting a variable as I am able to use the spark-cli and monitor the variable in realtime and it reports correctly:

spark variable monitor photoresisto

What's odd is that I"m not able to find any mention of "endpoint" in https://github.com/spark/spark-cli or https://github.com/spark/spark-server (even though it's fairly new).

Are other's seeing this issue?

I'm running:

spark-io@0.5.1 spark-cli@0.3.95 johnny-five@0.7.56

kevinold commented 10 years ago

I've started a thread on this at the Spark Community and will report back with any findings (and hopefully a patch!)

http://community.spark.io/t/unable-to-connect-to-spark-cloud-404-error-from-spark-io-npm-module-trying-to-access-endpoint/6038

kevinold commented 10 years ago

Seems I don't have the latest version of voodoospark installed. Will try that and report back.

kevinold commented 10 years ago

Confirmed, updating voodoospark to the latest head (https://github.com/voodootikigod/voodoospark/commit/b2f3ec048a15b0480a60a57d9fb1895140b73a7a as of today) fixed the issue.

rwaldron commented 10 years ago

@kevinold excellent, thank you for following up.