-
Notifications
You must be signed in to change notification settings - Fork 555
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
[BUG]WebSocketServer crash on ESP32-C6 #907
Comments
makes sense the address is diffrent for the C6, but espressif has added a define for get the correct address: can you test: #ifdef ESP8266
randomSeed(RANDOM_REG32);
#elif defined(ESP32) && defined(WDEV_RND_REG)
randomSeed(REG_READ(WDEV_RND_REG));
#elif defined(ESP32)
#define DR_REG_RNG_BASE 0x3ff75144
randomSeed(READ_PERI_REG(DR_REG_RNG_BASE));
#elif defined(ARDUINO_ARCH_RP2040)
randomSeed(rp2040.hwrand32());
#else
// TODO find better seed
randomSeed(millis());
#endif
this may require to add a include to |
I have tested the changes with success on : ESP32 / ESP32-C3 / ESP32-C6 / ESP32-S2 / ESP32-S3
and no issue so far ^_^, so looks good - thank you |
new release with change https://github.com/Links2004/arduinoWebSockets/releases/tag/2.6.1 |
Hello Markus,
I hope you are ok - I am using your library (mainly WebSocketServer) on my project for years now, and it is working well on ESP8266, ESP8285, ESP32, ESP32-Pico,ESP32-S2, ESP32-S3, ESP32C3, great library.
Unfortunatly the WebSocketServer crash on ESP32-C6, I am just starting the porting.
I digged in the issue using your example: https://github.com/Links2004/arduinoWebSockets/blob/master/examples/esp32/WebSocketServer/WebSocketServer.ino
and found that line is the root cause on C6:
https://github.com/Links2004/arduinoWebSockets/blob/master/src/WebSocketsServer.cpp#L92
it seems ESP32-C6 really does not like :
replacing it by the default :
randomSeed(millis());
Solve the crash issue, I did not do a PR because I am not sure this is the solution you want, or you want to screen C6 only for it, etc...
So I just share my finding - hope it help
The text was updated successfully, but these errors were encountered: