Failure to complete setup

For the past 15 hours I have been having trouble communicating with the Particle cloud when trying to setup an existing Photon and then trying a brand new one.

This happens with both the iOS and CLI methods.

FWIW Both devices are seen and connect to my 'phone.

On the existing device via my Apple phone, it sometimes gets as far the last stage and hangs complaining about WiFi credentials not being correct. This could be due to the last sketch successfully run playing with the IP settings and going into safe mode not clearing them.

As it happens, I had a new unused Photon and this failed to get past the ‘changing network’ stage.

The CLI has hung for about 15 minutes at the detecting devices stage immediately after logging in.

Is there a fix for this?

Rgds,

Neil.

What does ‘particle serial list’ say?
Have you tried ‘particle serial wifi’?
Have you tried updating your firmware using ‘particle update’?
Could you try flashing a known good app (Blink an LED/Tinker) to it over USB?

Microsoft Windows [Version 6.3.9600]
© 2013 Microsoft Corporation. All rights reserved.

C:\Users\Arduino>particle serial list
Error loading command C:\Users\Arduino\AppData\Roaming\npm\node_modules\particle
-cli\commands\SerialCommand.js Error: Cannot find module 'node-pre-gyp’
particle: Unknown command: “serial”

C:\Users\Arduino>particle serial wifi
Error loading command C:\Users\Arduino\AppData\Roaming\npm\node_modules\particle
-cli\commands\SerialCommand.js Error: Cannot find module 'node-pre-gyp’
particle: Unknown command: “serial”

Microsoft Windows [Version 6.3.9600]
© 2013 Microsoft Corporation. All rights reserved.

C:\Users\Arduino>particle serial wifi
Error loading command C:\Users\Arduino\AppData\Roaming\npm\node_modules\particle
-cli\commands\SerialCommand.js Error: Cannot find module 'node-pre-gyp’
particle: Unknown command: “serial”

C:\Users\Arduino>particle update
Error loading command C:\Users\Arduino\AppData\Roaming\npm\node_modules\particle
-cli\commands\SerialCommand.js Error: Cannot find module ‘node-pre-gyp’
!!! There was an error trying execute DFU utilities.

!!! For help with installing DFU Utilities, please see:
https://docs.particle.io/guide/tools-and-features/cli/#advanced-install

!!! You may also find our community forums helpful:
https://community.particle.io/

Error code: 1

C:\Users\Arduino>particle update
Error loading command C:\Users\Arduino\AppData\Roaming\npm\node_modules\particle
-cli\commands\SerialCommand.js Error: Cannot find module ‘node-pre-gyp’
!!! There was an error trying execute DFU utilities.

!!! For help with installing DFU Utilities, please see:
https://docs.particle.io/guide/tools-and-features/cli/#advanced-install

!!! You may also find our community forums helpful:
https://community.particle.io/

Error code: 1

C:\Users\Arduino>

FWIW, The device is already running the 0.4.9 firmware update.
I have tried resetting the router (twice) with no effective improvement, though contact can sometimes be very briefly made (or appears to be that way).

The problem seems to be between me and the Particle server as I don’t appear to have any trouble accessing other web sites and the iOS app keeps reporting connection problems.

Rgds,

Neil.

Just out of interest, another device that is running tried and tested firmware is doing perfectly well under the current setup without making any calls to the Particle cloud.

The device that is causing all this problem is now blinking cyan, indicating problems connecting to the particle cloud.

Rgds,

Neil.

Does placing them in Safe mode resolve the issue then?

I can’t get the ‘older’ device to stay in safe mode. With the magenta flash releasing the SETUP button it goes white then flashes cyan.

The new device can enter safe mode.

Rgds

Neil.

Hmm…If you use the latest firmware v0.4.9, the performance should be stable and decent.

I have got the new device back - somehow the iOS app worked and by using tinker was able to rename the device (it previously got claimed with no name) and have successfully ran an uploaded sketch.

Now to sort out the older device. :smiley:

Rgds,

Neil.

Further to the above, I have checked the router and found that the malfunctioning device has connected with the code set IP

For completeness, I am posting the effective part of the sketch here:

...
...
Particle.process();
...
...
...
IPAddress deviceIP(192, 168, 0, 214);
IPAddress netMask(255, 255, 255, 0);
IPAddress gateway(0, 0, 0, 0);
IPAddress dns(0, 0, 0, 0);
WiFi.setStaticIP(deviceIP, netMask, gateway, dns);
WiFi.useStaticIP();

Looking at the RGB light, it seems that the device is cycling through the set APs as green occasionally replaces flashing cyan. I’m fairly confident that the credentials are set correctly as otherwise the IP wouldn’t show in the attached devices list.

I’m suspecting that the inability to link the device to my account is blocking communication with Particle’s cloud as the iOS app keels over at the verification stage with a message indicating that the credentials are likely to be invalid!

Grr!!

Rgds,

Neil.

How does the device know which gateway to connect to then?

Good point, which is definitely the underlying problem which neither safe mode nor network reset can clear.

It is how to recover from this, probably via the DFU serial by-pass, that is causing me headaches as the CLI route is currently ‘obstructed’. :smile:

Rgds,

Neil.

Another thing you might want to consider is that setStaticIP() and useStaticIP() are persistent settings that don’t need to (and possibly shouldn’t) be set each time anew.
At one point (don’t know if this is already changed in the current version) the settings only got into effect after a reboot.

Understood - it is a multi-use routine to pre-set the required static WiFi parameters before installing the application firmware.

Rgds