Skip to content

A balena Block for interfacing with the Blues Wireless Notecard

Notifications You must be signed in to change notification settings

blues/balena-notecard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notecard Balena Block

This is a balena Block for interfacing with the Blues Wireless Notecard.

Add this block to your Balena fleet to easily send data to your cloud backend via a low-power cellular connection.

Prerequisites

To add the Blues Block to your fleet you need to add Blues Wireless connectivity to all of your devices. To you will need to:

And if all of this is new to you, we’d recommend going through the Notecard quickstart tutorial before continuing.

Block configuration

To add the Blues Block, add this service in your docker-compose.yml, as shown below.

  notecard:
    image: "bh.cr/blues_wireless/notecard-<architecture>"
    devices:
      - "/dev/i2c-1:/dev/i2c-1"
    expose:
      - "3434"
    privileged: true

Use aarch64 on the architecture if you are using a Raspberry Pi 4.

Usage

Once you have everything deployed on your fleet, you can use the Notecard by POSTing JSON requests to http://notecard:3434.

diagram-blues-balena

For example, the following code performs a hub.set command on the Notecard.

import requests

req = {"req": "hub.set"}
req["product"] = "com.company.name:myproject"
req["mode"] = "continuous"

url = "http://notecard:3434"
headers = {"Content-Type": "application/json"}
result = requests.post(url, json=req, headers=headers)

NOTE: See the example-python folder for a full sample script.

Refer to the Notecard quickstart for more information on how to set up and use a Blues Wireless Notecard.

About

A balena Block for interfacing with the Blues Wireless Notecard

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •