Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
test-and-measurement:guides:getting-started-with-raspberry-pi [2022/09/08 20:13] – changed forum.digilentinc.com to forum.digilent.com jeff.greenberg_ni.comtest-and-measurement:guides:getting-started-with-raspberry-pi [2022/10/04 11:38] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Getting Started with Raspberry Pi and a Test and Measurement Device ======
  
 +~~TechArticle~~
 +
 +{{ reference:test-and-measurement:guides:rpi_cover.jpeg?600 |}}
 +
 +The following guide presents how to set up a Raspberry Pi 4 to control Test and Measurement devices and by the end of the guide, WaveForms will be running on Raspberry Pi 4. In this guide, a so called "headless" setup will be used, but other setups work as well.
 +----
 +
 +===== Inventory =====
 +=== Hardware ===
 +<WRAP group>
 +  * A Digilent Test and Measurement device
 +    * [[test-and-measurement:analog-discovery-pro-3x50:start|Analog Discovery Pro (ADP3450/ADP3250)]]
 +    * [[test-and-measurement:analog-discovery-studio:start|Analog Discovery Studio]]
 +    * [[test-and-measurement:analog-discovery-2:start|Analog Discovery 2]]
 +    * [[test-and-measurement:analog-discovery:start|Analog Discovery (Legacy)]]
 +    * [[test-and-measurement:digital-discovery:start|Digital Discovery]]
 +  * [[https://www.raspberrypi.org/products/raspberry-pi-4-model-b/|Raspberry Pi 4 Model B]]
 +  * A 5V 3A USB-C power supply
 +  * A minimum 8GB microSD card (an adapter might be needed, if your computer doesn't have a microSD socket)
 +  * A Computer connected to Wi-Fi
 +</WRAP>
 +
 +**Note:** //If you plan to use your Raspberry Pi in another setup (with a display, or with Ethernet connection), you might need additional hardware.//
 +
 +=== Software on your PC ===
 +<WRAP group>
 +  * [[https://www.raspberrypi.org/software/|Raspberry Pi Imager]]
 +  * [[https://ttssh2.osdn.jp/|TeraTerm]] - or any other terminal emulator of your choice
 +  * [[https://www.realvnc.com/en/connect/download/viewer/|VNC Viewer]]
 +</WRAP>
 +
 +=== Software on Raspberry Pi ===
 +<WRAP group>
 +  * [[https://mautic.digilentinc.com/adept-runtime-download|Adept Runtime]]
 +  * [[https://mautic.digilentinc.com/waveforms-download|WaveForms]]
 +</WRAP>
 +
 +**Note:** //These programs will going to be downloaded and installed on the device, later in this guide.//
 +
 +----
 +
 +===== Setting Up the Raspberry Pi =====
 +
 +<WRAP group>
 +To see more setup options for your Raspberry Pi, check this site: [[https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up|Setting up your Raspberry Pi]]. If you have already set up your Raspberry Pi, you can skip this part.
 +</WRAP>
 +
 +
 +--> Raspberry Pi - "Headless" Setup #
 +<WRAP group><WRAP half column>
 +Insert the microSD card in your laptop, then download, install and open the [[https://www.raspberrypi.org/software/|Raspberry Pi Imager]]. Select the Raspberry Pi OS as the operating system and your SD card in the second column, then click write. Once the writing process is finished, extract the SD card from your computer.
 +</WRAP><WRAP half column>
 +{{ reference:test-and-measurement:guides:rpi_imager.png?600 |}}
 +</WRAP></WRAP>
 +
 +<WRAP group><WRAP half column>
 +Reinsert the SD card into your PC. If you are working on Windows, you might be asked to format the SD card, but don't do that. Open the file manager, then open the only partition visible on your SD card: the **boot** partition.
 +
 +First create a new file named **ssh** (without extension!) in the root directory. When the Raspberry Pi boots, it will look for this file and if it finds it, it will enable Secure Shell (SSH) connection. We will use this connection to send commands to the Raspberry Pi when it boots first.
 +
 +Create another file named **wpa_supplicant.conf** (*.conf is the extension). Open this file with a text editor and copy the following lines in the file:
 +<code>
 +ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
 +update_config=1
 +country=<Insert 2 letter ISO 3166-1 country code here>
 +
 +network={
 + ssid="<Name of your wireless LAN>"
 + psk="<Password for your wireless LAN>"
 +}
 +</code>
 +Change the country code to fit your country, then set the SSID and the password of your Wi-Fi network before saving the file. This file will be used during the boot process of the Raspberry Pi to connect to the specified Wi-Fi network.
 +</WRAP><WRAP half column>
 +{{ reference:test-and-measurement:guides:rpi_boot_partition.png?600 |}}
 +</WRAP></WRAP>
 +
 +<WRAP group><WRAP half column>
 +Insert the SD card in the Raspberry Pi, then power it up. Wait a bit (around 2-3 minutes) for the Raspberry Pi to connect to the network. On your PC, open a command prompt then display the Raspberry's IP address with the following command:
 +<code>
 +ping raspberrypi.local -4
 +</code>
 +</WRAP><WRAP half column>
 +{{ reference:test-and-measurement:guides:rpi_ip_address.png?600 |}}
 +</WRAP></WRAP>
 +
 +<WRAP group><WRAP half column>
 +On your PC, download, install and open [[https://ttssh2.osdn.jp/|Tera Term]], or any other terminal emulator of your choice, then establish a new SSH connection to the IP address of the Raspberry Pi.
 +
 +Log in with the username:
 +<code>
 +pi
 +</code>
 +and passphrase:
 +<code>
 +raspberry
 +</code>
 +</WRAP><WRAP half column>
 +{{ reference:test-and-measurement:guides:rpi_ssh.png?400 |}}
 +</WRAP></WRAP>
 +
 +<WRAP group><WRAP half column>
 +Now you can send commands to your Raspberry Pi. First update and upgrade the installed packages with the commands:
 +<code>
 +sudo apt update
 +sudo apt upgrade -y
 +</code>
 +When the upgrades are finished, open the settings of your Raspberry Pi with the command:
 +<code>
 +sudo raspi-config
 +</code>
 +You should see a graphical interface with different settings. Select **Interface Options** (number 3 in the current version of the operating system) with the arrow keys and confirm with the enter key. Now select **VNC** (P3 in the current version), then select **Yes**. This will enable Virtual Network Computing (VNC) when the device boots.
 +
 +Exit the configuration tool with the escape key, then reboot the device with the following command:
 +<code>
 +sudo reboot
 +</code>
 +You can close the terminal emulator.
 +</WRAP><WRAP half column>
 +{{ reference:test-and-measurement:guides:rpi_vnc_enable.png?400 |}}
 +</WRAP></WRAP>
 +
 +<WRAP group><WRAP half column>
 +On your PC, download, install and open a [[https://www.realvnc.com/en/connect/download/viewer/|VNC Viewer]]. In the search bar, enter the IP address of the Raspberry Pi, then log in with the username:
 +<code>
 +pi
 +</code>
 +and password:
 +<code>
 +raspberry
 +</code>
 +</WRAP><WRAP half column>
 +{{ reference:test-and-measurement:guides:rpi_vnc_login.png?400 |}}
 +</WRAP></WRAP>
 +
 +<WRAP group><WRAP half column>
 +You should see now the "desktop" of your Raspberry Pi. Go through the initial settings as guided by the wizard to finish the setup.
 +</WRAP><WRAP half column>
 +{{ reference:test-and-measurement:guides:rpi_initial_settings.png?600 |}}
 +</WRAP></WRAP>
 +<--
 +
 +----
 +
 +===== Installing WaveForms on Raspberry Pi =====
 +<WRAP group><WRAP half column>
 +On your Raspberry Pi, open the [[https://mautic.digilentinc.com/adept-runtime-download|Adept Runtime Download]] and the [[https://mautic.digilentinc.com/waveforms-download|WaveForms Download]] pages. Fill in the required fields, then download Adept runtime for **Linux ARM-Raspberry Pi** and WaveForms for **Linux ARM-32-bit.deb**.
 +</WRAP><WRAP half column>
 +{{ reference:test-and-measurement:guides:rpi_adept_download.png?600 |}}
 +</WRAP></WRAP>
 +
 +<WRAP group><WRAP half column>
 +Open **Downloads** folder with the file manager, then hit **F4** to open a terminal here. Install the downloaded packages with the following commands (don't forget to change the name of the files according to their version):
 +<code>
 +sudo dpkg -i digilent.adept.runtime_2.21.2-armhf.deb
 +sudo dpkg -i digilent.waveforms_3.14.3_armhf.deb
 +</code>
 +</WRAP><WRAP half column>
 +{{ reference:test-and-measurement:guides:rpi_waveforms_install.png?600 |}}
 +</WRAP></WRAP>
 +----
 +
 +===== Using WaveForms on Raspberry Pi =====
 +<WRAP group><WRAP half column>
 +Connect your Test and Measurement device to one of the USB ports of the Raspberry Pi (doesn't matter which port).
 +</WRAP><WRAP half column>
 +{{ reference:test-and-measurement:guides:rpi_cover.jpeg?600 |}}
 +</WRAP></WRAP>
 +
 +<WRAP group><WRAP half column>
 +On the Raspberry Pi, open WaveForms: the launcher can be found in **Programming** and in **Education**.
 +</WRAP><WRAP half column>
 +{{ reference:test-and-measurement:guides:rpi_waveforms_open.png?600 |}}
 +</WRAP></WRAP>
 +
 +<WRAP group><WRAP half column>
 +WaveForms should automatically recognize the connected Test and Measurement device. If not, the **Device Manager** can be opened from the **Settings** menu.
 +
 +Now you have your Test and Measurement device connected to Raspberry Pi. You can use WaveForms on Raspberry Pi like on any other PC. For more guides about WaveForms, check: [[software:waveforms:waveforms-3:getting-started-guide]] and [[test-and-measurement:guides:start]].
 +</WRAP><WRAP half column>
 +{{ reference:test-and-measurement:guides:rpi_waveforms.png?600 |}}
 +</WRAP></WRAP>
 +----
 +===== Next Steps =====
 +
 +For more guides on how to use the Digilent Test and Measurement Device, return to the device's Resource Center, linked from the [[test-and-measurement:start]] page of this wiki.
 +
 +For technical support, please visit the [[https://forum.digilentinc.com/forum/8-test-and-measurement/|Test and Measurement]] section of the Digilent Forums.