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
Crashes when pixels > 288 #5
Comments
Alright, will test this with RGBW but sending it to RGB since I don't have such a large stripe at the moment. But that should be enough to reproduce right? |
Testing in feature/debug-400px Took 908 micro seconds to consume UDP receiving 1472 bytes. One pixel more at 490 pixels it just does not do anything. What would be the way to receive passing this MTU limit @IoTPanic? Can you debug deeper and share your thoughts? What I find cool about the ESPAsyncHttp is that the callback function is aware of this and splits the packages in 1,2 Kb approx. calling the function twice and sending len, index, total as a parameter. Notes: After 490 pix PIXELS::unmarshal -> PIXELS::receive() is never called. It's just like if the UDP receive never happened hitting this limit. RESEARCH Links: |
Hm, okay, that makes sense, so a UDP packet size is 65535 bytes, it is the wi-fi/ethernet layers job to split it into MTU sized frames and reassemble on the ESP. There must be a good solution for this, I am on the case. |
Hendrik and I talked, going to work on multi frame s data to transport PIXELs data since the ESP cannot handle multi frame UDP packets. |
Would be nice to hear a more descriptive and understandable explanation from both of you. Unless there is something more to add here we can close this. In http side it’s working good and tested for 1000 pixels but of course this recursive function is not meant to handle animations. |
Keep it open until I solve the issue, since the ESP doesn't stitch together wi-fi frames like computers do, it needs a wrapper to break up a single pixels packet to multiple UDP packets. We already have a layer between pixels and UDP, which is s, so I need to both finish s and add multi frame capabilities. |
@martinberlin why would you close it if the issue is not solved? The problem is #5 (comment) |
@hputzek I though was going to be solved elsewhere since I did not understood the initial explanation. Now I will like to picture out in existant documentation is how the s library will act as a layer between pixels and UDP. But I guess we will have to wait until Samuel is done for that. Now what I want to understand, after this MTU revelation, is how multi-UDP packages of max. 1.4 Kb are going to be joined together and if that will have an effect over the animations. |
It will be interesting to see how it effects aninstions. Things will start slowing down at work in the next week or two, I hope to have s done way before that, but than I will be able to put more time into this project. Also, I was going to merge PIXELS+s to development after I was done, but you seem to be working on the development branch. Should I merge today? |
Do it! And let's keep a master branch with Tagged versions. I already made a copy of master in https://github.com/martinberlin/udpx/tree/feature/json-v0.1 just to keep a historic version of the first one we made based on Hendrik's first example. |
@IoTPanic: The branch to test S is now then Pixels+s right. I was making a feature/s when it was already there! When I test this one with @hputzek tester using Pixels+s option I get: From S readme:
One thing regarding the 16 bit integer on the first 5 bytes header, I think you are calculating it wrong Hendrik, please look at how I calculated it on the udpx tester. Let's say you send 10 pixels, it should be for Pixels only: 50 00 00 0A 00 On your tester is coming out for same amount: 50 00 00 1e 00 that is 30 on decimal, so if I'm thinking correct, is the wrong number for the amount of Pixels. I'm calculating that like this: let MSB = parseInt(pixLength/256);
let LSB = pixLength - (MSB*256);
// header bytes Less significant byte first:
hByte = [80,0,0,LSB,MSB]; Now if I see it correctly then on Pixels+s protocol you are not sending the header as documented in the library: NOTE: In s docuementation this length should represent the lenght in bytes (That's already done correctly) And then should come 8-bit XOR checksum. @IoTPanic please explain how to generate this number because it's not explained how to generate it in the Readme. Also is not clear if it should come from the data itself or from where. And before handling this to Hendrik again please check if my explanations are correct. Please let's use the testing/s branch ( I deleted PIXELS+s to avoid confusion ) |
Sorry but I'm closing this here since it's an MTU issue that has nothing to do with the Firmware itself and has to be done elsewhere, like with the S implementation of https://github.com/IoTPanic/s#fragmentation the UDP receive. |
When I tested with @martinberlin testing tool, I had the following issue:
When I used 288 pixels to test, it sometimes crashed.
When using 432px, the esp crashed after the first push of the animation button.
To be more exact:
It did not crash, but "disconnected from mqtt" "reconnected to mqtt" for several times and then stopped logging anything. As soon as that happened the first time, the output stopped and did not work anymore.
This was tested with rgbw output, see the #4 issue
The text was updated successfully, but these errors were encountered: