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

hunting the LmacRxBlk:1 error - #220

Closed
gnkarn opened this issue Jul 23, 2017 · 3 comments
Closed

hunting the LmacRxBlk:1 error - #220

gnkarn opened this issue Jul 23, 2017 · 3 comments

Comments

@gnkarn
Copy link

gnkarn commented Jul 23, 2017

Now that i have the basic functionality going , im starting to make the application reliable ( it is far now from that state)

one of the main problems is related to Websockets connections, i may have some fundamental flaw in my program , as it is too much unstable, and connection is too much dependen on the connection sequence, and once it gets disconnected i do not have a mechanism to regain connection again .

so starting from basics , getting rid of LmacRxBlk:1

i do receive this messages, and after a while , the saturation message come up ( even when the video function is off) ,

i appreciate if , you can give me some hints , on where can i start looking for something that i may be missing in my program .

debug , messages :

:sent 4
:ww
:wr
:sent 646
:ww
:rn 53
:rch 53, 53
:rch 106, 53
:rd 2, 159, 0
:rdi 53, 2
:rd 51, 159, 2
:rdi 51, 51
:c 51, 53, 159
:wr
:sent 2
:ww
:wr
:sent 24
:ww
:rch 106, 53
:rn 8
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
:rd 2, 159, 0
:rdi 53, 2
:rd 51, 159, 2
:rdi 51, 51
:c 51, 53, 159
:rd 2, 8, 0
:rdi 8, 2
:rd 4, 8, 2
:rdi 6, 4
:rd 2, 8, 6
:rdi 2, 2
:c0 2, 8
[0] get Text: e5
:rn 188
:rch 106, 53
LmacRxBlk:1
LmacRxBlk:1
:rd 2, 159, 0
:rdi 53, 2
:rd 51, 159, 2
:rdi 51, 51
:c 51, 53, 159
:rd 2, 188, 0
:rdi 188, 2
:rd 4, 188, 2
:rdi 186, 4
:rd 2, 188, 6
:rdi 182, 2
[0] get Text: e4
:wr
:sent 2
:ww
:wr
:sent 24
:ww
:rch 106, 212
LmacRxBlk:1
LmacRxBlk:1
:rd 2, 318, 0
:rdi 53, 2
:rd 51, 318, 2
:rdi 51, 51
:c 51, 53, 318
:rd 2, 188, 8
:rdi 180, 2
:rd 4, 188, 10
:rdi 178, 4
:rd 2, 188, 14
:rdi 174, 2
[0] get Text: e3
:urch 40, 139
:urch 139, 147
:urd 23, 147, 13
:urch 147, 147
:urd 23, 147, 13
:urch 147, 614
:rd 2, 265, 0
:rdi 53, 2
:rd 51, 265, 2
:rdi 51, 51
:c 51, 53, 265
:rd 2, 188, 16
:rdi 172, 2
:rd 4, 188, 18
:rdi 170, 4
:rd 2, 188, 22
:rdi 166, 2
[0] get Text: e2
:wr
:sent 2
:ww
:wr
:sent 24
:ww
:urch 614, 86
:urd 10, 86, 13
:urch 86, 86
:urd 10, 86, 13
:urch 86, 86
:urd 10, 86, 13
:urch 86, 86
:urd 10, 86, 13
:urch 86, 312
:urch 312, 550
:rch 212, 212
:rch 424, 318
LmacRxBlk:1
:rd 2, 742, 0
:rdi 212, 2
:rd 51, 742, 2
:rdi 210, 51
:rd 2, 188, 24
:rdi 164, 2
:rd 4, 188, 26
:rdi 162, 4
:rd 2, 188, 30
:rdi 158, 2
[0] get Text: e1
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
:rd 2, 742, 53
:rdi 159, 2
:rd 51, 742, 55
:rdi 157, 51
:rd 2, 188, 32
:rdi 156, 2
:rd 4, 188, 34
:rdi 154, 4
:rd 2, 188, 38
:rdi 150, 2
[0] get Text: e0
:wr
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
:ww
:wr
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
:ww
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
:rd 2, 742, 106
:rdi 106, 2
:rd 51, 742, 108
:rdi 104, 51
:rd 2, 188, 40
:rdi 148, 2
:rd 4, 188, 42
:rdi 146, 4
:rd 2, 188, 46
:rdi 142, 2
[0] get Text: e1
:wr !ERR_OK
:wr !ERR_OK
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
:rd 2, 742, 159
:rdi 53, 2
:rd 51, 742, 161
:rdi 51, 51
:c 51, 212, 742
:rd 2, 188, 48
:rdi 140, 2
:rd 4, 188, 50
:rdi 138, 4
:rd 2, 188, 54
:rdi 134, 2
[0] get Text: e2
:sent 26
:rch 188, 1072
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
:rd 2, 530, 0
:rdi 212, 2
:rd 51, 530, 2
:rdi 210, 51
:rd 2, 1260, 56
:rdi 132, 2
:rd 4, 1260, 58
:rdi 130, 4
:rd 2, 1260, 62
:rdi 126, 2
[0] get Text: e4
:wr
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
:ww
:wr
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
:ww
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
:rd 2, 530, 53
:rdi 159, 2
:rd 51, 530, 55
:rdi 157, 51
:rd 2, 1260, 64
:rdi 124, 2
:rd 4, 1260, 66
:rdi 122, 4
:rd 2, 1260, 70
:rdi 118, 2
[0] get Text: e6
:wr !ERR_OK
:wr !ERR_OK
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
:rd 2, 530, 106
:rdi 106, 2
:rd 51, 530, 108
:rdi 104, 51
:rd 2, 1260, 72
:rdi 116, 2
:rd 4, 1260, 74
:rdi 114, 4
:rd 2, 1260, 78
:rdi 110, 2
[0] get Text: e8
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
:rd 2, 530, 159
:rdi 53, 2
:rd 51, 530, 161
:rdi 51, 51
:c 51, 212, 530
:rd 2, 1260, 80
:rdi 108, 2
:rd 4, 1260, 82
:rdi 106, 4
:rd 3, 1260, 86
:rdi 102, 3
[0] get Text: e11
:wr !ERR_OK
:wr !ERR_OK
WS:ac
:rn 426
LmacRxBlk:1
:rd 2, 318, 0
:rdi 318, 2
:rd 51, 318, 2
:rdi 316, 51
:ref 1
WS:av
:ref 2
:ur 2

@gnkarn
Copy link
Author

gnkarn commented Jul 24, 2017

what is the minimum action that the esp needs to take in order to free the buffer? and avoid overflowing .
go to the websocketloop, in case of sync mode?
execute the onmesagge callback, even if you don't need to do anything?
change the status of some variable?

@Links2004
Copy link
Owner

Links2004 commented Jul 24, 2017

LmacRxBlk:1 shows that the internal MAC layer buffer has a overflow.

calling websocket.loop() more often if possible is one way to deal with it (dont call it inside the webSocketEvent callback).
the callback is fired from the library as soon one websocket message has been handled.
the buffer is freed after the callback.
https://github.com/Links2004/arduinoWebSockets/blob/master/src/WebSockets.cpp#L460

if you already run the callback as often as possible, then you simple hit the maximum what the ESP can handle.

if you stream big amounts of data to the ESP, try to add some ACK handling to you protocol.
see my comment in #204 :
#204 (comment)

@gnkarn
Copy link
Author

gnkarn commented Jul 25, 2017

thank you for the explanation ,
i made a move to the Async ws and so far the problem went away .

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