Skip to main content
Planet Zephyr

The Easy Way to Build Wi-Fi Products With a Cellular Fallback

By October 30, 2023No Comments

Wi-Fi is the fastest, most common, and most convenient communication protocol for consumer and commercial products.

However, if you’re developing a product that must remain connected (healthcare, security, asset tracking, etc), relying solely on Wi-Fi coverage can be problematic for a variety of reasons. Network passwords change, routers get unplugged, service providers go down—and perhaps most commonly, a device can be carried outside of Wi-Fi range.

The most logical failover for Wi-Fi products is cellular, as cellular does not tie you to a specific area, and has reasonably good coverage worldwide. Combining Wi-Fi with cellular gives you the best of both worlds: simple and fast connectivity while in Wi-Fi range, with a robust and reliable failover when Wi-Fi connectivity is unavailable.

Today I’d like to introduce you to a new solution we have at Blues that makes cellular + WiFi incredibly simple: Notecard Cell+WiFi .

The Global Wideband Notecard

The Notecard is a system-on-module we designed to make connectivity easy for any embedded application. Our latest Notecard, the Notecard Cell+WiFi, includes both a cellular modem and Wi-Fi module, allowing you to leverage two different communication protocols in one integration.

The Global Wideband Notecard

The Notecard’s API is all JSON-based, meaning you don’t have to care about whether the data you’re sending will ultimately be sent over cellular or Wi-Fi—you just format up JSON requests and let the Notecard take care of the rest.

The Notecard comes prepaid with 10 years of cellular service and 500MB of data, so when the Notecard does use a cellular connection, it does so without any setup. There are no subscriptions, cellular providers, SIM cards or modems to worry about—it just works.

The Notecard securely syncs your data (regardless of whether you use Wi-Fi or cellular) to Notehub , our cloud service that helps you manage your devices and the data that flows to and from them.

Flow of data through Blues

Now that you have some background on what the Notecard is and can do, let’s see how the Notecard works in practice with an example.

Suppose you’re building a weather station that captures temperature and humidity readings at a regular interval.

To build a solution like this with the Notecard you’ll first need to get your hardware ready. The Notecard comes with an M.2 edge connector that easily connects to a series of Notecarriers . The Notecarriers are development boards that make it dead simple to connect the Notecard to virtually any microcontroller or single-board computer, as well as making it easy to provide the Notecard power through USB, LiPo batteries, or solar.

Although you’re welcome to start with any Notecarrier, The easiest way to get started with the Notecard is with a Blues Starter Kit , which comes with a Notecard, a Notecarrier, and an MCU all in one box. Here’s what a Blues Starter Kit looks like fully assembled, with a BME280 temperature and humidity sensor attached.

Blues Starter Kit with BME280 attached

With your hardware assembled, you next need to create a free Notehub account and create a new project, which gives you a logical place to store your devices and data in the cloud.

Sample Notehub project

With a cloud backend set up, you next need to send the Notecard a hub.set request so it knows about your new project, and how often to sync your data to and from the cloud. Here’s an example.

{
  "req": "hub.set",
  "product": "com.company.name:weather",
  "outbound": 60
}

The hub.set request takes a product, which is a unique reference to your Notehub project. (Here’s how to find your product in a Notehub project.)

You also use the hub.set request to configure how your device should synchronize data with Notehub. In this case, setting outbound to 60 tells the Notecard to send any queued data to Notehub every 60 minutes.

note

The Notecard accepts JSON requests over Serial or I2C, but the simplest way to interact with the Notecard is with our firmware libraries for Arduino, Python, Zephyr, C, Go and more.

With the configuration in place you next need to send your data, which for this article is temperature and humidity. The easiest way to send data with the Notecard is with the note.add request. Here’s an example.

{
  "req": "note.add",
  "body": {
    "temperature": 32.123,
    "humidity": 54.382,
  }
}

The note.add request queues up your data, or Note, on the Notecard, and sends it to the cloud according to the configuration you provided in the hub.set request. For this example these Notes will queue on the Notecard, and synchronize to the cloud every 60 minutes (because we set outbound to 60 earlier).

note

If you’re looking for a real-world example of how to collect data from a BME280 sensor check out our Temperature and Humidity Monitor project. It includes full written instructions and open-source firmware you can customize for your own project.

The final request you need to perform is a card.wifi request, which as the name implies, tells the Notecard which Wi-Fi network to use.

{
  "req": "card.wifi",
  "ssid": "your-network-name",
  "password": "your-network-password"
}

And with those three requests you actually have a fully viable connectivity solution for your application The Notecard communicates with the provided Wi-Fi network by default, and fails over to cellular if the Wi-Fi is unavailable or unresponsive for whatever reason. It just works!

As data flows in, you’ll see it listed in your Notehub project.

Sample event in Notehub

note
  • Notehub provides a series of routes that make it simple to forward your data from Notehub to your own cloud or service.
  • The Notecard Cell+WiFi prioritizes Wi-Fi connectivity while falling back to cellular by default, but you can customize this behavior with the Notecard’s card.transport request.

The Notecard Cell+WiFi greatly simplifies the process of developing a product that communicates over Wi-Fi and falls back to a cellular connection.

And what we’ve covered in this article is just a small taste of what the Notecard can do. The Notecard has an onboard GPS/GNSS module, and can also do Wi-Fi triangulation, making it perfect for any type of asset tracking solution. The Notecard can also perform host firmware updates using a unique mechanism we call Outboard Firmware Update. And so much more.

If you’re looking to get started we recommend purchasing a starter kit and completing the quickstart, which is a series of tutorials that teach you everything you need to get up and running with the Notecard.

Benjamin Cabé