CLI going crazy again


#1

Hi,

I seem to be having trouble with the particle-cli again.

I’ve had head banging sessions in the past but for the last year or so its been fine. I have it installed on my windows 7 laptop, and after my last problems I discovered that I had multiple over installations which appead to be the casse of my problems. So I uninstalled it both using the installer and the command line prompt. Installed it via the windows installer and everything seem stable.

Then a few weeks ago, I was using the command line to set up a core, which it had been succesfull at doing when I was prompted that a new version of the cli was available and to update it with npm -g particle-cli upgrade, for something very similar, OK I thought and gave it a go. Which was a mistake becasue then, when ever I ran it it would complain that it needed node 4.4. So I upgraded node to 8 (something) and then the CLI just started messing me around all over again. So I uninstalled the CLI, with the installer, only to find particle still present on the command line, did a command line uninstall and once I thought I had rid of it, reinstalled it with the installer. Everything seemed to go fine, I could run particle without a prompt to undate.

But now I am trying to set up a 1st gen core.

I can use particle setup, to set up the wifi, and strangely it is not asking for the security type, just the SSID and password. It can been seen on the console devices screen going on and offline. its breathing blue, it reacts to the rainbow command. I can not flash to it.

I have tried using particle doctor, but it fails after updating cc3000 firmware, applying update, then doctor didn’t complete sucesfully. this.promptDfd is not a function.

my current particle version is 1.28.2 and Node version 8,10.0

any suggestions?

Liam


#2

Despite the instructions to the contrary, you should never update the Windows Particle CLI installed with the Particle CLI installer using npm install -g particle-cli (or npm update). The Windows CLI will update itself when needed now.

To get out of this, uninstall the manual install again:

npm uninstall -g particle-cli

Then try reinstalling the CLI using the Windows CLI Installer again.


#3

Manually updating CLI previously installed via Windows Installer would be done via particle update-cli


#4

Hi,

Well I’ve managed to get my core functioning again, by running partical doctor at home on my desk top, another windows 7 machine.

This machine is running CLI version 1.27 and node 4.2.2. When I checked which version of cli it is running it did prompt me:-

C:\Users\Cyber>particle --version
particle-cli v1.27.0

! A newer version (1.28.2) of particle-cli is available.
! Upgrade now by running: npm install -g particle-cli

1.27.0

C:\Users\Cyber>particle setup

So clearly I’m not going to update my desktop, unitl I can figure out why my laptop got all hissy-fitty with trying to upgrade the cli. All I did was run the suggested command line npm install -g particle-cli, and then it got nasty about the node version I was using, demanding node 4.4. after finally upgrading node to version 8 it started going wrong, forcing me in to uninstalling the cli both via the program manager, and becasue it was still there, the command line uninstall.

Thinking I was all clear I reinstalled via the program manager and now its really not playing ball. When I do get the core online via the laptop, it keeps goiong on and offline every 20 second or so.

As I have managed to get it working using an older install of my desktop surely it must be something in the laptop installation. And clearly casued by something uninstalling both the command line way and the program manager way failed to resolve.

Still scratching my head but I’ll try again tomorrow at work.

Liam


#5

Do not follow the npm install instructions listed there, as they’re wrong and will lead to the problem you described. Instead, do:

particle update-cli

#6

Hi, Hopefully someone will pick up on this old thread, but I’ve just had some time to return to the problem.

OK, my main problem started when I got a message on my cli advising me to update it with using the :- npm install -g particle-cli command.

Well like a good chap I did and it turns out I was wrong and should have used ‘particle update-cli’

Will I have tried it, and I get a report back that there is nothing to update. But I am still having problems when I run the particle doctor command is get:-

Flash success!
Applying update…
Wait until the device stops blinking magenta and starts blinking yellow
The Doctor didn’t complete sucesfully. this.promptDfd is not a function
Please visit our community forums for help with this error:

And my device is stuck flashing yellowy/green,

I’m able to recover my device using particle doctor on an other machine so I’m not tearing my hair out but I would like to get my laptop working again.

Basically its a win 7 machine. I have tried uninstalling it and reinstalling it using the windows installer.

Using

npm ls

Shows there is no other npm packages installed

I get

C:\Users\Liam>particle --version
1.29.0

And attempts to repair the install using

C:\Users\Liam>particle update-cli
Updating CLI… no plugins to update.

So I am at a loss now. I thought I have learnt uninstalling and reinstalling particle CLI to a tee now, but its got me beat.

Any idea what is causing the

this.promptDfd is not a function

So I can try and find a solution? Any help appreciated.

Thanks

Liam


#7

I think you’re still picking up the wrong CLI install. Do a file search for particle. The correct installation location after using the Particle CLI installer is of the form:

C:\Users\username\AppData\Local\particle

If you’re finding one in a node directory, then the wrong one is being used.


#8

Hi,

I’ve had as best a look as I can, but as an Old Dos-fuddy-wuddy, I find the search functions on windows 7 a bit lumpy.

But at the command line I can only find one instance of particle.exe anywhere on my system.

And for good measure I searched for node as well, the result are below.

Microsoft Windows [Version 6.1.7601]
Copyright © 2009 Microsoft Corporation. All rights reserved.

C:\Users\Liam>where node
C:\Program Files\nodejs\node.exe

C:\Users\Liam>where particle
C:\Users\Liam\AppData\Local\particle\bin\particle.exe

I think I am going to have to uninstall the CLI yet again and uninstall node as well. Any thing else anyone can suggest I should do my best to uninstall as well?

Thanks

Liam


#9

hi,

OK I’ve tried, and tried, and tried again to fix a problem with a fault that occured with the CLI after following the instrustions when prompted by the CLI to upgrade to a newer version.

Apparently I was not supposed to use ‘npm install -g particle-cli’ but I did, becasue thats what the prompt TOLD me to do.

Anyway, I have tried uninstalling the CLI, both manually and using the installer I have also removed node js. To the best of my knowlage I have removed both node and the particle cli, and any referance I can find to them and reinstalled using the windows installer. I now have Version 1.29.0

However I still keep getting the SAME error when running the particle doctor, after Updateing the CC3000 firmware, continue when the device blinks yellow, Flash success, Applying the update, wait until device stops blinking magenta, and starts blinking Yellow. The doctor didn’t complete sucesfully. this.promptDfd is not a function.

and at that point the routine stops and drops back to the command line.

So the only thing I can think of for now is to force my laptop back to the state it was in before which means version 1.27.0. But everytime I run the installer it keeps trying to install the latest version which is the only varible I can not control.

Is there still a means of installing version 1.27.0?

Liam


#10

If the CLI is working except for the device doctor, another question to ask would be for what reason do you need to use the device doctor? It’s just a front-end in front of other CLI commands, so if you have a specific problem you need to solve - like bad keys - I can just give you the command to fix that instead.

It is possible to roll back the Particle CLI version, however this will have the side effect of rolling back the version of system firmware installed by particle update, so this isn’t usually a good solution.


#11

Hi,

As far as I can tell, most of the rest of the CLI functions are working. I’ve specifically tried List, Help and Monitor.

As far as I know I don’t have a problem with my keys. I can get the device working again by simply running particle doctor on my desk top PC which is running CLI 1.27.0. The problem is with the laptop, which is handy to have working as I am often setting up cores and photons at work, the London Hackspace, home or my mothers. All have different wi-fi routers and such like so if I have a problem with particle setup not working, a particle doctor gets it going again and away I go.

How would I know I have a problem with my keys?

Liam


#12

If you get fast blinking cyan followed by one or more red or orange blinks and you can never get to breathing cyan, you may have a keys problem. However, in this case you probably don’t.

You should just be able to restore default user firmware:

In DFU mode (blinking yellow):

particle flash --usb tinker

Then reconfigure Wi-Fi in blinking dark blue (listening mode):

particle serial wifi

instead of using particle setup and you should be able to get online.


#13

I want to reuse my Core and having the same problem that Liam, just did the flash tinker and with the wifi, it stays at flashing green.
I try first in a mac OS, and now in a PC (win10) and it is exactly the same :frowning:


#14

I want to reuse my Core and having the same problem that Liam, just did the flash tinker and with the wifi, it stays at flashing green.

To fix that on a Spark Core only (not a Photon, P1, Electron, etc.):

Put the Core in DFU mode by holding down both the RST and MODE buttons, releasing RST and continuing to hold down MODE until it blinks yellow and issue the commands below, in order.

After completing some of the steps the color may change to something else; if so note what color/pattern it is, then use the button combination to get back to blinking yellow. The core should be blinking yellow before each of the commands listed below is entered.

particle flash --usb --factory tinker
particle flash --usb deep_update_2014_06
particle flash --usb tinker
particle flash --usb cc3000
particle flash --usb tinker

Additional instructions are here:
https://docs.particle.io/support/troubleshooting/connection-help/core/#deep-update-for-the-core

Then put the Core in listening mode (blinking blue) if not already in that state by pressing and releasing RST. Then holding down MODE until it blinks dark blue. Then issue the command:

particle serial wifi

The normal sequence is white, blinking green, blinking cyan (light blue), fast blinking cyan, and finally breathing cyan. If you don’t get all the way to breathing cyan, copy and paste the full output from all the commands and submit them as a support ticket.