Some issues (dns, wifi not disconnecting) with reliable ethernet connection with wifi fall back

hello

we have a board with p2 and ethernet and are trying to get reliable ethernet connection with wifi as fall back. it sort of works but we see some strange things:

-1- attached to ethernet we get no dns address - Ethernet.dnsServerIP() = 0.0.0.0 - (attched to wifi and the same dhcp server we do get an dns address). it will not connect to the cloud unless the board was connected to the cloud before (e.g. attached to wifi) -- is this a bug?

-ad 1- if we do not get a dns server address: can we use Ethernet.setConfig() to set a DNS (e.g. 8.8.8.8)? how?

-2- when it has been attached to wifi and we turn of the access-point falling back to ethernet works (we use: WiFi.disconnect() and Ethernet.connect()). but even though it attaches to ethernet and connects to the cloud i see in the logging attempts to attach to wifi. turning the access point back on we get a situation where Ethernet.ready() and WiFi.ready() are both true even though we did a WiFi.disconnect()

thanks
frank

note: our ethernet is on alternate pins
note 2: device os 5.4.1

i used wireshark to checkout what goes on. in this case ethernet does connect (mac sharing internet):

  • the dns address is given to the p2 in the dhcp communication but p2 reports dns = 0.0.0.0
  • in this case p2 seems to have cached the particle cloud address
  • see a lot of "Malformed Packet"s

capture where it does not want to connect to the cloud (directly connected to my local network):

here is the logging (fails to connect to the cloud):

0000000810 [system] INFO: Device 0a10aced202194944a004b38 started
0000000811 [system] TRACE: Last reset reason: 40 (data: 0x00)
0000000818 [hal] TRACE: Using external antenna
0000001431 [system.nm] INFO: State changed: NONE -> DISABLED
0000001432 [system.nm] TRACE: Interface 4 power state: 1
0000001437 [system.nm] TRACE: Interface 3 power state: 2
0000001464 [comm] INFO: channel inited
0000001511 [ncp.mgr] TRACE: Updated file: /sys/wifi_config.bin
0000001687 [system.nm] TRACE: Updated file: /sys/network.dat
0000001820 [app] INFO: Disconnecting WiFi, connecting Ethernet
0000001821 [app] INFO: Ethernet MAC: 94 94 4a 00 4b 3b
0000001828 [app] INFO: timout set for 60000
0000001829 [app] INFO: State: eth connecting (previous: unknown)
0000001924 [system.nm] INFO: State changed: DISABLED -> IFACE_DOWN
0000001926 [system.nm] INFO: State changed: IFACE_DOWN -> IFACE_REQUEST_UP
0000001933 [net.ifapi] INFO: Netif en2 state UP
0000002098 [net.en] TRACE: Closed MACRAW socket
0000002129 [net.en] TRACE: Opened MACRAW socket, err = 0
0000002130 [system.nm] INFO: State changed: IFACE_REQUEST_UP -> IFACE_UP
0000002142 [net.en] INFO: Link up
0000002143 [net.ifapi] INFO: Netif en2 link UP, profile=NONE
0000002150 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0000002873 [app] INFO: State: eth connecting: Ethernet: not ready, WiFi: not ready, Cloud: not connected
0000003839 [app] INFO: State: eth connecting: Ethernet: not ready, WiFi: not ready, Cloud: not connected
0000003952 [hal] INFO: DNS server list changed
0000003953 [hal] INFO: DNS server list changed
0000003958 [net.ifapi] TRACE: Netif en2 ipv4 configuration changed
0000003963 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0000004052 [app] INFO: Ethernet network connected
0000004109 [app] INFO: Ethernet IP address: 192.168.1.137
0000004114 [app] INFO: Ethernet gateways IP address: 192.168.1.1
0000004120 [app] INFO: Ethernet DNS IP address: 0.0.0.0
0000004138 [app] INFO: timout set for 60000
0000004182 [app] INFO: State: eth cloud connecting (previous: eth conn56 [system] INFO: Cloud: connecting
0000004205 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000004242 [system] WARN: Failed to load session data from persistent storage
0000004286 [system] INFO: Discarding session data
0000004533 [system] TRACE: Resolving 0a10aced202194944a004b38.v5.udp.particle.io#5684
0000004921 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000005848 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000005900 [system] TRACE: Address type: 3
0000005953 [system] TRACE: Cloud socket=0, family=2, type=2, protocol=17
0000005954 [system] INFO: Cloud socket=0, connecting to 18.213.90.196#5684
0000005961 [system] TRACE: Cloud socket=0, connected 0.196#5684
0000005967 [system] TRACE: Updating cloud keepalive for AF_INET: 25000 -> 25000
0000005975 [system] TRACE: Applying new keepalive interval now
0000006015 [system] INFO: Cloud socket connected
0000006072 [system] INFO: Starting handshake: presense_announce=0
0000006073 [comm.protocol.handshake] INFO: Establish secure connection
0000006079 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=2
0000006923 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000007875 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000008834 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000009888 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000010870 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000011891 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000012876 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000013860 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000014863 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000015833 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000016859 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000017835 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000018821 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000019879 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000020845 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000021192 [comm.protocol.handshake] INFO: Sending HELLO message
0000021193 [comm.coap] TRACE: Sending CoAP message
0000021229 [comm.coap] TRACE: CON POST /h size=39 token= id=1
0000021912 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000022843 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000023853 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000024883 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000025914 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000026118 [comm.coap] TRACE: Retransmitting CoAP message; ID: 1; attempt 1 of 3
0000026136 [comm.coap] TRACE: Sending CoAP message
0000026191 [comm.coap] TRACE: CON POST /h size=39 token= id=1
0000026867 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000027907 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000028838 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000029865 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000030900 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000031847 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000032839 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000033911 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000034840 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000035862 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000036904 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000037383 [comm.coap] TRACE: Retransmitting CoAP message; ID: 1; attempt 2 of 3
0000037384 [comm.coap] TRACE: Sending CoAP message
0000037389 [comm.coap] TRACE: CON POST /h size=39 token= id=1
0000037855 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000038048 [comm.coap] TRACE: Received CoAP message
0000038079 [comm.coap] TRACE: ACK 0.00  size=4 token= id=1
0000038081 [comm.protocol.handshake] INFO: Handshake completed
0000038086 [comm.protocol.handshake] TRACE: Updating cached session parameters
0000038167 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000038168 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000038834 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000039008 [comm.coap] TRACE: Sending CoAP message
0000039009 [comm.coap] TRACE: CON POST /d?\x01 size=505 token=cc id=2
0000039046 [system] INFO: Send spark/device/last_reset event
0000039048 [comm.coap] TRACE: Sending CoAP message
0000039052 [comm.coap] TRACE: CON POST /E/spark/device/last_reset size=42 token= id=3
0000039061 [comm.coap] TRACE: Sending CoAP  [comm.coap] TRACE: CON POST /E/particle/device/updates/enabled size=44 token= id=4
0000039105 [comm.coap] TRACE: Sending CoAP message
0000039129 [comm.coap] TRACE: CON POST /E/particle/device/updates/forced size=44 token= id=5
0000039221 [comm] INFO: Sending TIME request
0000039222 [comm.coap] TRACE: Sending CoAP message
0000039232 [comm.coap] TRACE: CON GET /t size=7 token=cd id=6
0000039321 [system] INFO: Sending application DESCRIBE
0000039322 [comm.coap] TRACE: Sending CoAP message
0000039325 [comm.coap] TRACE: CON POST /d?\x02 size=25 token=ce id=7
0000039425 [system] INFO: Sending subscriptions
0000039425 [comm.protocol] INFO: Sending subscriptions
0000039436 [comm.coap] TRACE: Sending CoAP message
0000039506 [comm.coap] TRACE: CON GET /e/particle?u size=17 token= id=8
0000039508 [comm.coap] TRACE: Sending CoAP message
0000039513 [comm.coap] TRACE: CON GET /e/spark?u size=14 token= id=9
0000039593 [system] TRACE: Waiting until all handshake messages are processed by the protocol layer
0000039675 [comm.coap] TRACE: Received CoAP message
0000039675 [comm.coap] TRACE: ACK 0.00  size=5 token=cc id=2
0000039680 [comm.protocol] TRACE: Updating system DESCRIBE checksum
0000039712 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000039891 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000040892 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000041870 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000042894 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000043873 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000044153 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000044870 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000045115 [comm.coap] TRACE: Received CoAP message
0000045116 [comm.coap] TRACE: CON GET /d?\x04 size=9 token=01 id=7230
0000045123 [comm.coap] TRACE: Retransmitting CoAP message; ID: 9; attempt 1 of 3
0000045128 [comm.coap] TRACE: Sending CoAP message
0000045134 [comm.coap] TRACE: CON GET /e/spark?u size=14 token= id=9
0000045147 [comm.coap] TRACE: Retransmitting CoAP message; ID: 8; attempt 1 of 3
0000045170 [comm.coap] TRACE: Sending CoAP message
0000045186 [comm.coap] TRACE: CON GET /e/particle?u size=17 token= id=8
0000045209 [comm.coap] TRACE: Retransmitting CoAP message; ID: 7; attempt 1 of 3
0000045232 [comm.coap] TRACE: Sending CoAP message
0000045269 [comm.coap] TRACE: CON POST /d?\x02 size=25 token=ce id=7
0000045277 [comm.coap] TRACE: Retransm5300 [comm.coap] TRACE: Sending CoAP message
0000045301 [comm.coap] TRACE: CON GET /t size=7 token=cd id=6
0000045374 [comm.coap] TRACE: Retransmitting CoAP message; ID: 5; attempt 1 of 3
0000045392 [comm.coap] TRACE: Sending CoAP message
0000045443 [comm.coap] TRACE: CON POST /E/particle/device/updates/forced size=44 token= id=5
0000045475 [comm.coap] TRACE: Retransmitting CoAP message; ID: 4; attempt 1 of 3
0000045538 [comm.coap] TRACE: Sending CoAP message
0000045556 [comm.coap] TRACE: CON POST /E/particle/device/updates/enabled size=44 token= id=4
0000045638 [comm.coap] TRACE: Retransmitting CoAP message; ID: 3; attempt 1 of 3
0000045639 [comm.coap] TRACE: Sending CoAP message
0000045675 [comm.coap] TRACE: CON POST /E/spark/device/last_reset size=42 token= id=3
0000045721 [comm.protocol] INFO: Received DESCRIBE request; flags: 0x04
0000045757 [comm.coap] TRACE: Sending CoAP message
0000045802 [comm.coap] TRACE: ACK 0.00  size=4 token= id=7230
0000045803 [comm.coap] TRACE: Sending CoAP message
0000045808 [comm.coap] TRACE: CON 2.05  size=151 token=01 id=10
0000045852 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000045891 [comm.coap] TRACE: Received CoAP message
0000045938 [comm.coap] TRACE: ACK 0.00  size=4 token= id=9
0000046150 [comm.coap] TRACE: Received CoAP GET /d?\x02 size=9 token=02 id=7231
0000046153 [comm.protocol] INFO: Received DESCRIBE request; flags: 0x02
0000046233 [comm.coap] TRACE: Sending CoAP message
0000046234 [comm.coap] TRACE: ACK 0.00  size=4 token= id=7231
0000046310 [comm.coap] TRACE: Sending CoAP message
0000046333 [comm.coap] TRACE: CON 2.05  size=21 token=02 id=11
0000046592 [comm.coap] TRACE: Received CoAP message
0000046593 [comm.coap] TRACE: CON GET /d?\x04 size=9 token=01 id=7230
0000046620 [comm.coap] TRACE: Sending CoAP message
0000046673 [comm.coap] TRACE: ACK 0.00  size=4 token= id=7230
0000046845 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000046899 [comm.coap] TRACE: Received CoAP message
0000046947 [comm.coap] TRACE: ACK 0.00  size=4 token= id=9
0000047007 [comm.coap] TRACE: Received CoAP message
0000047030 [comm.coap] TRACE: ACK 0.00  size=4 token= id=8
0000047046 [comm.protocol] TRACE: Updating subscriptions checksum
0000047103 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000047106 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000047360 [comm.coap] TRACE: Received CoAP message
0000047360 [comm.coap] TRACE: ACK 0.00  size=5 token=ce id=7
0000047376 [comm.protocol] TRACE: Updating application DESCRIBE checksum
0000047421 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000047451 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000047680 [comm.coap] TRACE: Received CoAP message
0000047681 [comm.coap] TRACE: CON GET /d?\x02 size=9 token=02 id=7231
0000047687 [comm.coap] TRACE: Sending CoAP message
0000047698 [comm.coap] TRACE: ACK 0.00  size=4 token= id=7231
0000047884 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000048896 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000049922 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000050725 [comm.coap] TRACE: Retransmitting CoAP message; ID: 10; attempt 1 of 3
0000050761 [comm.coap] TRACE: Sending CoAP message
0000050767 [comm.coap] TRACE: CON 2.05  size=151 token=01 id=10
0000050915 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000051864 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000052164 [comm.coap] TRACE: Retransmitting CoAP message; ID: 11; attempt 1 of 3
0000052191 [comm.coap] TRACE: Sending CoAP message
0000052195 [comm.coap] TRACE: CON 2.05  size=21 token=02 id=11
0000052921 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000053868 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000054878 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000055687 [comm.coap] TRACE: Retransmitting CoAP message; ID: 3; attempt 2 of 3
0000055728 [comm.coap] TRACE: Sending CoAP message
0000055730 [comm.coap] TRACE: CON POST /E/spark/device/last_reset size=42 token= id=3
0000055853 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000056160 [comm.coap] TRACE: Retransmitting CoAP message; ID: 4; attempt 2 of 3
0000056170 [comm.coap] TRACE: Sending CoAP message
0000056176 [comm.coap] TRACE: CON POST /E/particle/device/updates/enabled size=44 token= id=4
0000056436 [comm.coap] TRACE: Retransmitting CoAP message; ID: 6; attempt 2 of 3
0000056446 [comm.coap] TRACE: Sending CoAP message
0000056451 [comm.coap] TRACE: CON GET /t size=7 token=cd id=6
0000056655 [comm.coap] TRACE: Retransmitting CoAP message; ID: 5; attempt 2 of 3
0000056721 [comm.coap] TRACE: Sending CoAP message
0000056722 [comm.coap] TRACE: CON POST /E/particle/device/updates/forced size=44 token= id=5
0000056905 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000057834 [app] INFO: State: eth cloud connecting:: not ready, Cloud: not connected
0000058879 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000059832 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000060836 [comm.coap] TRACE: Retransmitting CoAP message; ID: 10; attempt 2 of 3
0000060867 [comm.coap] TRACE: Sending CoAP message
0000060874 [comm.coap] TRACE: CON 2.05  size=151 token=01 id=10
0000060894 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000061877 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000062833 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000063405 [comm.coap] TRACE: Retransmitting CoAP message; ID] TRACE: Sending CoAP message
0000063414 [comm.coap] TRACE: CON 2.05  size=21 token=02 id=11
0000063875 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000064135 [comm.coap] TRACE: Received CoAP message
0000064149 [comm.coap] TRACE: ACK 0.00  size=4 token= id=11
0000064153 [comm.protocol] TRACE: Updating application DESCRIBE checksum
0000064212 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000064235 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000064221 [app] INFO: timed out
0000064241 [app] INFO: Ethernet cloud connecting takes too long
0000064324 [app] INFO: No WiFi credentials: sticking with ethernet
0000064325 [app] INFO: State: eth connect (previous: eth cloud connecting)
0000064432 [app] INFO: Disconnecting WiFi, connecting Ethernet
0000064446 [app] INFO: Ethernet MAC: 94 94 4a 00 4b 3b
0000064450 [app] INFO: timout set for 60000
0000064465 [app] INFO: State: eth connecting (previous: eth connect)
0000064603 [app] INFO: Ethernet network connected
0000064614 [app] INFO: Ethernet IP address: 192.168.1.137
0000064621 [app] INFO: Ethernet gateways IP address: 192.168.1.1
0000064623 [app] INFO: Ethernet DNS IP address: 0.0.0.0
0000064631 [app] INFO: timout set for 60000
0000064632 [app] INFO: State: eth cloud connecting (previous: eth connecting)
0000064838 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000065854 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000066919 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000067841 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000068884 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000069076 [comm.coap] TRACE: Received CoAP message
0000069077 [comm.coap] TRACE: CON POST /f/update?26 size=17 token=03 id=7232
0000069083 [comm.coap] TRACE: Sending CoAP message
0000069089 [comm.coap] TRACE: ACK 0.00  size=4 token= id=7232
0000069858 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000070884 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000071898 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000072829 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000073147 [comm.coap] TRACE: Received CoAP message
0000073165 [comm.coap] TRACE: CON POST /f/update?26 size=17 token=03 id=7232
0000073171 [comm.coap] TRACE: Sending CoAP message
0000073228 [comm.coap] TRACE: ACK 0.00  size=4 token= id=7232
0000073921 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000074885 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000075055 [comm.coap] TRACE: Retransmitting CoAP message; ID: 3; attempt 3 of 3
0000075057 [comm.coap] TRACE: Sending CoAP message
0000075062 [comm.coap] TRACE: CON POST /E/spark/device/last_reset size=42 token= id=3
0000075322 [comm.coap] TRACE: Received CoAP message
0000075323 [comm.coap] TRACE: ACK 0.00  size=4 token= id=3
0000075429 [comm.coap] TRACE: Retransmitting CoAP message; ID: 5; attempt 3 of 3
0000075430 [comm.coap] TRACE: Sending CoAP message
0000075436 [comm.coap] TRACE: CON POST /E/particle/device/updates/forced size=44 token= id=5
0000075700 [comm.coap] TRACE: Received CoAP message
0000075701 [comm.coap] TRACE: ACK 0.00  size=4 token= id=5
0000075916 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000076821 [comm.coap] TRACE: Received CoAP message
0000076835 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000076836 [comm.coap] TRACE: CON POST /E/particle/device/updates/pending size=47 token=04 id=7233
0000076920 [comm.coap] TRACE: Sending CoAP message
0000076926 [comm.coap] TRACE: ACK 0.00  size=4 token= id=7233
0000077552 [comm.coap] TRACE: Retransmitting CoAP message; ID: 10; attempt 3 of 3
0000077597 [comm.coap] TRACE: Sending CoAP message
0000077600 [comm.coap] TRACE: CON 2.05  size=151 token=01 id=10
0000077831 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000078901 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000079032 [comm.coap] TRACE: Received CoAP message
0000079033 [comm.coap] TRACE: ACK 0.00  size=4 token= id=10
0000079038 [comm.coap] TRACE: Retransmitting CoAP message; ID: 6; attempt 3 of 3
0000079043 [comm.coap] TRACE: Sending CoAP message
0000079049 [comm.coap] TRACE: CON GET /t size=7 token=cd id=6
0000079217 [comm.coap] TRACE: Retransmitting CoAP message; ID: 4; attempt 3 of 3
0000079218 [comm.coap] TRACE: Sending CoAP message
0000079224 [comm.coap] TRACE: CON POST /E/particle/device/updates/enabled size=44 token= id=4
0000079363 [comm.coap] TRACE: Received CoAP message
0000079386 [comm.coap] TRACE: ACK 2.05  size=10 token=cd id=6
0000079392 [comm.protocol] INFO: Received TIME response: 1690974984
0000079847 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000080903 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000081829 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000082869 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000083906 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000084883 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000085865 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000086822 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000087837 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected
0000088894 [app] INFO: State: eth cloud connecting: Ethernet: ready, WiFi: not ready, Cloud: not connected

Ethernet. dnsServerIP() is not supported. It will always return 0.0.0.0 even if it gets a valid DNS server address by DHCP.

2 Likes

ah, ok

do you see any other issues why it might not connect? our ethernet/wifi is based on your lib

pretty much:

switch to ethernet:
WiFi.disconnect();
Ethernet.connect();
waitfor(Ethernet.ready)
Particle.connect();

switch to wifi:
Ethernet.disconnect();
WiFi.connect();
waitFor(WiFi.ready)
Particle.connect();

i am now just testing ethernet connectivity (no wifi credentials):

  • connected to my mac with a usb ethernet adaptor and internet sharing works well almost every time
  • directly connected to my local ethernet network does not work most of the time. even had it "freeze" the p2 (no led, no nothing). see below
  • when connected it is reliable / stays connected

how can we debug this?

any help is greatly appreciated
thanks
frank

freeze:

0000355671 [app] INFO: Ethernet cloud connecting takes too long
0000355702 [app] INFO: State: 'wifi connect' (previous: 'eth cloud connecting')
0000355746 [net.ifapi] INFO: Netif en2 state DOWN
0000355747 [hal] INFO: DNS server list changed
0000355761 [hal] INFO: DNS server list changed
0000355771 [system.nm] INFO: State change
--- freeze, nothing, led off ---
1 Like

the dhcp communication for both is almost identical, except for "next server ip address" which is 0.0.0.0 for the network that the p2 does not want to connect to: