Best Practices for Production-Ready Projects
This guide contains a list of practices we've found useful as we've helped our users take projects from prototypes, to real, production deployments.
For readers early in their development, this guide contains a number of best practices you should be aware of, and that you should strive to implement by the time your project is ready for real-world usage.
For readers late in their development, or with projects already out in the field, this guide can be viewed as a list of highly recommended practices you should consider adopting for the long-term success of your deployment, especially as you scale up to hundreds or thousands of devices.
- Design for an Always-On, Low-Power Notecard Solution
- Manage Connectivity and Sync Intentionally
- Optimize Data Usage with Note Templates
- Use an External GPS if Location is Critical
- Operate Devices at Scale with Notehub
- Allow For Host Firmware Updates
- Create a Provisioning Process
- Follow Starnote Best Practices for Satellite Deployments
Design for an Always-On, Low-Power Notecard Solution
Many of our quickstart tutorials sync data frequently for convenience and clarity, but that behavior is not representative of how production, battery-powered deployments should operate. In real-world designs, power efficiency and longevity drive every decision. Notecard is designed from the ground up for this reality.
A cardinal rule of the Notecard is that it is designed to be always powered on (regardless of the power source) while maintaining extremely low current consumption. It includes built-in features that enable aggressive power optimization for reliable, long-lived production deployments.
These features include the ability to:
- Manage the modem's power state
- Configure synchronization intervals based on battery levels
- Intelligently manage the power of a connected host microcontroller
In addition, actively monitoring your power supply and providing a backup power source is critical. We strongly recommend designing in a coulomb counter such as Blues Mojo to continuously measure power flowing into and out of the system over time. We also recommend integrating a backup energy store, like a lithium-ion capacitor (LIC) such as Blues Scoop, to maintain operation during transient power loss and brownout conditions.
If you're building a battery-powered project, read through our low-power design guide in detail so you can configure your Notecard appropriately.
Read the Low Power Design GuideManage Connectivity and Sync Intentionally
Notecard gives you fine-grained control over when and how it connects to the cloud. In production deployments, treating connectivity as an explicit design choice is essential for reliability, power efficiency, and long-term operability.
Configure Sync Mode Deliberately
A core mental model to internalize is that Notecard acts as a durable, on-device queue. Data is saved locally first and synchronized opportunistically based on your configuration and available connectivity. Your application should respect this model and allow the Notecard to manage connectivity on its own terms.
Always choose an appropriate sync mode with the hub.set API:
continuousmode is appropriate when you want near-real-time connectivity, and power usage is not a concern.periodicmode is ideal for battery-powered deployments that can tolerate delayed delivery and have predictable sync behavior.minimummode should be used sparingly. It is intended for deployments that truly require minimal network usage. If used incorrectly, minimum mode can make it difficult to regain contact with devices after failures, misconfiguration, or unexpected field conditions.
Configure Sync Intervals Thoughtfully
Notecard's sync intervals with the cloud should be tuned to your application's actual needs. Syncing too frequently wastes battery and data without providing meaningful benefit.
- Set reasonable
outboundandinboundintervals that align with how often data must be delivered or commands must be received. In addition, use the aforementioned voltage-variable sync behaviors to sync based on battery levels. - Even when using
continuousmode, explicitly configure bothoutboundandinboundintervals and set aduration. - Avoid forcing syncs manually using
hub.syncornote.addwithsync:true. These patterns bypass Notecard's internal intelligence and often lead to excessive network usage and higher power draw. Let Notecard manage connectivity and synchronization autonomously.
Plan for Connectivity Gaps
Production deployments should assume that connectivity will be intermittent or unavailable at times. Do not assume cellular connectivity is always present, even in areas with historically good coverage!
In regions with poor or inconsistent cellular service, consider enabling NTN (non-terrestrial network) backup, such as satellite connectivity with Blues Starnote, to maintain fleet visibility and data delivery during extended outages.
Optimize Data Usage with Note Templates
By default, Notecard allows for maximum developer flexibility in how Notes are structured. Individual Notes within a Notefile do not share a fixed schema, allowing you to add arbitrary JSON payloads and evolve fields over time as your application changes.
For production deployments, however, Notecard supports Note templates, which let you define a fixed schema for the data stored in a Notefile. When you use templates, the Notecard understands the structure of your data, enabling significant efficiency and scalability benefits:
-
Reduced data usage, as Notecard can more efficiently store, compress, and transmit structured data.
-
The ability to use the same host firmware on different RATs (radio access technologies), as Note templates are required when working with Notecard for LoRa and Starnote (satellite) devices.
-
Increased on-device storage, allowing you to store more Notes locally before data must be synced with Notehub, as non-templated Notefiles are limited to 100 Notes.
If you want to give Note templates a try, check out the following guide.
Working with Note TemplatesUse an External GPS if Location is Critical
Notecard includes an onboard GPS/GNSS receiver, but because it cannot run the cellular modem and onboard GPS simultaneously, it is not ideal for applications that require frequent or on-demand location fixes. If your solution depends on predictable and fast location acquisition while maintaining active connectivity, an external GPS/GNSS module is a necessity.
An external GPS operates independently of the Notecard's modem, allowing location data to be captured without interrupting data synchronization or cellular connectivity.
Use an external GPS when you need:
- Rapid and/or deterministic GPS fixes.
- Simultaneous cellular connectivity and GPS sampling.
- Frequent or continuous location updates (e.g. asset tracking use cases).
For occasional or opportunistic location updates, the onboard GPS will likely be sufficient and easier to implement.
Using an External GPS/GNSS Module with NotecardOperate Devices at Scale with Notehub
Notehub provides the control plane for managing configuration, behavior, and health across your deployed devices and fleets. Applying these best practices from the start enables reliable, scalable operation in production.
Use Environment Variables to Store Configuration
Once you have devices out in the world, you'll inevitably want to tweak how they work or to run simple experiments—e.g. how would synching every hour instead of every 30 minutes affect my battery usage?
The easiest way to accomplish this configurability with Blues is by using environment variables, which are a Notehub state and settings management feature that allow you to set variables in key-value pairs, and intelligently synchronize those values across devices and fleets.
Based off our experiences with customers, we highly recommend placing any of your project's settings or configuration values in environment variables, and to not hardcode specific values into your firmware. With your configuration in environment variables, you can change the behavior of your devices in the Notehub user interface or Notehub API, and not have to go through the hassle of physically visiting devices, or updating their entire firmware.
The guide below has examples on how to retrieve environment variables values in your firmware.
Working with Environment VariablesAutomate Fleet Grouping with Smart Fleets
Notehub's "Smart Fleets" feature lets you automatically categorize and regroup devices based on the data they send. You define rules using JSONata expressions that Notehub evaluates on every inbound Note. When a rule triggers, Notehub adds the device to a fleet, removes it, or leaves it unchanged - eliminating manual fleet sorting and enabling dynamic operational workflows like grouping by telemetry thresholds or device state.
You can use Smart Fleets to:
- Group devices based on sensor values or metadata like voltage level and cellular signal quality.
- Automatically highlight and track devices sending potentially anomalous data values.
- Generate alerts based on devices being added to, or removed from, Smart Fleets.
Monitor Inactivity with Watchdog Events
A Watchdog Event in Notehub acts like a cloud-level watchdog timer: it
alerts you when a device has stopped communicating for longer than expected.
When enabled on a fleet, Notehub will publish a _watchdog.qo event for any
device that crosses the configured inactivity threshold. This helps you detect
malfunctioning, offline, or disconnected devices quickly and reliably.
Allow for Host Firmware Updates
Having the ability to update host firmware is crucial for maintaining security and for fixing mission-critical bugs.
At Blues we make this possible through Notecard Outboard Firmware Update, a feature of Notecard that allows you to perform host firmware updates "from the outside", and not involving the firmware running on the MCU whatsoever. Notecard Outboard Firmware Update works 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.
You can enable Notecard Outboard Firmware Update with some simple wiring and a single Notecard request, and it can give you the power to update your devices at any time from your desk.
Over-the-air firmware updates are not possible using Notecard for LoRa because of the low-bandwidth nature of the LoRaWAN protocol.
Read the tutorial below for a step-by-step guide on enabling Notecard Outboard Firmware Update, and try it out on your hardware.
Read about Notecard Outboard Firmware UpdateCreate a Provisioning Process
As your project scales and requires more than a single device, establishing a repeatable process for unboxing and preparing devices for deployment can save time and ensure consistent operation.
Provision Devices in Notehub
In Notehub, provisioning is a process that allows you to set up default configuration values for a device. Provisioning ensures your devices come online with preconfigured serial numbers, fleet associations, and default environment variables. You can provision devices in Notehub with the Provision Device API or with batch jobs.
Learn about Batch JobsUse Hardware-Specific QR Codes
All Notecards come with multiple stickers. The sticker on the Notecard itself links to a page that lists information about the device, such as its SKU and DeviceUID.
However, all Notecards also come with multiple non-attached stickers (usually they're packaged in the same bag as the Notecard itself.) The QR codes on those stickers are unique to each individual device, and Notehub provides a mechanism for redirecting QR code scans to a device- or product-specific address.
To try it out, check out our guide for working with QR codes below.
Read about Hardware-Specific QR CodesFollow Starnote Best Practices for Satellite Deployments
If your deployment uses a Blues Starnote for satellite (NTN) connectivity, be aware that satellite networks impose stricter constraints on bandwidth, latency, and power usage than terrestrial cellular networks.
Review the Starnote Best Practices guide to ensure your application is configured correctly for reliable, cost-effective satellite operation.
Read Starnote Best Practices