Troubleshoot: Particle-CLI on windows [Q&A]


#1
https://community.spark.io/t/tutorial-spark-cli-on-windows-26-june-2014/3112/47

Great tutorial @kennethlimcp! It was getting to be 2am and I just had to sleep vs. continuing to to troubleshoot smile

FYI: one more issue I'm working on now... my MS VC++ 2010 Express trial has expired and I'm getting this error when installing Win32 OpenSSL:

Over time, I have installed quite a few of these trials to get crap to compile:

...what a pain that this requires such a dependency.

Hopefully I can uninstall all of these, clean out my registry and install 2010 Express again.


Tutorial: Particle-cli on Windows [07 Jun 2015]
[Webhooks] Super Simple Motion Activated Push Notifications
Tutorial: Particle-cli on Windows [07 Jun 2015]
Tutorial: Particle-cli on Windows [07 Jun 2015]
#2

Uninstall the programs and Try installing OpenSSL followed by V C+++ Express


#3

Ok! It's working smile Still had some warnings, but everything compiled fine.

One thing I wish the CLI didn't do, was every time I log in it's changing my access_token. So that basically just broke all of my static web apps. I suppose I should login with my web apps, but it's such a pain to type that all in on my phone every time I just want to toggle something. @Dave can we make the CLI not create a new access_token each time we login?

Also here's some Serial failures...

[HERE I RESET THE CORE AND PUT INTO LISTENING MODE]

c:\Spark\CLI>spark serial list
Found 1 core(s) connected via serial:
1:      COM7

c:\Spark\CLI>spark serial monitor COM7
Opening serial monitor for com port: "COM7"

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Opening \\.\COM7: Access denied

[HERE I RESET THE CORE AND PUT BACK INTO LISTENING MODE]

c:\Spark\CLI>spark serial monitor COM7
Opening serial monitor for com port: "COM7"

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Opening \\.\COM7: Access denied

c:\Spark\CLI>spark serial list
Found 1 core(s) connected via serial:
1:      COM7


c:\Spark\CLI>spark serial identify

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Opening \\.\COM7: Access denied

c:\Spark\CLI>spark serial wifi
SSID: xxxxxxxxxxxx
Pass: xxxxxxxxxxxx
Security 0=unsecured, 1=WEP, 2=WPA, 3=WPA2: 3
Attempting to configure wifi on COM7

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Opening \\.\COM7: Access denied

c:\Spark\CLI>

#4

Thank you guys for testing this out, and thank you @kennethlimcp for the installing on Windows tutorial!

@BDub I wonder if the serial failures are an admin command prompt vs. regular command prompt issue? I'll have to go back and double-check that.

The access_token is meant to be CLI specific, but it sounds like that's not working, I'll open a Github issue for this.

Thanks guys!
David


#5

So, I could remove the hard dependency on OpenSSL and make it more of a soft dependency. This might confuse people seeking out the tool to do key fixes, but it would certainly make things easier if you don't need openssl.

Thoughts?
David


#6

I like the idea of it being a soft dependency, only because I've never needed to do anything with keys yet, and I would imagine a very small percentage of users will. That way most people get the really great super easy "npm install -g spark-cli" to run like magic and get you to doing cool stuff with your Core quicker. Python can still be a hurdle, but at least it's not that bad.


#7

Not sure how Openssl becoming a soft dependency will help, in the case of Windows.

The multiple dependencies are due to usara and serialport packages and installing openssl is a one click thing


#8

That's what I mean, the "ursa" module is the "hard dependency" on building OpenSSL, so it'd be one less thing to install initially. We are also starting to talk about distributing node-serialport binaries to make the install easier.


#9

I must be missing something. I was able to execute "spark cloud login" and "spark cloud list" successfully. But...when I try "spark serial list" with the Spark plugged into my USB port, it says it found 0 cores connected via serial.

Am I supposed to do something else to connect to USB?

Thanks!


#10

They'll only show up if the Core is in listening mode, or if you've put Serial.begin() in your own code.


#11

Ahhhhh. Too much of a noobie. Thanks!


#12

@skyvoyager There's 2 ways to get connected on USB.

But 1st, are you on Windows? There's some issue with the Serial right now.

1) Your program must be using Serial which will open a COM port and with that, the CLI can be used to monitor the output

2) Your core is in the listening mode(flashing blue) and you can enter wifi-credentials using CLI

Other than the 2 listed above, you probably won't see any core listed as no Serial ports are actually opened to the PC.

@Dave is definitely a better person to answer this since i wasn't able to test this as of yet blush


#13

Yup! Flashing Blue for serial, or Serial.begin in your apps, and flashing yellow for Dfu (local flash, and keys)

Also if you're running on Windows, don't forget to install the Windows driver: http://docs.spark.io/#/connect/connecting-your-core-connect-over-usb

Thanks!
David


#14

When I typically plug a USB device into the computer, it asks me for a driver. This isn't the case for the Spark. I see nothing with an issue in the device manager, either. How would I get the Windows computer to "want" to recognize it?


#15

A factory reset will get you in listening mode:

http://docs.spark.io/#/connect/appendix-factory-reset

Once it starts blinking blue, the core will be detected.

But i'm not sure if you want to give it a try smile

Alternatively, simple open a new app and put 'Serial.begin(9600);" in "void setup()" and download to the core!

void setup() {
Serial.begin(9600);
}

void loop() {

}


#16

Hi @skyvoyager,

Hmm. You should see something for the Core in your device manager, maybe try a different usb cable?

Thanks,
David


#17

Woo, hoo! I finally got to the point where I got an error! (for some reason I'm happy and sad at the same time!).

C:\Users\skyvoyager>spark serial monitor COM3
Opening serial monitor for com port: "COM3"

envents.js:72
throw er; // Unhandled 'error' event
^
Error: Opening \.\COM3: Access denied


#18

@skyvoyager what did you to let it detect?

Good work!

@dave is working hard on the cli and you can be a great help to test stuff! smile


#19

@kennethlimcp The tried and true method of Microsoft. A reboot. smile


#20

I loled. smile

Make sure you run the command prompt as an administrator, sorry!

Thanks,
David