Skip to content

Commit 7e4b8a3

Browse files
authored
[PC-1032] Portenta X8: Output WebGL Content on a Screen Redefinition (#363)
* Initial commit - Tutorial content update * Tutorial content minor update * Tutorial content update * Tutorial content update * Tutorial content update
1 parent 924dec4 commit 7e4b8a3

File tree

1 file changed

+56
-38
lines changed
  • content/hardware/04.pro/boards/portenta-x8/tutorials/display-output-webgl

1 file changed

+56
-38
lines changed

Diff for: content/hardware/04.pro/boards/portenta-x8/tutorials/display-output-webgl/content.md

+56-38
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: 'Output WebGL Content on a Screen'
3-
description: 'This tutorial shows how to install and modify a container that outputs web browser and webGL content'
3+
description: 'This tutorial shows how to install and modify a container that outputs web browser and webGL content.'
44
difficulty: beginner
55
tags:
66
- containers
@@ -17,32 +17,34 @@ hardware:
1717

1818
## Overview
1919

20-
The Arduino Portenta X8's processor **NXP® i.MX 8M Mini Processor** can be used for 3D rendering, this will allow us to display 3D content on a screen or video output, the device is using OpenGL to process the 3D related calculations. In this tutorial we will render web content from the internet using WebGL and display it on a screen, using an USB Hub. We will go through the steps of how to setup, install and modify the video output.
20+
The Arduino Portenta X8's processor **NXP® i.MX 8M Mini Processor** is capable of 3D rendering by using OpenGL to process the 3D-related calculations, allowing us to display 3D content on a screen or video output.
21+
22+
In this tutorial, we will render web content from the internet using WebGL and display it on a screen, using a USB Hub. We will go through the steps to set up, install and modify the video output.
2123

2224
## Goals
2325

24-
- Setup the Video Output
25-
- Get the required container
26-
- Run the container
27-
- Change the video output
26+
- Learn how to setup the Video Output
27+
- Learn how to get the required container
28+
- Learn how to run the container
29+
- Learn how to change the video output
2830

2931
### Required Hardware and Software
3032

3133
- [Arduino Portenta X8](https://store.arduino.cc/products/portenta-x8)
3234
- USB-C® cable (either USB-C® to USB-A or USB-C® to USB-C®)
3335
- USB-C® hub with HDMI
34-
- External monitor
36+
- External monitor
3537
- HDMI cable
3638

3739
## Instructions
3840

3941
### Install The Container
4042

41-
There are two ways to get the container, either through `foundriesFactories` or downloading the container from [portenta-containers repository](https://github.com/arduino/portenta-containers)
43+
There are two ways to get the container, either through `foundriesFactories` or downloading the container from [portenta-containers repository](https://github.com/arduino/portenta-containers).
4244

43-
**With Foundries.io:**
45+
**With Foundries.io:**
4446

45-
If you use [Foundries.io](https://www.foundries.io) you can switch the current `target` of your device to `x-kiosk-imx8-webgl` by switching the app from a terminal on your computer:
47+
If you use [Foundries.io](https://www.foundries.io), you can switch the current `target` of your device to `x-kiosk-imx8-webgl` by switching the app from a terminal on your computer:
4648

4749
```
4850
//Change the app to an existing one
@@ -51,21 +53,24 @@ fioctl devices config updates --apps "x-kiosk-imx8-webgl" <deviceName> -f <yourF
5153
//Make a clean installation with no containers
5254
fioctl devices config updates --apps "," <deviceName> -f <yourFactoryName>
5355
54-
//If you are getting issues to do so, make sure you are logged correctly with your token
56+
//If you are getting issues doing so, make sure you are logged correctly with your token
5557
//You can logout:
5658
fioctl logout
5759
58-
//Then login again and follow the instructions
60+
//Then log in again and follow the instructions
5961
fioctl login
6062
```
6163

62-
You will now see the home-screen for some seconds and then it will fade-out and open the Aquarium 3D from [WebGL samples - Aquarium](https://webglsamples.org/aquarium/aquarium.html).
64+
You will now see the home screen for a few seconds and then it will fade out and open the Aquarium 3D from [WebGL samples - Aquarium](https://webglsamples.org/aquarium/aquarium.html).
65+
66+
**With downloaded repository:**
67+
68+
If you downloaded the [portenta-containers repository](https://github.com/arduino/portenta-containers), you will need to connect your board directly to your computer and run the `adb shell`, then push the container to your Portenta X8.
6369

64-
**With downloaded repository:** In case you downloaded the [portenta-containers repository](https://github.com/arduino/portenta-containers) you will need to connect your board directly to your computer and run the `adb shell`, then push the container to your Portenta X8.
70+
### Connect to a Wi-Fi®
6571

66-
### Connect to a Wi-Fi
72+
Check the available Wi-Fi® access points by using the `nmcli de wifi` command. You will be able to see an output laying out `BSSID`, `SSID`, and its other elements.
6773

68-
Check the available Wi-Fi access points
6974
```
7075
nmcli de wifi
7176
@@ -74,7 +79,8 @@ IN-USE BSSID SSID MODE CHAN RATE SIGNAL BAR
7479
AA:BB:CC:DD:EE:FF <yourAP-SSID> Infra X 130 Mbit/s -- * WPA2
7580
```
7681

77-
You can save your Wi-Fi details with these commands:
82+
The Wi-Fi® details can be saved using the following commands in sequence:
83+
7884
```
7985
nmcli c add type wifi con-name <customName> ifname wlan0 ssid <SSID>
8086
nmcli con modify <customName> wifi-sec.key-mgmt wpa-psk
@@ -88,7 +94,8 @@ nmcli con down <customName>
8894
nmcli c delete <customName>
8995
```
9096

91-
If the LED is on and green then we know that has been correctly connected. If you want to check it in your terminal, you can type:
97+
If the LED is illuminating Green, then we know it has been correctly connected. If you want to check it in your terminal, you can use the following commands:
98+
9299
```
93100
nmcli de
94101
@@ -100,7 +107,12 @@ wlan0 wifi connected <customName>
100107
docker0 bridge connected (externally) docker0
101108
```
102109

110+
The output table will display information regarding active connections as well as the Wi-Fi® connection in which we are interested.
111+
103112
### Get Your Board's IP
113+
114+
The IP information of the board can be obtained using `ifconfig wlan0` command. It will show different IP information composed of `inet`, `netmask`, and `broadcastIP`.
115+
104116
```
105117
ifconfig wlan0
106118
@@ -109,37 +121,41 @@ wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
109121
inet <localIP> netmask 255.255.255.0 broadcast <broadcastIP>
110122
```
111123

112-
Test your IP connection by exiting the `adb shell`, you can use **CTRL+Z** or typing `exit`, then try to connect through **ssh** with:
124+
Test your IP connection by exiting the `adb shell`, you can use **CTRL+Z** or type `exit`, then try to connect through **SSH** using following command:
125+
113126
```
114127
ssh fio@<localIP>
115128
```
116-
***To connect through ssh it will request the user's password, which is "fio".***
117-
***If you have troubles connecting with the ssh, please check the troubleshooting section at the end of this tutorial***
118129

119-
### Copy/push the Container
120-
You can push the container from your computer, first open a terminal on the container's directory, then you can use this command to send the container to the Portenta X8:
130+
***To connect through SSH it will request the user's password, which is "fio". If you have trouble connecting with the SSH, please check the troubleshooting section at the end of this tutorial.***
131+
132+
### Copy/Push the Container
133+
134+
You can push the container from your computer using a terminal on the container's directory. The following command is used to send the container to the Portenta X8:
135+
121136
```
122137
scp <folderName> fio@<portentaX8-IP>:<desiredPath>
123138
```
124139

125140
### Video Output Setup
126141

127-
Now we need a USB Hub that has a video output connector, like for an HDMI cable. Connect the Portenta X8 to the USB Hub as a Host, the video connector to a display, the power supply USB to your computer. We could also connect a USB mouse to the hub, this step is optional.
128-
129-
The setup should look like this:
142+
Now we need a USB Hub that has an available video output connector, for example, an HDMI cable. Connect the Portenta X8 to the USB Hub as a Host, the video connector to a display, and the power supply USB to your computer. It is optional but we could also connect a USB mouse to the hub. The setup should look like as follows:
130143

131144
![X8 usb hub setup](assets/portentaX8_hub_screen.svg)
132145

133-
By default if you connect the board to a display you will see the "home-screen" with the `Arduino PRO` background wallpaper, and a bottom bar with the real time.
146+
***As a reference, a list of validated USB-C® to HDMI hubs that you can use are: [ACT AC7022](https://www.act-connectivity.com/en-us/usb-c-to-hdmi-multiport-adapter-4k-usb-hub-pd-pass-ac7022), [ACT AC7041](https://www.act-connectivity.com/en-us/usb-c-to-hdmi-multiport-adapter-with-ethernet-ac7041), [ACT AC7042](https://www.act-connectivity.com/en-us/usb-c-to-hdmi-multiport-adapter-with-ethernet-and-ac7042)***
147+
148+
By default, if you connect the board to a display, you will see the "home screen" with the `Arduino PRO` background wallpaper, and a bottom bar with real-time.
134149

135-
***You can interact with the interface by plugging USB devices to your hub, like a mouse or a keyboard.***
150+
***You can interact with the interface by plugging USB devices into your hub, like a mouse or a keyboard.***
136151

137152
![X8 home-screen](assets/portentaX8-home-screen.png)
138153

139154
### Running The Container
140-
If you got the container from **Foundries.io** it will run automatically after few seconds.
141155

142-
In case you copied from the repository, you will need to initialize it with **docker** by accessing your Portenta X8 through ssh, going to the directory where you copied it and run it from there:
156+
If you obtained the container from **Foundries.io**, it will run automatically after a few seconds.
157+
158+
On the other hand, if you copied from the repository, you will need to initialize with **docker** by accessing your Portenta X8 through SSH, going to the directory where you have copied it, and running it from that directory using following commands:
143159

144160
```
145161
//Connect to your device
@@ -156,7 +172,9 @@ docker-compose stop
156172
```
157173

158174
### Edit The Output
159-
You can change the URL of the web output, by going to the container's directory and editing the `docker-compose.yml` file:
175+
176+
It is possible to change the web output URL by editing the `docker-compose.yml` file, using the following commands:
177+
160178
```
161179
//Connect to your device
162180
ssh fio@<portentaX8-IP>
@@ -168,25 +186,25 @@ cd <containerPath>
168186
vim docker-compose.yml
169187
```
170188

171-
Once you are inside the **VIM** editor, to edit the file you will need to press **insert** and replace the url as shown in the screenshot.
189+
Once you are inside the **VIM** editor, to edit the file you will need to press **insert** and replace the URL as shown in the screenshot.
172190

173191
![VIM editing docker-compose.yml](assets/vim-edit-dockerCompose.png)
174192

175-
To save the changes press the **ESC** key and type `:wq` this will write and quit the **VIM** editor. After editing it you will need to compose the container again.
193+
To save the changes, press the **ESC** key and type `:wq`. This will write and quit the **VIM** editor. After editing the file, you will need to compose the container again to make the changes take effect.
176194

177195
## Conclusion
178196

179-
In this tutorial we went through how to connect the board and display something on a screen. Using a container from FoundriesFactories or by downloading it and uploading it to your Portenta X8. Lastly, we showed how to edit the video output by editing the container.
197+
In this tutorial, we went through how to connect the board and display something on a screen. Using a container from FoundriesFactories or by downloading it and uploading it to your Portenta X8. Lastly, we showed how to edit the video output by editing the container.
180198

181199
### Next Steps
182200

183-
- Make your own HTML content, push it to your device and output that content.
184-
- You could make an app that shows information about the weather in a web and having that on a display.
201+
- Make your own HTML content, push it to your device, and output the desired content.
202+
- You could make an app that shows information about the weather on the web and have that on a display.
185203

186204
## Troubleshooting
187-
- If you tried to connect with `ssh` and you get a **fingerprint** issue you will need to remove the IP and fingerprint on your `.ssh` file, on windows the file is at `C:\Users\<yourUsername>\.ssh\known_hosts` and try again the **ssh** connection.
188205

189-
Example:
206+
- If you tried to connect with `ssh` and you get a **fingerprint** issue, you will need to remove the IP and fingerprint on your `.ssh` file. On Windows, the file is located at `C:\Users\<yourUsername>\.ssh\known_hosts` and try again with the **ssh** connection. An example is as follows:
207+
190208
```
191209
//<portentaX8-ip> <type> <fingerprint>
192210
192.168.50.8 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAasdaddgre<kopPOTYAAABBBM8EZPWPKdRRGHpSMosJM08R1d10G0h5g5rE4cNjXdJtYpmJNOR+X2FhNRpEdvyDGHfSomJepbaqBoRcCi0Y7M=

0 commit comments

Comments
 (0)