Skip to content

Commit ea2224f

Browse files
Put it in unlisted
1 parent 1fde61a commit ea2224f

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: 'Using BLE, WiFi and Ethernet on the Arduino Opta'
3+
description: "Learn how to make use of the Arduino 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+
- web-editor
18+
hardware:
19+
- hardware/05.pro-solutions/solutions-and-kits/opta
20+
---
21+
22+
## Overview
23+
24+
The Arduino® Opta is a powerful PLC device that has many features, allowing you to customize its use for your solution. Among these features are the standard connectivity features Wi-Fi®, Ethernet and Bluetooth®. In this tutorial we will go through how to use these features with the Arduino IDE and the Arduino Opta.
25+
26+
## Goals
27+
28+
- Learn how to use Bluetooth® Low Energy on the Opta
29+
- Learn how to use Wi-Fi® on the Opta
30+
- Learn how to use Ethernet on the Opta
31+
32+
### Required Hardware and Software
33+
34+
- USB-C cable (either USB-C to USB-A or USB-C to USB-C)
35+
- Wi-Fi Access Point with Internet Access
36+
- Arduino Opta
37+
- Ethernet cable
38+
39+
## Instructions
40+
41+
Using the Arduino IDE we can easily work with these peripherals. Some features have their own library that we can make use of. First we need to install the appropriate core for the Arduino Opta, go into the **Board manager** and search for **Opta Mbed core**. When the latests version of the core is installed we can move on to trying out the connectivity options.
42+
43+
### Wi-Fi®
44+
45+
The files necessary for using the Wi-Fi® on the Opta are included in the core. To try it out we can go to **File > Examples**, under **Examples for Opta** we can find the **WiFi** section, inside there is an example sketch **WiFiWebClient**. Open this example sketch and fill out the WiFi details in the **arduino_secrets.h** tab. The sketch will make the Opta connect to whatever website is entered into the `char server[] = "example.com";` variable. If the connection is successful it will then print the websites HTML content to the serial monitor. If the sketch ran successfully the output should look like the image below.
46+
47+
![Running WiFi sketch on the Opta in the Arduino IDE](assets/opta-wifi.png)
48+
49+
If you want to take a deeper look at what features the **WiFi** library has to offer, [take a look at the API reference page](https://www.arduino.cc/reference/en/libraries/wifi/).
50+
51+
### Ethernet
52+
53+
The Arduino Opta has a RJ45 ethernet port with a LED that will indicate the status of the connected cable. The files necessary for using Ethernet on the Opta are included in the core. To try it out we can go to **File > Examples**, under **Examples for Opta** we can find the **Ethernet** section, inside there is an example sketch **WebClient**. Connect the Ethernet cable to the Arduino Opta then try and upload the example. This example will function the same way as the one mentioned in the Wi-Fi® section. The device will connect to the website stated in the sketch and print the websites HTML content in the serial monitor. If the sketch ran successfully the output should look like the image below.
54+
55+
![Running the Ethernet sketch on the Opta in the Arduino IDE](assets/opta-ethernet.png)
56+
57+
If you want to take a deeper look at what features the **Ethernet** library has to offer, [take a look at the API reference page](https://www.arduino.cc/reference/en/libraries/ethernet/).
58+
59+
### Modbus TCP Via Ethernet Port
60+
61+
The Arduino Opta uses the RS485 protocol for Modbus communication, enabling Modbus TCP via the Ethernet port. Modbus TCP is a variant of the Modbus family of simple, vendor-neutral communication protocols intended for supervision and control of automation equipment. Specifically, it covers the use of Modbus messaging in an intranet or internet environment using the TCP/IP protocols. The most common use of the protocols at this time is for Ethernet attachment of PLCs, I/O modules and gateways to other simple field buses or I/O networks.
62+
63+
### Bluetooth® Low Energy
64+
65+
To use the Bluetooth® feature, download the **ArduinoBLE** library in the Arduino IDE. Go into the **library manager** and search for **ArduinoBLE**, if you can't find it try to sort by official libraries published by Arduino. Let's now try and run a simple example sketch from the ArduinoBLE library, a sketch that will scan for other Bluetooth® devices within range. The sketch will then print the found devices address, local name and the advertised service UUIDs, if present. You can find the example under **File > Examples > ArduinoBLE > Central**, the sketch is called **Scan**. When the sketch is running on the Opta the output on the serial monitor should look something like the image below.
66+
67+
![Bluetooth® sketch running on the Opta](assets/opta-ble.png)
68+
69+
If you want to take a deeper look at what features the **ArduinoBLE** library has to offer, [take a look at the API reference page](https://www.arduino.cc/reference/en/libraries/arduinoble/).
70+
71+
## Conclusion
72+
73+
Now you have a better overview of the connectivity features on the Arduino Opta and how to use them. We went through how to use the different connectivity features and what libraries are required for them. By running all the example sketches on our device we have made sure that the modules are all working and everything is up to date.
74+
75+
### Next Steps
76+
77+
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 Opta uses the same architecture as the Portanta H7, it could therefore be a good idea to take a look at the Portenta H7 tutorials. Such as the 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).

0 commit comments

Comments
 (0)