-
• #2
And I tried to send data piece by piece, on "drain" event of the socket, but still got LOW_MEMORY error.
-
• #3
.
-
• #4
Here is the test data (short version):
[{"name":"6","nickname":"6","type":"dw","pin":"NodeMCU.D0","state":"auto","id":"8f00ea92fd13290a00b439c50fcf44b55adf4b5e"},{"name":"66","nickname":"66","type":"dw","pin":"NodeMCU.D1","state":"auto","id":"954d9746e2c362d436626ca9baadaf0b23f1344d"},{"name":"666","nickname":"666","type":"dw","pin":"NodeMCU.D2","state":"auto","id":"69a58c85aef959e6cfe3bf1f60304b9fd3e6a82b"},{"name":"66666","nickname":"66666","type":"dw","pin":"NodeMCU.D3","state":"auto","id":"ba057ce5419bf32c7cd8187bf59038f23e422fab"},{"name":"666666","nickname":"666666","type":"dw","pin":"NodeMCU.D5","state":"auto","id":"a207a27e844ad42e6bed12a33859e28b4fc1224c"},{"name":"66666666","nickname":"66666666","type":"dw","pin":"NodeMCU.D6","state":"auto","id":"7e1fc12b607bbef30c7120ab93a89e55d13b29e7"},{"name":"6666666666","nickname":"6666666666","type":"dw","pin":"NodeMCU.D8","state":"auto","id":"880eb9d52c07f310654c835410ff0c9bd746edbc"},{"name":"666666666666","nickname":"666666666666","type":"dw","pin":"NodeMCU.D9","state":"auto","id":"bd988671faeefd7f6504cb6967ab674933d30405"}]
I had a problem with WebSocket when I try to send a long string(1688 Bytes in my case). I got error
"Execution Interrupted during event processing.
New interpreter error: LOW_MEMORY,MEMORY".
Then I modified the ws module, made the send function can accept a json object, to prevent string copy. But in another for loop, it still make a copy of source, I made comment down below.
I tried 5 methods(like using flash as buffer or turn source string in to array at first and exchange char in it in for loop) to fix it ,but none of them work.
I wish to use the second method to send data, but server will emit error "MASK must be set".
Anyone know how to deal with this? Thank you.