Description
According to the Arduino API reference
https://www.arduino.cc/reference/en/language/functions/random-numbers/randomseed/
it should be possible to create a repeatable sequence of pseudo-random numbers based on the same seed being used.
This does not seem to work on ESP32. Poking around, it looks like it is implemented here
It looks like it is based on esp_random() which uses noise to more "truly" randomize numbers. This might seem like a good idea, but it actually breaks documented behavior. The spec even suggests:
"it can occasionally be useful to use pseudo-random sequences that repeat exactly."
I think it would be better to keep the defined Arduino behavior and give the user a way to opt for the ESP32 style randomization if desired, or perhaps documenting a technique to do so, such as setting a seed based on esp_random().
Originally posted by @rsiemens77 in #7399
Metadata
Metadata
Assignees
Labels
Type
Projects
Status