Spotlight

Blues Wifi + Cell Communication Module

Explore the Blues Cell + Wifi communication module on a Raspberry Pi Zero, Notehub, and thoughts on the pros and cons of utilizing Blues in your IoT project.
Justin Courtright Featured Team Member
Justin Courtright | Dec 21 2024
6 min read

Recently, the IoT team at Trek10 conducted some research and testing with the Blues Cell + Wifi Notecard housed in the Raspberry Pi Notecarrier. We were inspired to test this device after listening to a podcast featuring Ray Ozzie, founder of Blues and also former Chief Software Architect at Microsoft, who helped bring Azure to the forefront of cloud computing. During the podcast, he gave an inspiring vision of how IoT products will continue to shape the future and enable smarter decision making and resource allocation.

We chose the Wifi + Cell chip to test out since we are interested in helping our customers maintain connectivity in environments where signal quality can vary. A common issue our customers encounter with IoT is spotty network connectivity, and having a reliable redundant communication system built into a device’s communication module simplifies the process of ensuring data ends up in the cloud.

The chip is offered in a variety of configurations, allowing you to choose from LTE Cat 1, LTE Cat M, and NB-IoT. You can choose North American or Global coverage models depending on your needs. The microcontroller can communicate with the communication module via I2C or serial interface by issuing JSON formatted commands. Data ultimately ends up in Notehub, a data and device platform developed by Blues which allows you to view your fleet, manage over-the-air updates, and integrate with other cloud platforms.

In this overview, we will go through step by step how we set up the Blues Cell + Wifi communication module on a Raspberry Pi Zero, explore Notehub and its features, investigate AWS integrations with the Blues ecosystem, and give our thoughts on the pros and cons of utilizing Blues in your IoT project.

Notehub

The Notehub platform allows you to manage your fleet of Notecards, view and monitor incoming data, and integrate with 3rd party cloud platforms. Creating a Notehub account is free, and includes 5,000 credits which are used when data is exported from Notehub. Features are limited to data ingestion, OTA management, device environment management, and data routing with the Essentials tier.

Setup and Testing

To test the capabilities and usability of the Cell + Wifi chip, we purchased the following items:

  • Raspberry Pi Zero 2 WH with pre-soldered 40 pin header
  • Cell + Wifi chip configured for LTE CAT-1 in North America
  • Flexible Dual LTE / Wi-Fi antenna
  • Notecarrier Pi Hat

Raspberry Pi Setup
The first step is to set up the Raspberry Pi in a headless configuration. This involves:

  • Flashing a microSD card with Raspbian OS. Add a wpa_supplicant.conf to the root file system to provide network credentials to the Pi. During the flashing process be sure to enable SSH using password authentication.
  • After rebooting the device, you should be able to access your Raspberry Pi via ssh with the command:

$ ssh <username>@raspberrypi.local

  • Enable the ARM I2C interface on the Raspberry Pi by uncommenting the following lines in /boot/firmware/config.txt:

dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on

  • Using the command sudo raspi-config, enter the configuration menu and modify the interface options to enable the I2C interface. This step should be unnecessary after modifying the /boot/firmware/config.txt file, however, we found that in order to get the communication to work between the Raspberry Pi and communication module we had to do both.
  • Install the Notecard into the Notecarrier hat and secure with the provided screw, then place the hat on the Raspberry Pi’s header pins.
  • You can confirm that the I2C interface is open by running the following commands on the Raspberry Pi CLI:

sudo apt-get install i2c-tools
i2cdetect -y 1

Notecard Provisioning

Once you have your Raspberry Pi online and have installed the Notecarrier, navigate to Notehub and create an account. You will need to create a project which will generate a project ID that looks like this: com.<org>.<user>:<project_name>.

The notecard has an external micro-usb serial interface that can be used to issue commands directly using the notecard-cli or the online interface

Issuing the command in the in-browser terminal:

{“req”:“card.wifi”,“ssid”:”<network_name>“,“password”:”<wifi_password>“}

provides network access to the Notecard, which will utilize wifi as the primary source of communication with cellular as a backup method. To provision the device to Notehub, simply issue the following two commands:

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

You should now see your device listed in Notehub and the sync event under the Events section:

Sending Data to Notehub

After the device is provisioned, run the following Python script on the Raspberry Pi after installing the required notecard pip packages:

filelock=3.16.1
note—python==1.5.0 
notecard—pseudo—sensor=2.0.0
pyserial=3.5 
python—periphery=2.4.1 
RPi.GPI0=0.7.1


import notecard
import notecard_pseudo_sensor
from periphery import I2C
import time
import notecard
import notecard_pseudo_sensor
from periphery import I2C
import time
import random
import serial
import json
PRODUCTUID = "<YOUR_NOTEHUB_PRODUCT_ID>"
port = I2C("/dev/i2c-1")
card = notecard.OpenI2C(port, 0, 0)
sensor = notecard_pseudo_sensor.NotecardPseudoSensor(card)
counter = 0
while True and counter  <= 20:
  temp = sensor.temp()
  humidity = sensor.humidity()
  print('Temperature: {} degrees C'.format(temp))
  print('Humidity: {}%'.format(humidity))
  req = {"req": "note.add"}
  req["file"] = "sensors.qo"
  req["sync"] = True
  req["body"] = { "temp": temp, "humidity": humidity }
  rsp = card.Transaction(req)
  print(rsp)
  counter += 1
  time.sleep(15)

The script generates synthetic data from the notecard_pseudo_sensor package, however, this is easily substituted with GPIO readings if you have sensors you would like to read in data from. The file field on the request is a way to segment data types, similar to how you would segment data onto different MQTT topics in AWS IoT core. Setting a different file name for different data types will allow you to process the data in different ways in Notehub.

After running this script you should be able to see your published events in the Events section of Notehub:

AWS Integration

Notehub offers several ways to integrate with AWS, however, in a limited capacity. Incoming messages can be backed up to an S3 bucket at a set time or volume interval with the purchase of the developer edition of Notehub.

You can also configure ‘routes’ within Notehub to have messages trigger a Lambda function, or be pushed into SQS queues and IoT Analytics. Although these features are useful, IoT Core’s integrations with AWS services are far more configurable, event-driven, and cost-effective to utilize. Assuming you are using AWS IoT Basic ingest to avoid messaging costs and message payloads are sub 5Kb, the cost to route data into an AWS service would just include the price of the rule invocation. On AWS (not factoring in the free tier), the price to invoke a rule 1 million times is $.15. On Notehub, there is a tiered pricing structure based on consumption credits. The first 15,000 route invocations are free, the next 485K are priced at .000750 per invocation, and the next 500k are priced at .000563, putting the total price at $0 + $363.75 + $281.50 = $645.25.

Pros and Cons of Utilizing the Blues Ecosystem

As with every technology we look at, there are advantages and disadvantages to adopting the Blues hardware we tested:

Pros:

  • Prototyping and building a fully functioning proof of concept (albeit with limited scope) was extremely fast with the combination of the RPi Notecarrier and the notecard we purchased. Within 8 hours we had data flowing to the cloud and were able to evaluate the Notehub ecosystem from a real user perspective.
  • Provisioning a Notecard to the Notehub ecosystem was incredibly simple, consisting of simply setting the Notehub project ID within the firmware via a CLI command, and then running a sync command. Provisioning an IoT device is generally time-consuming and complicated to implement, so we appreciate the work done here to simplify this step.
  • The firmware you write for basic operations like syncing data, sending data to the cloud, and retrieving global environment variables set in Notehub is extensible to different Notecard models. This allows the development team to write a common software core.

Cons:

  • As AWS aficionados, we were hoping to see a better way to integrate the Blues notecard into IoT Core and other AWS managed services. Currently, there is no direct way to do this as data ingestion must flow first to Notehub, and then through routes into AWS. Routes do support data ingestion into the IoT Analytics feature on AWS, however, integration with most other IoT-related services would take a custom cloud software implementation to deliver.
  • The cloud side implementation costs seem rather high compared to using AWS natively. Looking at the pricing page, the cost per device ranges between 75 cents and 1 dollar per month, per device regardless of the volume of data ingested. Tack on any additional data export and integration costs and your cloud bill could be significantly higher than a traditional serverless IoT data ingestion platform on a per-device basis.
  • The hardware costs are also prohibitively high. Although we did not explore bulk pricing, a $57 price target on the Wifi + Cell model we purchased potentially rules out the incorporation of this chip set into standard, low-cost consumer products. To our team, this limits the cost effective domain of this technology to low-volume, high-value consumer goods or scientific equipment.

Final Thoughts

Overall, our team enjoyed testing out the Blues Wifi + Cellular notecard and Notehub ecosystem. We took a balanced approach to evaluating the merits and drawbacks of adopting this technology.

We found that Blues can:

  • Increase speed to market
  • Minimize firmware development overhead
  • Decrease cloud side complexities

With these priorities in mind, Blues is definitely worth considering. Perhaps some of the restrictions around cost, integration flexibility, and scalability will improve over time as platform adoption grows.

Author
Justin Courtright Featured Team Member
Justin Courtright

"I worked exclusively on IoT products hosted on AWS for the past 2 years and found a software niche where I feel most at home."