CLI going crazy again


#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.


#15

Here is the reply I get when I try the command

particle update-cli
Update the CLI by running npm install -g particle-cli

looking at the old comments in this thread, that reply is hilarious :joy::joy::joy:

I assume this statement is still true for windows:

But what about Linux. What is the plan with Linux as on some of my machines I get very bad installation of the particle-cli?


#16

What does particle --version report?
Is this a Windows installation?


#17

I believe the windows version falsely indicates to update by running npm. It shoud, instead, indicate to run particle update-cli.


#18

1.37.0. and it is a windows install since

where particle gives

…AppData\Local\particle\bin\particle.exe

@peekay123 when I did run particle update-cli it told me to run npm, hence the laughter . It looks like my windows install is up-to-date it just doesn’t seem to know it.


#19

@rocksetta, I wonder if you have left-overs from an older npm install on your system. When I run particle update-cli is does the update or indicates that there no no packages to update.


#20

Very likely. My poor computer has had so many things installed and re-installed. Glad to hear it works for others.

Linux and cloud installs are another story. I am wondering if I should make another thread.

I have particle version 1.36.3 installed but version 1.37.0 is having troubles.

anyone else seeing this.
?

I just checked with https://github.com/particle-iot/particle-cli/releases and particle-cli version 1.37.0 was released yesterday (Jan 10th, 2019). So this is what I am seeing.

Install fine on cloud9 Can use nvm (node version manager) to switch node versions and everything seems fine from version 6 to version 10

The windows version installs fine on windows (not sure if it is the same release).

Does not install on my 32 bit Ubuntu version 16.04 LTS running node v8.15.0

Does not install on my 64 bit Ubuntu running v18.04 LTS running node v9.11.2

Note: version 1.36.3 installs fine

@jvanier

Not really sure if the deprecated packages are a big deal but they should probably be updated.

This image is from cloud9

.

.

.

P.S. (Advanced question:) I got this javascript code working in nodejs.

var particle = require("particle-cli");
particle.help;   //outputs the help information to the node console.

Anyone know how to access the particle-cli functions using nodejs? Would be kind of cool to make my own version of particle-cli


#21

Have you tried?:

sudo npm uninstall -g --unsafe-perm particle-cli
sudo npm install -g --unsafe-perm particle-cli

CLI on Macbook so I can flash using USB
#22

Cool looking commands, but they did not work. Actually looked like version 1.37.0 got installed but then I checked the version and it was 1.36.3.

Interesting but if is very difficult to uninstall version 1.36.3 even using
sudo npm uninstall -g particle-cli --save

I think I am just going to reformat my Ubuntu 18.04 machine. It is only a few weeks fresh anyway. Maybe this time I will update it immediately after installing the image.


#23

So this is kind of funny. I installed a fresh ubuntu 18.04. updated it. installed node, npm, curl, git and tried to install particle-cli.

Particle-cli version 1.37.0 would not install, not at all not even version 1.36.3. Forgot to try @nrobinson2000 trick above but tried anyway to install po-util

po-util got particle-cli installed. Weird but nice. Po-util fully working so my issues on this situation is over.