Skip to content

Portenta X8: Global Post Update #902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ hardware:

The container infrastructure provided by Arduino contains a pre-built Python® image that you can use to run Python® applications on the Portenta X8. In this tutorial, we're going to build a container based on a provided one.

While all the peripherals are accessible from the iMX8 processor running the Linux environment, it can be useful to let the onboard microcontroller take care of certain peripheral handling and exchange only the required data between the microcontroller and the Python® application.
While all the peripherals are accessible from the iMX8 processor running the Linux environment, it can be useful to let the onboard microcontroller take care of certain peripheral handling and exchange only the required data between the microcontroller and the Python® application.

Thus you will learn how to do that. If you haven't done so, read through the [user manual](/tutorials/portenta-x8/user-manual) to understand the fundamental concepts of the X8 and the provided infrastructure.
Thus you will learn how to do that. If you haven't done so, read through the [user manual](https://docs.arduino.cc/tutorials/portenta-x8/user-manual) to understand the fundamental concepts of the X8 and the provided infrastructure.

## Goals

Expand Down Expand Up @@ -74,7 +74,7 @@ Make sure you have installed the "Arduino Mbed OS Portenta Boards" core and uplo

### Debugging the Arduino Sketch

To check if the Arduino sketch is working correctly, you may want to read the messages from the `Serial.println` statements. You cannot currently read them directly in the serial monitor of the Arduino IDE. Instead, you can use a simple service called `py-serialrpc`, which listens for those messages and prints them to the console.
To check if the Arduino sketch is working correctly, you may want to read the messages from the `Serial.println` statements. You cannot currently read them directly in the serial monitor of the Arduino IDE. Instead, you can use a simple service called `py-serialrpc`, which listens for those messages and prints them to the console.

This service needs to run on the Linux side of the X8. You can get the files [here](assets/py-serialrpc.zip). From the command prompt of your local machine, navigate to the adb tool folder and upload the files to the X8 with `adb push <local directory path>/py-serialrpc /home/fio`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ In this tutorial, we will go through the steps of how to install, run and remove
- [Arduino® Portenta X8](https://store.arduino.cc/products/portenta-x8)
- USB-C® cable (either USB-C® to USB-A or USB-C® to USB-C®)
- Wi-Fi® Access Point with Internet Access
- ADB, [Check how to connect to your Portenta X8](/tutorials/portenta-x8/out-of-the-box#controlling-portenta-x8-through-the-terminal)
- ADB: [Check how to connect to your Portenta X8](https://docs.arduino.cc/tutorials/portenta-x8/user-manual#out-of-the-box-experience)
- [Arduino IDE 1.8.10+](https://www.arduino.cc/en/software), [Arduino IDE 2.0+](https://www.arduino.cc/en/software), or [Arduino Web Editor](https://create.arduino.cc/editor)

***Make sure to have the Portenta X8 with the latest image as well as bootloader. Please check [how to flash your Portenta X8](/tutorials/portenta-x8/image-flashing) to have latest version.***
Expand All @@ -47,7 +47,7 @@ The Portenta X8 provides Docker CLI by default. The following command will help
docker -v
```

***To use this tool, you will need to connect to your device first. Check [how to connect using adb/ssh](/tutorials/portenta-x8/out-of-the-box#controlling-portenta-x8-through-the-terminal).***
***To use this tool, you will need to connect to your device first. Check [how to connect using adb/ssh](https://docs.arduino.cc/tutorials/portenta-x8/user-manual#out-of-the-box-experience).***

You can check the Docker's reference documentation, which covers all the features of the tool in depth at [docs.docker.com](https://docs.docker.com/).

Expand Down Expand Up @@ -133,4 +133,4 @@ In this tutorial, you have learned how to use Docker with Portenta X8. You have

- Now that you have the base of the workflow to use [Docker](https://docker.com), go to its docs page and make sure you understand all the features.
- Look for a container image from [Docker hub](http://hub.docker.com), install it and make your own application out of it.
- Create a container to run your custom made application. For this, it may interest you [Create and Upload a Custom Container to the Portenta X8](tutorials/portenta-x8/custom-container) tutorial.
- Create a container to run your custom made application. For this, it may interest you [Deploy a Custom Container with Portenta X8 Manager](tutorials/portenta-x8/custom-container) tutorial.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ This tutorial will show you how to define fleets and how to construct a Wave tha
- Arduino Create account
- Arduino Cloud for business subscription with Portenta X8 Manager add-on: [Learn more about here](https://cloud.arduino.cc/plans#business)
- Foundries.io™ account (linked with the Arduino Cloud for business subscription)
- FoundriesFactory® and devices already attached to your Factory ([Check the Getting Started tutorial](https://docs.arduino.cc/tutorials/portenta-x8/out-of-the-box))
- FoundriesFactory® and devices already attached to your Factory ([User Manual for Out-of-the-box experience](https://docs.arduino.cc/tutorials/portenta-x8/user-manual#out-of-the-box-experience))

## Instructions

### Setting Up the Terminal

Waves fleet management requires us to have the X8 setup with FoundriesFactory. If you have not done so, please follow our [Getting Started tutorial](https://docs.arduino.cc/tutorials/portenta-x8/out-of-the-box), as it will walk you through setting up the X8 with your Factory.
Waves fleet management requires us to have the X8 setup with FoundriesFactory. If you have not done so, please follow our [User Manual for Out-of-the-experience](https://docs.arduino.cc/tutorials/portenta-x8/user-manual#out-of-the-box-experience), as it will walk you through setting up the X8 with your Factory.

To use Waves, you need to have fioctl installed and configured. Follow this [guide](https://docs.foundries.io/latest/getting-started/install-fioctl/index.html) to do so. Creating Waves and device groups will be done via the host, which is your factory. As such, the following commands will be entered in a terminal using fioctl to connect to your Factory.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In this tutorial, we will create a simple container and upload it to the Arduino
### Required Hardware and Software

- [Portenta X8](https://store.arduino.cc/portenta-x8)
- ADB
- ADB: [Check how to connect to your Portenta X8](https://docs.arduino.cc/tutorials/portenta-x8/user-manual#out-of-the-box-experience)
- USB-C® cable (either USB-C® to USB-A or USB-C® to USB-C®)
- Arduino Pro Cloud Subscription [Learn more about the Pro Cloud](https://www.arduino.cc/pro/hardware/product/portenta-x8#pro-cloud)
- [Arduino IDE 1.8.10+](https://www.arduino.cc/en/software), [Arduino IDE 2.0+](https://www.arduino.cc/en/software), or [Arduino Web Editor](https://create.arduino.cc/editor)
Expand Down Expand Up @@ -57,6 +57,7 @@ TEST_CMD="python3 --help"
```

### Container File: Docker-compose.yml

This file defines the app name through the Factory, permissions, and settings for the involved containers. The argument in the image tag will make it, so our image file builds locally.

```python
Expand Down Expand Up @@ -128,7 +129,7 @@ if __name__ == '__main__':

## Uploading the Container Folder

First, you will need to set up your board to a Factory setting, as shown in the [Portenta X8 Out of the Box tutorial](https://docs.arduino.cc/tutorials/portenta-x8/out-of-the-box).
First, you will need to set up your board to a Factory setting, as shown in the Portenta X8 [Out-of-the-box experience from the User Manual](https://docs.arduino.cc/tutorials/portenta-x8/user-manual#out-of-the-box-experience).

Once finished, we will push our folder to a repository within the Factory. Let us place our folder "x8-custom-test" inside the "containers.git" repository. You can find this repository inside your Factory page under "Source". Then, on "container.git", the page URL will be used in the following command.

Expand Down Expand Up @@ -217,5 +218,5 @@ To get a better understanding of how to manage containers with Docker, take a lo

Here are some errors that might occur in the process of this tutorial:

- Make sure you have followed our other tutorials that shows how to set up the [Portenta X8 out of the box](https://docs.arduino.cc/tutorials/portenta-x8/out-of-the-box)
- Make sure you have followed our other tutorials that shows how to set up the Portenta X8 with [Out-of-the-box experience from the User Manual](https://docs.arduino.cc/tutorials/portenta-x8/user-manual#out-of-the-box-experience)
- If you are having issues with the adb shell, don't forget to try and use `sudo` and `su`
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ In this tutorial, you will learn how to manually flash your Portenta X8 with the
- [Arduino Portenta X8](https://store.arduino.cc/products/portenta-x8)
- [Portenta Breakout Board](https://store.arduino.cc/products/arduino-portenta-breakout) or [Arduino Portenta Max Carrier](https://store.arduino.cc/products/portenta-max-carrier)
- USB-C® cable (either USB-C® to USB-A or USB-C® to USB-C®)

## Instructions

### Arduino's Download Repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ These four blocks will be running locally on the [Arduino® Portenta X8](https:/
- Command-line interface
- [Arduino IDE 2.0](https://www.arduino.cc/en/software)

***If you are new to the Portenta X8 board, check out this [getting started tutorial](/tutorials/portenta-x8/out-of-the-box#controlling-portenta-x8-through-the-terminal) on controlling your board using a terminal or command-line interface.***
***If you are new to the Portenta X8 board, check out this [User Manual](https://docs.arduino.cc/tutorials/portenta-x8/user-manual) on controlling your board using a terminal or command-line interface.***

## IoT Architecture Basics

Expand Down Expand Up @@ -276,7 +276,7 @@ We can now proceed to configure InfluxDB.

## Installing InfluxDB

InfluxDB is an open-source, high-performance, time series database; with InfluxDB data can be written and read in real-time, and data can be processed in the background for extract, transform, and load (ETL) purposes or for monitoring and alerting purposes. User dashboards for visualizing and exploring data can also be set up.
InfluxDB is an open-source, high-performance, time series database; with InfluxDB data can be written and read in real-time, and data can be processed in the background for extract, transform, and load (ETL) purposes or for monitoring and alerting purposes. User dashboards for visualizing and exploring data can also be set up.

The simplest form to run InfluxDB with Docker is by using the following command:

Expand Down Expand Up @@ -516,7 +516,7 @@ If everything is ok, we should see the following in the Serial monitor of the Ar

![Debug messages in the Arduino IDE 2.0 Serial Monitor.](assets/x8-data-logging-img_25.png)

Check out now the Grafana dashboard we configured earlier; we should see data coming from the MKR WiFi 1010 board.
Check out now the Grafana dashboard we configured earlier; we should see data coming from the MKR WiFi 1010 board.

## Conclusion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ In this tutorial, we will go through the steps on how to set up both the Linux a
- USB-C® cable (either USB-C® to USB-A or USB-C® to USB-C®)
- Wi-Fi® Access Point with Internet Access
- 868-915 MHz antenna with SMA connector
- ADB or SSH [Check how to connect to your Portenta X8](https://docs.arduino.cc/tutorials/portenta-x8/out-of-the-box#controlling-portenta-x8-through-the-terminal)
- ADB: [Check how to connect to your Portenta X8](https://docs.arduino.cc/tutorials/portenta-x8/user-manual#out-of-the-box-experience)
- [Multi-protocol gateway example code](assets/Multi_Protocol_Gateway_X8.zip)
- [Arduino IDE 1.8.10+](https://www.arduino.cc/en/software), [Arduino IDE 2.0+](https://www.arduino.cc/en/software), or [Arduino Web Editor](https://create.arduino.cc/editor)

Expand Down Expand Up @@ -73,7 +73,7 @@ Foremost, you will learn how the multi-protocol gateway is implemented with a Po

The Arduino layer extends within the M4 Core, which is the layer dedicated to real-time operations development. Thus, you can use the Arduino layer to perform Proportional-Integral-Derivative (PID) tasks and make the RPC calls to exchange data with the Linux layer. An example could be a temperature sensor driven with PID controller, which will use the actual reading as input and compare with the desired temperature target to provide an output for the control element.

***To learn in-depth about how to exchange data using RPC between Arduino and Linux layer, please check out [User Manual: Communication Between Linux And Arduino](tutorials/portenta-x8/what-is-portenta-x8) or [Data Exchange Between Python® on Linux and an Arduino Sketch](https://docs.arduino.cc/tutorials/portenta-x8/python-arduino-data-exchange)***
***To learn in-depth about how to exchange data using RPC between Arduino and Linux layer, please check out the [User Manual: Communication Between Linux And Arduino](https://docs.arduino.cc/tutorials/portenta-x8/user-manual#communication-between-linux-and-arduino) or [Data Exchange Between Python® on Linux and an Arduino Sketch](https://docs.arduino.cc/tutorials/portenta-x8/python-arduino-data-exchange)***

## The Linux Layer

Expand Down Expand Up @@ -103,7 +103,7 @@ Before setting up the software, it is necessary to configure the hardware to be

![Multi-Protocol Gateway Hardware Setup](assets/multi-protocol-hardware.png)

***If you have not set up your Portenta X8, please have a look at [Portenta X8 Getting Started](https://docs.arduino.cc/tutorials/portenta-x8/out-of-the-box) tutorial***
***If you have not set up your Portenta X8, please have a look at [User Manual's Out-of-the-box experience](https://docs.arduino.cc/tutorials/portenta-x8/user-manual#out-of-the-box-experience)***

### Setting Up The Portenta X8

Expand Down Expand Up @@ -146,15 +146,15 @@ If you have not configured internal Wi-Fi® connectivity within the system, plea
nmcli device wifi connect "SSID" password "PASSWORD"
```

### Setting Up *The Things Network*
### Setting Up The Things Network

You now have the prerequisites for the Portenta X8 ready, but since you are using the LoRa® connectivity, you will need a platform capable of receiving data transmitted from the Portenta X8 and Max Carrier. **The Things Network** will be the platform we will use to communicate using LoRaWAN®. On the platform, you will need to create an application to add the Portenta Max Carrier as an End-Device.

**Manual** option will be used when adding the End-Device. The Portenta Max Carrier will be added under Arduino SA to be included within the LoRaWAN® Device Repository. The LoRaWAN® version and parameters compatible with the Portenta Max Carrier are as follows. The frequency plan will depend on the region in which you are going to install the device.

![General End-Device Configuration](assets/ttn-end-device.png)

***To learn more about LoRa® and LoRaWAN®, please have a look at our [Arduino Guide to LoRa® and LoRaWAN®](https://docs.arduino.cc/learn/communication/lorawan-101). Additionally, if you wish to learn how to properly set up the End-Device in *The Things Network*, please read [this tutorial](https://docs.arduino.cc/tutorials/mkr-wan-1310/the-things-network) reference***
***To learn more about LoRa® and LoRaWAN®, please have a look at our [Arduino Guide to LoRa® and LoRaWAN®](https://docs.arduino.cc/learn/communication/lorawan-101). Additionally, if you wish to learn how to properly set up the End-Device in The Things Network, please read [this tutorial](https://docs.arduino.cc/tutorials/mkr-wan-1310/the-things-network) reference***

We will now build a multi-protocol gateway using Portenta X8 and Max Carrier.

Expand Down Expand Up @@ -551,6 +551,7 @@ If you are curious about what to expect from the build you have made in this tut
In this tutorial, you have learned how to set up a Multi-Protocol Gateway composed of MQTT protocol, RPC, and LoRaWAN®, by using the Portenta X8 and the Portenta Max Carrier. You have built the gateway that will connect to *The Things Network* to send the desired data. Also, the gateway is capable of exchanging data between Arduino and Linux layers using RPC, in which you have exposed the ports to be able to receive data from the local sensor to be sent directly to *The Things Network*.

### Next Steps

- Now that you have developed a multi-protocol gateway, using Wi-Fi® and LoRaWAN® connectivity, expand the gateway's capability by adding other connectivity types such as Cat. M1 and NB-IoT.
- Expand functionalities for data processing using RPC while using multi-protocol architecture.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The Arduino Portenta X8 is a powerful board that has many features that can be e

## Instructions

First, make sure your Portenta X8 is set up correctly by following the [getting started tutorial](https://docs.arduino.cc/tutorials/portenta-x8/out-of-the-box).
First, make sure your Portenta X8 is set up correctly by following the [User Manual's Out-of-the-box experience](https://docs.arduino.cc/tutorials/portenta-x8/user-manual#out-of-the-box-experience).

### Creating the Docker-compose.yml File

Expand Down Expand Up @@ -96,7 +96,7 @@ When you are in the correct directory and no other container is running on the p

### Connecting to the WordPress Site

To connect to the WordPress setup site, you simply need to access it with your Portenta X8s unique id and port. So for example: `http://portenta-x8-<uuid>.local:<port>`, where you would substitute the `<uuid>` with your Portenta X8's unique id and the port chosen for the WordPress container with `<port>`. The `<uuid>` can be found on the setup page that is shown in the [Getting started tutorial](https://docs.arduino.cc/tutorials/portenta-x8/out-of-the-box), but you can also see it in the terminal when running `adb` or you can go to `http://192.168.7.1:8000` if you use Windows and Linux, on MacOS use `http://192.168.8.1:8000`.
To connect to the WordPress setup site, you simply need to access it with your Portenta X8s unique id and port. So for example: `http://portenta-x8-<uuid>.local:<port>`, where you would substitute the `<uuid>` with your Portenta X8's unique id and the port chosen for the WordPress container with `<port>`. The `<uuid>` can be found on the setup page that is shown in the [User Manual's Out-of-the-box experience](https://docs.arduino.cc/tutorials/portenta-x8/user-manual#out-of-the-box-experience), but you can also see it in the terminal when running `adb` or you can go to `http://192.168.7.1:8000` if you use Windows and Linux, on MacOS use `http://192.168.8.1:8000`.

When you connect, you should get some feedback in the terminal. Text will begin printing in the terminal, showing you information about the connection that has just been established as shown in the image below.

Expand Down