Generate a random int = wipy 3.0

Questions and discussion about The WiPy 1.0 board and CC3200 boards.
Target audience: Users with a WiPy 1.0 or CC3200 board.
Post Reply
washcycle
Posts: 2
Joined: Wed Jan 23, 2019 3:20 am

Generate a random int = wipy 3.0

Post by washcycle » Wed Jan 23, 2019 3:30 am

I am trying to generate a random int and there is no urandom package on my wipy 3.0.

upip.install('urandom')
Installing to: /flash/
Error installing 'urandom': NotFoundError('Package not found',), packages may be partially installed
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/flash/lib/upip.py", line 230, in install
File "/flash/lib/upip.py", line 230, in install
File "/flash/lib/upip.py", line 218, in install
File "/flash/lib/upip.py", line 173, in install_pkg
File "/flash/lib/upip.py", line 159, in get_pkg_metadata
File "/flash/lib/upip.py", line 153, in url_open
File "/flash/lib/upip.py", line 153, in url_open
File "/flash/lib/upip.py", line 143, in url_open
NotFoundError: Package not found

I was able to install random.py, but it relies on urandom.

Micropython Version Details

Pycom MicroPython 1.20.0.rc4 [v1.9.4-1444e48] on 2019-01-07; WiPy with ESP32
Type "help()" for more information.

Installed the firmware via the pycom desktop app... I have a feeling this distribution from pycom strips a lot of the base packages from micropython.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Generate a random int = wipy 3.0

Post by Roberthh » Wed Jan 23, 2019 6:16 am

You are at the wrong forum. For WiPy3, ask as forum.pycom.io.
Besides that, in the Pycom variant of Micropython random numbers are provided by ucrypto.getrandbits() or uos.urandom().
See also the link to the documentation at their forum.

Post Reply