Internet on the PYNQ board
By default the PYNQ board cannot access the internet. However, it can be useful to have internet on the PYNQ, for example to install new software or to use external git repositories.
You check if the board has internet access by executing ping google.com
in a terminal on the PYNQ.
You have no internet access if it shows that it cannot find google:
Since it is simpler it is recommended to leave internet access off. Switch it on only if your course requires it or you need it for a particular reason.
⚠️ Warning
Never connect the PYNQ board to a TU/e network socket. This will result in the socket being disabled.
Network configuration on the PYNQ board
The network can be configured on the PYNQ in two ways:
1. The PYNQ board is a DHCP server (default)
By default the board acts as a DHCP server, which is the easiest way to use the PYNQ board. When you connect your laptop to the PYNQ board, the PYNQ board supplies the laptop with an IP address (i.e. a network address). This is the default, and there is no need to configure anything. The PYNQ board does not have access to the internet in this mode.
2. The PYNQ board is a DHCP client
Alternatively, the PYNQ board can also act as a DHCP client. When you connect your laptop to the PYNQ board, the laptop supplies the laptop with an IP address (i.e. a network address). In this mode the PYNQ board has access to the internet.
Enabling internet on the PYNQ board
Enabling internet access on the PYNQ board is different on Windows, macOS, and Linux.
Share internet on Microsoft Windows
Take the following steps (only once) to enable internet on the PYNQ board:
-
Connect the PYNQ board to the Windows machine. Do not switch on the PYNQ.
-
On you Windows machine, go to the following menu:
Control Panel
>Network and Sharing Centre
>Change adapter settings
. Take note of your Wi-Fi Adapter, as well as the Ethernet Adapter your PYNQ board is connected to. In this case, this is theEthernet 2
Adapter (ASIX AX88772A).
- Double click on the Wi-Fi Adapter, and select
Properties
. Then open theSharing
tab. Here, the checkboxAllow other network users to connect through this competers Internet connection
should be checked. Select the Ethernet Adapter your PYNQ board is connected to in theHome networking connection
drop-down menu.
- Close the Wi-Fi Adapter menu's, and open the Ethernet Adapter your PYNQ board is connected to. In this case the
Ethernet 2
(ASIX AX88772A). In this menu, double click onInternet Protocol Version 4 (TCP/IPv4)
. Here, te IP address and Subnet mask should have been filled in automatically. Take note of the IP address, which in this case is192.168.137.1
.
-
Now you can switch on the PYNQ board and wait until the green DONE LED has lit up. Your PYNQ board will now be connected to your Windows machine via a new IP address, instead of the default
10.43.0.1
IP address. The new IP address will be in the range of192.168.137.2-192.168.137.254
. -
In order to find the exact IP address of your PYNQ board, you can use the following Windows Batch script, which can be run by saving this code block as
find-ip.bat
file. Note that your the variablesBASE_IP
should reflect the first 3 octets of your IP address found in step 4.@echo off setlocal enabledelayedexpansion REM Define the base IP address (e.g., 192.168.1) set BASE_IP=192.168.137 REM Set a ping timeout of [ms] before continuing set TIMEOUT=100 REM Define the start and end range of the IP addresses set /A START_RANGE=1 set /A END_RANGE=254 REM Loop through the range of IP addresses for /L %%I in (%START_RANGE%,1,%END_RANGE%) do ( REM Construct the full IP address set IP=%BASE_IP%.%%I echo Pinging !IP!... REM Ping the IP address with a timeout of 100ms (1 second) ping -n 1 -w !TIMEOUT! !IP! >nul REM Check if the ping was successful if !errorlevel!==0 ( echo Host found at !IP! ) ) endlocal
-
Run the batch file to start pinging the range of IP addresses. When your PYNQ board has been found, it will show the message
Host found at <IP>
. Please note that the host found at192.168.137.1
will be your Windows machine, not your PYNQ board. An example can be seen here:
- Once the IP address of your PYNQ board has been found, you can change your SSH configuration with the updated IP address. In this case the new IP address will be
192.168.137.29
:
- You can now connect to your PYNQ board as usual via Visual Studio Code or MobaXterm. To verify your PYNQ board has internet access, execute the
ping google.com
command. This should show you are receiving bytes, as shown here:
.
⚠️ Warning
One important thing to note is that the IP address of the PYNQ board is not static in this configuration. When connected to a different (Wi-Fi) network, or after a reboot from your Windows machine or PYNQ, the IP address to which your PYNQ board is connected might change. If this happens, just re-run the Windows Batch script to find the IP address of your PYNQ board again and update you SSH configuration, as shown in steps 7-9.
If running the Batch script does not work, disable the network sharing and unplug your network adapter. Then re-enable network sharing again as described in this manual.
Share internet on macOS
Apple's security policy prevents sharing the internet on the authenticated TU/e wireless networks (e.g. WPA2 and guest). (And you shouldn't connect it to the TU/e wired network since that will disable the network socket.) You will get the following error message:
Internet sharing of non-authenticated networks at home or elsewhere, even when using the TU/e VPN, should work. Take the following steps (only once) to enable internet on the PYNQ board.
- Connect the PYNQ board to the Mac. Do not switch on the PYNQ.
- On your Mac open the System Settings application and select
Internet Sharing
(it's easiest to search for "sharing"). (On your computer "Remote Login" is probably disabled. This doesn't matter.) You have to enter an administrator account and password on your computer. - Click on the "(i)" next to "Internet Sharing", and select "WIFI" and the Ethernet adapter (here it is the Digitus "AX88x72A").
If you are on the TU/e VPN then you should select that. Click "Done".
- Click on the switch of "Internet Sharing" to start sharing and confirm:
- Switch on the PYNQ board and wait until the green DONE LED has lit up.
-
You can now log in to the PYNQ board. You can verify that it has an internet connection with the
ping google.com
command that should show no packet losses. (Use control + c to stop the program.)
Until you switch off internet sharing, your PYNQ board will now use your laptop's connection to the internet every time you use it.
⚠️ Warning
You can only switch on or off the internet sharing when the PYNQ board is off. If you change internet sharing when your board is on you will lose your connection to the PYNQ. Similarly, switching the internet sharing on and off multiple times will probably stop it from working altogether. To fix, switch off the PYNQ board and reboot your laptop.
⚠️ Warning
If you enable internet sharing at home you must disable it before you can use the PYNQ board at the university. Otherwise you will get the following error.
Share internet on Linux
The exact setup might differ per used distribution but for most network-manager based systems it should be similar to the following.
- Connect the PYNQ board to your laptop. Switch it on and wait until it has booted (the green DONE LED is on). TODO: needed?
- On your laptop, go to the network properties.
-
Click 'Add network' and select 'Ethernet':
-
Give the connection a name, and on the IPv4 settings page select "shared to other computers":
-
If you select this "profile" to be active on the network device connected to the PYNQ board, it should get an IP address when the PYNQ boots and the PYNQ board will have internet access.