Support
Blues.io
Notehub.io
Shop
Support
Blues.io
Notehub.io
Shop
×
HomeReference
Glossary
Notecard Walkthrough
Overview
Notecard Requests & Responses
JSON Fundamentals
Notecard Interfaces
Essential Requests
Time & Location Requests
Inbound Requests & Shared Data
Web Transactions
Low Power Design
Low Bandwidth Design
Host Firmware Update Requests
Advanced Notecard Configuration
Complete API Reference
Introduction
card Requests
dfu Requests
env Requests
file Requests
hub Requestshub.env.gethub.env.sethub.gethub.loghub.sethub.statushub.synchub.sync.status
note Requests
web Requests

hub Requests

The hub set of requests provide a variety of ways for a developer to configure and monitor the connection between the Notecard and Notehub.

hub.env.get

Used to retrieve one or more environment variables from Notehub.

Arguments

mode

string enumeration

The scope of variable(s) to retrieve. Must be one of:

"project" for Project-level variables.

"fleet" for Fleet-level variables.

"device" for Device-level variables.

name

string (optional)

The name of the environment variable (case-insensitive). Omit to return all environment variables in the provided mode scope.

    Response Members

    text

    string

    If a name was specified, the value of the environment variable.

    env

    JSON object

    If a name was not specified, an object with name and value pairs for all environment variables.

    Example Response
    {
      "env": {
        "monitor-pump": "true"
      }
    }
    

    hub.env.set

    Used to set or delete environment variables in Notehub. This request can be used to set or clear a single environment variable, or multiple variables with a single request.

    Arguments

    mode

    string enumeration

    The scope of variable(s) to set. Must be one of:

    "project" for Project-level variables.

    "fleet" for Fleet-level variables.

    "device" for Device-level variables.

    name

    string (optional)

    The name of the environment variable (case-insensitive). Required if not using env to set or delete multiple variables.

    text

    string (optional)

    The value of the variable. Pass "" or omit from the request to delete it.

    env

    JSON object (optional)

    When updating multiple variables, a list of variable keys and values to update. To delete a variable, pass "" as the value. Required if not using name to set or delete a single variable.

    device

    string (optional)

    When setting a Device-level environment variable, the DeviceUID.

    fleet

    string (optional)

    When setting a Fleet-level environment variable, the FleetUID.

      Response Members
      None: an empty object {} means success.

      hub.get

      Retrieves the current Notehub configuration for the Notecard.

      Arguments
      None
        Response Members

        device

        string

        The DeviceUID for the Notecard.

        product

        string

        The ProductUID to which the Notecard is registered.

        mode

        string

        The current operating mode of the Notecard, as defined in hub.set.

        outbound

        integer

        The max wait time, in minutes, to sync outbound data from the Notecard.

        voutbound

        string

        If outbound is overridden with a voltage-variable value.

        inbound

        integer

        The max wait time, in minutes, to sync inbound data from Notehub.

        vinbound

        string

        If inbound has been overridden with a voltage-variable value.

        host

        string

        The URL of the Notehub host.

        sn

        string

        The serial number of the device, if set.

        sync

        boolean

        true if the device is in continuous mode and set to sync every time a change is detected.

        Example Response
        {
          "device":  "dev:000000000000000",
          "product": "com.your-company.your-name:your_product",
          "mode":    "periodic",
          "outbound": 60,
          "inbound":  240,
          "host":    "a.notefile.net",
          "sn":      "your-serial-number"
        }
        

        hub.log

        Add a "device health" log message to send to Notehub on the next sync.

        Arguments

        text

        string

        alert

        boolean

        true if the message is urgent.

        sync

        boolean

        true if a sync should be initiated immediately.

          Response Members
          None: an empty object {} means success.

          hub.set

          The hub.set request is the primary method for controlling the Notecard's Notehub connection and sync behavior.

          Arguments

          product

          string (optional)

          A Notehub-managed unique identifier that is used to match Devices with Projects. This string is used during a device’s auto-provisioning to find the Notehub Project that, once provisioned, will securely manage the device and its data.

          host

          string (optional)

          The URL of the Notehub service. Use "_" to reset to the default value.

          mode

          string enumeration (optional)

          The Notecard's synchronization mode. Must be one of:

          periodic

          Periodically connect to the Notehub. This is the default value set on each Notecard after a factory reset.

          continuous

          Enables an always-on cellular connection, for high power devices. Outbound data still syncs periodically, unless specified in a Note or File request.

          minimum

          Disables periodic connection. The Notecard will not sync until it receives an explicit hub.sync request.

          off

          Disables automatic and manual syncs. hub.sync requests will be ignored in this mode.

          dfu

          For putting the Notecard in DFU mode for a host firmware update. This mode is effectively the same as off in terms of the Notecard's cellular and Notehub connections.

          sn

          string (optional)

          The end product’s serial number.

          outbound

          integer (optional)

          The max wait time, in minutes, to sync outbound data from the Notecard.

          duration

          integer (optional)

          When in continuous mode, the amount of time, in minutes, of each session. When this time elapses, the Notecard gracefully ends the current session and starts a new one in order to sync session-specific data to Notehub.

          voutbound

          string (optional)

          Overrides outbound with a voltage-variable value.

          inbound

          integer (optional)

          The max wait time, in minutes, to sync inbound data from Notehub.

          vinbound

          string (optional)

          Overrides inbound with a voltage-variable value.

          align

          boolean (optional)

          true to align syncs onto a regular time-periodic cycle.

          sync

          boolean (optional)

          If in continuous mode, automatically and immediately sync each time a Notefile change is detected on Notehub.

            Response Members
            None: an empty object {} means success.
            More information:
            • Notehub Configuration with hub.set

            • Modem Power Management with Voltage Variable Modes

            • Changing the Notehub Service Host

            hub.status

            Displays the current status of the Notecard's connection to Notehub.

            Arguments
            None
              Response Members

              status

              string

              Details about the Notecard's connection status.

              connected

              boolean

              true if the Notecard is connected to Notehub.

              Example Response
              {
                "status":    "connected (session open) {connected}",
                "connected": true
              }
              

              hub.sync

              Manually initiates a sync with Notehub.

              Arguments
              None
                Response Members
                None: an empty object {} means success.

                hub.sync.status

                Check on the status of a recently triggered or previous sync.

                Arguments

                sync

                boolean (optional)

                true if this request should auto-initiate a sync pending outbound data.

                  Response Members

                  status

                  string

                  The status of the current or previous sync.

                  time

                  UNIX Epoch time

                  Time of the last sync completion.

                  sync

                  boolean

                  true if the sync was triggered by the sync field.

                  completed

                  integer

                  Number of seconds since the last sync completion.

                  requested

                  integer

                  Number of seconds since the last explicit sync request.

                  Example Response
                  {
                    "status": "completed {sync-end}",
                    "time": 1598367163,
                    "sync": true,
                    "completed": 1648
                  }
                  
                  More information:
                  • Initiating a Notehub Sync
                  file Requestsnote Requests
                  Can we improve this page? Send us feedbackRate this page
                  • ★
                    ★
                  • ★
                    ★
                  • ★
                    ★
                  • ★
                    ★
                  • ★
                    ★
                  © 2021 Blues Inc.Terms & ConditionsPrivacy
                  blues.ioTwitterLinkedInGitHubHackster.io
                  Disconnected
                  Disconnected
                  Having trouble connecting?

                  Try changing your Micro 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.

                  Connect a NotecardClick 'Connect' and select a USB-connected Notecard to start issuing requests from the browser.