Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 99f687c

Browse files
[PC-915] Jcarolinares/opta/basic tutorials launch (#777)
Arduino Opta-Initial tutorials
1 parent 2227862 commit 99f687c

File tree

14 files changed

+431
-77
lines changed

14 files changed

+431
-77
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: 'Bluetooth® Low Energy, Wi-Fi® and Ethernet on Arduino OptaTM'
3+
description: "Learn how to make use of the Opta's connectivity features."
4+
difficulty: beginner
5+
tags:
6+
- Wi-Fi®
7+
- Ethernet
8+
- Bluetooth®
9+
- Connectivity
10+
author: 'Benjamin Dannegård'
11+
libraries:
12+
- name: Arduino BLE
13+
url: https://www.arduino.cc/reference/en/libraries/arduinoble/
14+
software:
15+
- ide-v1
16+
- ide-v2
17+
- arduino-cli
18+
- web-editor
19+
hardware:
20+
- hardware/05.pro-solutions/solutions-and-kits/opta
21+
---
22+
23+
## Overview
24+
25+
The Arduino OptaTM is a powerful micro PLC device with many features that can be customized to meet the requirements of each professional solution. Among these features, you can find standard connectivity protocols such as Wi-Fi®, Ethernet and Bluetooth®. Please note that these connectivity features are not available on all variants of the Arduino OptaTM. In this tutorial we will go through how to use these features in OptaTM using the Arduino IDE.
26+
27+
## Goals
28+
29+
- Learn how to use Wi-Fi® on the Arduino OptaTM
30+
- Learn how to use Ethernet on the Arduino OptaTM
31+
- Learn how to use Bluetooth® Low Energy on the Arduino OptaTM
32+
33+
34+
### Required Hardware and Software
35+
36+
- [Arduino OptaTM](https://store.arduino.cc/pages/opta) (x1)
37+
- Ethernet (RJ45) cable (x1)
38+
- [Arduino IDE](https://www.arduino.cc/en/software)
39+
- USB-C® cable (either USB-C to USB-A or USB-C to USB-C) (x1)
40+
- Wi-Fi® Access Point with Internet Access
41+
42+
## Instructions
43+
44+
### Setup With the Arduino IDE
45+
46+
Using the Arduino IDE we can easily work with the connectivity features, which have their own libraries that we can make use of. First, make sure the latest version of the Arduino IDE is installed. The IDE can be downloaded [here](https://www.arduino.cc/en/software).
47+
48+
Then we need to install the appropriate core for the Arduino OptaTM. Go to **Tools > Board > Boards Manager**, in the board's manager section search for **Opta mbed** and install it. For more detailed instructions on setting up the Arduino OptaTM with the Arduino IDE, have a look at the [Getting started with OptaTM tutorial](/tutorials/opta/getting-started).
49+
50+
### Wi-Fi®
51+
52+
The files necessary for using the Wi-Fi® on the Arduino OptaTM are included in the core. To try it out, we can go to **File > Examples**, and under **Examples for Opta**, we can find the **WiFi** section. Inside there is an example sketch called **WiFiWebClient**. Open this example sketch and fill out the Wi-Fi® details in the **arduino_secrets.h** tab. Once uploaded, the sketch will make the Arduino Opta® connect to the desired website defined within `char server[] = "example.com";` variable. If the connection is successful, it will then print the website's HTML content to the serial monitor. If the sketch ran successfully, the output should look like the image below.
53+
54+
![Running Wi-Fi® sketch on the Arduino OptaTM in the Arduino IDE](assets/opta-wifi.png)
55+
56+
If you want to take a deeper look at the features that the **WiFi** library has to offer, [take a look at the API Wi-Fi® reference page](https://www.arduino.cc/reference/en/libraries/wifi/).
57+
58+
### Ethernet
59+
60+
The Arduino OptaTM has an RJ45 ethernet port with a LED that will indicate the status of the connected cable. The files necessary for using Ethernet with the Arduino OptaTM are included in the core. To try it out, we can go to **File > Examples** and under **Examples for Opta** we can find the **Ethernet** section. Inside there is an example sketch called **WebClient**. Connect the Ethernet cable to the Arduino OptaTM and upload the example using the USB-C® cable. This example will function the same way as the one mentioned in the Wi-Fi® section. The device will connect to the website defined in the sketch and print the website's HTML content in the serial monitor. If the sketch ran successfully, the output should look like the image below.
61+
62+
![Running the Ethernet sketch on the Arduino OptaTM in the Arduino IDE](assets/opta-ethernet.png)
63+
64+
If you want to take a deeper look at the features that the **Ethernet** library has to offer, [take a look at the API Ethernet reference page](https://www.arduino.cc/reference/en/libraries/ethernet/).
65+
66+
### Modbus TCP Via Ethernet Port
67+
68+
The Arduino OptaTM can be configured to use Modbus TCP protocol, which runs a Modbus protocol layered over a TCP/IP stack. Thus the coverage distance is dependent on the capacity of the Ethernet cable. In the case of an industrial environment, a good cable choice could be an RJ45 cable with the category Cat6 or Cat6A, allowing a maximum distance of 100 meters.
69+
70+
### Bluetooth® Low Energy
71+
72+
To use the Bluetooth® Low Energy feature, you will need to download the **ArduinoBLE** library in the Arduino IDE. Go into the **library manager** and search for **ArduinoBLE**. if you can't find it, try sorting by official libraries published by Arduino. Once the ArduinoBLE library is installed, let's try and run a simple example that scans for other Bluetooth® devices within range. The sketch will print the addresses of near devices as well as the local name and the advertised service UUIDs, if present. The example can be found under **File > Examples > ArduinoBLE > Central**, the sketch is called **Scan**. When the sketch is running on the OptaTM, the output on the serial monitor should look something like the image below.
73+
74+
![Bluetooth® sketch running on the OptaTM](assets/opta-ble.png)
75+
76+
If you want to take a deeper look at the features that the **ArduinoBLE** library has to offer, [take a look at the API BLE reference page](https://www.arduino.cc/reference/en/libraries/arduinoble/).
77+
78+
## Conclusion
79+
80+
This tutorial has shown an overview of the connectivity features of the Arduino OptaTM and how to use them, including how to use the different connectivity protocols and which libraries are required to make them work. By running all the example sketches mentioned in this tutorial, you can confirm that the connectivity features of your Arduino OptaTM are ready to be implemented into more complex solutions.
81+
82+
### Next Steps
83+
84+
Now that you know how to use the connectivity features of the device, have a look at our other tutorials and try to combine the different features. The Arduino OptaTM uses the same architecture as the Portenta H7 and therefore, it could be a good idea to take a look at the Portenta H7 tutorials. Such as using your [device as a Wi-Fi® access point tutorial](https://docs.arduino.cc/tutorials/portenta-h7/wifi-access-point) or the [Bluetooth® Low Energy connectivity with a phone tutorial](https://docs.arduino.cc/tutorials/portenta-h7/ble-connectivity).
657 KB
Loading[フレーム]
530 KB
Loading[フレーム]
301 KB
Loading[フレーム]
638 KB
Loading[フレーム]
618 KB
Loading[フレーム]
761 KB
Loading[フレーム]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /