Thank you Cathal – that fixed it.
For reference and others’ benefit, here is the full setup that worked for me. I’m on a mac laptop (Catalina). The PYNQ-Z2 board is powered from my laptop via a USB-C to USB-Micro cable.
Step-by-step instructions
- Start with PYNQ board powered down
- Ensure the SD card is inserted (I’m using v2.5)
- Plug in the USB WiFi dongle into the USB-A port on the PYNQ
- Power up the PYNQ board, wait for LEDs to light up appropriately
- Establish connection from laptop to PYNQ by opening a Terminal on the mac and typing:
$ screen /dev/tty.usbserial-1234_tul1 115200
(you’ll need to change /dev/tty....
to be whatever the relevant name is on your system)
- Initially, the Terminal window will be blank, but after hitting “Return”, you’ll see a linux prompt. Then, start python3 (with sudo), and execute the three commands to initialize the WiFi dongle:
xilinx@pynq:~$ sudo python3
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pynq.lib import Wifi
>>> port = Wifi()
>>> port.connect('wifiNetworkNameGoesHere', 'wifiNetworkPasswordGoesHere')
Also, for reference, I tried this with three different WiFi modules.
- The Wi-Pi from element14 (FCC ID: OYR-COMFAST88) Worked
- EASTECH Ralink RT5370 Raspberry PI WiFi Adapter. Worked.
- D-Link Model No.: DWA-131 (FCC ID:KA2WA131A1) Did not work.
The first two worked, the third did not.
Connecting the WiFi dongle before or after powering up the PYNQ board does not change the outcome either way.
The error message that I got when using the D-Link was:
>>> port = Wifi()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/xilinx/pynq/lib/wifi.py", line 84, in __init__
raise ValueError("No WiFi device found. Re-attach the device "
ValueError: No WiFi device found. Re-attach the device or check compatibility.
If I then replaced the D-Link with the Wi-Pi and re-ran >>> port=Wifi()
, it worked.