You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/04.pro/boards/portenta-x8/tutorials/display-output-webgl/content.md
+56-38
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
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.'
4
4
difficulty: beginner
5
5
tags:
6
6
- containers
@@ -17,32 +17,34 @@ hardware:
17
17
18
18
## Overview
19
19
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.
- USB-C® cable (either USB-C® to USB-A or USB-C® to USB-C®)
33
35
- USB-C® hub with HDMI
34
-
- External monitor
36
+
- External monitor
35
37
- HDMI cable
36
38
37
39
## Instructions
38
40
39
41
### Install The Container
40
42
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).
42
44
43
-
**With Foundries.io:**
45
+
**With Foundries.io:**
44
46
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:
//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
55
57
//You can logout:
56
58
fioctl logout
57
59
58
-
//Then login again and follow the instructions
60
+
//Then log in again and follow the instructions
59
61
fioctl login
60
62
```
61
63
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.
63
69
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®
65
71
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.
67
73
68
-
Check the available Wi-Fi access points
69
74
```
70
75
nmcli de wifi
71
76
@@ -74,7 +79,8 @@ IN-USE BSSID SSID MODE CHAN RATE SIGNAL BAR
74
79
AA:BB:CC:DD:EE:FF <yourAP-SSID> Infra X 130 Mbit/s -- * WPA2
75
80
```
76
81
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
+
78
84
```
79
85
nmcli c add type wifi con-name <customName> ifname wlan0 ssid <SSID>
80
86
nmcli con modify <customName> wifi-sec.key-mgmt wpa-psk
@@ -88,7 +94,8 @@ nmcli con down <customName>
88
94
nmcli c delete <customName>
89
95
```
90
96
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:
The output table will display information regarding active connections as well as the Wi-Fi® connection in which we are interested.
111
+
103
112
### 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
+
104
116
```
105
117
ifconfig wlan0
106
118
@@ -109,37 +121,41 @@ wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
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
+
113
126
```
114
127
ssh fio@<localIP>
115
128
```
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***
118
129
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:
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:
130
143
131
144

132
145
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.
134
149
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.***
If you got the container from **Foundries.io** it will run automatically after few seconds.
141
155
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:
143
159
144
160
```
145
161
//Connect to your device
@@ -156,7 +172,9 @@ docker-compose stop
156
172
```
157
173
158
174
### 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
+
160
178
```
161
179
//Connect to your device
162
180
ssh fio@<portentaX8-IP>
@@ -168,25 +186,25 @@ cd <containerPath>
168
186
vim docker-compose.yml
169
187
```
170
188
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.
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.
176
194
177
195
## Conclusion
178
196
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.
180
198
181
199
### Next Steps
182
200
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.
185
203
186
204
## 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.
188
205
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:
0 commit comments