random(a,b) not working on Wemos D1 mini


Tested on one of the basic examples “Mini Web Server” the instruction random(0,100) always return 0. If I try to use random(21,126) I always get 21. I don’t get any warning or error after compile. I was wandering if it is possible to replace the random function with the VM RNG function and how…


I Correct: I was wondering if you could use the VM RNG function in place of python “random” function.


Also tested with a nodeMCU v2, same code, same response. Random function only return the first value ! Any ideas ??


Hi ZioTo73,
the Zerynth random function should retrieve the value from the hardware random number generator but this is not happening in all the ESP8266 boards because of a bug. We have already solved it and the fix will be available in the next patch. 


Hi ZioTo73

the new patch is out:



Yesss, it works fine ! :) Thank you.