Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does t MQTT_MSG_TYPE_PINGRESP mean? #11

Open
shirish47 opened this issue Jun 30, 2017 · 9 comments
Open

What does t MQTT_MSG_TYPE_PINGRESP mean? #11

shirish47 opened this issue Jun 30, 2017 · 9 comments

Comments

@shirish47
Copy link

I am getting following thing I don't exaclty know that mqtt broker is working fine or not. but I want to understand the error ..
screen shot 2017-06-30 at 12 58 50 pm

@tuanpmt
Copy link
Owner

tuanpmt commented Jun 30, 2017

Every ~120seconds, ESP32 will send PING msg to server for keepalive, server will response with MQTT_MSG_TYPE_PINGRESP

@shirish47
Copy link
Author

shirish47 commented Jun 30, 2017

ok I understand while I am testing this with nodeRed
I made nodered program to send a delayed message when it receives something from esp32. but somehow it restarts after 2 restarts its works ok. I am sorry for this long log.

`[MQTT INFO] Connected!
[MQTT INFO] Connected to server 192.168.1.101:1883
[MQTT INFO] Sending MQTT CONNECT message, type: 1, id: 0000
[MQTT INFO] Reading MQTT CONNECT response message
[MQTT INFO] Connected
[MQTT INFO] Connected to MQTT broker, create sending thread before call connected callback
[MQTT INFO] mqtt_sending_task
[MQTT INFO] Queue subscribe, topic"/testESP1", id: 1
[MQTT INFO] Sending...16 bytes
[MQTT INFO] Sending...18 bytes
[MQTT INFO] Queuing publish, length: 18, queue size(0/4096)


[MQTT INFO] mqtt_start_receive_schedule
[MQTT INFO] Read len 5
[MQTT INFO] Read len 24
[MQTT INFO] deliver_publish
[MQTT INFO] Data received: 11/11 bytes 
[APP] Publish topic: /testESP1
[APP] Publish data[11/11 bytes]
[APP] DATA: Received Ok 
f task=mqt a=0x3ffaf238 h=1a2b3c4d t=1a2b3c0a
abort() was called at PC 0x40083779 on core 0
Guru Meditation Error: Core  0 panic'ed (abort)

Backtrace: 0x40009203:0x3ffc4cb0 0x40082ed5:0x3ffc4cd0 0x400833d2:0x3ffc4cf0 0x400864a0:0x3ffc4d10 0x400820d4:0x3ffc4d30 0x4000beca:0x3ffc4d50 0x4011183c:0x3ffc4d70 0x401134a4:0x3ffc4d90 0x401135b1:0x3ffc4de0 0x401136a1:0x3ffc4e00

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0008,len:8
load:0x3fff0010,len:4412
ho 0 tail 12 room 4
load:0x40078000,len:11092
load:0x40080000,len:252
entry 0x40080034
�[0;32mI (48) boot: ESP-IDF v2.0-rc1-877-g636d2b3-dirty 2nd stage bootloader�[0m
�[0;32mI (48) boot: compile time 19:29:54�[0m
�[0;32mI (52) boot: Enabling RNG early entropy source...�[0m
�[0;32mI (68) boot: SPI Speed      : 40MHz�[0m
�[0;32mI (81) boot: SPI Mode       : DIO�[0m
�[0;32mI (93) boot: SPI Flash Size : 4MB�[0m
�[0;32mI (106) boot: Partition Table:�[0m
�[0;32mI (117) boot: ## Label            Usage          Type ST Offset   Length�[0m
�[0;32mI (140) boot:  0 nvs              WiFi data        01 02 00009000 00006000�[0m
�[0;32mI (163) boot:  1 phy_init         RF data          01 01 0000f000 00001000�[0m
�[0;32mI (186) boot:  2 factory          factory app      00 00 00010000 00100000�[0m
�[0;32mI (210) boot: End of partition table�[0m
�[0;32mI (222) boot: Disabling RNG early entropy source...�[0m
�[0;32mI (240) boot: Loading app partition at offset 00010000�[0m
�[0;32mI (946) boot: segment 0: paddr=0x00010018 vaddr=0x00000000 size=0x0ffe8 ( 65512) �[0m
�[0;32mI (946) boot: segment 1: paddr=0x00020008 vaddr=0x3f400010 size=0x09c7c ( 40060) map�[0m
�[0;32mI (962) boot: segment 2: paddr=0x00029c8c vaddr=0x3ffb0000 size=0x02400 (  9216) load�[0m
�[0;32mI (992) boot: segment 3: paddr=0x0002c094 vaddr=0x40080000 size=0x00400 (  1024) load�[0m
�[0;32mI (1015) boot: segment 4: paddr=0x0002c49c vaddr=0x40080400 size=0x12ba4 ( 76708) load�[0m
�[0;32mI (1078) boot: segment 5: paddr=0x0003f048 vaddr=0x400c0000 size=0x00000 (     0) load�[0m
�[0;32mI (1079) boot: segment 6: paddr=0x0003f050 vaddr=0x00000000 size=0x00fb8 (  4024) �[0m
�[0;32mI (1100) boot: segment 7: paddr=0x00040010 vaddr=0x400d0018 size=0x4832c (295724) map�[0m
�[0;32mI (1126) cpu_start: Pro cpu up.�[0m
�[0;32mI (1137) cpu_start: Single core mode�[0m
�[0;32mI (1151) heap_alloc_caps: Initializing. RAM available for dynamic allocation:�[0m
�[0;32mI (1175) heap_alloc_caps: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM�[0m
�[0;32mI (1195) heap_alloc_caps: At 3FFB7628 len 000289D8 (162 KiB): DRAM�[0m
�[0;32mI (1216) heap_alloc_caps: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM�[0m
�[0;32mI (1238) heap_alloc_caps: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM�[0m
�[0;32mI (1259) heap_alloc_caps: At 40092FA4 len 0000D05C (52 KiB): IRAM�[0m
check b=0x3ffae2ac size=7496 ok
check b=0x3ffafff4 size=0 ok
check b=0x3ffb7634 size=166336 ok
check b=0x3ffdfff4 size=0 ok
check b=0x3ffe044c size=15272 ok
check b=0x3ffe3ff4 size=0 ok
check b=0x3ffe435c size=113816 ok
check b=0x3ffffff4 size=0 ok
check b=0x40092fb0 size=53316 ok
�[0;32mI (1358) cpu_start: Pro cpu start user code�[0m
�[0;32mI (1414) cpu_start: Starting scheduler on PRO CPU.�[0m
[APP] Startup..
[APP] Free memory: 290852 bytes
[APP] SDK version: master, Build time: 2017-Jun-30_12:39:16_IST
E (1491) wifi: esp_wifi_set_auto_connect 1270 wifi is not init
[APP] Start, connect to Wifi network: UNICORN ..
I (1497) wifi: wifi firmware version: 8a1ad86
I (1500) wifi: config NVS flash: enabled
I (1503) wifi: config nano formating: disabled
�[0;32mI (1508) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE�[0m
�[0;32mI (1517) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE�[0m
I (1579) wifi: Init dynamic tx buffer num: 32
I (1579) wifi: Init dynamic rx buffer num: 32
I (1579) wifi: wifi driver task: 3ffbc794, prio:23, stack:4096
I (1582) wifi: Init static rx buffer num: 10
I (1585) wifi: Init dynamic rx buffer num: 32
I (1590) wifi: Init rx ampdu len mblock:7
I (1593) wifi: Init lldesc rx ampdu entry mblock:4
I (1598) wifi: wifi power manager task: 0x3ffc1c94 prio: 21 stack: 2560
I (1605) wifi: wifi timer task: 3ffc2d3c, prio:22, stack:3584
�[0;32mI (1634) phy: phy_version: 354.0, b2dba61, May 16 2017, 21:41:06, 0, 0�[0m
I (1635) wifi: mode : sta (24:0a:c4:01:1b:34)
I (1758) wifi: n:11 0, o:1 0, ap:255 255, sta:11 0, prof:1
I (2746) wifi: state: init -> auth (b0)
I (2748) wifi: state: auth -> assoc (0)
I (2755) wifi: state: assoc -> run (10)
I (2772) wifi: connected with UNICORN, channel 11
�[0;32mI (3453) event: ip: xxxxxxxxxxxx, mask: 255.255.255.0, gw: xxxxxxxxx�[0m
[MQTT INFO] Connecting to serverxxxxxxxxxxxx:1883,23303
[MQTT INFO] Connected!
[MQTT INFO] Connected to server xxxxxxxxxx:1883
[MQTT INFO] Sending MQTT CONNECT message, type: 1, id: 0000
[MQTT INFO] Reading MQTT CONNECT response message
[MQTT INFO] Connected
[MQTT INFO] Connected to MQTT broker, create sending thread before call connected callback
[MQTT INFO] mqtt_sending_task
[MQTT INFO] Queue subscribe, topic"/testESP1", id: 1
[MQTT INFO] Sending...16 bytes
[MQTT INFO] Sending...18 bytes
[MQTT INFO] Queuing publish, length: 18, queue size(0/4096)


[MQTT INFO] mqtt_start_receive_schedule
[MQTT INFO] Read len 5
[MQTT INFO] Read len 24
[MQTT INFO] deliver_publish
[MQTT INFO] Data received: 11/11 bytes 
[APP] Publish topic: /testESP1
[APP] Publish data[11/11 bytes]
[APP] DATA: Received Ok 
f task=mqt a=0x3ffaf238 h=1a2b3c4d t=1a2b3c0a
abort() was called at PC 0x40083779 on core 0
Guru Meditation Error: Core  0 panic'ed (abort)

Backtrace: 0x40009203:0x3ffc4cd0 0x40082ed5:0x3ffc4cf0 0x400833d2:0x3ffc4d10 0x400864a0:0x3ffc4d30 0x400820d4:0x3ffc4d50 0x4000beca:0x3ffc4d70 0x4011183c:0x3ffc4d90 0x401134a4:0x3ffc4db0 0x401135b1:0x3ffc4e00 0x401136a1:0x3ffc4e20

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0008,len:8
load:0x3fff0010,len:4412
ho 0 tail 12 room 4
load:0x40078000,len:11092
load:0x40080000,len:252
entry 0x40080034
�[0;32mI (48) boot: ESP-IDF v2.0-rc1-877-g636d2b3-dirty 2nd stage bootloader�[0m
�[0;32mI (48) boot: compile time 19:29:54�[0m
�[0;32mI (52) boot: Enabling RNG early entropy source...�[0m
�[0;32mI (68) boot: SPI Speed      : 40MHz�[0m
�[0;32mI (81) boot: SPI Mode       : DIO�[0m
�[0;32mI (93) boot: SPI Flash Size : 4MB�[0m
�[0;32mI (106) boot: Partition Table:�[0m
�[0;32mI (117) boot: ## Label            Usage          Type ST Offset   Length�[0m
�[0;32mI (140) boot:  0 nvs              WiFi data        01 02 00009000 00006000�[0m
�[0;32mI (163) boot:  1 phy_init         RF data          01 01 0000f000 00001000�[0m
�[0;32mI (186) boot:  2 factory          factory app      00 00 00010000 00100000�[0m
�[0;32mI (210) boot: End of partition table�[0m
�[0;32mI (222) boot: Disabling RNG early entropy source...�[0m
�[0;32mI (240) boot: Loading app partition at offset 00010000�[0m
�[0;32mI (946) boot: segment 0: paddr=0x00010018 vaddr=0x00000000 size=0x0ffe8 ( 65512) �[0m
�[0;32mI (946) boot: segment 1: paddr=0x00020008 vaddr=0x3f400010 size=0x09c7c ( 40060) map�[0m
�[0;32mI (962) boot: segment 2: paddr=0x00029c8c vaddr=0x3ffb0000 size=0x02400 (  9216) load�[0m
�[0;32mI (992) boot: segment 3: paddr=0x0002c094 vaddr=0x40080000 size=0x00400 (  1024) load�[0m
�[0;32mI (1015) boot: segment 4: paddr=0x0002c49c vaddr=0x40080400 size=0x12ba4 ( 76708) load�[0m
�[0;32mI (1078) boot: segment 5: paddr=0x0003f048 vaddr=0x400c0000 size=0x00000 (     0) load�[0m
�[0;32mI (1079) boot: segment 6: paddr=0x0003f050 vaddr=0x00000000 size=0x00fb8 (  4024) �[0m
�[0;32mI (1100) boot: segment 7: paddr=0x00040010 vaddr=0x400d0018 size=0x4832c (295724) map�[0m
�[0;32mI (1126) cpu_start: Pro cpu up.�[0m
�[0;32mI (1137) cpu_start: Single core mode�[0m
�[0;32mI (1151) heap_alloc_caps: Initializing. RAM available for dynamic allocation:�[0m
�[0;32mI (1175) heap_alloc_caps: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM�[0m
�[0;32mI (1195) heap_alloc_caps: At 3FFB7628 len 000289D8 (162 KiB): DRAM�[0m
�[0;32mI (1216) heap_alloc_caps: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM�[0m
�[0;32mI (1238) heap_alloc_caps: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM�[0m
�[0;32mI (1259) heap_alloc_caps: At 40092FA4 len 0000D05C (52 KiB): IRAM�[0m
check b=0x3ffae2ac size=7496 ok
check b=0x3ffafff4 size=0 ok
check b=0x3ffb7634 size=166336 ok
check b=0x3ffdfff4 size=0 ok
check b=0x3ffe044c size=15272 ok
check b=0x3ffe3ff4 size=0 ok
check b=0x3ffe435c size=113816 ok
check b=0x3ffffff4 size=0 ok
check b=0x40092fb0 size=53316 ok
�[0;32mI (1358) cpu_start: Pro cpu start user code�[0m
�[0;32mI (1414) cpu_start: Starting scheduler on PRO CPU.�[0m
[APP] Startup..
[APP] Free memory: 290852 bytes
[APP] SDK version: master, Build time: 2017-Jun-30_12:39:16_IST
E (1491) wifi: esp_wifi_set_auto_connect 1270 wifi is not init
[APP] Start, connect to Wifi network: UNICORN ..
I (1497) wifi: wifi firmware version: 8a1ad86
I (1500) wifi: config NVS flash: enabled
I (1503) wifi: config nano formating: disabled
�[0;32mI (1508) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE�[0m
�[0;32mI (1517) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE�[0m
I (1532) wifi: Init dynamic tx buffer num: 32
I (1532) wifi: Init dynamic rx buffer num: 32
I (1535) wifi: wifi driver task: 3ffbc6fc, prio:23, stack:4096
I (1541) wifi: Init static rx buffer num: 10
I (1544) wifi: Init dynamic rx buffer num: 32
I (1549) wifi: Init rx ampdu len mblock:7
I (1552) wifi: Init lldesc rx ampdu entry mblock:4
I (1557) wifi: wifi power manager task: 0x3ffc1c54 prio: 21 stack: 2560
I (1564) wifi: wifi timer task: 3ffc2d24, prio:22, stack:3584
�[0;32mI (1618) phy: phy_version: 354.0, b2dba61, May 16 2017, 21:41:06, 0, 0�[0m
I (1619) wifi: mode : sta (24:0a:c4:01:1b:34)
I (1742) wifi: n:11 0, o:1 0, ap:255 255, sta:11 0, prof:1
I (2729) wifi: state: init -> auth (b0)
I (2737) wifi: state: auth -> assoc (0)
I (2747) wifi: state: assoc -> run (10)
I (2768) wifi: connected with UNICORN, channel 11
�[0;32mI (3435) event: ip: xxxxxxxxxxx, mask: 255.255.255.0, gw: xxxxxxxxxxxx�[0m
[MQTT INFO] Connecting to server xxxxxxxxxx:1883,23303
[MQTT INFO] Connected!
[MQTT INFO] Connected to server xxxxxxxxx:1883
[MQTT INFO] Sending MQTT CONNECT message, type: 1, id: 0000
[MQTT INFO] Reading MQTT CONNECT response message
[MQTT INFO] Connected
[MQTT INFO] Connected to MQTT broker, create sending thread before call connected callback
[MQTT INFO] mqtt_sending_task
[MQTT INFO] Queue subscribe, topic"/testESP1", id: 1
[MQTT INFO] Sending...16 bytes
[MQTT INFO] Sending...18 bytes
[MQTT INFO] Queuing publish, length: 18, queue size(0/4096)


[MQTT INFO] mqtt_start_receive_schedule
[MQTT INFO] Read len 5
[MQTT INFO] Read len 24
[MQTT INFO] deliver_publish
[MQTT INFO] Data received: 11/11 bytes 
[APP] Publish topic: /testESP1
[APP] Publish data[11/11 bytes]
[APP] DATA: Received Ok 
[MQTT INFO] Read len 28
[MQTT INFO] deliver_publish
[MQTT INFO] Data received: 15/15 bytes 
[APP] Publish topic: /testESP1
[APP] Publish data[15/15 bytes]
[APP] DATA: Broker received 
I (12748) wifi: pm start, type:0

[MQTT INFO] Sending pingreq
[MQTT INFO] Read len 2
[MQTT INFO] MQTT_MSG_TYPE_PINGRESP
[MQTT INFO] Sending pingreq
[MQTT INFO] Read len 2
[MQTT INFO] MQTT_MSG_TYPE_PINGRESP
`

@shirish47
Copy link
Author

shirish47 commented Jun 30, 2017

screen shot 2017-06-30 at 2 13 42 pm

this was the nodeRed program and but first I used trigger that was first sending a msg wait for 250ms and send another msg now I changed it to send nothing wait for 255ms and send Msg OK received. but I think there is still some problem let me check more after a long interval of staying idle the device resets or something happens just waiting it to happen again.

@shirish47
Copy link
Author

shirish47 commented Jun 30, 2017

It restarts or something... 29 times sending pingreq ...
here it is [Edit: I think this is the second issue]

[MQTT INFO] MQTT_MSG_TYPE_PINGRESP  
[MQTT INFO] Sending pingreq       << --- 29 th pingreq
[MQTT INFO] Read len 2
[MQTT INFO] MQTT_MSG_TYPE_PINGRESP
I (1812683) wifi: state: run -> auth (2c0)
I (1812684) wifi: n:11 0, o:11 0, ap:255 255, sta:11 0, prof:1
I (1812684) wifi: pm stop, total sleep time: 0/1799971734

[MQTT INFO] Read len 0
[MQTT INFO] network disconnected
I (1812809) wifi: n:11 0, o:11 0, ap:255 255, sta:11 0, prof:1
I (1812810) wifi: state: auth -> auth (b0)
I (1812815) wifi: state: auth -> assoc (0)
I (1812821) wifi: state: assoc -> run (10)
I (1812834) wifi: connected with UNICORN, channel 11
�[0;32mI (1813454) event: ip: xxxxxx, mask: 255.255.255.0, gw: xxxxxxxxx�[0m
[MQTT INFO] Connecting to server xxxxxxxx:1883,23303
[MQTT INFO] Connected!
[MQTT INFO] Connected to server xxxxxxxxxx:1883
[MQTT INFO] Sending MQTT CONNECT message, type: 1, id: 0000
[MQTT INFO] Reading MQTT CONNECT response message
[MQTT INFO] Connected
[MQTT INFO] Connected to MQTT broker, create sending thread before call connected callback
[MQTT INFO] mqtt_sending_task
[MQTT INFO] Queue subscribe, topic"/testESP1", id: 1
[MQTT INFO] Sending...16 bytes
[MQTT INFO] Sending...18 bytes
[MQTT INFO] Queuing publish, length: 18, queue size(0/4096)


[MQTT INFO] mqtt_start_receive_schedule
[MQTT INFO] Read len 5
[MQTT INFO] Read len 36
[MQTT INFO] deliver_publish
[MQTT INFO] Data received: 23/23 bytes 
[APP] Publish topic: /testESP1
[APP] Publish data[23/23 bytes]
[APP] DATA: Broker: Msg OK received 
I (1822822) wifi: pm start, type:0

@shirish47
Copy link
Author

shirish47 commented Jun 30, 2017

espressif/esp-at#12 this does not solve the problem either......
its restarts multiple times .. and then it works fine after 4-5 restarts.[Edit: this is the first issue.]

`

[MQTT INFO] mqtt_start_receive_schedule
[MQTT INFO] Read len 5
[MQTT INFO] Read len 36
[MQTT INFO] deliver_publish
[MQTT INFO] Data received: 23/23 bytes 
[APP] Publish topic: /testESP1
[APP] Publish data[23/23 bytes]
[APP] DATA: Broker: Msg OK received⸮
Z⸮⸮V⸮o⸮�: 
f task=mqt a=0x3ffaf238 h=1a2b3c4d t=d9d45a0a
abort() was called at PC 0x40083779 on core 0
Guru Meditation Error: Core  0 panic'ed (abort)

Backtrace: 0x40009203:0x3ffc4b20 0x40082ed5:0x3ffc4b40 0x400833d2:0x3ffc4b60 0x400864a0:0x3ffc4b80 0x400820d4:0x3ffc4ba0 0x4000beca:0x3ffc4bc0 0x4011183c:0x3ffc4be0 0x401134a4:0x3ffc4c00 0x401135b1:0x3ffc4c50 0x401136a1:0x3ffc4c70

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0008,len:8
load:0x3fff0010,len:4412
ho 0 tail 12 room 4
load:0x40078000,len:11092
load:0x40080000,len:252
entry 0x40080034
�[0;32mI (48) boot: ESP-IDF v2.0-rc1-877-g636d2b3-dirty 2nd stage bootloader�[0m
�[0;32mI (48) boot: compile time 19:29:54�[0m
�[0;32mI (52) boot: Enabling RNG early entropy source...�[0m
�[0;32mI (68) boot: SPI Speed      : 40MHz�[0m
�[0;32mI (81) boot: SPI Mode       : DIO�[0m
�[0;32mI (93) boot: SPI Flash Size : 4MB�[0m
�[0;32mI (106) boot: Partition Table:�[0m
�[0;32mI (117) boot: ## Label            Usage          Type ST Offset   Length�[0m
�[0;32mI (140) boot:  0 nvs              WiFi data        01 02 00009000 00006000�[0m
�[0;32mI (163) boot:  1 phy_init         RF data          01 01 0000f000 00001000�[0m
�[0;32mI (186) boot:  2 factory          factory app      00 00 00010000 00100000�[0m
�[0;32mI (210) boot: End of partition table�[0m
�[0;32mI (222) boot: Disabling RNG early entropy source...�[0m
�[0;32mI (240) boot: Loading app partition at offset 00010000�[0m
�[0;32mI (946) boot: segment 0: paddr=0x00010018 vaddr=0x00000000 size=0x0ffe8 ( 65512) �[0m
�[0;32mI (946) boot: segment 1: paddr=0x00020008 vaddr=0x3f400010 size=0x09c7c ( 40060) map�[0m
�[0;32mI (962) boot: segment 2: paddr=0x00029c8c vaddr=0x3ffb0000 size=0x02400 (  9216) load�[0m
�[0;32mI (992) boot: segment 3: paddr=0x0002c094 vaddr=0x40080000 size=0x00400 (  1024) load�[0m
�[0;32mI (1015) boot: segment 4: paddr=0x0002c49c vaddr=0x40080400 size=0x12ba4 ( 76708) load�[0m
�[0;32mI (1078) boot: segment 5: paddr=0x0003f048 vaddr=0x400c0000 size=0x00000 (     0) load�[0m
�[0;32mI (1079) boot: segment 6: paddr=0x0003f050 vaddr=0x00000000 size=0x00fb8 (  4024) �[0m
�[0;32mI (1100) boot: segment 7: paddr=0x00040010 vaddr=0x400d0018 size=0x4832c (295724) map�[0m
�[0;32mI (1126) cpu_start: Pro cpu up.�[0m
�[0;32mI (1137) cpu_start: Single core mode�[0m
�[0;32mI (1151) heap_alloc_caps: Initializing. RAM available for dynamic allocation:�[0m
�[0;32mI (1175) heap_alloc_caps: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM�[0m
�[0;32mI (1195) heap_alloc_caps: At 3FFB7628 len 000289D8 (162 KiB): DRAM�[0m
�[0;32mI (1216) heap_alloc_caps: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM�[0m
�[0;32mI (1238) heap_alloc_caps: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM�[0m
�[0;32mI (1259) heap_alloc_caps: At 40092FA4 len 0000D05C (52 KiB): IRAM�[0m
check b=0x3ffae2ac size=7496 ok
check b=0x3ffafff4 size=0 ok
check b=0x3ffb7634 size=166336 ok
check b=0x3ffdfff4 size=0 ok
check b=0x3ffe044c size=15272 ok
check b=0x3ffe3ff4 size=0 ok
check b=0x3ffe435c size=113816 ok
check b=0x3ffffff4 size=0 ok
check b=0x40092fb0 size=53316 ok
�[0;32mI (1358) cpu_start: Pro cpu start user code�[0m
�[0;32mI (1414) cpu_start: Starting scheduler on PRO CPU.�[0m
[APP] Startup..
[APP] Free memory: 290852 bytes
[APP] SDK version: master, Build time: 2017-Jun-30_15:07:44_IST
E (1519) wifi: esp_wifi_set_auto_connect 1270 wifi is not init
[APP] Start, connect to Wifi network: UNICORN ..
I (1521) wifi: wifi firmware version: 8a1ad86
I (1524) wifi: config NVS flash: enabled
I (1527) wifi: config nano formating: disabled
�[0;32mI (1532) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE�[0m
�[0;32mI (1541) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE�[0m
I (1556) wifi: Init dynamic tx buffer num: 32
I (1556) wifi: Init dynamic rx buffer num: 32
I (1559) wifi: wifi driver task: 3ffbc564, prio:23, stack:4096
I (1565) wifi: Init static rx buffer num: 10
I (1568) wifi: Init dynamic rx buffer num: 32
I (1573) wifi: Init rx ampdu len mblock:7
I (1576) wifi: Init lldesc rx ampdu entry mblock:4
I (1581) wifi: wifi power manager task: 0x3ffc1abc prio: 21 stack: 2560
I (1588) wifi: wifi timer task: 3ffc2b8c, prio:22, stack:3584
�[0;32mI (1614) phy: phy_version: 354.0, b2dba61, May 16 2017, 21:41:06, 0, 0�[0m
I (1615) wifi: mode : sta (24:0a:c4:01:1b:34)
I (1738) wifi: n:11 0, o:1 0, ap:255 255, sta:11 0, prof:1
I (2726) wifi: state: init -> auth (b0)
I (2731) wifi: state: auth -> assoc (0)
I (2737) wifi: state: assoc -> run (10)
I (2750) wifi: connected with UNICORN, channel 11
�[0;32mI (3433) event: ip: xxxxxxxxx, mask: 255.255.255.0, gw: xxxxxxxxx�[0m
[MQTT INFO] Connecting to server xxxxxxx:1883,23303
[MQTT INFO] Connected!
[MQTT INFO] Connected to server xxxxxxxxx:1883
[MQTT INFO] Sending MQTT CONNECT message, type: 1, id: 0000
[MQTT INFO] Reading MQTT CONNECT response message
[MQTT INFO] Connected
[MQTT INFO] Connected to MQTT broker, create sending thread before call connected callback
[MQTT INFO] mqtt_sending_task
[MQTT INFO] Queue subscribe, topic"/testESP1", id: 1
[MQTT INFO] Sending...16 bytes
[MQTT INFO] Sending...18 bytes
[MQTT INFO] Queuing publish, length: 18, queue size(0/4096)


[MQTT INFO] mqtt_start_receive_schedule
[MQTT INFO] Read len 5
[MQTT INFO] Read len 36
[MQTT INFO] deliver_publish
[MQTT INFO] Data received: 23/23 bytes 
[APP] Publish topic: /testESP1
[APP] Publish data[23/23 bytes]
[APP] DATA: Broker: Msg OK received:
�⸮m⸮⸮S�⸮⸮ 
I (12737) wifi: pm start, type:0

`

and following is the code. I just add function to store wifi in FLASH and autoconnect function .


static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
{

    switch(event->event_id) {
    case SYSTEM_EVENT_STA_START:
        ESP_ERROR_CHECK(esp_wifi_connect());
        break;

    case SYSTEM_EVENT_STA_GOT_IP:

        mqtt_start(&settings);
        // Notice that, all callback will called in mqtt_task
        // All function publish, subscribe
        break;
    case SYSTEM_EVENT_STA_DISCONNECTED:
        /* This is a workaround as ESP32 WiFi libs don't currently
           auto-reassociate. */
       // INFO("[APP] Bytelens: SYSTEM_EVENT_STA_DISCONNECTED\n");
        mqtt_stop();
        ESP_ERROR_CHECK(esp_wifi_connect());
        break;
    default:
        break;
    }
    return ESP_OK;


}

void wifi_conn_init(void)
{
    INFO("[APP] Start, connect to Wifi network: %s ..\n", WIFI_SSID);

    tcpip_adapter_init();

    ESP_ERROR_CHECK( esp_event_loop_init(wifi_event_handler, NULL) );

    wifi_init_config_t icfg = WIFI_INIT_CONFIG_DEFAULT();
    ESP_ERROR_CHECK( esp_wifi_init(&icfg) );
    ESP_ERROR_CHECK( esp_wifi_set_storage(WIFI_STORAGE_FLASH)); //RAM) );
    //by shirish: if setting from storage are restored  don't do the below part.
    wifi_config_t wifi_config = {
        .sta = {
            .ssid = WIFI_SSID,
            .password = WIFI_PASS
        },
    };

    ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA));
    //by shirish: if configured from storage dont do below part
   ESP_ERROR_CHECK( esp_wifi_set_config(WIFI_IF_STA, &wifi_config));
    ESP_ERROR_CHECK( esp_wifi_start());
}

void app_main()
{
    INFO("[APP] Startup..\n");
    INFO("[APP] Free memory: %d bytes\n", system_get_free_heap_size());
    INFO("[APP] SDK version: %s, Build time: %s\n", system_get_sdk_version(), BUID_TIME);

#ifdef CPU_FREQ_160MHZ
    INFO("[APP] Setup CPU run as 160MHz\n");
    SET_PERI_REG_BITS(RTC_CLK_CONF, RTC_CNTL_SOC_CLK_SEL, 0x1, RTC_CNTL_SOC_CLK_SEL_S);
    WRITE_PERI_REG(CPU_PER_CONF_REG, 0x01);
    INFO("[APP] Setup CPU run as 160MHz - Done\n");
#endif

    nvs_flash_init();
    esp_wifi_set_auto_connect(true); //added this

    wifi_conn_init();
}

@shirish47
Copy link
Author

issue 2 is happening always. after 29 times ..


[MQTT INFO] Read len 2
[MQTT INFO] MQTT_MSG_TYPE_PINGRESP
I (1812826) wifi: state: run -> auth (2c0)
I (1812827) wifi: n:11 0, o:11 0, ap:255 255, sta:11 0, prof:1
I (1812828) wifi: pm stop, total sleep time: 0/1800089915

[MQTT INFO] Read len 0
[MQTT INFO] network disconnected
I (1812953) wifi: n:11 0, o:11 0, ap:255 255, sta:11 0, prof:1
I (1812954) wifi: state: auth -> auth (b0)
I (1812956) wifi: state: auth -> assoc (0)
I (1812961) wifi: state: assoc -> run (10)
I (1812977) wifi: connected with UNICORN, channel 11
[MQTT INFO] Connecting to server 192.168.1.101:1883,23303
[MQTT ERROR] Connect failed
�[0;32mI (1813983) event: ip: 192.168.1.203, mask: 255.255.255.0, gw: 192.168.1.1�[0m
[MQTT INFO] Connecting to server 192.168.1.101:1883,23303
[MQTT INFO] Connected!

@shirish47
Copy link
Author

hello... any help on this ? i am stuck here.

@shirish47
Copy link
Author

what is this problem?

@shirish47
Copy link
Author

shirish47 commented Aug 23, 2017

still this error is killing my project..
Please help.

`[MQTT INFO] Read len 18
[MQTT INFO] deliver_publish
[MQTT INFO] Data received: 5/5 bytes 
[APP] Publish topic: rpi2/temp
[APP] Publish data[5/5 bytes]
[APP] DATA: 43.83s
123. 
f task=mqt a=0x3ffc34a4 h=1a2b3c4d t=00103332
abort() was called at PC 0x40083779 on core 0
Guru Meditation Error: Core  0 panic'ed (abort)

Backtrace: 0x40009203:0x3ffc4bf0 0x400e6df1:0x3ffc4c10 0x400833d2:0x3ffc4c30 0x400864a0:0x3ffc4c50 0x400820d4:0x3ffc4c70 0x4000beca:0x3ffc4c90 0x40111840:0x3ffc4cb0 0x401134a8:0x3ffc4cd0 0x401135b5:0x3ffc4d20 0x401136a5:0x3ffc4d40

Rebooting...`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants