3.2.2.4 Lab – Using a PL-App Notebook (Answers)

3.2.2.4 Lab – Using a PL-App Notebook (Instructor Version)

Lab Topology

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 16

Objectives

  • Access existing PL-App notebooks
  • Lean how to interact with PL-App notebooks using keyboard shortcuts
  • Create your own PL-App notebook

Background

The PL-App notebook concept is based on the Jupyter open source project that provides an interactive web page, where the content is divided into multiple smaller sections called cells. Each cell can contain either Markdown type of code or executable code.

The Markdown cell type is used to write the standard text of the page. Besides formatted text, it can hold multimedia objects like pictures, videos, animations, etc., and it is used to introduce and explain learning objectives, or is used as part of the documentation.

The Code cells are used to write directly executable code in one of the supported programming languages (Python, Bash). The application code can be split into multiple cells, where each cell can be executed one by one, multiple times. The code in these cells can be directly edited and modified, re-executed multiple times, and adapted to specific needs. This enables rapid prototyping concepts, where the development of the final application can be divided into smaller sections, each dealing only with the specific problem, while all the cells are solving the overall problem.

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 17

This lab provides a basic guideline to access existing labs – notebooks on the PL-App platform in the Course Materials folder-and to create new notebooks in the myfiles folder.

Required Resources

  • Prototyping Lab Kit (PL-Kit)
  • Prototyping Lab App (PL-App) Launcher application
  • Wired Ethernet or Wi-Fi connection to the local-area network with DHCP
  • Raspberry Pi with a power adapter
  • Google Chrome or other modern a web browser

Task 1: Use Existing PL-App Notebooks

Step 1: Access a PL-App Device from PL-App Launcher

a. Connect the Raspberry Pi with the PL-App µSD card to the same network as your computer and power on the Raspberry Pi.

b. Start the PL-App Launcher application. You should see the following screen with the Available Devices tab with a list of your PL-App devices. If you cannot see your PL-App device name in the list, click the Add Device Name button to add a new device to discover. Wait until your PL-App device is connected and the green Connect button becomes active.

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 18

c. Click the Connect button to connect directly to the PL-App web interface running on your Raspberry Pi device.

d. First, log in to the web interface of PL-App. Use the password you specified in PL-App Launcher in the setup process of the µSD card.

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 19

e. After a successful login, the PL-App directory browser opens the root directory with the notebooks.

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 20

Step 2: Access a PL-App Notebook

a. In the PL-App web interface, navigate to the Course Materials > Tutorials and Demos > Blockly folder and select the Real Time Plot in the Blockly.ipynb notebook to open it in a new browser tab.

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 21

b. After the Real Time Plot in Blockly notebook has been opened in a new browser tab, you can start to play with the Visual Programming example in Blockly. Execute the example Blockly cell:

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 22

c. Try to modify the Blockly code, change some of the parameters and execute the cell again.

Task 2: Create New PL-App Notebooks

Step 1: Create a new a PL-App Notebook

a. In the PL-App web interface navigate to the myfiles folder and then select from the menu: New > Python 2 to create a new Python 2 based notebook in the current folder:

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 23

b. After the new notebook has been opened in a new browser tab, you can start to work with the interactive notebook page. Change the first cell from the default Code type to Markdown:

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 24

c. Add some explanatory text to the Markdown cell:

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 25

d. To visualize the output , Execute the Markdown cell by using the keyboard shortcut Shift+Enter.

e. Create a new Code cell. In the new Code cell, add a sample Python code and execute the cell either with some of the keyboard shortcuts, or by using the Play button on the left part of the cell:

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 26

f. There are many existing tutorials and sample notebooks located in the Course Materials/Tutorials and Demos/Python folder. You can open these notebooks to learn and practice your Python skills.Open existing tutorials and sample Notebooks by navigating from PLApp’s homepage to

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 27

You can learn to make graphs like the one shown in the figure below.

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 28

g. To rename your notebook from the default “Untitled”, click the notebook’s name and specify a new name:

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 29

h. Close the web browser tabs, remove the power from the Raspberry Pi and remove the µSD card.

i. Insert the µ SD card into your µSD card reader or USB reader and insert it into your computer.

j. Open the File Explorer and enter the µSD card drive. Open the notebooks\myfiles folder to find and backup the My First Notebook.ipynb file to your computer.

3.2.2.4 Lab - Using a PL-App Notebook (Answers) 30

Notes

Use this space to note the key elements of what you learned in performing this exercise. The notes can include problems encountered, solutions applied, useful commands employed, alternate solutions, methods, processes, procedure, and communication improvements.
_______________________________________________________

 


guest
0 Comments
Inline Feedbacks
View all comments