The use of the ESP8266 in the world of IoT

User avatar
By marianoT
#92393 with classic esp8266 (wemos) connection example usind DHCP in sagemcom FAST3890V3 router, i never get IP, after about 10 minutes i get some ip outside of range and it doesn't work. I read lots of post and can't find a solution. thanks

connection pseudocode (you know)
Code: Select all WiFi.begin(ssid, password);
  client.setTrustAnchors(&cert); // Add root certificate for api.telegram.org
 // wifi_station_set_auto_connect(true);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.println("Connecting to WiFi..");
  }

wireshark capture only Discover - transaction, router didn't answer, 5 times.

323 43.461691 0.0.0.0 255.255.255.255 DHCP 350 DHCP Discover - Transaction ID 0x2beb89bf

Frame 323: 350 bytes on wire (2800 bits), 350 bytes captured (2800 bits) on interface \Device\NPF_{4F87DED9-5E05-47A3-A4C3-1D594FD44EE5}, id 0 Ethernet II, Src: Espressi_df:9d:f6 (e8:db:84:df:9d:f6), Dst: Broadcast (ff:ff:ff:ff:ff:ff) Destination: Broadcast (ff:ff:ff:ff:ff:ff) Address: Broadcast (ff:ff:ff:ff:ff:ff) .... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default) .... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast) Source: Espressi_df:9d:f6 (e8:db:84:df:9d:f6) Address: Espressi_df:9d:f6 (e8:db:84:df:9d:f6) .... ..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: 255.255.255.255 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: 336 Identification: 0x0004 (4) Flags: 0x00 0... .... = Reserved bit: Not set .0.. .... = Don't fragment: Not set ..0. .... = More fragments: Not set Fragment Offset: 0 Time to Live: 255 Protocol: UDP (17) Header Checksum: 0xba99 [validation disabled] [Header checksum status: Unverified] Source Address: 0.0.0.0 Destination Address: 255.255.255.255 User Datagram Protocol, Src Port: 68, Dst Port: 67 Source Port: 68 Destination Port: 67 Length: 316 Checksum: 0x5bed [unverified] [Checksum Status: Unverified] [Stream index: 9] [Timestamps] UDP payload (308 bytes) Dynamic Host Configuration Protocol (Discover) Message type: Boot Request (1) Hardware type: Ethernet (0x01) Hardware address length: 6 Hops: 0 Transaction ID: 0x2beb89bf Seconds elapsed: 0 Bootp flags: 0x0000 (Unicast) Client IP address: 0.0.0.0 Your (client) IP address: 0.0.0.0 Next server IP address: 0.0.0.0 Relay agent IP address: 0.0.0.0 Client MAC address: Espressi_df:9d:f6 (e8:db:84:df:9d:f6) Client hardware address padding: 00000000000000000000 Server host name not given Boot file name not given Magic cookie: DHCP Option: (53) DHCP Message Type (Discover) Length: 1 DHCP: Discover (1) Option: (57) Maximum DHCP Message Size Length: 2 Maximum DHCP Message Size: 1500 Option: (55) Parameter Request List Length: 5 Parameter Request List Item: (1) Subnet Mask Parameter Request List Item: (3) Router Parameter Request List Item: (28) Broadcast Address Parameter Request List Item: (6) Domain Name Server Parameter Request List Item: (42) Network Time Protocol Servers Option: (255) End Option End: 255 Padding: 000000000000000000000000000000000000000000000000000000000000000000000000…

0000 ff ff ff ff ff ff e8 db 84 df 9d f6 08 00 45 00 0010 01 50 00 04 00 00 ff 11 ba 99 00 00 00 00 ff ff 0020 ff ff 00 44 00 43 01 3c 5b ed 01 01 06 00 2b eb 0030 89 bf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0040 00 00 00 00 00 00 e8 db 84 df 9d f6 00 00 00 00 0050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0110 00 00 00 00 00 00 63 82 53 63 35 01 01 39 02 05 0120 dc 37 05 01 03 1c 06 2a ff 00 00 00 00 00 00 00 0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00