Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibilities with Spark CLI 1.2.0 #61

Open
nebrius opened this issue May 28, 2015 · 30 comments
Open

Incompatibilities with Spark CLI 1.2.0 #61

nebrius opened this issue May 28, 2015 · 30 comments

Comments

@nebrius
Copy link

nebrius commented May 28, 2015

When running Spark CLI 1.2.0, the only version that worked for us at JSConf, we had to flash voodoo spark with spark flash [id] voodoo, which is an older version of VoodooSpark. Our installation instructions are at https://github.com/opheliasdaisies/nodeboats-jsconf2015.

When we flash the latest version straight from GitHub, we would get a 404 error very quickly (less than a second after startup). This error came from the call that spark-io makes to get the device info (not from a voodoospark call).

This doesn't really make sense, but it's what we observed ¯_(ツ)_/¯.

This issue is mostly to track the problems we ran into that wasn't purely Spark Core based.

@nebrius
Copy link
Author

nebrius commented May 28, 2015

cc @Resseguie

@rwaldron
Copy link
Owner

Thanks for the report!

@blackjk3
Copy link

blackjk3 commented Jun 5, 2015

@bryan-m-hughes I also noticed this issue. I have a Photon which needs a newer version of the cli for "particle setup" to work. It looks like an issue with voodospark and the "endpoint" action results in a 404. I saw some people suggest that I flash with the lastest version of voodospark but that ended in a trail of errors. I would love to help out but i'm not really sure where to proceed from here.

@nebrius
Copy link
Author

nebrius commented Jun 5, 2015

@rwaldron do you have a photon yet? I don't, and without one in hand, I couldn't test and say what's going on.

On an unrelated note: here's why we had to use an old version of the Spark CLI: particle-iot/particle-cli@a5ae0db

@rwaldron
Copy link
Owner

rwaldron commented Jun 5, 2015

I do, but when I first got it there was no cli that worked for it yet and I didn't have time resources to try and figure it out out. I just tried flashing voodoospark to the photon that I have and it doesn't work:

$ particle flash 53ff71066667574841202467 firmware-latest.bin
Including:
    firmware-latest.bin
attempting to flash firmware to your device 53ff71066667574841202467
flash device said  {"ok":false,"errors":[{"error":"Timed out."}]}

And...

$ particle flash --usb firmware-latest.bin
Apparently I didn't find a DFU device? util said  dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to [email protected]

Deducing device DFU version from functional descriptor length
Found Runtime: [05ac:8286] ver=0148, devnum=6, cfg=1, intf=3, alt=0, name="UNKNOWN", serial="UNKNOWN"

Error writing firmware... no dfu device found.

I see Photon-E5AF in my wifi networks and the particle setup claims to have completed successfully. I have no idea what's going on.

On an unrelated note: here's why we had to use an old version of the Spark CLI: particle-iot/particle-cli@a5ae0db

I don't quite understand what that change means for Spark CLI...?

@nebrius
Copy link
Author

nebrius commented Jun 5, 2015

The cli command setup first queries to see what devices are available. They forgot to rename the device in this one single place when they renamed the company (it's technically the Particle Spark Core, not Particle Core), so the CLI basically said I have no idea what "Core" is. It isn't "Spark Core", "Photon", or "Electron", and just gave up immediately.

@nebrius
Copy link
Author

nebrius commented Jun 5, 2015

Oh, so the DFU thing...you have to hold down the reset and mode button, then release the reset button, and wait until it's flashing yellow (not flashing white) to put it in DFU mode (takes many seconds). Then that command should find it.

@rwaldron
Copy link
Owner

rwaldron commented Jun 5, 2015

so the CLI basically said I have no idea what "Core" is. It isn't "Spark Core", "Photon", or "Electron", and just gave up immediately.

Wow.

Oh, so the DFU thing...you have to hold down the reset and mode button, then release the reset button, and wait until it's flashing yellow (not flashing white) to put it in DFU mode (takes many seconds). Then that command should find it.

$ particle flash --usb firmware/voodoospark.cpp
Found DFU device 1d50:607f
Apparently I didn't find a DFU device? util said  dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to [email protected]

Deducing device DFU version from functional descriptor length
Found Runtime: [05ac:8286] ver=0148, devnum=6, cfg=1, intf=3, alt=0, name="UNKNOWN", serial="UNKNOWN"
Found DFU: [1d50:607f] ver=0200, devnum=13, cfg=1, intf=0, alt=1, name="@DCT Flash   /0x00000000/01*016Kg", serial="00000000010C"
Found DFU: [1d50:607f] ver=0200, devnum=13, cfg=1, intf=0, alt=0, name="@Internal Flash   /0x08000000/03*016Ka,01*016Kg,01*064Kg,07*128Kg", serial="00000000010C"

checking file  firmware/voodoospark.cpp
spawning dfu-util -d 1d50:607f -a 0 -i 0 -s 0x08005000:leave -D firmware/voodoospark.cpp
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to [email protected]

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Deducing device DFU version from functional descriptor length
Opening DFU capable USB device...
ID 1d50:607f
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x08005000, size = 20502
dfu-util: Last page at 0x0800a015 is not writeable
Error writing firmware...

I can't spend any more time on this tonight. It's 8 o'clock and I have to start dinner for my wife and I soon

@nebrius
Copy link
Author

nebrius commented Jun 5, 2015

You and your silly eastern time zone ;-) Enjoy dinner!

@blackjk3
Copy link

blackjk3 commented Jun 6, 2015

@rwaldron haha, yeah I had to make dinner for my wife and 3 year old as well. Anyway, originally I flashed it successfully with $ particle flash device_id voodoo which worked. (At least flashed magenta, then breathing cyan) But then when I tried running anything it's a 404 error. Until jsconf, I had always flashed code written in C/C++ so I apologize for not really knowing what i'm doing :)

@Resseguie
Copy link
Collaborator

@bryan-m-hughes with that "Core" -> "Spark Core" fix in on the CLI, the latest works with the Spark Core now?

But something still not right with Photon? Am I tracking correctly?

Hopefully I'll get my Photon soon so I can help test.

@nebrius
Copy link
Author

nebrius commented Jun 6, 2015

@Resseguie that is my understanding, but admittedly I have not tested since the cli fix I referenced was landed, so I can't say with any confidence.

@blackjk3
Copy link

blackjk3 commented Jun 6, 2015

@bryan-m-hughes confirmed! The core works with the cli fix referenced above.

However, the Photon throws this error right away.

★  node bot-start.js
Device(s) spark-io
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: Unable to connect to spark cloud.: code: 404
    at IncomingMessage.<anonymous> (/node-rolling-spider/node_modules/particle-io/node_modules/spark-io/lib/spark.js:282:19)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickDomainCallback (node.js:381:11)

@blackjk3
Copy link

Ok, I got it to work! The issue was voodoospark and the setup() method. It worked on the core but bombed on the photon. With this patch I got it to work on both. I tested 2 cores and 2 photons. voodootikigod/voodoospark#45

@luke3butler
Copy link

@blackjk3 and you loaded spark-io successfully?
If so, then I'll be trying it out.

@blackjk3
Copy link

@luke3butler yup. With the patch to voodoospark flashed on a core or photon spark-io works for me. Let me know if you have issues.

@Resseguie
Copy link
Collaborator

Unfortunately I'm still waiting to receive my early bird photon.

@ericterpstra
Copy link

I am still unable to get spark-io working on my Photon. I've flashed the latest voodoospark firmware (with @blackjk3 patch) and get the following error when attempting to run the "Hello World" code (to blink D7).

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: Unable to connect to spark cloud.: code: 401
    at IncomingMessage.<anonymous> (/Users/ericterpstra/Dev/hardware/nodebotsday/node_modules/spark-io/lib/spark.js:282:19)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)

@blackjk3
Copy link

@ericterpstra according to the docs 401 error code = "Unauthorized - Your access token is not valid." That is a good sign I think, since I was getting a 404 before. Can you verify that your access token is valid or refresh it from the particle IDE and try again?

@ericterpstra
Copy link

Yep, you are correct. My token expired. Generated a new one, and all is well. Thanks!

@blackjk3
Copy link

Yippie! Glad it works.

@slooker
Copy link

slooker commented Oct 6, 2015

I was getting the same problem (401) and I re-generated my token, but now I get this error:

$ node blinky.js 
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: connect ECONNREFUSED
    at exports._errnoException (util.js:746:11)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)

Running this as per the voodoospark page works fine:

curl https://api.particle.io/v1/devices/{DEVICE-ID}/endpoint?access_token={ACCESS-TOKEN}

@rwaldron
Copy link
Owner

rwaldron commented Oct 6, 2015

Are you using a photon or core?

@slooker
Copy link

slooker commented Oct 6, 2015

Core

@rwaldron
Copy link
Owner

rwaldron commented Oct 6, 2015

  • Do you have spark-cli or particle-cli installed?
  • Do you have the latest voodoospark installed?

@slooker
Copy link

slooker commented Oct 6, 2015

Particle-cli, and I updated to the latest voodoospark before posting here.

@rwaldron
Copy link
Owner

rwaldron commented Oct 6, 2015

Particle-cli, and I updated to the latest voodoospark before posting here.

Thanks, I need as much information as possible and I didn't see it mentioned. Please paste the exact code you're using here, but delete your token and device id.

@slooker
Copy link

slooker commented Oct 7, 2015

Now I can't even get it to get to the point where I enter in the network password. Regardless of whether I have it autodetect the password, it freezes here:

$ particle setup

I have detected a Core connected via USB.
? Would you like to continue with this one? Yes
? Should I scan for nearby Wi-Fi networks? Yes
? Select the Wi-Fi network with which you wish to connect your device: IronYard
? Should I try to auto-detect the wireless security type? No

@rwaldron
Copy link
Owner

rwaldron commented Oct 7, 2015

Now I can't even get it to get to the point where I enter in the network password

Did you file that with particle-cli?

@slooker
Copy link

slooker commented Oct 7, 2015

Not yet. I'm going to try it again when I get home (where I was having the original problem) to verify it's not a wifi issue at work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants