---
title: Wireless for OPTA Quickstart
description: Learn how to set up and use the Blues Wireless for OPTA to add cellular or WiFi connectivity to your Arduino OPTA PLC.
source_url: https://dev.blues.io/quickstart/wireless-for-opta-quickstart/
canonical_url: https://dev.blues.io/quickstart/wireless-for-opta-quickstart/
markdown_url: https://dev.blues.io/quickstart/wireless-for-opta-quickstart.md
---

# Wireless for OPTA Quickstart

## Introduction

*This tutorial should take approximately 60–75 minutes to complete.*

In this guide you'll learn how to use **Blues Wireless for OPTA**, an expansion module that can quickly add [Cellular IoT](https://dev.blues.io/cellular-iot/) connectivity to any Arduino OPTA PLC.

![Wireless for OPTA](https://dev.blues.io/images/hardware/opta-expansion/opta-expansion-front-small.jpg?v=84af811f)

In this tutorial you'll learn how to assemble your hardware, how to configure your OPTA expansion, how to write firmware that communicates with the expansion module, and how to manage your data in the cloud.

### Key Concepts to Know

Before you dive in, it's important to understand a few key concepts from the Blues ecosystem.

- The **Notecard** is a device-to-cloud data pump that reduces the complexity of building connected solutions with a secure, reliable cellular, WiFi, or LoRa connection. It's a System-on-Module (SOM) that's ready for embedding into any project. The Blues OPTA expansion uses a Notecard for connectivity.

- **Notehub** is the cloud service the Notecard uses to securely send and receive data. Notehub also provides a console for fleet management and secure connectors for routing data to 3rd-party cloud applications. You'll use Notehub throughout this tutorial to manage your device and data.

- A **Note** is a JSON object containing developer-provided content. A Note is the primary means of sending data to/from a Notecard.

Notecard and Notehub work together to provide *bidirectional* wireless communication capabilities, both *outbound* (from your Arduino OPTA PLC to the cloud), and *inbound* (from the cloud to your Arduino OPTA PLC). The full process makes seamless connectivity possible for the Arduino OPTA ecosystem.

![Wireless for OPTA](https://dev.blues.io/images/hardware/opta-expansion/opta-typical-application.png?v=f7df9f1d)

## Before You Begin

To complete this quickstart, make sure you have access to the following:

- The contents of a [Blues Wireless for OPTA Bundle](https://shop.blues.com/products/wireless-for-opta-bundle?utm_source=dev-blues\&utm_medium=web\&utm_campaign=store-link), which include:

  - Arduino OPTA Lite

  - Blues Wireless for OPTA expansion module

  - Two LTE SMA antennas

  - Solderless AUX connector

- One of the following means of supplying power:

  - (Recommended) A bench power supply that can provide 12–24 volts, and appropriately rated jumper wires (typically 18AWG) to connect the voltage from the Arduino OPTA to the expansion module.

  - Two dedicated USB-C cables to independently power the Arduino OPTA and expansion module.

- A computer with an available USB port.

- A browser that supports the Web Serial API, like Chrome, Microsoft Edge, or Firefox.

- [Arduino IDE 2.0+](https://www.arduino.cc/en/software)

- An internet connection that allows access to [Notehub](https://notehub.io).

## Connect Your Notecard

With introductions out of the way, let's get started!

In this section you'll connect to your Notecard, the module within the OPTA expansion that makes cellular connectivity possible, and run your first [Notecard API](https://dev.blues.io/api-reference/notecard-api.md) request.

### Connecting Antennas

The Notecard requires antennas to establish and maintain communication with cellular networks.

To attach antennas to your Notecard, start by locating the two SMA antennas that came in your Wireless for OPTA. Once you have them, attach each to the female SMA connectors to your OPTA expansion as shown in the image below.

> **Note:**
>
> You will likely need a wrench or pair of pliers to attach the second antenna. You can hold the antenna in place, and then use the wrench or pliers to turn the connector at the base.

![Antennas connected to the Wireless for OPTA](https://dev.blues.io/images/quickstart/arduino/antennas.png?v=ed640be5)

### Connect to the Notecard

With the antennas connected, you're ready to start communicating with the Notecard.

To do so, connect a USB-C cable to the USB port on your Blues OPTA expansion, as this connection will allow you to send serial requests to the Notecard.

With the USB-C cable connected, next locate the panel on the right-hand side of your browser window, which we call the **In-Browser Terminal**.

Within the In-Browser Terminal, click the **USB Notecard** button. A browser prompt will appear asking for permission to connect to a USB serial device:

![Browser prompt for connecting serial](https://dev.blues.io/images/quickstart/serial-prompt.gif?v=385ee8e6)

- If you're on a Mac, select either `Notecard (cu.usbmodemNOTE1)` or `Notecard (tty.usbmodemNOTE1)`.

- On Windows, the option will show up as `USB Serial Device (COMx)`.

- On Linux the option will show up as `Notecard (ttyACM0)`.

**Having trouble connecting?**

- Try using a different USB cable. Some USB cables are only capable of transferring power, not data.

- If Linux is your operating system, try adding your user to the `dialout` group. Run the command `sudo usermod -aG dialout $USER` and restart your computer for the change to take effect (as logging out and back in may not be enough).

### Validate Serial Connection

Now you're ready to send your first [JSON](https://dev.blues.io/api-reference/glossary.md#json) request to the Notecard! All requests and responses to/from the Notecard are in JSON format and are structured with the command as the value of a `req` key. Additional arguments are written as additional key-value pairs. For example, `{"req":"card.version"}` or `{"req":"hub.set", "mode":"continuous"}`.

The first request you'll send invokes the `card.version` API, which returns metadata about your Notecard.

Copy and paste the following request into the In-Browser Terminal *(click the **TRY IT** button below)*.

Hit **Enter** and you'll see a response similar to the example output.

```json
{"req":"card.version"}
```

```json
{
 "version": "notecard-7.4.1",
 "device": "dev:000000000000000",
 "name": "Blues Wireless Notecard",
 "sku": "NOTE-WBNAW",
 "ordering_code": "FA0YT1N0ACAM",
 "board": "5.13",
 "wifi": true,
 "cell": true,
 "gps": true,
 "api": 7,
 "body": {
  "org": "Blues Wireless",
  "product": "Notecard",
  "target": "u5",
  "version": "notecard-u5-7.4.1",
  "ver_major": 7,
  "ver_minor": 4,
  "ver_patch": 1,
  "ver_build": 201,
  "built": "Jul  1 2024 15:25:49"
 }
}
```

Well done! You have properly set up, configured, and validated your hardware. Next, you'll configure your Notecard to communicate with Notehub.

## Set up Notehub

[Notehub](https://notehub.io) is a secure proxy cloud service that communicates with the Notecard, provides tooling for managing fleets of devices, allows you to perform over-the-air Notecard and host MCU firmware updates, and makes it easy for you to route data to your own cloud applications.

In this section, you'll set up a Notehub [Project](https://dev.blues.io/api-reference/glossary.md#project) and create your first [ProductUID](https://dev.blues.io/api-reference/glossary.md#productuid). A ProductUID is the unique identifier you will use to associate a Notecard with a Notehub Project, and ensure that data from the Notecard ends up in the right location.

### Create a Notehub Project

1. Sign in or sign up for Notehub using the links below.

   [Sign up for a free Notehub account](https://notehub.io/sign-up) or [sign in to an existing account](https://notehub.io/sign-in).

2. Click "Create Project" on the dashboard. In the New Project card, give your project a name and ProductUID.

   ![The dialog for creating a project in Notehub](https://dev.blues.io/images/guides/notehub/create-project.png?v=bf29a47a)

   > **Note:**
   >
   > The ProductUID must be globally unique. To reduce collisions, Notehub prepends a generated namespace based on your account email, for instance `com.your-company.your-name:`. Enter any identifier you like in the input on the right.

3. Take note of your ProductUID. This identifier is used by Notehub to associate your Notecard to your project.

   ![The location of the ProductUID within a Notehub project](https://dev.blues.io/images/guides/notehub/product-uid.png?v=d829ab1d)

## Set Up Your Notecard

Now that you know how to send requests to the Notecard, let's next tell the Notecard about your Notehub project so it knows where to send data.

To associate the Notecard with your project in Notehub you must assign the ProductUID you created to your Notecard. A Notecard can easily be moved between projects over time, but it can only belong to one project at a time.

To set the ProductUID, you'll start by sending a `hub.set` JSON request to your Notecard. Once the Notecard has finished processing your request, it will send a JSON response back to your computer to let you know that the request is complete.

An empty JSON object (`{}`) from the Notecard indicates a successful request. If an error occurs, the Notecard will return a JSON object with an `err` key and a string describing the error that occurred.

Copy and paste the following Notecard request, making sure to replace `com.your-company.your-name:your_product` with the ProductUID you created in the last step *(click the **TRY IT** button below)*.

```json
{"req":"hub.set", "product":"com.your-company.your-name:your_product"}
```

```json
{}
```

The JSON object above consists of two key-value pairs. The first provides the name of the request, denoted with the key `req` and a value of `hub.set`. The second, `product`, is one of the arguments for the `hub.set` request. You can see all the arguments for this and all Notecard requests in the [API Documentation](https://dev.blues.io/api-reference/notecard-api/hub-requests.md#hub-set).

### Validate Your ProductUID and Connection

In this section, you'll validate your Notecard configuration by performing a manual sync with Notehub and then request sync status updates from the Notecard.

#### Start a Sync

Initiate a synchronization between the Notecard and Notehub with a `hub.sync` request, as shown below.

```json
{"req":"hub.sync"}
```

```json
{}
```

Once a sync has started, you can monitor the state of the sync by watching the status bar at the top of the In-Browser Terminal.

![In-Browser Terminal sync pending](https://dev.blues.io/images/quickstart/terminal-sync-pending.png?v=93f9e77c)

As soon as you see "Successful Notehub sync \[x]s ago", the sync is complete!

![In-Browser Terminal sync complete](https://dev.blues.io/images/quickstart/terminal-sync-complete.png?v=8c8f85d9)

**Optional: Manually check on the state of a sync with the hub.sync.status API**

You can also manually check on the state of a sync with a `hub.sync.status` request. When the sync is ongoing, the response will return a `status` field with the current progress of the sync and a `requested` field with the number of seconds since the sync was initiated.

Depending on the timing of your `hub.sync.status` requests, your responses may differ from what is displayed here:

```json
{"req":"hub.sync.status"}
```

```json
{
  "status": "starting communications {wait-module} {connecting}",
  "requested": 2
}
...
{
  "status": "modem now ON {modem-on}",
  "requested": 6
}
...
{
  "status": "waiting for wireless service 6 sec [+---] {cell-registration-wait}",
  "requested": 12
}
```

Once the sync has completed, the response to `hub.sync.status` includes the UNIX Epoch time of the last sync, and the number of seconds since the last completed sync.

```json
{"req":"hub.sync.status"}
```

```json
{
 "time": 1615585299,
 "completed": 4
}
```

You should now be able to return to Notehub, refresh the **Devices** page, and see that a device has been added to your project:

![device in notehub](https://dev.blues.io/images/quickstart/view-device-notehub.png?v=becf1bd4)

**Sync not completing, or having trouble connecting?**

1. Check if the response to a `hub.sync.status` request includes "no project was found" or "can't open Notehub" errors:

   ```json
   {"req":"hub.sync.status"}
   ```

   ```json
   {
     "status": "opening notehub: no project was found with product UID product:com.your-company.your-name:your_product {product-noexist} {notehub-open-failure}",
     "requested": 10
   }
   ...
   {
     "status": "can't open notehub: opening notehub: no project was found with product UID product:com.your-company.your-name:your_product {product-noexist} {notehub-open-failure}",
     "requested": 11
   }
   ```

   If so, you may have a typo, or may have passed a project name to your `hub.set` request's `product` instead of a ProductUID. If this is the case, send another `hub.set` request with the correct `product`, and then send a `hub.sync` request.

   **REMINDER:** The ProductUID is typically in the form of `com.your-company.your-name:your_product`.

2. If your ProductUID seems correct, you may have a connectivity issue. Please consult our guide on [Diagnosing Cellular Connectivity Issues](https://dev.blues.io/support/diagnosing-cellular-connectivity-issues.md).

3. It may be helpful to view a detailed trace of the Notecard's activity during a connection attempt. To do this, type `sync-trace` into the In-Browser Terminal and press return to initate a sync and start logging. Once the trace is complete, click the save button in the terminal to export the log for further analysis.

4. If you've tried these troubleshooting steps and are still having issues, please reach out on our [community forum](https://discuss.blues.com/).

At this point it's worth taking a step back and thinking about what just happened here. Your device just connected to the cloud, over cellular, and you didn’t have to buy a SIM, sign up with a cellular provider, or manage a cellular modem. This is the magic of the Notecard—cellular just works!

Now that you've seen the device work over cellular, you can optionally configure a WiFi network.

### (Optional) Configure a WiFi Network

The Notecard inside the Blues OPTA expansion is a Cell+WiFI Notecard, so it’s possible to configure the expansion to use a 2.4 GHz WiFi Network as a primary backhaul, with cellular as a failover. Note that 5GHz WiFi networks are not supported. If you wish to use a local WiFi network for your testing, you can send the following command to the Notecard via the terminal:

```json
{
  "req":"card.wifi",
  "ssid": "YOUR-NETWORK-SSID",
  "password": "YOUR-PASSWORD"
}
```

> **Note:**
>
> You can use the Notecard's [`card.transport` request](https://dev.blues.io/api-reference/notecard-api/card-requests/latest.md#card-transport) to configure which connectivity protocol your Notecard should use.
>
> The default value of the request is `"wifi-cell"`, which tells the Notecard to prioritize WiFi connectivity, and to fallback to cellular connectivity if a WiFi connection cannot be established.

Regardless of which method of connectivity you use, now that your expansion is communicating with Notehub you're now ready to physically connect the expansion to your OPTA.

## Connecting Your OPTA

Let's connect some hardware!

To start, get out your Arduino OPTA and locate the AUX port on the **right**-hand side. If you have an AUX connector attached here (see photo below), you're good to go.

If there's still a cover on this port you need to remove it (it comes off pretty easily with a screwdriver), and then attach the small AUX connector included in the Wireless for OPTA.

![Connecting the AUX connector](https://dev.blues.io/images/quickstart/arduino/aux-connector.png?v=59b447dc)

Next, return to the OPTA expansion, and remove the AUX cover on its **left** side. With the expansion's port exposed, connect the OPTA and the expansion as shown in the photo below.

![The Arduino OPTA and Blues Wireless for OPTA, connected](https://dev.blues.io/images/quickstart/arduino/connected.png?v=baa2e6c4)

> **Note:**
>
> Make sure the connection between the two modules is snug, as the AUX connector facilitates an I2C connection between the OPTA and the Notecard within the expansion module.

With everything connected you next need to provide power, and to do that you have two options.

### Option 1) Bench Power Supply (Recommended)

The most robust way to power the Arduino OPTA is by [connecting an external +12 VDC to +24 VDC power supply](https://docs.arduino.cc/tutorials/opta/user-manual/#powering-the-opta) to the OPTA's power supply. If your power supply's clips won't fit in the terminal, you may need to use loose pins or headers as I'm doing in the image below.

> **Note:**
>
> The Arduino OPTA uses combo Phillips/flathead screws, and the Blues OPTA expansion uses flathead screws. If you use a flathead screwdriver you can loosen/tighten the screws on both devices.

![Powering the Arduino OPTA from an external power supply](https://dev.blues.io/images/quickstart/arduino/power-supply-1.png?v=80da995e)

With the OPTA powered, next, connect the voltage from the OPTA to the expansion using rated jumper wires (typically 18AWG) as shown below.

![Connecting the voltage from an Arduino OPTA to an OPTA expansion](https://dev.blues.io/images/quickstart/arduino/power-supply-2.png?v=5c0e4398)

And that's it! You should have everything you need in place to power both the Arduino OPTA and the Blues OPTA expansion.

As one last step, connect a USB-C cable from your OPTA to the computer you're using to complete this guide. When using a bench power supply the USB cable won't provide power, but you will need it to flash firmware onto the OPTA.

### Option 2) USB Power

> **Note:**
>
> The OPTA's output ports are not powered via its USB-C port, therefore using USB for power should only be done during early development. For more, see [Powering the OPTA](https://docs.arduino.cc/tutorials/opta/user-manual/#powering-the-opta).

As a second option you may use two USB-C connections to independently power the OPTA and Blues OPTA expansion.

![Connecting two USB cables to the OPTA and expansion](https://dev.blues.io/images/quickstart/arduino/usb-cables.png?v=38ece7ab)

The other end of the OPTA's cable must be connected to the computer you're using to complete this guide, as you'll need that connection to flash firmware in the next section. And if you're using USB cables for power, we additionally recommend connecting both USB cables to the same computer, as it ensures the devices share a common ground.

Regardless of how you power your devices, your hardware setup is now complete and you're ready to write firmware.

## Writing Firmware

In this section you'll learn how to write some firmware for the Arduino OPTA that uses the Blues OPTA expansion.

> **Note:**
>
> - Although we cover the basics in this section, the Arduino OPTA is a very powerful device with a huge feature set. For an in-depth tutorial of everything the OPTA can do, check out the [Arduino OPTA User Manual](https://docs.arduino.cc/tutorials/opta/user-manual).
>
> - At this time, the Blues OPTA expansion only supports firmware written in Arduino IDE (discussed below). If you're interested in using the Arduino PLC IDE let us know in [our community forum](https://discuss.blues.com) so we can prioritize the work.

> **Tip:**
>
> **Let AI write your firmware.** Blues Expert MCP connects your AI coding assistant (Claude Code, GitHub Copilot, Cursor) directly to our API docs, providing live request validation and firmware best practices for Arduino, C, Zephyr, and Python. [Install the Blues Expert MCP →](https://dev.blues.io/tools-and-sdks/generative-ai-tools/blues-expert-mcp.md)

### Hello World Example

The easiest way to write firmware for the Arduino OPTA is with the Arduino IDE, which you can [download and install from Arduino's website](https://www.arduino.cc/en/software).

Once installed, open Arduino IDE, click the **Boards Manager** icon in the left sidebar, search for “opta”, and install the latest version of **Arduino Mbed OS OPTA Boards**.

![Installing the necessary board for Arduino OPTA](https://dev.blues.io/images/quickstart/arduino/install-opta-board.png?v=e6287d38)

Next, replace the contents of your sketch (the `.ino` file that's open by default) with the code below, which is a basic firmware example that blinks one of the OPTA built-in LEDs.

```c
void setup() {
  // Initialize LED_BUILTIN as an output
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  // Turn the LED_BUILTIN ON
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  // Turn the user LED_BUILTIN OFF
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
}
```

Ensure you have a USB-C cable connected from your OPTA to your computer, and then press the **Upload** button in Arduino IDE to flash the firmware to your device.

![Arduino IDE upload button](https://dev.blues.io/images/quickstart/arduino/upload-button.png?v=89c9a43f)

If all went well you should see the LED above the OPTA's RESET button blink on and off every one second.

### Notecard Example

Now that you know how to build firmware and flash it to your device, you're ready to start working with the Notecard. To do so, you first need to install [`note-arduino`](https://dev.blues.io/tools-and-sdks/firmware-libraries/arduino-library.md), the official Notecard Arduino library from Blues.

To install `note-arduino`, go to the libraries tab in Arduino IDE, search for “blues”, and install the latest version of the **Blues Wireless Notecard** library.

![Installing the Blues Noteard library in Arduino IDE](https://dev.blues.io/images/quickstart/arduino/notecard-arduino-library.png?v=dd4a2c01)

With `note-arduino` installed, you now have access to [its full API](https://dev.blues.io/tools-and-sdks/firmware-libraries/arduino-library.md) for interacting with the Notecard.

To try it out, replace the contents of your sketch with the code below, which uses a few new Notecard requests to send a temperature and voltage reading to Notehub every 15 seconds.

```c
#include <Notecard.h>

#define usbSerial Serial

Notecard notecard;

void setup() {
    usbSerial.begin(115200);
    const size_t usb_timeout_ms = 3000;
    for (const size_t start_ms = millis(); !usbSerial && (millis() - start_ms) < usb_timeout_ms;)
        ;
    notecard.setDebugOutputStream(usbSerial);

    notecard.begin();
}

void loop() {
  takeReading();
  delay(15 * 1000);
}

void takeReading() {
  double temperature = 0;
  
  {
    J *rsp = notecard.requestAndResponse(notecard.newRequest("card.temp"));
    if (rsp != NULL)
    {
      temperature = JGetNumber(rsp, "value");
      notecard.deleteResponse(rsp);
    }
  }

  double voltage = 0;
  {
    J *rsp = notecard.requestAndResponse(notecard.newRequest("card.voltage"));
    if (rsp != NULL)
    {
      voltage = JGetNumber(rsp, "value");
      notecard.deleteResponse(rsp);
    }
  }

  {
    J *req = notecard.newRequest("note.add");
    if (req != NULL)
    {
      JAddBoolToObject(req, "sync", true);
      J *body = JAddObjectToObject(req, "body");
      if (body != NULL)
      {
        JAddNumberToObject(body, "temp", temperature);
        JAddNumberToObject(body, "voltage", voltage);
      }
      notecard.sendRequest(req);
    }
  }
}
```

Let's break down this code in detail. The `takeReading()` function starts by gathering two different values from the Notecard. The first call uses the [Notecard's `card.temp` request](https://dev.blues.io/api-reference/notecard-api/card-requests/latest.md#card-temp) to take a reading from the Notecard's onboard temperature sensor.

```c
double temperature = 0;
{
  J *rsp = notecard.requestAndResponse(notecard.newRequest("card.temp"));
  if (rsp != NULL)
  {
    temperature = JGetNumber(rsp, "value");
    notecard.deleteResponse(rsp);
  }
}
```

The second call uses the [Notecard's `card.voltage` request](https://dev.blues.io/api-reference/notecard-api/card-requests/latest.md#card-voltage) to retrieve the current V+ voltage level from the Notecard.

```c
double voltage = 0;
{
  J *rsp = notecard.requestAndResponse(notecard.newRequest("card.voltage"));
  if (rsp != NULL)
  {
    voltage = JGetNumber(rsp, "value");
    notecard.deleteResponse(rsp);
  }
}
```

The final call takes these two values, and uses the [Notecard's `note.add` request](https://dev.blues.io/api-reference/notecard-api/note-requests/latest.md#note-add) to queue a [Note](https://dev.blues.io/api-reference/glossary.md#note) on the Notecard.

```c
{
  J *req = notecard.newRequest("note.add");
  if (req != NULL)
  {
    JAddBoolToObject(req, "sync", true);
    J *body = JAddObjectToObject(req, "body");
    if (body != NULL)
    {
      JAddNumberToObject(body, "temp", temperature);
      JAddNumberToObject(body, "voltage", voltage);
    }
    notecard.sendRequest(req);
  }
}
```

By default, the Notecard acts as a queue that you can synchronize with the cloud using a [number of different strategies](https://dev.blues.io/notecard/notecard-walkthrough/essential-requests.md#configuring-synchronization-modes).

In the case of this example, notice that we're including a `sync=true` option on the `note.add` request. This option tells the Notecard to immediately synchronize this Note to Notehub.

It's easier to understand what this code is doing after you see it in action. To try this firmware on your device, once again hit the **Upload** button in Arduino IDE to flash this updated sketch. Once the new code has been running for a minute or so, return to your Notehub project and visit its **Events** screen.

If all went well, you should see a running list of events with temperature and voltage readings from your device.

![Temperature and voltage events in Notehub](https://dev.blues.io/images/quickstart/arduino/notehub-events.png?v=c650969c)

> **Note:**
>
> If you open the Serial Monitor in Arduino IDE, you can also see a running log of the requests and responses from the Notecard.
>
> ![Serial monitor with Notecard logs](https://dev.blues.io/images/quickstart/arduino/serial-monitor.png?v=a77f591e)

This is the most common workflow when using the Notecard. To take sensor readings from your device at a certain interval, you queue that data on your Notecard as Notes, and you tell the Notecard how often to synchronize that data with the cloud.

The power of the Notecard is you don't have to worry about the underlying connectivity. In fact, this exact same code works regardless of whether your Notecard is using a WiFi or cellular connection!

Now that you have data flowing in from your device, let's look at what you may want to do with it.

## Routing Your Data

Once you have data flowing from your Notecard to Notehub, you can use Notehub’s [routing capability](https://dev.blues.io/notehub/notehub-walkthrough.md#routing-data-with-notehub) to send data to and from your cloud application of choice.

Notehub supports a [wide variety of route types](https://dev.blues.io/notehub/notehub-walkthrough.md#available-route-types), including easy ways to send data over HTTP/HTTPS or MQTT, and powerful integrations with bigger clouds like AWS, Azure, and Google Cloud.

In this section you'll set up a basic HTTP/HTTPS route to see how routing in Notehub works.

### Routing With HTTP/HTTPS

To create your first route you'll use [webhook.site](https://webhook.site/), an online service that lets you create an HTTPS endpoint and monitor all incoming requests.

After getting your Notehub route working with webhook.site, switching your route to use a custom endpoint is as easy switching the URL. Let's see how it works.

1. Navigate to [webhook.site](https://webhook.site). When the page loads, you'll be presented with a unique URL that you can use as a route destination. Copy that URL for the next step.

   ![webhook.site service](https://dev.blues.io/images/guides/route-tutorial/webhook-site-url.png?v=5ed567fe)

2. Open up your project on [Notehub.io](https://notehub.io), and click on the Routes menu item in the left nav.

3. Click **Create Route**.

   ![create a route button in notehub](https://dev.blues.io/images/guides/route-tutorial/add-route.png?v=4724c860)

4. Select the **General HTTP/HTTPS Request/Response** route type.

   ![general https request route](https://dev.blues.io/images/guides/route-tutorial/general-route.png?v=b3b8e6a5)

5. Give the route a name (for example, "Health").

   ![name notehub route](https://dev.blues.io/images/guides/route-tutorial/route-name.png?v=9aa60fa8)

6. For the Route **URL**, use the unique URL you obtained from webhook.site.

   ![url for notehub route](https://dev.blues.io/images/guides/route-tutorial/route-url.png?v=449917f5)

7. Make sure the **Enabled** switch remains selected, and click **Create Route**.

8. Return to webhook.site. This page will update automatically with data from your Notecard as it is received in Notehub. Notice how your custom data is in the `body` attribute, but that the Notehub appends [additional metadata](https://dev.blues.io/notehub/notehub-walkthrough.md#data-notehub-appends-to-events) to each request, such as a device's best location.

   ![notehub data in webhook.site](https://dev.blues.io/images/quickstart/arduino/webhook-data.png?v=725ba49a)

### Routing With Other Services

A basic HTTP route is just one of my ways you can access your data from Notehub. For a guided tutorial through the other routing options, see our [Routing Data to Cloud tutorial](https://dev.blues.io/guides-and-tutorials/routing-data-to-cloud.md).

You can also use the RESTful [Notehub API](https://dev.blues.io/api-reference/notehub-api.md) to access your event data. For more information on the Notehub API, see our [Using the Notehub API](https://dev.blues.io/guides-and-tutorials/using-the-notehub-api.md) tutorial.

## Next Steps

In this tutorial you learned how to assemble your Blues Wireless for OPTA, how to configure the Notecard, how to write firmware that communicates over cellular, and how to manage your data in the cloud.

Even after all this, you're still scratching the surface of what the Notecard can do. Because the Blues OPTA expansion is Notecard-powered, you can complete any of this site's [Notecard Guides](https://dev.blues.io/guides-and-tutorials/notecard-guides.md) to learn more about what you can do with the Notecard.

Additionally, you may wish to check out our many [Example Apps](https://dev.blues.io/example-apps.md) for inspiration, or for a starting point for the app you want to build next.

If you have any questions along the way (or just show off something cool you built), reach out anytime in our [community forum](https://discuss.blues.com).

## Reference

The following is reference information you may find useful as you work with your Arduino OPTA expansion.

### Default Configuration

Blues runs a series of Notecard requests on all new OPTA expansions. Knowing this default configuration can be useful if you choose to override the defaults, or if you [factory reset your Notecard](https://dev.blues.io/notecard/notecard-walkthrough/advanced-notecard-configuration.md#factory-resetting-the-notecard) and wish to reapply the default configuration.

#### Monitor Mode

The Blues OPTA expansion includes a push button and Neopixel on the front panel that can be used for testing connectivity during installation or for debugging. The [`card.aux` request](https://dev.blues.io/api-reference/notecard-api/card-requests/latest.md#card-aux) configures the Notecard to "watch" for a GPIO button press and, when detected, send a message to Notehub in a reserved `_button.qo` Notefile. During transmission the Neopixel colors change to signal pending or successful transmission as documented [here](https://dev.blues.io/notecard/notecard-walkthrough/working-with-the-notecard-aux-pins.md#using-neo-monitor-mode).

```json
{
  "req":"card.aux",
  "mode":"neo-monitor",
  "sensitivity": 25
}
```

A successful communication test will appear in the Notehub events view like this:

![A \_button.qo event in Notehub](https://dev.blues.io/images/quickstart/arduino/button-event.png?v=04b6ae81)

#### Power Outage Detection

The Blues OPTA expansion includes a power-outage-detection capability via a built-in Lithium Ion Capacitor. What this means is that, when an outage is detected on the 12-24V power supply that feeds the expansion (and presumably the OPTA it is connected to), the Notecard will send an alert to Notehub that an outage has been detected, and this message can be routed to your cloud application.

This capability is configured with the Notecard's [`card.voltage` request](https://dev.blues.io/api-reference/notecard-api/card-requests/latest.md#card-voltage).

```json
{
  "req":"card.voltage",
  "mode": "default",
  "alert": true,
  "sync": true
}
```

#### Notehub Connection Settings

In addition to setting the [ProductUID](https://dev.blues.io/api-reference/glossary.md#productuid) for your device, the Notecard's [`hub.set` request](https://dev.blues.io/api-reference/notecard-api/hub-requests/latest.md#hub-set) can also be used to perform additional configuration of the Notecard and how it interacts with Notehub. The default configuration for the expansion sets the Notecard to maintain a continuous connection to Notehub, and to sync every 15 minutes if there’s data to send.

```json
{
  "req": "hub.set",
  "mode": "continuous",
  "outbound": 15,
  "inbound": 1440,
  "sync": true,
  "align":true
}
```

### Using the Expansion QR Code

The Blues OPTA expansion includes a QR code sticker on the front face. This sticker is an additional feature of the Notecard that allows product builders to associate the Notecard with a dashboard or system for their users.

For example, the [Blues Airnote](https://shop.blues.com/products/airnote?utm_source=dev-blues\&utm_medium=web\&utm_campaign=store-link) has a printed QR code that users can scan to change an Airnote's settings, and to view a dashboard of device data.

![Example of the Airnote QR code flow](https://dev.blues.io/images/notehub/airnote_example.png?v=9b4a097a)

To set up something similar for your product, see [Creating a Device Dashboard](https://dev.blues.io/notehub/notehub-walkthrough.md#creating-a-device-dashboard).
