Hello,
I am using a P1 on a custom PCB, running 0.6.1 firmware, and seeing a cloud connection error very similar to norstar’s: (https://community.particle.io/t/photon-green-cyan-red/30761), except that the status LED blinks red once instead of orange before reverting back to cyan.
The P1 will not enter safe mode (no cloud connection), and I have tried “particle keys doctor DEVICE_ID” using the CLI:
[CODE]
D:\Dir2\tests>particle keys doctor DEVICE_ID
running dfu-util -l
Found DFU device 2b04:d008
running openssl genrsa -out DEVICE_ID_new.pem 1024
running openssl rsa -in DEVICE_ID_new.pem -pubout -out DEVICE_ID_new.pub.pem
running openssl rsa -in DEVICE_ID_new.pem -outform DER -out DEVICE_ID_new.der
New Key Created!
running dfu-util -l
Found DFU device 2b04:d008
running dfu-util -l
Found DFU device 2b04:d008
running dfu-util -d 2b04:d008 -a 1 -s 34:612 -U pre_DEVICE_ID_new.der
running openssl rsa -in pre_DEVICE_ID_new.der -inform DER -pubout -out pre_DEVICE_ID_new.pub.pem
Saved!
checking file DEVICE_ID_new.der
spawning dfu-util -d 2b04:d008 -a 1 -i 0 -s 34:leave -D DEVICE_ID_new.der
dfu-util 0.8
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
Opening DFU capable USB device…
ID 2b04:d008
Run-time device DFU version 011a
Claiming USB DFU Interface…
Setting Alternate Setting #1 …
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "DCT Flash "
Downloading to address = 0x00000022, size = 610
Download [ ] 0% 0 bytes
Download [ ] 0% 0 bytes
Download [=========================] 100% 610 bytes
Download done.
File downloaded successfully
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Saved!
attempting to add a new public key for device DEVICE_ID
submitting public key succeeded!
Okay! New keys in place, your device should restart.
[/CODE]
but the P1 still does not connect to the cloud (blinks cyan, then single red blink, then back to cyan).
Using the photon-clouddebug combined-p1.bin (https://github.com/rickkas7/photon-clouddebug, thanks to rickas7 for posting!), I see the output:
SSID=CON_NET security=wpa2 channel=8 rssi=-64
connecting to WiFi
0000007037:INFO : virtual void ManagedNetworkInterface::connect(bool) (282):ready():false,connecting():false,listening():false
connected to WiFi!
localIP=192.168.1.78
subnetMask=255.255.255.0
gatewayIP=192.168.1.254
dnsServerIP=0.0.0.0 (often 0.0.0.0)
dhcpServerIP=0.0.0.0 (often 0.0.0.0)
ping gateway=1
ping addr 8.8.8.8=1
device.spark.io=54.221.65.123
0000009002:DEBUG: virtual void TCPClient::stop() (192):_sock -1 closesocket
0000009002:DEBUG: virtual int TCPClient::connect(IPAddress, uint16_t, network_interface_t) (80):socket 536895952
0000009003:DEBUG: virtual int TCPClient::connect(IPAddress, uint16_t, network_interface_t) (98):_sock 536895952 connect
0000009092:DEBUG: virtual int TCPClient::connect(IPAddress, uint16_t, network_interface_t) (100):_sock 536895952 connected=1
connected to device server CoAP (testing connection only)
0000009092:DEBUG: virtual void TCPClient::stop() (192):_sock 536895952 closesocket
0000009093:DEBUG: sock_result_t socket_close(sock_handle_t) (939):socket closed 200061d0
connecting to cloud
0000009093:INFO : void establish_cloud_connection() (214):Cloud: connecting
0000009093:DEBUG: int spark_cloud_socket_connect() (834):sparkSocket Now =-1
0000009094:DEBUG: int spark_cloud_socket_connect() (853):HAL_FLASH_Read_ServerAddress() = type:255,domain:,ip: 0.0.0.0, port: 0
0000009126:INFO : int determine_connection_address(IPAddress&, uint16_t&, ServerAddress&, bool) (803):Resolved host device.spark.io to 52.90.147.116
0000009126:DEBUG: int spark_cloud_socket_connect() (864):socketed udp=0, sparkSocket=536895672, 1
0000009127:DEBUG: int spark_cloud_socket_connect() (874):connection attempt to 52.90.147.116:5683
0000009215:INFO : int spark_cloud_socket_connect() (891):connected to cloud 52.90.147.116:5683
0000009216:INFO : void establish_cloud_connection() (221):Cloud socket connected
0000009216:DEBUG: int Spark_Handshake(bool) (546):starting handshake announce=1
0000009308:DEBUG: int read_packet_and_dispose(tcp_packet_t&, void*, int, wiced_tcp_socket_t*, int) (792):Socket 0 receive bytes 40 of 40
0000009345:DEBUG: sock_result_t socket_send(sock_handle_t, const void*, socklen_t) (1002):Write 256 bytes to socket 536895672 result=0
0000009435:DEBUG: int read_packet_and_dispose(tcp_packet_t&, void*, int, wiced_tcp_socket_t*, int) (778):Socket 0 receive fail 19
0000009436:DEBUG: sock_result_t socket_receive(sock_handle_t, void*, socklen_t, system_tick_t) (824):socket_receive on 536895672 returned -19
0000009436:ERROR: int SparkProtocol::handshake() (108):Handshake: Unable to receive key -19
0000009437:WARN : void handle_cloud_connection(bool) (268):Cloud handshake failed, code=-19
0000009687:INFO : void cloud_disconnect(bool) (427):Cloud: disconnecting
0000009687:DEBUG: int spark_cloud_socket_disconnect() (912):Close Attempt
0000009687:DEBUG: sock_result_t socket_close(sock_handle_t) (939):socket closed 200060b8
0000009688:DEBUG: int spark_cloud_socket_disconnect() (914):socket_close()=success
0000009688:INFO : void cloud_disconnect(bool) (440):Cloud: disconnected
...
(output repeats)
What does “Cloud handshake failed, code=-19” mean?
Thank you.