Ethernet support for MQTT

hnhkj2020
Posts: 3
Joined: Mon Jan 13, 2020 3:05 am

Ethernet support for MQTT

Postby hnhkj2020 » Mon Feb 17, 2020 12:58 am

I'm running MQTT client via WIFI on ESP32. Now, I hope to change to Ethernet port (IP101). but MQTT display error information.
see follow.

1. get ip and gw etc.
2. sntp get network date&time.
3. mqtt client connect error.

I simple to check the tcp_connect(). It's don't working normal. can you provide some suggest?

Code: Select all

rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:596
load:0x40078000,len:9076
ho 0 tail 12 room 4
load:0x40080400,len:5148
entry 0x40080648
I (200) cpu_start: Pro cpu up.
I (200) cpu_start: Application information:
I (200) cpu_start: Project name:     bsl_bed_mqtt
I (203) cpu_start: App version:      release/v4.13-c1-9-g5b916e8-dir
I (210) cpu_start: Compile time:     Feb 16 2020 15:40:31
I (216) cpu_start: ELF file SHA256:  84d66c5ba17c4079...
I (222) cpu_start: ESP-IDF:          v3.3.1-57-ge28c5127c-dirty
I (229) cpu_start: Starting app cpu, entry point is 0x40081478
0x40081478: call_start_cpu1 at /home/ubuntu/esp/esp-idf/components/esp32/cpu_start.c:269

I (0) cpu_start: App cpu up.
I (239) heap_init: Initializing. RAM available for dynamic allocation:
I (246) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (252) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (258) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (264) heap_init: At 3FFBDB5C len 00000004 (0 KiB): DRAM
I (270) heap_init: At 3FFC2128 len 0001DED8 (119 KiB): DRAM
I (277) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (283) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (289) heap_init: At 40089BA0 len 00016460 (89 KiB): IRAM
I (296) cpu_start: Pro cpu start user code
I (314) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (315) BED_MQTT: [APP] Startup..
I (315) BED_MQTT: [APP] Free memory: 253936 bytes
I (315) BED_MQTT: [APP] IDF version: v3.3.1-57-ge28c5127c-dirty
I (355) eth_example: Power On Ethernet PHY
I (365) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (365) emac: emac reset done
I (365) eth_example: Ethernet Started
I (4365) eth_example: Ethernet Link Up
I (5355) event: eth ip: 192.168.1.104, mask: 255.255.255.0, gw: 192.168.1.1
I (5355) eth_example: Ethernet Got IP Addr
I (5355) eth_example: ~~~~~~~~~~~
I (5355) eth_example: ETHIP:192.168.1.104
I (5365) eth_example: ETHMASK:255.255.255.0
I (5365) eth_example: ETHGW:192.168.1.1
I (5375) eth_example: ~~~~~~~~~~~
I (5375) eth_example: ethernet Connected to network
I (5375) sntp: Boot count: 1
I (5385) sntp: Time is not set yet. Connecting to network and getting time over NTP.
I (5395) sntp: Initializing SNTP
I (5395) sntp: Waiting for system time to be set... (1/10)
I (7405) sntp: The current date/time in New York is: Sun Feb 16 19:53:14 2020
I (7405) sntp: The current date/time in Shanghai is: Mon Feb 17 08:53:14 2020
I (7405) BED_MQTT: mqtt_event (7)
I (7405) BED_MQTT: MQTT_EVENT_BEFORE_CONNECT
I (7415) BED_MQTT: free Heap:187236,187236
E (21355) MQTT_CLIENT: Error transport connect
I (21355) BED_MQTT: mqtt_event (0)
I (21355) BED_MQTT: MQTT_EVENT_ERROR
I (21355) BED_MQTT: free Heap:187120,187120
I (21355) BED_MQTT: mqtt_event (2)
I (21365) BED_MQTT: free Heap:187120,187120
I (31365) BED_MQTT: mqtt_event (7)
I (31365) BED_MQTT: MQTT_EVENT_BEFORE_CONNECT
I (31365) BED_MQTT: free Heap:187120,187120
E (45355) MQTT_CLIENT: Error transport connect
I (45355) BED_MQTT: mqtt_event (0)
I (45355) BED_MQTT: MQTT_EVENT_ERROR
I (45355) BED_MQTT: free Heap:187120,187120
I (45355) BED_MQTT: mqtt_event (2)
I (45365) BED_MQTT: free Heap:187120,187120

hnhkj2020
Posts: 3
Joined: Mon Jan 13, 2020 3:05 am

Re: Ethernet support for MQTT

Postby hnhkj2020 » Wed Feb 19, 2020 12:58 am

this function is fine. I make a error on other function. It affect MQTT function.

Who is online

Users browsing this forum: MSN [Bot] and 28 guests