Device setup problem

I have three photons working great on my network and one that I can not get setup. When it powers up it just blinks green forever. I have tried to set it up with multiple devices and they don't work. when I try and set it up from CLI it goes through all the steps like it is going to setup then returns: (any ideas?)

Requesting public key from the device...
Setting the magical cloud claim code...
Telling the Photon to apply your Wi-Fi configuration...
C:\Users\Brock\AppData\Roaming\npm\node_modules\particle-cli\node_modules\node-rsa\src\NodeRSA.js:283
throw Error('Error during encryption. Original error: ' + e);
^

Error: Error during encryption. Original error: Error: error:0306E06C:bignum routines:BN_mod_inverse:no inverse
at Error (native)
at NodeRSA.module.exports.NodeRSA.$$encryptKey (C:\Users\Brock\AppData\Roaming\npm\node_modules\particle-cli\node_modules\node-rsa\src\NodeRSA.js:283:19)
at NodeRSA.module.exports.NodeRSA.encrypt (C:\Users\Brock\AppData\Roaming\npm\node_modules\particle-cli\node_modules\node-rsa\src\NodeRSA.js:238:21)
at TcpSoftAP.configure (C:\Users\Brock\AppData\Roaming\npm\node_modules\particle-cli\node_modules\softap-setup\lib\SoftAP.js:176:33)
at configure (C:\Users\Brock\AppData\Roaming\npm\node_modules\particle-cli\commands\WirelessCommand\index.js:790:7)
at response (C:\Users\Brock\AppData\Roaming\npm\node_modules\particle-cli\node_modules\softap-setup\lib\SoftAP.js:140:3)
at Socket.socketClose (C:\Users\Brock\AppData\Roaming\npm\node_modules\particle-cli\node_modules\softap-setup\lib\TcpSoftAP.js:86:4)
at Socket.g (events.js:292:16)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)

C:\Windows\System32>

Hello,

Let me ping someone that might be able to help, @tylercpeacock are you able to assist?

Kyle

Well I’ve never seen this error before. However, the encryption error makes it sound like there may be a problem with the keys on the device.

Try generating new keys by running:

particle keys server
particle keys doctor YOUR_DEVICE_ID

Then try the setup process again and see if that goes through.

@hammillbr, can you run npm install -g particle-cli again and see if there are errors?

Thanks for the help I reinstalled particle and ran setup again. This time it made it all the way through setup but when it reboots it flashes green for a while and then fast blinks cyan.

I tried to run key doctor but got this error:

C:\Windows\System32>particle keys doctor 3c0020000e47343432313031
Found DFU device 2b04:d006
Found DFU device 2b04:d006
New Key Created!
I couldn’t find the file: 3c0020000e47343432313031_rsa_new.der
Make sure your device is in DFU mode (blinking yellow), and that your computer is online.
Error - I couldn’t find the file: 3c0020000e47343432313031_rsa_new.der

C:\Windows\System32>

Can you cd to the Desktop before running the command again?

1 Like

I went to the desktop and the commands worked from there but it didn’t solve the problem after wards. I installed the photon cloud debugging program on the photon and this was the output.

It alternates between flashing green and cyan, back and forth

C:\Users\Brock\Desktop>particle serial monitor
Opening serial monitor for com port: "COM13"
Serial monitor opened successfully:
ping addr 8.8.8.8=0
failed to get device.spark.io from DNS, try 1
failed to get device.spark.io from DNS, try 2
failed to get device.spark.io from DNS, try 3
device.spark.io=0.0.0.0
connecting to cloud
0000045039:INFO : void establish_cloud_connection() (214):Cloud: connecting
0000045039:DEBUG: int spark_cloud_socket_connect() (834):sparkSocket Now =-1
0000045040:DEBUG: int spark_cloud_socket_connect() (853):HAL_FLASH_Read_ServerAddress() = type:1,domain:device.spark.io,ip: 105.118.101.100, port: 65535
0000060044:ERROR: int determine_connection_address(IPAddress&, uint16_t&, ServerAddress&, bool) (800):Cloud: unable to resolve IP for device.spark.io
0000060044:DEBUG: int spark_cloud_socket_connect() (864):socketed udp=0, sparkSocket=536895952, 1
0000060044:DEBUG: int spark_cloud_socket_connect() (874):connection attempt to 54.208.229.4:5683
0000065045:ERROR: int spark_cloud_socket_connect() (889):connection failed to 54.208.229.4:5683, code=-2
0000065045:DEBUG: int spark_cloud_socket_disconnect() (912):Close Attempt
0000065045:DEBUG: sock_result_t socket_close(sock_handle_t) (939):socket closed 200061d0
0000065046:DEBUG: int spark_cloud_socket_disconnect() (914):socket_close()=success
0000065046:WARN : void establish_cloud_connection() (225):Cloud socket connection failed: -2
0000065046:DEBUG: int Internet_Test() (661):Internet test socket
0000065046:DEBUG: int Internet_Test() (663):socketed testSocket=536895952
0000065047:DEBUG: int Internet_Test() (685):Connect Attempt
0000070047:DEBUG: int Internet_Test() (687):socket_connect()=fail
0000070047:DEBUG: int Internet_Test() (696):Close
0000070047:DEBUG: sock_result_t socket_close(sock_handle_t) (939):socket closed 200061d0
0000070047:ERROR: void handle_cfod() (181):Resetting CC3000 due to 2 failed connect attempts
0000070048:WARN : void manage_network_connection() (100):!! Resetting WLAN due to SPARK_WLAN_RESET
0000070051:INFO : void manage_network_connection() (116):Network Connect: !SPARK_WLAN_STARTED
0000070051:INFO : virtual void ManagedNetworkInterface::connect(bool) (282):ready():false,connecting():false,listening():false
0000084979:INFO : void establish_cloud_connection() (214):Cloud: connecting
0000084979:DEBUG: int spark_cloud_socket_connect() (834):sparkSocket Now =-1
0000084980:DEBUG: int spark_cloud_socket_connect() (853):HAL_FLASH_Read_ServerAddress() = type:1,domain:device.spark.io,ip: 105.118.101.100, port: 65535
0000099984:ERROR: int determine_connection_address(IPAddress&, uint16_t&, ServerAddress&, bool) (800):Cloud: unable to resolve IP for device.spark.io
0000099984:DEBUG: int spark_cloud_socket_connect() (864):socketed udp=0, sparkSocket=536895952, 1
0000099985:DEBUG: int spark_cloud_socket_connect() (874):connection attempt to 54.208.229.4:5683
Caught Interrupt.  Cleaning up.
Serial connection closed.
Terminate batch job (Y/N)? y

C:\Users\Brock\Desktop>

Place the device in DFU mode and run a particle keys server

nope same issue

I really have no clue if your other two devices are connected properly now.

Might need to see if a replacement can be made.

Thanks. I have tried everything I can think of and can’t make progress.