Comments (13)
i never had this kind of problem,
the RX and TX buffer are independent from each other on the ESP.
can you please add
Serial.setDebugOutput(true);
and enable the DEBUG_WEBSOCKETS.
and then post the log here when it happens.
from arduinowebsockets.
Yes I thought the same on the RX/TX issue.
So I deleted my patch and enabled the debugging.
In this test I'm basically sending some strings with values ("x410","x420"...."x450") many times very fast and the ESP8266 sending back the the string "red changed". Now when I looked at it again - it "freezes" and then after a second it kept writing the log stating that the websocket disconnected.
When I add my patch I still get some of the received data, less frequent of course...
Here's the last part of the log:
[WS][2][handleWebsocket] free: x420
[WS][2][handleWebsocket] ------- read massage frame -------
:rd 2, 50, 0
:rdi 10, 2
[WS][2][handleWebsocket] fin: 1 rsv1: 0 rsv2: 0 rsv3 0 opCode: 1
[WS][2][handleWebsocket] mask: 1 payloadLen: 4
:rd 4, 50, 2
:rdi 8, 4
:rd 4, 50, 6
:rdi 4, 4
:c 4, 10, 50
[WS][2][handleWebsocket] text: x420
420
[WS][2][sendFrame] ------- send massage frame -------
[WS][2][sendFrame] fin: 1 opCode: 1 mask: 0 length: 4 headerToPayload: 0
[WS][2][sendFrame] text: red changed
:wr !_pcb
:wr !_pcb
[WS][2][handleWebsocket] free: x420
[WS][2][handleWebsocket] ------- read massage frame -------
:rd 2, 40, 0
:rdi 10, 2
[WS][2][handleWebsocket] fin: 1 rsv1: 0 rsv2: 0 rsv3 0 opCode: 1
[WS][2][handleWebsocket] mask: 1 payloadLen: 4
:rd 4, 40, 2
:rdi 8, 4
:r
:wr !_pcb
d 4, 40, 6
:rdi 4, 4
:c 4, 10, 40
[WS][2][handleWebsocket] text: x430
430
[WS][2][sendFramrd 2, 30, 0
:rdi 10, 2
e] ------- send massage frame -------
[WS][2][sendFrame] fin: 1 opCode: 1 mask: 0 length: 4 headerToPayload: 0
[WS][2][sendFrame] text: red changed
:wr !_pcb
[WS][2][handleWebsocket] free: x430
[WS][2][handleWebsocket] ------- read massage frame -------
:[WS][2][handleWebsocket] fin: 1 rsv1: 0 rsv2: 0 rsv3 0 opCode: 1
[WS][2][handleWebsocket] mask: 1 payloadLen: 4
:rd 4, 30, 2
:rdi wr !_pcb
:wr !_pcb
8, 4
:rd 4, 30, 6
:rdi 4, 4
:c 4, 10, 30
[WS][2][handleWebsocket] text: x430
430
[WS][2]rd 2, 20, 0
:rdi 10, 2
[sendFrame] ------- send massage frame -------
[WS][2][sendFrame] fin: 1 opCode: 1 mask: 0 length: 4 headerToPayload: 0
[WS][2][sendFrame] text: red changed
:[WS][2][handleWebsocket] free: x430
[WS][2][handleWebsocket] ------- read massage frame -------
:[WS][2][handleWebsocket] fin: 1 rsv1: 0 rsv2: 0 rsv3 0 opCode: 1
[WS][2][handleWebsocket] mask: 1 payloadLen: 4
:rd 4, 20, 2
:rdi wr !_pcb
:wr !_pcb
8, 4
:rd 4, 20, 6
:rdi 4, 4
:c 4, 10, 20
[WS][2][handleWebsocket] text: x430
430
[WS][2]rd 2, 10, 0
:rdi 10, 2
[sendFrame] ------- send massage frame -------
[WS][2][sendFrame] fin: 1 opCode: 1 mask: 0 length: 4 headerToPayload: 0
[WS][2][sendFrame] text: red changed
:[WS][2][handleWebsocket] free: x430
[WS][2][handleWebsocket] ------- read massage frame -------
:[WS][2][handleWebsocket] fin: 1 rsv1: 0 rsv2: 0 rsv3 0 opCode: 1
[WS][2][handleWebsocket] mask: 1 payloadLen: 4
:rd 4, 10, 2
:rdi 8, 4
:rd 4, 10, 6
:rdi 4, 4
:c0 4, 10
[WS][2][handleWebsocket] text: x440
440
:ur 1
WS:dis
[WS-Server][2] client disconnected.
[WS][2][handleWebsocket] free: x440
from arduinowebsockets.
I made some changes can you test them?
from arduinowebsockets.
Hi,
So I pulled the new code, it seems I missing a file since I get this error
C:\Program Files (x86)\Arduino\libraries\WebSockets\src\WebSockets.cpp:28:35: fatal error: core_esp8266_features.h: No such file or directory
#include <core_esp8266_features.h>
Did I missed this .h file? Is it from a certain version of the IDE?
from arduinowebsockets.
its only in the git version of the core,
what core version you have?
from arduinowebsockets.
you mean the arduino IDE core? I currently have the 2.0.0 rc2 from the staging versions.
Should it be on the new 2.0.0 stable version? or I should I download it manually?
from arduinowebsockets.
the easy-es way it to follow this:
https://github.com/esp8266/arduino#using-git-version-
you need to remove the version in your user dir.
from arduinowebsockets.
EDIT:
Wait... forgot to enable debugging on your new code
Deleted what I wrote
from arduinowebsockets.
the debug out is disabled.
but the main info is LmacRxBlk:1
which mean that the WiFi input buffer of the SDK is overloaded.
so in short, you reach the maximum possible for the ESP hardware.
you can try to run at 160Mhz.
but better think about if you need to answer to each data request you get, may rate limit it.
the TCP layer itself will ensure the packages come save to the other side.
from arduinowebsockets.
Ah... you answered before I had the chance to fix my comment :)
Thanks, I do not need to response every time, just wondered if it is a bug.
But I am still wondering how come when I've added my patch it solved the problem...
perhaps when I cancelled some of the "sendFrame" it also made the buffer smaller.
What's the maximum by the way? do you know?
from arduinowebsockets.
if you do less sendFrame there is more time to handle the incoming data :)
and in you case this saved time where enough to prevent the buffer form overflowing.
espressif not provide any info about this part of the chip.
we only know the meaning of LmacRxBlk:1
from many cases where all is coming form the same basic problem,
to many incoming data that is not handled --> buffer full.
from arduinowebsockets.
OK, Thanks for the info!
from arduinowebsockets.
I ran into something similar on this. The websocket module would fail and not recover when transmitting data from main loop on a 1s period while receiving continuous data from an html slider.
I fixed it by putting a 1ms delay after the websocket transmit (sendTXT) portion in the main loop, as if it needs a break to finish it's job after transmit call has returned.
Also, if a client breaks connection without properly disconnecting, it hangs the server for 10 or 20 seconds every loop. I fixed this by pinging all possible clients and disconnecting the ones that fail that were thought to be active by the server.
from arduinowebsockets.
Related Issues (20)
- esp8266 unable to connect websocket server wss://xyz.com
- problem in mocpp_initialize() function. HOT 1
- Possible hint at how to close connections. HOT 1
- WebSocketsClient.cpp begin() error HOT 1
- I can not connect Heroku Server
- Use a buffer pool HOT 4
- WebSocket with AT commands (GSM model: Quectel EC25)
- Async with Socket.IO disconnects and reconnects repeatedly HOT 1
- Conflict when using with pn532. HOT 2
- WebSocketsClient - Return in Void-Function and also toString not found? HOT 3
- Connecting as a client to another ESP8266 hosting Async websocket server is failing on long messages. HOT 1
- Serial Monitor Garbage datas
- Can we describe the behavior of disconnect/autoreconnect and according action HOT 2
- Disconnection detection issue HOT 11
- The error code is not compiled: 'class WiFiServer' does not have a member named 'accept' HOT 4
- Cannot connect to Socket.IO serve HOT 1
- Can't find WiFi.h and WiFiClientSecure.h
- ESP32 + ENC28J60 = tcpip_send_msg_wait_sem HOT 1
- Compilation error: exit status 1
- Sadly it's crashing all over the place
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduinowebsockets.