Cellular, LoRa, and Wi-Fi: Introducing the Next Generation of Notecards

Blues Developers
What’s New
Resources
AcceleratorsBlogCommunityTerminalBlues.ioNotehub.io
Shop
Docs
Button IconHelp
Notehub StatusVisit our ForumContact Support
Button IconSign In
Sign In
Sign In
Docs Home
What’s New
Resources
AcceleratorsBlogCommunityTerminalBlues.ioNotehub.io
Shop
Docs
Notehub
Notehub API Reference
Routing Tutorial
Notehub Walkthrough
What is NotehubCreate a Notehub AccountCreate a New ProjectSending Data to Notehub from NotecardRouting Data with NotehubSending Data from Notehub to NotecardAdd Collaborators to a ProjectCreate a New FleetAdd a Device to a FleetManage Notecard FirmwareManage Host FirmwareConfiguring Your Billing AccountUnderstanding Consumption CreditsManaging Connectivity AssuranceAdding Contact InformationAdd a FavoriteCreating a Device DashboardFinding a ProductUIDTemporarily Block Device Connections
Configuring a Slack Route

Notehub

Notehub is a cloud-based service designed to connect to Notecard devices and synchronize Notefiles.

This walkthrough covers what Notehub is, how to get started, and how to utilize Notehub's rich feature set to accomplish your application's IoT objectives.

What is Notehub?

Notehub is available as a feature rich software as a service (SaaS) platform, implemented as Notehub.io . Notehub is also made available as open-source software (OSS), allowing you to implement your own UI and features tailored to your specific business needs.

Notehub.io provides a UI and a RESTful API which allow you to explore the vast collection of data and metadata created by the Notecard/Notehub infrastructure. Notehub also provides functionality for interacting with Notecards, securely routing data, managing Notecard and host firmware, as well as managing projects, fleets, and teams.

The remainder of this document details and describes the features and functionality of the Blues SaaS product, Notehub.io.

Features

  • Detailed information about Notecard Devices, Events, and Sessions.
  • Event routing to external services (such as AWS, Azure, MQTT servers, as well as most HTTPS endpoints).
  • Over-the-Air (OTA) Notecard firmware and host firmware updates.
  • Ability to view and modify Team, Project, Fleet, and Product settings.
  • Quick and easy filtering of information by device, session, or event details.
  • Ability to set cascading environment variables to enable scalable state updates to projects, fleets, and devices.
  • Downloadable device information in JSON format.

Create a Notehub Account

  1. Navigate your browser to Notehub.io , and you will be greeted with the sign-in screen.

  2. Click the Sign up button at the bottom of the display. Alternatively, if you already have a GitHub account and you would prefer to sign up using GitHub, you may click the Sign in with GitHub button.

    New Account Signup Page

  3. If you chose to create an account using email, enter your name, email address, and create a password. Then click Sign up.

    new account sign up with email

    Otherwise, if you chose to create an account using GitHub, then follow the prompts to authorize Notehub.

    new account sign up with github

  4. Verify your email address by clicking on the link in the email you receive from support@blues.io. The link will return you to Notehub.io and you will be ready to create your first project.

    create project

Create a New Project

Projects are core to the functionality of Notehub. They provide a way to organize fleets of devices, distribute firmware, organize teams, and provide team access controls.

A Project is composed of one or more identifiers called ProductUIDs. Each Project is created with an initial ProductUID, enabling you to associate your Notecard(s) to your Project as soon as it is created.

note

Projects may also be managed via the Notehub API.

  1. Navigate to Notehub.io , and click on the Create Project button in the upper right corner.

    Create project button

  2. The Create Project dialog will open.

    Create project card

  3. Provide a name for the project in the Project Name input box.

  4. Provide a unique identifier for the default ProductUID. In order to help ensure your ProductUID is unique, every ProductUID is prepended with the reverse domain name notation of your account email.

    For example, if you signed up with winston.smith@oceania.com, then your product would take the form of com.oceania.winston.smith:your_product_uid.

  5. By default, projects will be associated with the Billing Account tied to your Notehub account. If you wish to associate the project with a billing account other than your main account - for instance a company account - you can select it in the Billing Account dropdown.

  6. Click the Create Project button.

Sending Data to Notehub from Notecard

Data is sent to Notehub (from Notecard devices or via the Notehub API) in the form of JSON objects called Notes.

This is an example of a Note containing arbitrary temperature and humidity data in the body of the Note, along with metadata about the Note and the device's location:

{
  "event": "df9f5e04-7aa4-44d1-bd7f-068b6b576ffc",
  "session": "6facb2b9-b4af-4790-bc70-a8c3b566c1f3",
  "best_id": "dev:868050040247343",
  "device": "dev:868050040247343",
  "product": "product:com.blues.name:project",
  "app": "app:911ee04e-cd6d-469a-8379-de05062aa5r3",
  "received": 1670791362.736713,
  "req": "note.add",
  "when": 1670790603,
  "file": "data.qo",
  "body": {
    "temperature": 24.56,
    "humidity": 68.22
  },
  "best_location_type": "tower",
  "best_location_when": 1670791362,
  "best_lat": 41.83748,
  "best_lon": -89.183298,
  "best_location": "Shorewood Hills WI",
  "best_country": "US",
  "best_timezone": "America/Chicago",
  "tower_when": 1670791362,
  "tower_lat": 41.83748,
  "tower_lon": -89.183298,
  "tower_country": "US",
  "tower_location": "Shorewood Hills WI",
  "tower_timezone": "America/Chicago",
  "tower_id": "310,410,17169,77315594",
  "status": "success"
}

Notes are stored in Notefiles, which are also named JSON files. Notefiles are automatically created when a Note is first added, are persisted to Notecard flash, and are managed by the Notecard's synchronization policies with Notehub.

Notecard and Notehub work together to provide bidirectional wireless communication capabilities. In this diagram, Notes are sent from a host microcontroller (or single-board computer) to an arbitrary cloud endpoint.

animation of outbound communication from notecard to notehub to cloud

The Notehub UI displays a list of Events that contains Notes, along with other session and environment-specific events sent automatically by the Notecard.

List of events in Notehub

A hands-on example of the outbound data flow from Notecard to Notehub is available as part of the Notecard quickstart experience.

note

Notehub retains event data for 7 days after it is created.

Routing Data with Notehub

One powerful feature of Notehub is routes, which allow you to forward your data from Notehub to a public cloud like AWS, Azure, or Google Cloud, a messaging platform like MQTT, or a custom HTTP/HTTPS endpoint. Routes are defined in a Notehub for a single project, and can target any fleet(s) and/or device(s). A Notehub project can have multiple routes defined and active at any one time.

  • Available Route Types
  • Available Route Tutorials
  • Manually Routing Events
  • Bulk Event Retries
  • Automatic Retry of Failed Route
  • Using Placeholder Variable Substitution/Interpolation
  • Transforming JSON when Routing with JSONata

Available Route Types

There are a variety of different route types available in Notehub, exposing different configuration options depending on the service and protocol.

General HTTP/HTTPS Request/Response

general http/https request/response route type

Allows you to send Notecard events to external HTTP/HTTPS endpoints, including webhooks.

View the General HTTP/HTTPS Route Tutorial

AWS

aws route type

Amazon Web Services (AWS) is the world's most comprehensive and broadly adopted cloud platform, offering over 200 fully featured services from data centers globally. Millions of customers—including the fastest-growing startups, largest enterprises, and leading government agencies are using AWS to lower costs, become more agile, and innovate faster.

View the AWS IoT Analytics Route Tutorial

Azure

azure route type

The Azure cloud platform is more than 200 products and cloud services designed to help you bring new solutions to life to solve today's challenges and create the future. Build, run, and manage applications across multiple clouds, on-premises, and at the edge, with the tools and frameworks of your choice.

View the Azure IoT Central Route Tutorial

Google Cloud Function

Google Cloud Function route type

Google Cloud Functions is a serverless execution environment for building and connecting cloud services. With Cloud Functions you write simple, single-purpose functions that are attached to events emitted from your cloud infrastructure and services. Your function is triggered when an event being watched is fired.

View the Google Cloud Platform Route Tutorial

MQTT

MQTT route type

MQTT is an OASIS standard messaging protocol for the Internet of Things (IoT). It is designed as an extremely lightweight publish/subscribe messaging transport that is ideal for connecting remote devices with a small code footprint and minimal network bandwidth.

View the MQTT Route Tutorial

Proxy for Device Web Requests

Proxy for Device Web Requests route type

Allows you to send Notecard web requests to external HTTP/HTTPS endpoints, using the Notehub as a proxy.

ThingWorx API

ThingWorx API route type

ThingWorx is an ultra-versatile IoT software platform used for enterprise applications in all varieties of industries. Think of ThingWorx as the foundation on which to build a powerful tool that's perfectly matched to meet your business' needs.

View the ThingWorx Route Tutorial

RadNote RadResponder

RadNote RadResponder route type

RadResponder is a free radiological data management and sharing tool provided by FEMA in partnership with EPA and DOE. It allows you to manage your own events and exercises, upload data, perform basic assessment, and securely share data with regional partners and federal assets.

Snowflake

Snowflake route type

Snowflake enables data storage, processing, and analytic solutions that are faster, easier to use, and far more flexible than traditional offerings.

Twilio

twilio route type

Twilio allows developers to send text messages, and perform other communication functions using its web service APIs.

View the Twilio SMS Guide

Slack

slack route type

Slack is a cloud-based set of team collaboration tools and services.

View the Slack Guide

S3 Archive

s3 archive route type

Amazon S3 or Amazon Simple Storage Service is a service offered by Amazon Web Services that provides object storage through a web service interface.

Datacake

datacake route type

Datacake is a multi-purpose, low-code IoT platform that requires no programming skills and minimal time to create custom IoT applications that can be brought into a white label IoT solution at the push of a button.

Available Route Tutorials

The provided Routing Data to Cloud tutorials walk you through routing Notecard data to a variety of big clouds and IoT platforms (including those listed above, and others):

  • AWS IoT Analytics
  • Azure IoT Central
  • Datacake
  • General HTTP/HTTPS
  • Google Cloud Platform
  • Initial State
  • MQTT
  • ThingSpeak
  • ThingWorx
  • Ubidots

There is also a Twilio SMS guide that demonstrates the ability to send SMS messages with the Twilio API, and a Slack guide for routing data to Slack.

Manually Routing Events

After a Notehub route is created, all future events that match the route parameters will be routed. However, you may wish to manually route an event to test a route, or to route an existing event after the Notehub route was created.

To manually route a single event, navigate to the event detail screen and click on the "Route event" button. You will be presented with a modal dialog of routes to use. All routing attempts will be captured in event's route log with a date/time stamp.

manual route single event

Bulk Event Retries

From the Events screen, you may choose one or more events and manually route them to one or more routes. Any events can be selected, regardless of whether or not they were previously routed successfully.

To route multiple events, navigate to the Events screen and select the event(s) you wish to route. In the modal dialog provided, specify whether you only want to retry routing events that previously failed or all selected events.

bulk event retries

note

Each attempt at routing an event consumes one consumption credit, regardless of whether it's the first attempt or a retry.

Automatic Retry of Failed Route

If the routing of an event fails for any reason, you may wish to have Notehub automatically retry the route. To enable this feature, simply check the "automatic reroute on failure" box when creating or editing a Notehub route.

enable automatic reroute

If enabled, Notehub will attempt to retry routing the event up to three times: at 5 seconds, 1 minute, and 5 minute intervals. All retry attempts will be captured in the route log with a date/time stamp.

Event routing is considered a "failure" if one of the following occurs:

  • Notehub is unable to connect to the remote endpoint after 30 seconds.
  • After connecting to the endpoint, Notehub does not receive a response after 30 seconds.
  • Notehub receives an invalid HTTP response from the endpoint.
  • A 5XX-level HTTP status code is returned from the endpoint.
note

Each attempt at routing an event consumes one consumption credit, regardless of whether it's the first attempt or a retry.

Using Placeholder Variable Substitution/Interpolation

If a Route setting (e.g. endpoint URL, MQTT topic, etc) needs to include data from a device, event, or environment variable, you can use string-based substitution placeholders when defining the Route.

Placeholder variables are denoted using a string inside of square brackets: [string]. A placeholder string either begins with a period . (for event attributes), a $ (for environment variables), or from a list of reserved strings. Multiple placeholder strings may be used in a single Route field.

Variable substitution occurs after events have already been transformed by JSONata expressions. See Examples of Using Placeholder Variable Substitution for an example of using placeholder variables with JSONata transforms.

warning

Placeholder substitutions will fail if the string being replaced contains square brackets ([ or ]). This applies to string data in Notes and environment variable names.

Where to Use Placeholder Variable Substitution

Many of the open text fields in the Route creation process are supported. These include:

  • URL
  • HTTP Headers
  • MQTT Broker, Port, Username, Password, Topic, and Client ID
  • Twilio Routes: From Number, To Number, and Message
  • AWS Routes: SQS FIFO and IoT Analytics Channel

Event Attribute Placeholders

Event attribute placeholders are identified by a . immediately after the first square bracket. Event attribute placeholders can substitute data from an event visible in Notehub. Inner fields and array elements can be referenced using standard JSON syntax.

For example, given the following (simplified) event in Notehub:

{
    "best_id": "My Test Device",
    "device": "dev:123456789",
    "body": {
        "temp": 24.5
    }
}

The following event attribute placeholders could be used when defining the Route:

[.best_id]
// "My Test Device"

[.device]
// "123456789"

[.body.temp]
// 24.5

Environment Variable Placeholders

Environment variable placeholders are identified by a $ immediately after the first square bracket. For example, [$phone_number] or [$_contact_name].

Reserved Placeholder Strings

Certain reserved placeholder variables allow you to substitute in Notecard- or event-specific data:

  • [device] - Replace this portion of the string with the Notecard's DeviceUID.
  • [device_no_prefix] - Same as above, but strips the dev: prefix from the DeviceUID.
  • [product] - Replace this portion of the string with the ProductUID to which the Notecard is associated.
  • [product_no_prefix] - Same as above, but strips the product: prefix from the ProductUID.
  • [sn] - Replace this portion of the string with the Device Serial Number.
  • [file] Replace this portion of the string with the full Notefile name (e.g. data.qo).
  • [filebase] Replace this portion of the string with the name of the Notefile to the left of the first non-alphanumeric (and non-underscore) character. In the case of Sparrow, this will be the sensor node id.

For example, an event from a DeviceUID of "dev:1234" using this endpoint URL:

https://webhook.site/89bd3bc4-f8bb-4f7d-b888-3683af6da958/[device]

...will resolve to the following URL when routed:

https://webhook.site/89bd3bc4-f8bb-4f7d-b888-3683af6da958/dev:1234

Unrecognized Placeholder Strings

Any string inside square brackets that isn't syntactically valid won't be replaced. For example, [This text in brackets] would be left as-is. However, if a referenced field is valid, but not available for substitution (i.e. the field is missing from the event) the placeholder string would be replaced by an empty string.

For example, given the example event above and the following endpoint URL:

https://webhook.site/123456/[tower_location]

...will replace [tower_location] with an empty string. This is because tower_location is a syntactically valid variable, but is absent from the provided event:

https://webhook.site/123456/

Examples of Using Placeholder Variable Substitution

  1. Replace a portion of an endpoint URL with the DeviceUID:

    https://test.com/[.device]/
    
    // resolves to:
    
    https://test.com/dev:1b7c56aa-1301-4142-accc-a69e1b077146/
  2. Replacing a portion of a Twilio API endpoint with the Twilio Account SID, set in an environment variable:

    https://api.twilio.com/2010-04-01/Accounts/[$TWILIO_ACCOUNT_SID]/Messages.json
    
    // resolves to:
    
    https://api.twilio.com/2010-04-01/Accounts/1234567890/Messages.json
  3. Substituting the To, From, and Body SMS variables in a Twilio route with variables from the body of an event:

    https://api.twilio.com/2010-04-01/Accounts/1234567890/Messages.json?To=[.body.phoneTo]&From=[.body.phoneFrom]&Body=[.body.message]
    
    // resolves to:
    
    https://api.twilio.com/2010-04-01/Accounts/1234567890/Messages.json?To=%2B11234567890&From=%2B10987654321&Body=Hello%20World%21
  4. Using a JSONata expression to conditionally transform the body of a Twilio SMS. In this scenario, the Message field of the Twilio route would be set to [.body.twilioMessage] (where twilioMessage is an arbitrary variable that is not present in the body of the event prior to the transform):

    // JSONata expression
    {
       "body":{
         "twilioMessage": $contains(body.text, "USB" )? "USB string found" : "USB string not found"
       }
    }
  5. Replacing authentication header values in HTTP Header fields:

    Authorization: Basic [$TWILIO_BASIC_AUTH_HEADER]
    
    // resolves to:
    
    Authorization: Basic am9obkBleGFtcGxlLmNvbTphYmqyusa=

Transforming JSON when Routing with JSONata

JSONata expressions allow you to transform Notecard-generated JSON into a new structure before it's routed to an external service.

Many Notehub Routes provide a setting to apply a JSONata expression to relevant Notes under the Data tab:

notehub jsonata expression

You can also apply a JSONata expression to all events in a project. This allows for project-wide application (and consistency) of transforms to the body and/or payload, in lieu of copy-pasting across individual routes. This feature is available in the Settings for each Notehub project:

notehub project jsonata transform

note

Learn more about JSONata in our guide on Using JSONata to Transform JSON.

Sending Data from Notehub to Notecard

Not only does Notehub receive communications from the Notecard, but it is also capable of sending communications back down to the Notecard. This takes two forms:

  • Inbound Notes
  • Environment Variables

Queue Inbound Notes

Inbound Notes are Notes that start from a cloud app or external service and propagate down to the Notecard.

This data is called "inbound" because it originates somewhere else and is synchronized to the Notecard. In other words, it is "inbound" from the perspective of the Notecard. Once synchronized, a host can retrieve this data from the Notecard and respond accordingly.

note

A typical use case of inbound Notes is to remotely communicate with (and/or control) a device. See our Remote Command and Control guide for more information.

Again, Notecard and Notehub work together to provide bidirectional wireless communication capabilities, both outbound (as documented above) and inbound (from the cloud to your microcontroller or single-board computer):

animation of inbound communication from cloud to notehub to notecard

Inbound Notes in Action

You can use either the Notehub UI or Notehub API to send Notes to your Notecard. Once you've added a Note to Notehub, you'll learn how to retrieve Notes with simple JSON requests.

Compose via the Notehub UI

Navigate to Notehub.io , and select your project to see the Device list.

List of devices in Notehub

Click on the check mark next to your Device, and then click on the Note button.

List of devices in Notehub with the first device selected

You will see a window for adding a Note meant for the selected Device. Select data.qi from the Select Notefile drop-down menu.

Notehub will place Notes you create in a Notefile called data.qi. The .qi extension means that the file is an "inbound queue," or a queue that originates in Notehub and is synchronized with the Notecard.

Copy and paste the following object into the Note JSON section:

{"key1":"val1"}

Now, click the Add Note button, and Notehub will queue the Note to be sent to your Notecard during the next sync operation.

Dialog for sending a Note to a device in Notehub

To confirm your note was successfully enqueued by Notehub, click on Events in the sidebar and you should see your Note at the top of the table.

Events screen in Notehub highlighting the new data.qi Note

Compose via the Notehub API

Sending data via the Notehub UI may be useful for a human, but sending data programmatically through the Notehub API is how your cloud services will communicate with your Notecard and, ultimately, your product.

Find your ProjectUID and DeviceUID

First you'll need to gather your project and device identifiers so that Notehub knows where to send the data. Copy and paste this request into the in-browser terminal:

>
{"req":"hub.get"}
{
 "outbound": 60,
 "mode": "periodic",
 "host": "a.notefile.net",
 "product": "com.your-company.your-name:your_product",
 "device": "dev:000000000000000"
}

The string in the device field is your DeviceUID: dev:000000000000000. Save this value for later.

Next, you need the string identifier assigned to your Notehub project, the ProjectUID. Your ProjectUID can be found in the Settings tab of your project in Notehub (e.g. app:00000000-0000-0000-0000-000000000000). Be sure to copy the ProjectUID and not the ProductUID!

location of projectuid in settings

Obtain a Bearer Token

Before sending Notes to the Notehub API, you need to obtain an authentication token with a request to the /oauth2/token endpoint, like so:

curl -X POST
    -L 'https://notehub.io/oauth2/token'
    -H 'content-type: application/x-www-form-urlencoded'
    -d grant_type=client_credentials
    -d client_id=your-client-id
    -d client_secret=your-client-secret

The client_id and client_secret values can be obtained from the Settings of your Notehub project, under Programmatic API access. Consult the Notehub API Introduction if you run into any issues.

note

If you're using Linux or macOS, you should have a tool called cURL installed and accessible from a terminal application to send API requests to the Notehub API.

If you are a Windows user, you can either use the Windows Subsystem for Linux , or follow this guide to install cURL on your Windows PC.

Another option is to use a tool like Postman to send these requests.

In response to the request to /oauth2/token, the Notehub API will return a JSON object with an access_token in its body. You'll need that token for the next step.

Queue your Note

Now, you can send another request to queue a Note. Copy and paste the following command into your terminal, and be sure to replace access_token, projectUID, and deviceUID fields with your specific values:

curl -X POST
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/notes/data.qi'
    -H 'Authorization: Bearer <access_token>'
    -d '{"body":{"key1":"val1"}}'
  • The -X POST option tells cURL to make a POST request instead of its default GET request.
  • The API URL is specified by -L 'https://api.notefile.net/'.
  • -H 'Authorization: Bearer <access_token>' must include a token to authorize the request.
  • The -d '{...}' option must be filled in with the body of the Note you are sending.

If all goes well, you will receive {} in response. Otherwise, you will receive a JSON object containing an "err": key, along with a message describing the error.

Sync your Note to the Notecard

Once you've queued a Note on Notehub, the Notecard will need to sync again with the service in order to obtain the Note and place it in internal storage.

Copy and paste the following request into the in-browser terminal to sync the data from Notehub onto the Notecard.

>
{"req":"hub.sync"}
{}

Once hub.sync.status reports a completed time, the sync is complete.

>
{"req":"hub.sync.status"}
{
 "time": 1615585299,
 "completed": 4
}

Read your Note from the Notecard

Your Note should now be on your Notecard! To confirm, copy the following request into your in-browser terminal. The request looks at the Notefile in "files", and determines whether there are changes.

>
{"req":"file.changes","files":["data.qi"]}
{
 "info": {
  "data.qi": {
   "total": 1
  }
 },
 "total": 1
}

Read the Note out of the Notefile by sending the following request to the Notecard:

>
{"req":"note.get", "file":"data.qi"}
{
 "body": {
  "key1": "val1"
 },
 "time": 1589309597
}

You should see the Note you sent from Notehub as the response to your request.

Notes synced from Notehub to the Notecard are held in storage until explicitly deleted. This extra step ensures Notes queued on the Notecard are not accidentally deleted just because they were read out.

In software engineering terms, note.get performs a peek of the queue by default, but will perform a pop if you specify "delete":true.

>
{"req":"note.get", "file":"data.qi","delete":true}
{
 "body": {
  "key1": "val1"
 },
 "time": 1589309597
}

Sending the file.changes request at this point should tell you that there are no more pending notes inside of data.qi.

>
{"req":"file.changes","files":["data.qi"]}
{
 "info": {
  "data.qi": {}
 }
}

Update Environment Variables

In IoT applications, products often require configuration variables or settings that can be used on an end device, but then be managed and updated once the product is deployed. In addition, these products often need the ability to manage these values at multiple levels, from the device to a fleet or even an entire product and all of its deployed devices.

Environment variables are a Notecard and Notehub feature that enable settings synchronization that "just work," with no special setup or configuration needed. These variables are key-value pairs, can be set in Notehub and propagate to devices in a project or fleet, or set on the Notecard directly using the same synchronization mechanism used for Notes and Notefiles.

Learn more about the use of environment variables in our guide on Understanding Environment Variables.

Add Collaborators to a Project

If you wish to delegate administration of your Project, share your Project with other developers, or provide read-only access, you can do so by adding team members. Members are easy to add and can be granted varying levels of access explained below.

To add new members to your Notehub project:

  1. Select Settings > Members from the left navigation bar.

    Members menu

  2. Click the Invite members button.

  3. Enter the email address(es) of the new members and choose the appropriate role from the dropdown provided.

    New member input form

Collaborator Roles

Team members can take the role of Owner, Developer, or Viewer. The permissions granted to each role are defined as follows:

ProductUIDs
Create✅✅❌
Read✅✅✅
Update✅✅❌
Delete✅✅❌
Devices
Create✅✅❌
Read✅✅✅
Update✅✅❌
Delete✅✅❌
Fleets
Create✅✅❌
Read✅✅✅
Update✅✅❌
Delete✅✅❌
Events
Read✅✅✅
Update✅✅❌
Delete✅✅❌
Notes
Create✅✅❌
Read✅✅✅
Update✅✅❌
Delete✅✅❌
Notefiles
Create✅✅❌
Read✅✅✅
Update✅✅❌
Delete✅✅❌
Routes
Create✅✅❌
Read✅✅✅
Update✅✅❌
Delete✅✅❌
Route Details
Create✅✅❌
Read✅✅❌
Update✅✅❌
Delete✅✅❌
Favorites
Create✅✅❌
Read✅✅✅
Update✅✅❌
Delete✅✅❌
Settings
Create✅✅❌
Read✅✅✅
Update✅✅❌
Delete✅✅❌
Members
Create✅❌❌
Read✅✅✅
Update✅❌❌
Delete✅❌❌
Environment Variables
Create✅✅❌
Read✅✅✅
Update✅✅❌
Delete✅✅❌
Firmware
Notecard
    Read✅✅❌
    Deploy✅✅❌
Host MCU
    Create✅✅❌
    Read✅✅❌
    Update✅✅❌
    Delete✅✅❌
    Deploy✅✅❌

Create a New Fleet

Fleets are a useful tool for grouping and managing devices in a Project. In their simplest form, fleets provide a filtering mechanism for a set of devices. Perhaps more importantly, fleets provide an intermediate level for the creation and application of environment variables.

note

Fleets may also be managed via the Notehub API.

  1. Select Fleets from the left navigation bar.

    Devices menu

  2. Click the Add fleet option, in the upper right corner.

    Add Fleet option

  3. Give the new fleet a name in the Fleet name field.

    New Fleet display

  4. Click Add fleet.

Add a Device to a Fleet

Upon first connection to Notehub.io, a device is associated with the default fleet of the Notehub project.

The concept of a fleet in Notehub.io is very flexible and can be adapted to meet most use cases. The standard fleet scheme is to consider the default fleet, My fleet, a temporary holding place. Then, once a new device appears in the default fleet, it can be triaged and properly associated with a production fleet or whatever nomenclature you choose to use.

note

Devices may also be added to fleets via the Notehub API.

  1. From the Devices menu, select the device(s) you would like to assign to one or more fleets and click the Move button.

    select devices to move

  2. Choose the fleet(s) and click Move to save the assignments.

    move devices to fleets

Manage Notecard Firmware

Notehub has the ability to manage the firmware running on your Notecards as well as your host MCU. You can easily choose between the available firmware and deploy to one or more devices.

warning

Make sure you read and understand the Blues Firmware Release Policies and Procedures before updating Notecard firmware.

Deploy Firmware

  1. Select Devices from the left navigation bar and select a device from the list of devices in the Notecard Firmware tab.

    Device selected from list

  2. Select Update from the available options.

    Update option

  3. Confirm you wish to update the Notecard firmware.

    Notecard firmware update confirmation

  4. Select the firmware you wish to apply from the list of available firmware, and click Apply.

    Select Notecard firmware

  5. Now that you have selected your firmware, you will see it in the Requested Version field.

    Notecard firmware requested

  6. The next time the Notecard syncs with Notehub, it will begin the download and installation process. No further action is needed on your part as the Notecard will update itself after it downloads the binary. You can view the current status of the update any time in the DFU Status field.

    Notecard firmware requested

Manage Host Firmware

Notehub has the ability to manage host firmware for whole projects or individual devices. You can use Notehub to upload and deploy the custom firmware for your host MCU.

Notehub supports two methods of updating host firmware:

  • Notecard Outboard Firmware Update (supported by most modern STM32- and ESP32-based microcontrollers)
  • IAP Firmware Update

Notecard Outboard Firmware Update allows the Notecard to utilize new capabilities of modern MCUs to perform firmware updates "from the outside", and not involve the firmware running on the MCU. It can update firmware regardless of RTOS or language, and can be used to switch between them, even modifying flash memory layout and partitioning any time after-the-fact, at the developer's discretion.

More information on enabling this feature can be found in this guide on using Notecard Outboard Firmware Update.

IAP (In Application Programming) is a more traditional form of DFU that performs firmware updates while the program is running. Read more about IAP vs ISP (In System Programming) in this kanda.com article .

Upload Host MCU Firmware

  1. Select Settings > Firmware from the left navigation bar.

    Firmware menu

  2. Select Upload firmware from the available options.

    Upload firmware option

  3. Upload firmware via the upload page.

    Upload page

Deploy Firmware

  1. Select Devices from the left navigation bar and select a device from the list of devices in the Host Firmware tab.

    Device selected from list

  2. Select Update from the available options.

    Update option

  3. Confirm you wish to update the host firmware.

    Notecard firmware update confirmation

  4. Select the firmware you wish to apply from the list of available firmware, and click Apply.

    Update host firmware button

Configuring Your Billing Account

Notehub is free to use, and every Notecard comes with Consumption Credits that you can use while you explore the service. Many applications, however, will require additional Consumption Credits for Notehub services, and you can manage these purchases in your billing account.

From the account menu at top-right, select Billing to access your billing account.

Billing menu item in the customer profile navigation

From the billing account section, you can purchase Consumption Credits, view credit usage, purchase history, add members to your account, and add any information needed on your invoices and receipts.

Adding Consumption Credits

To purchase Consumption Credits, you'll first need to add a payment method to your account. Once you've done so, select the amount of credits you wish to add and click the Purchase Credits button.

note

For volume discounts on Credits, consult the volume discount tiers table at the bottom of the credits page.

Billing credit purchase UI

Confirm the payment method and amount and click Pay now to complete the purchase.

Credit payment confirmation screen

Once purchased, Consumption Credits are available for immediate use in any project associated with your billing account.

Configuring Credit Auto-Recharge

To ensure that your projects always have credits available, you can use the Set up Auto-recharge section to enable or disable auto-recharge, as well as the balance below which to trigger the purchase of additional Credits, as well as the number of Credits to purchase when below the threshold.

Auto-recharge UI

Adding Billing Account Members

From the Member tab, you can add additional members to your account with permission to create projects in the account, manage, or administer the account on your behalf. Invited members will receive an invitation email and will need to create a Notehub account if they do not already have one.

Invite members UI

Understanding Consumption Credits

Consumption Credits (CCs) are used to pay for Notehub services such as event routing, Notehub API usage, and web requests. Notehub billing accounts are automatically "topped-up" to 5,000 CCs every month, and each Notecard purchased and connected to Notehub includes a one-time 5,000 CC credit. Additional CCs may be purchased through Notehub.

With the Consumption Credit model, you only pay for what you use:

  • Sending an Event to Notehub: 0 CC (Free)
  • Routing an Event from Notehub: 1 CC
  • Pulling an Event via the Notehub API: 1 CC
  • All other Notehub API requests: 0.001 CC

More information about Consumption Credits is available on the Blues pricing page .

Managing Connectivity Assurance

When a Notecard runs low on data, Connectivity Assurance will automatically add data to the Notecard SIM's data plan.

Connectivity Assurance is enabled by default if the Notehub Billing Account associated with the Notecard has a payment method on file. When a Notecard reaches 100MB of remaining data, Connectivity Assurance will add 500MB of data to the Notecard's data plan. The additional 500MB of data costs $10 for North America Notecards (e.g. NBNA and WBNA) and $15 for international Notecards (e.g. NBGL and WBEX).

warning

If the Notecard SIM's data plan runs out of data due to an invalid or missing payment method (or if Connectivity Assurance is disabled) the data flow from the Notecard will be paused.

Disabling Connectivity Assurance

Connectivity Assurance can be disabled at the following levels:

  • Billing Account
  • Project
  • Device

Disabling Connectivity Assurance at the Billing Account Level

In Notehub, navigate to the Billing menu, select the Information tab, and uncheck the Connectivity Assurance checkbox.

connectivity assurance disable billing account

note

If Connectivity Assurance is disabled for the Billing Account, it cannot be overwritten and re-enabled at the Project or Device levels.

Disabling Connectivity Assurance at the Project Level

Within a Notehub project, navigate to the Settings menu and uncheck the Connectivity Assurance checkbox.

connectivity assurance disable project

note

If Connectivity Assurance is disabled for the Project, it cannot be overwritten and re-enabled at the Device level.

Disabling Connectivity Assurance at the Device Level

Within a Notehub project, navigate to the Devices menu, select a Device to edit, navigate to the Summary tab, and uncheck the Connectivity Assurance checkbox.

connectivity assurance disable device

Adding Contact Information

Contact information for a Notehub project appears in the device JSON and is queryable and updatable using the Notecard API card.contact.

Select Settings from the left navigation bar and add your contact information in the Contacts form.

Contact form

Add a Favorite

Favorites are a way of both saving and organizing query filters you plan on reusing regularly.

By default, the Devices, Fleets, and Events views provide a list of every device, fleet, or event, respectively. To help refine these lists into useful information, a filter box is provided. These filters can become complex and difficult to enter, and you may find you are constantly creating the same filters as part of your workflow.

  1. To facilitate a more efficient workflow, there is a Save button located at the bottom right of your filter box.

    Save Button

  2. When you click the button, you will be prompted to add a new favorite.

    Add a Favorite

  3. Type in the name for your Favorite in the box provided, click Save, and the favorite will appear in your Favorites list.

    Favorites List

Creating a Device Dashboard

Deployed IoT devices often provide a QR code that users can scan for device configuration. For example, the Blues Airnote 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

Using Notehub you can create your own dashboard URLs for printing on devices via QR codes. Let's look at how it works.

How It Works

Notehub provides a domain, qrgo.org, that redirects requests for qrgo.org/id/[deviceUID] to a dashboard URL that you can configure. This workflow allows you to print QR codes that point to qrgo.org/id/[deviceUID] on physical devices, and configure the final resolved URL in Notehub.

This workflow also gives you the ability to change your dashboard URLs anytime—even after you deploy your devices. Let's look at how to set a dashboard URL for your Notehub project.

How to Set Up a Device Dashboard

  1. Within your Notehub project, select Settings from the left navigation bar, and scroll down to the Device Dashboard URL.

  2. Enter a URL in the Edit Device Dashboard URL textbox.

The device dashboard URL section in Notehub

In the URL you can use [device] as a shorthand for a device's UID, and [product] as a shorthand for a device's product UID. For example, the following is a valid Device Dashboard URL that includes shorthands for device UID and product UID.

https://mydomain.test/[device]?product=[product]

Given a device with a UID of dev:123456, and a product UID of com.blues.hello, a request to https://qrgo.org/id/dev:123456 would resolve to https://mydomain.test/dev:123456?product=com.blues.hello using the Device Dashboard URL above.

Once you have a Device Dashboard URL configured, you can test it by clicking the Dashboard link while viewing a device in Notehub.

The location of the Notehub dashboard link

And when you're ready to deploy devices, you can print QR codes that point to https://qrgo.org/id/[device] on each device—for example https://qrgo.org/id/dev:123456, https://qrgo.org/id/dev:7890123, etc.

Finding a ProductUID

A ProductUID is an immutable user-generated string generated when you create a new project. After you create a project, you can copy the ProductUID directly from the project tile after logging in to Notehub:

finding productuid from tile

The ProductUID is also available from the project's settings page:

finding productuid from settings

Once you have your ProductUID, you can assign it to one or many Notecards using the hub.set request.

{
  "req": "hub.set",
  "product": "com.blues.testing:test"
}

A ProductUID is also used in many Notecard samples to associate a Notecard with a cloud-based Notehub project. For example, the Notecard's C, C++, and Arduino samples include the following line of code that asks you to provide a PRODUCT_UID.

#define PRODUCT_UID "" // "com.my-company.my-name:my-project"

Once you have your ProductUID copied from Notehub, you can paste it into your sample's code.

#define PRODUCT_UID "com.blues.testing:test"
note

Assigning a ProductUID to a device in host firmware, as many of the Notecard samples do, is a development convenience. For production workflows we recommend loading Notecard configuration through a setup script, and to avoid placing ProductUIDs in source code.

Temporarily Block Device Connections

The Notehub UI allows you to block individual Notecards from connecting to Notehub. The intended use of this feature is to block connections from misbehaving devices until a root cause can be diagnosed.

Under the Summary tab of the device details, scroll down to the "Danger Zone" section. To temporarily block incoming connections from the selected device, check the appropriate box.

temporarily block device connection

When a Notecard is "blocked", it will likely continue to periodically re-attempt a connection with Notehub. Until it is "unblocked", no data will be received on Notehub. However, each time a Notecard attempts to connect it will use a small amount of its cellular data plan. Since these re-attempts are likely to occur periodically, this setting should not be used to disable a device for a long or indefinite period of time.

Can we improve this page? Send us feedback
© 2023 Blues Inc.
© 2023 Blues Inc.
TermsPrivacy
Notecard Disconnected
Having trouble connecting?

Try changing your USB cable as some cables do not support transferring data. If that does not solve your problem, contact us at support@blues.com and we will get you set up with another tool to communicate with the Notecard.

Advanced Usage

The help command gives more info.

Connect a Notecard
Use USB to connect and start issuing requests from the browser.
Try Notecard Simulator
Experiment with Notecard's latest firmware on a Simulator assigned to your free Notehub account.

Don't have an account? Sign up