Hi,
I've got the EtherTen Arduino, and noticed the past few months that quite often the Ethernet connection fails - I notice an error or connection failure via Serial output. I can't find a specific trigger..
- If you slightly touch/move it, it can trigger this
- If you leave it as-is, after a few hours, or day or so, it can also fail.
That said, you can leave it running for several days without an issue..
Hitting the Reset button often fixes it, though sometimes you have to hit the button several times, and/or start fiddling around a bit..
Running a packet capture, I noticed interestingly that it seems to drop the IP Address for some reason, replacing it with 0.0.0.0
tshark -r pc.pcap
1 0.000000 **0.0.0.0** → 192.168.1.4 TCP 58 49291 → 80 [SYN] Seq=0 Win=2048 Len=0 MSS=1460
2 0.202147 **0.0.0.0** → 192.168.1.4 TCP 58 [TCP Retransmission] 49291 → 80 [SYN] Seq=0 Win=2048 Len=0 MSS=1460
3 0.606498 **0.0.0.0** → 192.168.1.4 TCP 58 [TCP Retransmission] 49291 → 80 [SYN] Seq=0 Win=2048 Len=0 MSS=1460
4 2.165710 **0.0.0.0** → 192.168.1.4 TCP 58 49292 → 80 [SYN] Seq=0 Win=2048 Len=0 MSS=1460
5 2.368013 **0.0.0.0** → 192.168.1.4 TCP 58 [TCP Retransmission] 49292 → 80 [SYN] Seq=0 Win=2048 Len=0 MSS=1460
6 2.772296 **0.0.0.0** → 192.168.1.4 TCP 58 [TCP Retransmission] 49292 → 80 [SYN] Seq=0 Win=2048 Len=0 MSS=1460
tshark -r pc.pcap -Y "frame.number==1" -PV
0.000000 0.0.0.0 → 192.168.1.4 TCP 58 49291 → 80 [SYN] Seq=0 Win=2048 Len=0 MSS=1460
Frame 1: 58 bytes on wire (464 bits), 58 bytes captured (464 bits)
Encapsulation type: Ethernet (1)
Arrival Time: Dec 9, 2019 08:21:54.688585000 NZDT
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1575832914.688585000 seconds
[Time delta from previous captured frame: 0.000000000 seconds]
[Time delta from previous displayed frame: 0.000000000 seconds]
[Time since reference or first frame: 0.000000000 seconds]
Frame Number: 1
Frame Length: 58 bytes (464 bits)
Capture Length: 58 bytes (464 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ip:tcp]
Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: Raspberr_22:09:02 (b8:27:eb:22:09:02)
Destination: Raspberr_22:09:02 (b8:27:eb:22:09:02)
Address: Raspberr_22:09:02 (b8:27:eb:22:09:02)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: 00:00:00_00:00:00 (00:00:00:00:00:00)
Address: 00:00:00_00:00:00 (00:00:00:00:00:00)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 192.168.1.4
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
0000 00.. = Differentiated Services Codepoint: Default (0)
.... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
Total Length: 44
Identification: 0x0011 (17)
Flags: 0x4000, Don't fragment
0... .... .... .... = Reserved bit: Not set
.1.. .... .... .... = Don't fragment: Set
..0. .... .... .... = More fragments: Not set
...0 0000 0000 0000 = Fragment offset: 0
Time to live: 128
Protocol: TCP (6)
Header checksum: 0x390f [validation disabled]
[Header checksum status: Unverified]
Source: 0.0.0.0
Destination: 192.168.1.4
Transmission Control Protocol, Src Port: 49291, Dst Port: 80, Seq: 0, Len: 0
Source Port: 49291
Destination Port: 80
[Stream index: 0]
[TCP Segment Len: 0]
Sequence number: 0 (relative sequence number)
[Next sequence number: 0 (relative sequence number)]
Acknowledgment number: 0
0110 .... = Header Length: 24 bytes (6)
Flags: 0x002 (SYN)
000. .... .... = Reserved: Not set
...0 .... .... = Nonce: Not set
.... 0... .... = Congestion Window Reduced (CWR): Not set
.... .0.. .... = ECN-Echo: Not set
.... ..0. .... = Urgent: Not set
.... ...0 .... = Acknowledgment: Not set
.... .... 0... = Push: Not set
.... .... .0.. = Reset: Not set
.... .... ..1. = Syn: Set
[Expert Info (Chat/Sequence): Connection establish request (SYN): server port 80]
[Connection establish request (SYN): server port 80]
[Severity level: Chat]
[Group: Sequence]
.... .... ...0 = Fin: Not set
[TCP Flags: ··········S·]
Window size value: 2048
[Calculated window size: 2048]
Checksum: 0xc75c [unverified]
[Checksum Status: Unverified]
Urgent pointer: 0
Options: (4 bytes), Maximum segment size
TCP Option - Maximum segment size: 1460 bytes
Kind: Maximum Segment Size (2)
Length: 4
MSS Value: 1460
[Timestamps]
[Time since first frame in this TCP stream: 0.000000000 seconds]
[Time since previous frame in this TCP stream: 0.000000000 seconds]
Naturally, the server drops such packets.
I couldn't find any reason to why it would forget its IP Address and replace with 0.0.0.0.. I'm happy to provide more data - let me know what you need.
I'm using
- Arduino AVR Boards by Arduino v1.8.2 (aka. Arduino Ethernet).
- IP Address is obtained via DHCP - not sure if that makes any difference.
Note, this is 1 of 2 failures I've witnessed, where the second one is more serious - total failure without any packets egressing the Arduino.
The second more serious failure, seems to be stuck at this stage:
Ethernet.begin(mac);
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
lcd.setCursor(0,1);
lcd.print("DHCP Failed :(");
// Check for Ethernet hardware present
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Serial.println("Ethernet shield was not found. Sorry, can't run without hardware. :(");
<snip>
Output:
Initialise ethernet via DHCP... Failed to configure Ethernet using DHCP
Ethernet shield was not found. Sorry, can't run without hardware. :(
Listening on port 67 or port 68, I don't see anything out.. meaning the Arduino isn't firing out a DHCP Discovery packet..
Ta.