You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LoRa chip must be set in a specific mode before that, you can't get random number at any given time. LoRa must be stopped and set to continuous mode first, and so on.
There should be 8 reads, keeping only the least significant bit (LSB), and build the output byte from that.
To generate an N bit random number, perform N read operation of the register RegRssiWideband (address 0x2c) and use the LSB of the fetched value. The value from RegRssiWideband is derived from a wideband (4MHz) signal strength at the receiver input and the LSB of this value constantly and randomly changes.
You need to put the SX1276/8 in Receive Continuous mode, SF7, C/R 4/5, BW 125KHz (call to setupLoRandom(), and then read 8 bytes to get one random byte (call to getLoRandomByte()). After which you need to put back your LoRa chip to whatever settings you were using.
In BastWAN_LoRa_RNG I build a buffer of 256 random bytes at once.
The text was updated successfully, but these errors were encountered:
LoRaClass::random() reads the register once and returns the byte.
This is wrong for two reasons:
LoRa chip must be set in a specific mode before that, you can't get random number at any given time. LoRa must be stopped and set to continuous mode first, and so on.
There should be 8 reads, keeping only the least significant bit (LSB), and build the output byte from that.
See Chapter 4 of Random Number Generation for Cryptography.
Example code from LoRandom.h
You need to put the SX1276/8 in Receive Continuous mode, SF7, C/R 4/5, BW 125KHz (call to
setupLoRandom()
, and then read 8 bytes to get one random byte (call togetLoRandomByte()
). After which you need to put back your LoRa chip to whatever settings you were using.In BastWAN_LoRa_RNG I build a buffer of 256 random bytes at once.
The text was updated successfully, but these errors were encountered: