We have a Photon 2 that repeatedly drops the cloud connection. It is one of 4 devices and the other 3 have not had this problem - on our lab network or other networks. There are other cases of a similar problem in these forums, some related to DeviceOS version or router:
Brand new Photon 2 keeps disconnecting and reconnecting to cloud
P2 drops cloud connection and does not reconnect
Photon 2 wifi stability issues on 5.8.2
But none of these appear to be the same as our issue. We created this simple code to figure out what is going on. Using DeviceOS 6.3.5. Running it with WIFI using DHCP always connects to the cloud but drops within a minute. Running it with STATIC IP with DNS and gateway the same as DHCP assigned values never drops the cloud. (Switch between the two versions by commenting out one of the WiFi.setConfig calls.)
#include "Particle.h"
SYSTEM_MODE(SEMI_AUTOMATIC);
SYSTEM_THREAD(ENABLED);
STARTUP(WiFi.selectAntenna(ANT_EXTERNAL)); // selects the u.FL antenna
SerialLogHandler logHandler(LOG_LEVEL_ALL);
// setup() runs once, when the device is first turned on
void setup() {
WiFi.setConfig(NetworkInterfaceConfig()
.profile("BWW24G")
.source(NetworkInterfaceConfigSource::DHCP));
// WiFi.setConfig(NetworkInterfaceConfig()
// .profile("BWW24G")
// .source(NetworkInterfaceConfigSource::STATIC)
// .address({192,168,1,71}, {255,255,255,0})
// .gateway(SockAddr({192,168,1,1}))
// .dns(SockAddr({192,168,1,1})));
Particle.connect();
}
// loop() runs over and over again, as quickly as it can execute.
void loop() {
Particle.process();
String ssid = WiFi.SSID();
String ip = WiFi.localIP().toString();
String gateway = WiFi.gatewayIP().toString();
String dns = WiFi.dnsServerIP().toString();
if (Particle.connected()) {
Log.info("Cloud up:%s, IP:%s, GW:%s, DNS:%s", ssid.c_str(), ip.c_str(), gateway.c_str(), dns.c_str());
} else {
Log.info("Cloud down:%s, IP:%s, GW:%s, DNS:%s", ssid.c_str(), ip.c_str(), gateway.c_str(), dns.c_str());
}
delay(30000);
}
The logs for both are virtually identical up through the first couple send/receive CoAP messages. Here is the good, always stays connected STATIC IP version:
0000001724 [hal] INFO: WiFi on
0000001725 [ncp.rltk.client] TRACE: NCP power state changed: 2
0000001726 [net.rltkncp] TRACE: NCP event 3
0000001727 [net.rltkncp] TRACE: NCP power state changed: IF_POWER_STATE_UP
0000001729 [system.nm] TRACE: Interface 4 power state changed: UP
0000001731 [ncp.rltk.client] TRACE: NCP state changed: 1
0000001732 [net.rltkncp] TRACE: NCP event 1
0000005539 [ncp.rltk.client] TRACE: NCP connection state changed: 1
0000005541 [net.rltkncp] TRACE: NCP event 2
0000005542 [net.rltkncp] TRACE: State changed event: 1
0000005543 [ncp.rltk.client] INFO: Try to connect to ssid: BWW24G (74:ac:b9:47:25:d7)
0000010144 [ncp.rltk.client] TRACE: NCP connection state changed: 2
0000010145 [net.rltkncp] TRACE: NCP event 2
0000010146 [net.rltkncp] TRACE: State changed event: 2
0000010147 [net.ifapi] INFO: Netif wl3 link UP, profile=BWW24G
0000010153 [net.ifapi] TRACE: Netif wl3 ipv4 configuration changed
0000010155 [hal] INFO: DNS server list changed
0000010157 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0000010159 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0000010194 [system] INFO: Cloud: connecting
0000010203 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000010225 [system] WARN: Failed to load session data from persistent storage
0000010246 [system] INFO: Discarding session data
0000010259 [system.cm] TRACE: Using best network: WiFi
0000010290 [system] TRACE: Resolving 0a10aced202194944a055d54.v6.udp.particle.io#5684 cache=1 iface=4
0000010455 [system] TRACE: Address type: 3
0000010467 [system] TRACE: Cloud socket=0, family=2, type=2, protocol=17
0000010487 [system] INFO: Cloud socket=0, connecting to 3.222.143.118#5684 using if 4
0000010510 [system] INFO: Bound cloud socket to lwip if 4 ("wl3")
0000010528 [system] TRACE: Cloud socket=0, connected to 3.222.143.118#5684
0000010548 [system] TRACE: Updating cloud keepalive for AF_INET: 25000 -> 25000
0000010570 [system] TRACE: Applying new keepalive interval now
0000010587 [system] INFO: Cloud socket connected
0000010601 [system] INFO: Starting handshake: presense_announce=0
0000010619 [comm.protocol.handshake] INFO: Establish secure connection
0000010639 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=2
0000011996 [comm.protocol.handshake] INFO: Sending HELLO message
0000012013 [comm.coap] TRACE: Sending CoAP message
0000012028 [comm.coap] TRACE: CON POST /h size=39 token= id=1
0000012078 [comm.coap] TRACE: Received CoAP message
0000012092 [comm.coap] TRACE: ACK 0.00 size=4 token= id=1
0000012108 [comm.protocol.handshake] INFO: Handshake completed
0000012126 [comm.protocol.handshake] TRACE: Updating cached session parameters
0000012147 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000012166 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000012647 [comm.coap] TRACE: Sending CoAP message
0000012658 [comm.coap] TRACE: CON POST /d?\x01 size=198 token=b6 id=2
0000012680 [comm] INFO: Sending TIME request
0000012692 [comm.coap] TRACE: Sending CoAP message
0000012706 [comm.coap] TRACE: CON GET /t size=7 token=b7 id=3
0000012725 [system] INFO: Send spark/device/last_reset event
0000012742 [comm.coap] TRACE: Sending CoAP message
0000012756 [comm.coap] TRACE: CON POST /E/spark/device/last_reset size=42 token= id=4
0000012782 [comm.coap] TRACE: Sending CoAP message
0000012796 [comm.coap] TRACE: CON POST /E/particle/device/updates/enabled size=44 token= id=5
0000012823 [comm.coap] TRACE: Sending CoAP message
0000012838 [comm.coap] TRACE: CON POST /E/particle/device/updates/forced size=44 token= id=6
0000012865 [system] INFO: Sending application DESCRIBE
0000012880 [comm.coap] TRACE: Sending CoAP message
0000012895 [comm.coap] TRACE: CON POST /d?\x02 size=25 token=b8 id=7
0000012915 [system] INFO: Sending subscriptions
0000012928 [comm.protocol] INFO: Sending subscriptions
0000012944 [comm.coap] TRACE: Sending CoAP message
0000012958 [comm.coap] TRACE: CON GET /e/particle size=15 token= id=8
0000012978 [comm.coap] TRACE: Sending CoAP message
0000012992 [comm.coap] TRACE: CON GET /e/spark size=12 token= id=9
0000013012 [system] TRACE: Waiting until all handshake messages are processed by the protocol layer
0000013040 [comm.coap] TRACE: Received CoAP message
0000013055 [comm.coap] TRACE: ACK 0.00 size=5 token=b6 id=2
0000013072 [comm.protocol] TRACE: Updating system DESCRIBE checksum
0000013090 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000013586 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000013603 [comm.coap] TRACE: Received CoAP message
0000013618 [comm.coap] TRACE: ACK 2.05 size=10 token=b7 id=3
0000013634 [comm.protocol] INFO: Received TIME response: 1775674043
0000013653 [comm.coap] TRACE: Received CoAP message
0000013668 [comm.coap] TRACE: ACK 0.00 size=4 token= id=4
0000013685 [comm.coap] TRACE: Received CoAP message
0000013699 [comm.coap] TRACE: ACK 0.00 size=4 token= id=5
0000013715 [comm.coap] TRACE: Received CoAP message
0000013730 [comm.coap] TRACE: ACK 0.00 size=4 token= id=6
0000013747 [comm.coap] TRACE: Received CoAP message
0000013763 [comm.coap] TRACE: ACK 0.00 size=5 token=b8 id=7
0000013779 [comm.protocol] TRACE: Updating application DESCRIBE checksum
0000013799 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000013817 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000013835 [comm.coap] TRACE: Received CoAP message
0000013849 [comm.coap] TRACE: ACK 0.00 size=4 token= id=8
0000013867 [comm.coap] TRACE: Received CoAP message
0000013881 [comm.coap] TRACE: ACK 0.00 size=4 token= id=9
0000013896 [system] INFO: All handshake messages have been processed
0000013915 [comm.protocol] TRACE: Updating subscriptions checksum
0000013933 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000013951 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000013970 [comm.coap] TRACE: Received CoAP message
0000013984 [comm.coap] TRACE: CON POST /E/particle/device/updates/pending size=47 token=01 id=43739
0000014011 [comm.coap] TRACE: Sending CoAP message
0000014025 [comm.coap] TRACE: ACK 0.00 size=4 token= id=43739
0000014044 [system] INFO: Cloud connected
0000014055 [system.ledger] TRACE: Connected
0000014069 [comm] INFO: Forcing a cloud ping
0000014081 [comm.coap] TRACE: Sending CoAP message
0000014095 [comm.coap] TRACE: CON 0.00 size=4 token= id=10
0000014113 [comm.coap] TRACE: Received CoAP message
0000014127 [comm.coap] TRACE: CON GET /d?\x04 size=9 token=02 id=43740
0000014147 [comm.protocol] INFO: Received DESCRIBE request; flags: 0x04
0000014168 [comm.coap] TRACE: Sending CoAP message
0000014182 [comm.coap] TRACE: ACK 0.00 size=4 token= id=43740
0000014201 [comm.coap] TRACE: Sending CoAP message
0000014215 [comm.coap] TRACE: CON 2.05 size=187 token=02 id=11
0000014235 [comm.coap] TRACE: Received CoAP message
0000014249 [comm.coap] TRACE: ACK 0.00 size=4 token= id=10
0000014268 [comm.coap] TRACE: Received CoAP message
0000014283 [comm.coap] TRACE: ACK 0.00 size=4 token= id=11
0000031073 [app] INFO: Cloud up:BWW24G, IP:192.168.1.71, GW:192.168.1.1, DNS:192.168.1.1
0000039399 [comm.coap] TRACE: Sending CoAP message
0000039413 [comm.coap] TRACE: CON 0.00 size=4 token= id=12
0000039568 [comm.coap] TRACE: Received CoAP message
0000039582 [comm.coap] TRACE: ACK 0.00 size=4 token= id=12
0000061100 [app] INFO: Cloud up:BWW24G, IP:192.168.1.71, GW:192.168.1.1, DNS:192.168.1.1
0000064698 [comm.coap] TRACE: Sending CoAP message
0000064706 [comm.coap] TRACE: CON 0.00 size=4 token= id=13
0000064861 [comm.coap] TRACE: Received CoAP message
0000064875 [comm.coap] TRACE: ACK 0.00 size=4 token= id=13
0000089991 [comm.coap] TRACE: Sending CoAP message
0000090005 [comm.coap] TRACE: CON 0.00 size=4 token= id=14
0000090155 [comm.coap] TRACE: Received CoAP message
0000090169 [comm.coap] TRACE: ACK 0.00 size=4 token= id=14
0000091121 [app] INFO: Cloud up:BWW24G, IP:192.168.1.71, GW:192.168.1.1, DNS:192.168.1.1
0000115285 [comm.coap] TRACE: Sending CoAP message
0000115293 [comm.coap] TRACE: CON 0.00 size=4 token= id=15
0000115474 [comm.coap] TRACE: Received CoAP message
0000115489 [comm.coap] TRACE: ACK 0.00 size=4 token= id=15
0000121147 [app] INFO: Cloud up:BWW24G, IP:192.168.1.71, GW:192.168.1.1, DNS:192.168.1.1
0000140604 [comm.coap] TRACE: Sending CoAP message
0000140615 [comm.coap] TRACE: CON 0.00 size=4 token= id=16
0000140739 [comm.coap] TRACE: Received CoAP message
0000140747 [comm.coap] TRACE: ACK 0.00 size=4 token= id=16
0000151172 [app] INFO: Cloud up:BWW24G, IP:192.168.1.71, GW:192.168.1.1, DNS:192.168.1.1
And the bad, always drops DHCP version:
0000001736 [hal] INFO: WiFi on
0000001736 [ncp.rltk.client] TRACE: NCP power state changed: 2
0000001738 [net.rltkncp] TRACE: NCP event 3
0000001738 [net.rltkncp] TRACE: NCP power state changed: IF_POWER_STATE_UP
0000001740 [system.nm] TRACE: Interface 4 power state changed: UP
0000001742 [ncp.rltk.client] TRACE: NCP state changed: 1
0000001743 [net.rltkncp] TRACE: NCP event 1
0000005551 [ncp.rltk.client] TRACE: NCP connection state changed: 1
0000005552 [net.rltkncp] TRACE: NCP event 2
0000005553 [net.rltkncp] TRACE: State changed event: 1
0000005554 [ncp.rltk.client] INFO: Try to connect to ssid: BWW24G (74:ac:b9:47:25:d8)
0000010136 [ncp.rltk.client] TRACE: NCP connection state changed: 2
0000010137 [net.rltkncp] TRACE: NCP event 2
0000010138 [net.rltkncp] TRACE: State changed event: 2
0000010139 [net.ifapi] INFO: Netif wl3 link UP, profile=BWW24G
0000010149 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0000010246 [ncp.mgr] TRACE: Updated file: /sys/wifi_config.bin
0000010249 [hal] INFO: DNS server list changed
0000010295 [net.ifapi] TRACE: Netif wl3 ipv4 configuration changed
0000010297 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0000010441 [system] INFO: Cloud: connecting
0000010448 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000010470 [system] WARN: Failed to load session data from persistent storage
0000010491 [system] INFO: Discarding session data
0000010504 [system.cm] TRACE: Using best network: WiFi
0000010534 [system] TRACE: Resolving 0a10aced202194944a055d54.v6.udp.particle.io#5684 cache=1 iface=4
0000010738 [system] TRACE: Address type: 3
0000010743 [system] TRACE: Cloud socket=0, family=2, type=2, protocol=17
0000010763 [system] INFO: Cloud socket=0, connecting to 3.222.143.118#5684 using if 4
0000010786 [system] INFO: Bound cloud socket to lwip if 4 ("wl3")
0000010804 [system] TRACE: Cloud socket=0, connected to 3.222.143.118#5684
0000010824 [system] TRACE: Updating cloud keepalive for AF_INET: 25000 -> 25000
0000010845 [system] TRACE: Applying new keepalive interval now
0000010862 [system] INFO: Cloud socket connected
0000010876 [system] INFO: Starting handshake: presense_announce=0
0000010893 [comm.protocol.handshake] INFO: Establish secure connection
0000010913 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=2
0000012271 [comm.protocol.handshake] INFO: Sending HELLO message
0000012288 [comm.coap] TRACE: Sending CoAP message
0000012302 [comm.coap] TRACE: CON POST /h size=39 token= id=1
0000012351 [comm.coap] TRACE: Received CoAP message
0000012366 [comm.coap] TRACE: ACK 0.00 size=4 token= id=1
0000012381 [comm.protocol.handshake] INFO: Handshake completed
0000012398 [comm.protocol.handshake] TRACE: Updating cached session parameters
0000012419 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000012437 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000012919 [comm.coap] TRACE: Sending CoAP message
0000012933 [comm.coap] TRACE: CON POST /d?\x01 size=198 token=d0 id=2
0000012955 [comm] INFO: Sending TIME request
0000012968 [comm.coap] TRACE: Sending CoAP message
0000012982 [comm.coap] TRACE: CON GET /t size=7 token=d1 id=3
0000013000 [system] INFO: Send spark/device/last_reset event
0000013017 [comm.coap] TRACE: Sending CoAP message
0000013031 [comm.coap] TRACE: CON POST /E/spark/device/last_reset size=42 token= id=4
0000013056 [comm.coap] TRACE: Sending CoAP message
0000013070 [comm.coap] TRACE: CON POST /E/particle/device/updates/enabled size=44 token= id=5
0000013096 [comm.coap] TRACE: Sending CoAP message
0000013111 [comm.coap] TRACE: CON POST /E/particle/device/updates/forced size=44 token= id=6
0000013137 [system] INFO: Sending application DESCRIBE
0000013152 [comm.coap] TRACE: Sending CoAP message
0000013168 [comm.coap] TRACE: CON POST /d?\x02 size=25 token=d2 id=7
0000013187 [system] INFO: Sending subscriptions
0000013200 [comm.protocol] INFO: Sending subscriptions
0000013216 [comm.coap] TRACE: Sending CoAP message
0000013229 [comm.coap] TRACE: CON GET /e/particle size=15 token= id=8
0000013249 [comm.coap] TRACE: Sending CoAP message
0000013264 [comm.coap] TRACE: CON GET /e/spark size=12 token= id=9
0000013283 [system] TRACE: Waiting until all handshake messages are processed by the protocol layer
0000013311 [comm.coap] TRACE: Received CoAP message
0000013325 [comm.coap] TRACE: ACK 0.00 size=5 token=d0 id=2
0000013341 [comm.protocol] TRACE: Updating system DESCRIBE checksum
0000013359 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000013856 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000013874 [comm.coap] TRACE: Received CoAP message
0000013888 [comm.coap] TRACE: ACK 2.05 size=10 token=d1 id=3
0000013905 [comm.protocol] INFO: Received TIME response: 1775674404
0000013918 [comm.coap] TRACE: Received CoAP message
0000013932 [comm.coap] TRACE: ACK 0.00 size=4 token= id=4
0000013948 [comm.coap] TRACE: Received CoAP message
0000013962 [comm.coap] TRACE: ACK 0.00 size=4 token= id=5
0000013980 [comm.coap] TRACE: Received CoAP message
0000013994 [comm.coap] TRACE: ACK 0.00 size=4 token= id=6
0000014010 [comm.coap] TRACE: Received CoAP message
0000014025 [comm.coap] TRACE: ACK 0.00 size=5 token=d2 id=7
0000014042 [comm.protocol] TRACE: Updating application DESCRIBE checksum
0000014061 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000014079 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000014098 [comm.coap] TRACE: Received CoAP message
0000014112 [comm.coap] TRACE: ACK 0.00 size=4 token= id=8
0000014128 [comm.coap] TRACE: Received CoAP message
0000014142 [comm.coap] TRACE: ACK 0.00 size=4 token= id=9
0000014158 [system] INFO: All handshake messages have been processed
0000014176 [comm.protocol] TRACE: Updating subscriptions checksum
0000014195 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000014212 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000014231 [comm.coap] TRACE: Received CoAP message
0000014245 [comm.coap] TRACE: CON POST /E/particle/device/updates/pending size=47 token=01 id=31917
0000014272 [comm.coap] TRACE: Sending CoAP message
0000014286 [comm.coap] TRACE: ACK 0.00 size=4 token= id=31917
0000014304 [system] INFO: Cloud connected
0000014316 [system.ledger] TRACE: Connected
0000014328 [comm] INFO: Forcing a cloud ping
0000014340 [comm.coap] TRACE: Sending CoAP message
0000014354 [comm.coap] TRACE: CON 0.00 size=4 token= id=10
0000014373 [comm.coap] TRACE: Received CoAP message
0000014388 [comm.coap] TRACE: CON GET /d?\x04 size=9 token=02 id=31918
0000014408 [comm.protocol] INFO: Received DESCRIBE request; flags: 0x04
0000014427 [comm.coap] TRACE: Sending CoAP message
0000014441 [comm.coap] TRACE: ACK 0.00 size=4 token= id=31918
0000014460 [comm.coap] TRACE: Sending CoAP message
0000014474 [comm.coap] TRACE: CON 2.05 size=187 token=02 id=11
0000014494 [comm.coap] TRACE: Received CoAP message
0000014508 [comm.coap] TRACE: ACK 0.00 size=4 token= id=10
0000014526 [comm.coap] TRACE: Received CoAP message
0000014540 [comm.coap] TRACE: ACK 0.00 size=4 token= id=11
0000031083 [app] INFO: Cloud up:BWW24G, IP:192.168.1.187, GW:192.168.1.1, DNS:192.168.1.1
0000039657 [comm.coap] TRACE: Sending CoAP message
0000039669 [comm.coap] TRACE: CON 0.00 size=4 token= id=12
0000044185 [comm.coap] TRACE: Retransmitting CoAP message; ID: 12; attempt 1 of 3
0000044207 [comm.coap] TRACE: Sending CoAP message
0000044221 [comm.coap] TRACE: CON 0.00 size=4 token= id=12
0000054137 [comm.coap] TRACE: Retransmitting CoAP message; ID: 12; attempt 2 of 3
0000054160 [comm.coap] TRACE: Sending CoAP message
0000054173 [comm.coap] TRACE: CON 0.00 size=4 token= id=12
0000061109 [app] INFO: Cloud up:BWW24G, IP:192.168.1.187, GW:192.168.1.1, DNS:192.168.1.1
0000069703 [comm.protocol] ERROR: Event loop error 1
0000069715 [system] WARN: Communication loop error, closing cloud socket
0000069734 [system] INFO: Cloud: disconnecting
0000069748 [system.ledger] TRACE: Disconnected
0000069761 [system] INFO: Cloud: disconnected
0000069773 [system] INFO: Cloud: connecting
0000069787 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000069808 [system] INFO: Loaded cloud server address and port from session data
0000069830 [system.cm] TRACE: Using best network: WiFi
0000069844 [system] TRACE: Address type: 1
0000069856 [system] TRACE: Cloud socket=0, family=2, type=2, protocol=17
0000069875 [system] INFO: Cloud socket=0, connecting to 3.222.143.118#5684 using if 4
0000069899 [system] INFO: Bound cloud socket to lwip if 4 ("wl3")
0000069916 [system] TRACE: Cloud socket=0, connected to 3.222.143.118#5684
0000069936 [system] TRACE: Updating cloud keepalive for AF_INET: 25000 -> 25000
0000069957 [system] TRACE: Applying new keepalive interval now
0000069974 [system] INFO: Cloud socket connected
0000069983 [system] INFO: Starting handshake: presense_announce=0
0000070001 [comm.protocol.handshake] INFO: Establish secure connection
0000070021 [comm.dtls] INFO: session has 0 uses
0000070036 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=0
0000070055 [comm.dtls] INFO: out_ctr 0,1,0,0,0,0,0,17, next_coap_id=c
0000070073 [comm.dtls] INFO: restored session from persisted session data. next_msg_id=12
0000070097 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 2
0000070600 [comm.protocol.handshake] INFO: Skipping HELLO message
0000070614 [comm.coap] TRACE: Sending CoAP message
0000070627 [comm.coap] TRACE: CON 0.00 size=4 token= id=13
0000070645 [system] INFO: cloud connected from existing session.
0000070662 [comm.coap] TRACE: Sending CoAP message
0000070676 [comm.coap] TRACE: CON POST /E/particle/device/updates/enabled size=44 token= id=14
0000070703 [comm.coap] TRACE: Sending CoAP message
0000070717 [comm.coap] TRACE: CON POST /E/particle/device/updates/forced size=44 token= id=15
0000070744 [system] INFO: Sending application DESCRIBE
0000070758 [comm.protocol] INFO: Checksum has not changed; not sending application DESCRIBE
0000070783 [system] INFO: Sending subscriptions
0000070795 [comm.protocol] INFO: Checksum has not changed; not sending subscriptions
0000070818 [system] TRACE: Waiting until all handshake messages are processed by the protocol layer
0000074744 [comm.coap] TRACE: Retransmitting CoAP message; ID: 14; attempt 1 of 3
0000074766 [comm.coap] TRACE: Sending CoAP message
0000074780 [comm.coap] TRACE: CON POST /E/particle/device/updates/enabled size=44 token= id=14
0000074907 [comm.coap] TRACE: Retransmitting CoAP message; ID: 13; attempt 1 of 3
0000074928 [comm.coap] TRACE: Sending CoAP message
0000074942 [comm.coap] TRACE: CON 0.00 size=4 token= id=13
0000076059 [comm.coap] TRACE: Retransmitting CoAP message; ID: 15; attempt 1 of 3
0000076075 [comm.coap] TRACE: Sending CoAP message
0000076088 [comm.coap] TRACE: CON POST /E/particle/device/updates/forced size=44 token= id=15
0000084413 [comm.coap] TRACE: Retransmitting CoAP message; ID: 14; attempt 2 of 3
0000084435 [comm.coap] TRACE: Sending CoAP message
0000084450 [comm.coap] TRACE: CON POST /E/particle/device/updates/enabled size=44 token= id=14
0000084575 [comm.coap] TRACE: Retransmitting CoAP message; ID: 13; attempt 2 of 3
0000084595 [comm.coap] TRACE: Sending CoAP message
0000084609 [comm.coap] TRACE: CON 0.00 size=4 token= id=13
0000088026 [comm.coap] TRACE: Retransmitting CoAP message; ID: 15; attempt 2 of 3
0000088046 [comm.coap] TRACE: Sending CoAP message
0000088059 [comm.coap] TRACE: CON POST /E/particle/device/updates/forced size=44 token= id=15
0000091135 [app] INFO: Cloud down:BWW24G, IP:192.168.1.187, GW:192.168.1.1, DNS:192.168.1.1
0000095685 [comm.coap] TRACE: Sending CoAP message
0000095699 [comm.coap] TRACE: CON 0.00 size=4 token= id=16
0000099915 [comm.coap] TRACE: Retransmitting CoAP message; ID: 16; attempt 1 of 3
0000099937 [comm.coap] TRACE: Sending CoAP message
0000099951 [comm.coap] TRACE: CON 0.00 size=4 token= id=16
0000102168 [comm.coap] TRACE: Retransmitting CoAP message; ID: 13; attempt 3 of 3
0000102189 [comm.coap] TRACE: Sending CoAP message
0000102203 [comm.coap] TRACE: CON 0.00 size=4 token= id=13
0000104120 [comm.coap] TRACE: Retransmitting CoAP message; ID: 14; attempt 3 of 3
0000104142 [comm.coap] TRACE: Sending CoAP message
0000104156 [comm.coap] TRACE: CON POST /E/particle/device/updates/enabled size=44 token= id=14
0000111282 [comm.coap] TRACE: Retransmitting CoAP message; ID: 15; attempt 3 of 3
0000111304 [comm.coap] TRACE: Sending CoAP message
0000111318 [comm.coap] TRACE: CON POST /E/particle/device/updates/forced size=44 token= id=15
0000111543 [comm.coap] TRACE: Retransmitting CoAP message; ID: 16; attempt 2 of 3
0000111565 [comm.coap] TRACE: Sending CoAP message
0000111579 [comm.coap] TRACE: CON 0.00 size=4 token= id=16
0000121156 [app] INFO: Cloud down:BWW24G, IP:192.168.1.187, GW:192.168.1.1, DNS:192.168.1.1
0000125707 [comm.protocol] ERROR: Event loop error 1
0000125817 [comm.protocol] ERROR: Event loop error 1
0000125842 [system] TRACE: Resolving 0a10aced202194944a055d54.v6.udp.particle.io#5684 cache=0 iface=0
0000129263 [system] ERROR: Failed to determine server address
0000129280 [system] WARN: Internet test failed: -170 DNS
0000129295 [system] WARN: Cloud handshake failed, code=10
0000129560 [system] INFO: Cloud: disconnecting
0000129572 [system] INFO: Cloud: disconnected
0000129585 [system] INFO: Cloud: connecting
0000129598 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000129620 [system] INFO: Loaded cloud server address and port from session data
0000129641 [system.cm] TRACE: Using best network: WiFi
0000129656 [system] TRACE: Address type: 1
0000129668 [system] TRACE: Cloud socket=0, family=2, type=2, protocol=17
0000129687 [system] INFO: Cloud socket=0, connecting to 3.222.143.118#5684 using if 4
0000129710 [system] INFO: Bound cloud socket to lwip if 4 ("wl3")
0000129727 [system] TRACE: Cloud socket=0, connected to 3.222.143.118#5684
0000129748 [system] TRACE: Updating cloud keepalive for AF_INET: 25000 -> 25000
0000129769 [system] TRACE: Applying new keepalive interval now
0000129786 [system] INFO: Cloud socket connected
0000129799 [system] INFO: Starting handshake: presense_announce=0
0000129817 [comm.protocol.handshake] INFO: Establish secure connection
0000129836 [comm.dtls] INFO: session has 1 uses
0000129852 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=0
0000129871 [comm.dtls] INFO: out_ctr 0,1,0,0,0,0,0,32, next_coap_id=10
0000129889 [comm.dtls] INFO: restored session from persisted session data. next_msg_id=16
0000129913 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 2
0000130417 [comm.protocol.handshake] INFO: Skipping HELLO message
0000130427 [comm.coap] TRACE: Sending CoAP message
0000130441 [comm.coap] TRACE: CON 0.00 size=4 token= id=17
0000130458 [system] INFO: cloud connected from existing session.
0000130475 [comm.coap] TRACE: Sending CoAP message
0000130489 [comm.coap] TRACE: CON POST /E/particle/device/updates/enabled size=44 token= id=18
0000130516 [comm.coap] TRACE: Sending CoAP message
0000130530 [comm.coap] TRACE: CON POST /E/particle/device/updates/forced size=44 token= id=19
0000130556 [system] INFO: Sending application DESCRIBE
0000130571 [comm.protocol] INFO: Checksum has not changed; not sending application DESCRIBE
0000130595 [system] INFO: Sending subscriptions
0000130608 [comm.protocol] INFO: Checksum has not changed; not sending subscriptions
0000130631 [system] TRACE: Waiting until all handshake messages are processed by the protocol layer
0000135856 [comm.coap] TRACE: Retransmitting CoAP message; ID: 19; attempt 1 of 3
0000135877 [comm.coap] TRACE: Sending CoAP message
0000135891 [comm.coap] TRACE: CON POST /E/particle/device/updates/forced size=44 token= id=19
0000136017 [comm.coap] TRACE: Retransmitting CoAP message; ID: 18; attempt 1 of 3
0000136040 [comm.coap] TRACE: Sending CoAP message
0000136053 [comm.coap] TRACE: CON POST /E/particle/device/updates/enabled size=44 token= id=18
0000136179 [comm.coap] TRACE: Retransmitting CoAP message; ID: 17; attempt 1 of 3
0000136197 [comm.coap] TRACE: Sending CoAP message
0000136210 [comm.coap] TRACE: CON 0.00 size=4 token= id=17
0000145627 [comm.coap] TRACE: Retransmitting CoAP message; ID: 18; attempt 2 of 3
0000145640 [comm.coap] TRACE: Sending CoAP message
0000145653 [comm.coap] TRACE: CON POST /E/particle/device/updates/enabled size=44 token= id=18
0000146679 [comm.coap] TRACE: Retransmitting CoAP message; ID: 17; attempt 2 of 3
0000146702 [comm.coap] TRACE: Sending CoAP message
0000146715 [comm.coap] TRACE: CON 0.00 size=4 token= id=17
0000147632 [comm.coap] TRACE: Retransmitting CoAP message; ID: 19; attempt 2 of 3
0000147649 [comm.coap] TRACE: Sending CoAP message
0000147663 [comm.coap] TRACE: CON POST /E/particle/device/updates/forced size=44 token= id=19
0000151182 [app] INFO: Cloud down:BWW24G, IP:192.168.1.187, GW:192.168.1.1, DNS:192.168.1.1
0000155489 [comm.coap] TRACE: Sending CoAP message
0000155503 [comm.coap] TRACE: CON 0.00 size=4 token= id=20
0000160319 [comm.coap] TRACE: Retransmitting CoAP message; ID: 20; attempt 1 of 3
0000160341 [comm.coap] TRACE: Sending CoAP message
0000160355 [comm.coap] TRACE: CON 0.00 size=4 token= id=20
0000162672 [comm.coap] TRACE: Retransmitting CoAP message; ID: 18; attempt 3 of 3
0000162686 [comm.coap] TRACE: Sending CoAP message
0000162700 [comm.coap] TRACE: CON POST /E/particle/device/updates/enabled size=44 token= id=18
0000166325 [comm.coap] TRACE: Retransmitting CoAP message; ID: 19; attempt 3 of 3
0000166347 [comm.coap] TRACE: Sending CoAP message
0000166362 [comm.coap] TRACE: CON POST /E/particle/device/updates/forced size=44 token= id=19
0000166787 [comm.coap] TRACE: Retransmitting CoAP message; ID: 17; attempt 3 of 3
0000166804 [comm.coap] TRACE: Sending CoAP message
0000166818 [comm.coap] TRACE: CON 0.00 size=4 token= id=17
0000170734 [comm.coap] TRACE: Retransmitting CoAP message; ID: 20; attempt 2 of 3
0000170757 [comm.coap] TRACE: Sending CoAP message
0000170772 [comm.coap] TRACE: CON 0.00 size=4 token= id=20
0000181228 [app] INFO: Cloud down:BWW24G, IP:192.168.1.187, GW:192.168.1.1, DNS:192.168.1.1
0000185588 [comm.protocol] ERROR: Event loop error 1
0000185700 [comm.protocol] ERROR: Event loop error 1
0000185728 [system] TRACE: Resolving 0a10aced202194944a055d54.v6.udp.particle.io#5684 cache=0 iface=0
0000189263 [system] ERROR: Failed to determine server address
0000189275 [system] WARN: Internet test failed: -170 DNS
0000189291 [system] WARN: Cloud handshake failed, code=10
0000189556 [system] INFO: Cloud: disconnecting
0000189568 [system] INFO: Cloud: disconnected
0000189581 [system] INFO: Cloud: connecting
0000189594 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000189615 [system] INFO: Loaded cloud server address and port from session data
0000189637 [system.cm] TRACE: Using best network: WiFi
The DHCP version eventually degrades into DNS errors and then continually loops through that trying to get to the cloud. I don’t think the WIFI ever drops.
We tried using a phone as a WIFI hotspot with DHCP version and the cloud does not drop - although nearly every first CoAP message times out and has the be resent. The device then subsequently receives both CoAP messages. This doesn’t seem to be an issue other than wasting CPU / network / power on a timeout that appears to be too short.
So this problem on this one device seems to be specific to WIFI on a router using DHCP. The Photon 2 has been a thorn in our side ever since we moved from Argon - as we never had any issues at all with 100s of Argons. We also have an unresolved BLE issue with Photon 2 (one of the three devices that does not have this WIFI problem) that is just as quirky as this WIFI problem → “BLE on Photon 2 not accessible with Europe iPhone”.