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


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.

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

Ok! Itā€™s working :slight_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>

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

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

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.

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

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.

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!

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

Ahhhhh. Too much of a noobie. Thanks!

@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:

1 Like

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

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?

A factory reset will get you in listening mode:

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() {

}

Hi @skyvoyager,

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

Thanks,
David

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

@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! :slight_smile:

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

1 Like

I loled. :smile:

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

Thanks,
David