乐鑫技术交流
直播中

李娜

7年用户 1622经验值
私信 关注
[问答]

ESP32 DHCP获取不到IP的原因?如何解决?

使用的是ESP32C3芯片,换过不同厂家的模块,不同的工程,AT指令固件也不能获取到公司路由器IP。之前调了很久都是可以获取到IP,连接其他路由器可以获取到IP。公司路由器手机电脑都能正常获取到IP正常上网。路由器型号“TL-XDR3230易展版”,路由器日志里有“13days, 00:29:40,DHCPS: Send OFFER with ip 192.168.0.125.”貌似路由器有收到并回应DHCP请求,以下部分日志
  • etharp_timer

    dhcp_coarse_tmr()

    I (506838) BLUFI_EXAMPLE: rssi:-38

    I (506838) Protocol: 0x3fcb85e8   fa 00 00 00 00 02 00 11  8c e7 04 1f              |............|

    I (506838) BLUFI_EXAMPLE: mac:MAC34b4724e30c0

    I (507278) WIFI: wait to get IP

    etharp_timer

    dhcp_coarse_tmr()

    I (508278) WIFI: wait to get IP

    etharp_timer

    dhcp_coarse_tmr()

    I (509278) WIFI: wait to get IP

    etharp_timer

    dhcp_coarse_tmr()

    I (510278) WIFI: wait to get IP

    etharp_timer

    dhcp_coarse_tmr()

    I (510738) BLUFI_EXAMPLE: set rssi threshold

    dhcp_fine_tmr(): request timeout

    dhcp_timeout()

    dhcp_timeout(): restarting discovery

    dhcp_discover()

    dhcp_discover(): dhcp state is DISCOVER

    dhcp_select: could not allocate DHCP request

    pbuf_alloc(length=308)

    pbuf_alloc(length=308) == 0x3fcbf6e4

    transaction id xid(99999105)

    dhcp_discover: making request

    dhcp_discover: sendto(DISCOVER, IP_ADDR_BROADCAST, LWIP_IANA_PORT_DHCP_SERVER)

    pbuf_add_header: old 0x3fcbf734 new 0x3fcbf72c (8)

    pbuf_add_header: old 0x3fcbf72c new 0x3fcbf718 (20)

    ip4_output_if: st1

    IP header:

    +-------------------------------+

    | 4 | 5 |  0x00 |       336     | (v, hl, tos, len)

    +-------------------------------+

    |       38      |000|       0   | (id, flags, offset)

    +-------------------------------+

    |  255  |   17  |    0xba77     | (ttl, proto, chksum)

    +-------------------------------+

    |    0  |    0  |    0  |    0  | (src)

    +-------------------------------+

    |  255  |  255  |  255  |  255  | (dest)

    +-------------------------------+

    ip4_output_if: call netif->output()

    pbuf_add_header: old 0x3fcbf718 new 0x3fcbf70a (14)

    ethernet_output: sending packet 0x3fcbf6e4

    dhcp_discover: deleting()ing

    pbuf_free(0x3fcbf6e4)

    pbuf_free: deallocating 0x3fcbf6e4

    dhcp_discover: SELECTING

    dhcp_discover(): set request timeout 15000 msecs

    I (511278) WIFI: wait to get IP

    I (511338) BLUFI_EXAMPLE: rssi:-38

    I (511338) Protocol: 0x3fcb85e8   fa 00 00 00 00 02 00 11  8c e7 04 1f              |............|

    I (511338) BLUFI_EXAMPLE: mac:MAC34b4724e30c0

    etharp_timer

    dhcp_coarse_tmr()

    I (512278) WIFI: wait to get IP

    etharp_timer

    dhcp_coarse_tmr()

    I (513278) WIFI: wait to get IP

    etharp_timer

    dhcp_coarse_tmr()

    I (514278) WIFI: wait to get IP

    etharp_timer

    dhcp_coarse_tmr()

    I (515278) WIFI: wait to get IP

    etharp_timer

    dhcp_coarse_tmr()

    I (515738) BLUFI_EXAMPLE: set rssi threshold

    I (515848) BLUFI_EXAMPLE: rssi:-38

    I (515848) Protocol: 0x3fcb85e8   fa 00 00 00 00 02 00 11  8c e7 04 1f              |............|

    I (515848) BLUFI_EXAMPLE: mac:MAC34b4724e30c0

    I (516278) WIFI: wait to get IP

更多回帖

发帖
×
20
完善资料,
赚取积分