Open damiano94 opened 5 years ago
I'm sorry to say that this is somewhat expected. The uart output only has the 128-byte hardware buffer and then blocks the caller. You can try to change the baud rate to the max (921k baud?) and/or comment-out some of the more verbose messages. WRT resets, does it do that when you turn off the debug log also?
Ok, I'll try to increase baud. It's on µC Console page?
WRT resets, does it do that when you turn off the debug log also?
So when WRT resets esp-link it also resets attached mcu? Normally I have debug log turned off. It started happening week ago, it works 1-3 days and then it stops working. I can't really say for sure if its esp-link fault or OpenWRT but i didn't see anything suspicious in router's log. By the way, how to detect that esp-link is not responding (disconnected or not working) ? Maybe I put additional wire to reset esp-link from arduino.
Edit
I increased baud to max which is 460800 but I get framing error. I tried 250000, it works but same things are happening. I commented all Serial.print calls and esp link only sees one more mqtt publish.
Debug Log: Click to expand
106714> SLIP: start or end len=0 inpkt=1
106717> SLIP: start or end len=64 inpkt=1
106721> cmdParsePacket: cmd=11 argc=5 value=0
106725> cmdExec: Dispatching cmd=MQTT_PUB
106729> MQTT: MQTTCMD_Publish topic=sensors/kociolco/outdoortemp, data_len=3, qos=0, retain=0
106737> MQTT: Publish, topic: "sensors/kociolco/outdoortemp", length: 35
106744> SLIP: start or end len=0 inpkt=1
106780> MQTT: Send type=PUBLISH id=0000 len=31
106782> MQTT: Send type=PUBLISH id=0000 len=35
108439> HTTP GET /menu: 200, 10ms, h=13640
108441> HTTP GET /log/dbg: 200, 5ms, h=14400
0\1C\00devices/
111664> SLIP: start or end len=10 inpkt=1
111668> cmdParsePacket: cmd=7 argc=0 value=0
111672> cmdExec: Dispatching cmd=GET_TIME
111676> cmdResponse: cmd=2 val=1544913292 argc=0
111721> SLIP: start or end len=0 inpkt=1
111721> SLIP: start or end len=60 inpkt=1
111721> cmdParsePacket: cmd=11 argc=5 value=0
111724> cmdExec: Dispatching cmd=MQTT_PUB
But why there is empty line and number with > is missing at the beginning? And why outputing debug log on uart1 is affecting uart0? They have shared buffer?
I changed baud back to 115200 and with no Serial.print calls same happens as on 250000 baud. On 250000 it doesn't matter if debug log is enabled or not. I tried 57600 and I got crc error, so 115200 is the best choice. With disabled debug log it is not continuous
Debug Log: Click to expand
tching cmd=MQTT_PUB
691918> MQTT: MQTTCMD_Publish topic=sensors/kociolco/cwutemp, data_len=3, qos=0, retain=0
691919> MQTT: Publish, topic: "sensors/kociolco/cwutemp", length: 31
691919> MQTT: Send type=PUBLISH id=0000 len=31
691919> SLIP: start or end len=15 inpkt=0
691926> SLIP: start or end len=64 inpkt=1
691927> cmdParsePacket: cmd=11 argc=5 value=0
691927> cmdExec: Dispatching cmd=MQTT_PUB
691927> MQTT: MQTTCMD_Publish topic=sensors/kociolco/outdoortemp, data_len=3, qos=0, retain=0
691927> MQTT: Publish, topic: "sensors/kociolco/outdoortemp", length: 35
691927> MQTT: Send type=PUBLISH id=0000 len=35
691928> SLIP: start or end len=19 inpkt=0
691928> SLIP: start or end len=64 inpkt=1
691928> cmdParsePacket: cmd=11 argc=5 value=0
691928> cmdExec: Dispatching cmd=MQTT_PUB
691929> MQTT: MQTTCMD_Publish topic=devices/kociolco/airdoortemp, data_len=2, qos=0, retain=0
691929> MQTT: Publish, topic: "devices/kociolco/airdoortemp", length: 34
691930> MQTT: Send type=PUBLISH id=0000 len=34
691936> SLIP: start or end len=30 inpkt=0
691937> SLIP: start or end len=60 inpkt=1
691937> cmdParsePacket: cmd=11 argc=5 value=0
691938> cmdExec: Dispatching cmd=MQTT_PUB
691938> MQTT: MQTTCMD_Publish topic=devices/kociolco/copump, data_len=1, qos=0, retain=0
691938> MQTT: Publish, topic: "devices/kociolco/copump", length: 28
691938> MQTT: Send type=PUBLISH id=0000 len=28
692301> HTTP GET /log/text: 200, 10ms, h=15248
692720> HTTP GET /log/text: 200, 4ms, h=15240
693241> HTTP GET /log/text: 200, 4ms, h=15240
693862> HTTP GET /log/text: 200, 5ms, h=15240
694263> HTTP GET /log/text: 200, 5ms, h=15240
694550> HTTP GET /log/text: 200, 4ms, h=15240
694833> HTTP GET /log/text: 200, 5ms, h=15240
694942> HTTP GET /log/text: 200, 5ms, h=15240
695322> HTTP GET /log/text: 200, 6ms, h=15240
695635> HTTP GET /log/text: 200, 6ms, h=15240
695974> HTTP GET /log/text: 200, 9ms, h=15240
696277> HTTP GET /log/text: 200, 5ms, h=15240
696469> HTTP GET /log/text: 200, 4ms, h=15240
tching cmd=MQTT_PUB
696982> MQTT: MQTTCMD_Publish topic=sensors/kociolco/cwutemp, data_len=3, qos=0, retain=0
696982> MQTT: Publish, topic: "sensors/kociolco/cwutemp", length: 31
696982> MQTT: Send type=PUBLISH id=0000 len=31
696982> SLIP: start or end len=15 inpkt=0
696990> SLIP: start or end len=64 inpkt=1
696990> cmdParsePacket: cmd=11 argc=5 value=0
696990> cmdExec: Dispatching cmd=MQTT_PUB
696990> MQTT: MQTTCMD_Publish topic=sensors/kociolco/outdoortemp, data_len=3, qos=0, retain=0
696990> MQTT: Publish, topic: "sensors/kociolco/outdoortemp", length: 35
696991> MQTT: Send type=PUBLISH id=0000 len=35
696991> SLIP: start or end len=19 inpkt=0
696991> SLIP: start or end len=64 inpkt=1
696991> cmdParsePacket: cmd=11 argc=5 value=0
696992> cmdExec: Dispatching cmd=MQTT_PUB
696992> MQTT: MQTTCMD_Publish topic=devices/kociolco/airdoortemp, data_len=2, qos=0, retain=0
696992> MQTT: Publish, topic: "devices/kociolco/airdoortemp", length: 34
696993> MQTT: Send type=PUBLISH id=0000 len=34
696999> SLIP: start or end len=33 inpkt=0
697001> SLIP: start or end len=60 inpkt=1
697001> cmdParsePacket: cmd=11 argc=5 value=0
697001> cmdExec: Dispatching cmd=MQTT_PUB
697001> MQTT: MQTTCMD_Publish topic=devices/kociolco/copump, data_len=1, qos=0, retain=0
697001> MQTT: Publish, topic: "devices/kociolco/copump", length: 28
697002> MQTT: Send type=PUBLISH id=0000 len=28
697135> HTTP GET /log/text: 200, 10ms, h=15248
697489> HTTP GET /log/text: 200, 4ms, h=15240
697743> HTTP GET /log/text: 200, 4ms, h=15240
697921> HTTP GET /log/text: 200, 7ms, h=15240
698202> HTTP GET /log/text: 200, 5ms, h=15240
698483> HTTP GET /log/text: 200, 4ms, h=15240
698764> HTTP GET /log/text: 200, 4ms, h=15240
699064> HTTP GET /log/text: 200, 7ms, h=15240
699269> HTTP GET /log/text: 200, 5ms, h=15240
699447> HTTP GET /log/text: 200, 5ms, h=15240
699720> HTTP GET /log/text: 200, 5ms, h=15240
700013> HTTP GET /log/text: 200, 6ms, h=15240
700322> HTTP GET /log/text: 200, 7ms, h=15240
700560> HTTP GET /log/text: 200, 4ms, h=15240
700769> HTTP GET /log/text: 200, 4ms, h=15240
Like title says, most of Serial.print content is not received by esp-link and also most of mqtt publish calls are ignored. In Debug log I only get one slip crc error but in my arduino code there are more mqtt publish statements that are not seen by esp link. I have ESP-12E board and Arduino Pro Mini. Arduino is supplied from SMPS and ESP too but from LDO. There is also Logic level shifter board.
Snippet of Debug Log:
After bad CRC line you can see mqtt topic and payload and after that "Millis: 4456754\0D\0A" <- That should go to µC Console page.
You see more Serial.print and mqtt.publish calls but most of them are missed by esp-link.
Click to expand
µC Console:
Click to expand
Arduino sketch:
Click to expand
This only happens when uart0 or uart1 option on esp link's debug page is enabled. When I switch to auto or off everything works as it should. I need debug output because sometimes esplink is stopping working and it just blinks randomly LED and resets attached arduino over and over again. On my access point's (router with OpenWRT) log I see that esp tries to connect and it succeds but I cannot access web page.