😌 Learn How to Simplify Host Firmware Updates with the Notecard on February 2nd !

Search
Documentation Results
End of results
Community Results
End of results
Support
Blues.io
Notehub.io
Shop
Sign In
Search
Documentation Results
End of results
Community Results
End of results
Support
Blues.io
Notehub.io
Shop
Γ—
HomeNotecardNotecard API ReferenceNotecard Guides
Notecard Firmware Updates
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
Notecard Error and Status Codes
Rate this page Β 
  • β˜…
    β˜…
  • β˜…
    β˜…
  • β˜…
    β˜…
  • β˜…
    β˜…
  • β˜…
    β˜…
Can we improve this page? Send us feedbackRate this page
  • β˜…
    β˜…
  • β˜…
    β˜…
  • β˜…
    β˜…
  • β˜…
    β˜…
  • β˜…
    β˜…
Β© 2023 Blues Inc.Terms & ConditionsPrivacy
blues.ioTwitterLinkedInGitHubHackster.io
Disconnected
Notecard 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.

Advanced Usage

The help command gives more info.

Connect a Notecard
Use USB to connect and start issuing requests from the browser.
Try Notecard Simulator
Experiment with Notecard's latest firmware on a Simulator assigned to your free Notehub account.

Don't have an account? Sign up

Notecard Interfaces

Requests can be issued to the Notecard over USB, UART, or I2C. The Serial UART interface is fixed at a baud rate of 9600, with eight data bits, no parity bit, and one stop bit (9600/N-8-1).

The Notecard I2C interface is available at address 0x17, but can be reconfigured using a card.io request. This interface implements a straightforward serial over I2C protocol.

Using the Notecard Interface with a Firmware Library

The simplest way to initiate a connection with the Notecard from firmware is with one of our firmware libraries. Using this approach, you can initialize the Notecard over the appropriate interfacing using a few lines of code. For instance, with Serial:

    #include <Notecard.h>
    
    Notecard notecard;
    notecard.begin(Serial1, 9600);
    import notecard
    import serial
    
    port = serial.Serial("/dev/serial0", 9600)
    card = notecard.OpenSerial(port)

    Or with I2C:

      #include <Notecard.h>
      
      Notecard notecard;
      notecard.begin();
      import notecard
      from periphery import I2C
      port = I2C("/dev/i2c-1")
      
      card = notecard.OpenI2C(port, 0, 0)

      Using the Notecard Interface with Simple Serial I/O

      warning

      If NOT using a Notecard firmware library, you may unintentionally send requests to the Notecard so fast that you overflow the 1500 byte buffer used to receive data (whether it be I2C, Serial, or UART). The solution is to pause 250 ms after every 250 bytes sent and ensure the total size of each NDJSON object sent is no more than 8KB.

      Alternatively, it's possible to manually communicate with the Notecard over Serial in firmware using language-equivalent print() and read() functions.

        #define txRxPinsSerial Serial1
        
        // Initialize the Notecard
        txRxPinsSerial.begin(9600);
        txRxPinsSerial.println("\n");
        
        // Send a hub.set request
        txRxPinsSerial.println("{\"req\":\"hub.set\",\"product\":\""
                                myProductID "\"}");
        import json
        import serial
        
        serial = serial.Serial('/dev/ttyS0', 9600)
        serial.write(b'\n')
        
        req = {"req": "hub.set"}
        req["product"] = myProductID
        serial.write(bytearray(json.dumps(req), 'utf8'))
        serial.write(b'\n')

        The Notecard Serial-over-I2C Protocol

        If, on the other hand, you wish to use I2C without one of our firmware libraries, you'll need to write your own logic for writing to and reading from the bus. Your approach will vary from one language to the next, but you should use the existing implementations and the Serial-over-I2C Protocol Guide for reference.

        JSON FundamentalsEssential Requests