How do I capture a trace information from Notecard?

Trace information is a stream of messages that can be useful when looking to understand Notecard behavior.

Blues Support often requests trace information when assisting customers with network connectivity questions.

Note
If you need to store trace information on the Notecard internal memory to be retrieved later, please review the section here: On-board Notecard Storage

Network Sync Trace - Easy Mode

Requires

  • USB connection to Notecard
  • Recent Chrome or Chrome-based browser

Steps:

  1. Visit Notecard Playground - Blues Wireless Developers

  2. Follow the connection guide here until you verify connection to Notecard

  3. Perform the trace by entering the following

sync-trace
  1. Click the Save history button in the upper right-hand corner

This will download the contents of the terminal history to a .log file


Manual Trace - Notecard Playground

Video Overview: How to Create Trace Log from the Notecard CLI - YouTube

Use this if looking to modify the verbosity of the trace log on different Notecard behaviors, especially if you need to log something other than network syncs.

Requires

  • USB connection to Notecard
  • Recent Chrome or Chrome-based browser

Steps:

  1. Visit Notecard Playground - Blues Wireless Developers

  2. Follow the connection guide here until you verify connection to Notecard

  3. Enable the trace with the following request

{"req":"card.trace","mode":"on"}
  1. Perform operations that you want to capture. For network connectivity related inquiries, this usually is a hub.sync request
{"req":"hub.sync"}
  1. Click the Save history button in the upper right-hand corner

This will download the contents of the terminal history to a .log file

  1. Disable the trace with
{"req":"card.trace","mode":"off"}

Manual Trace - Serial Terminal App

Use this if looking to modify the verbosity of the trace log on different Notecard behaviors, especially if you need to log something other than network syncs. Use the serial terminal app if you do not have access to the Notecard USB or the Notecard Playground.

Requires

  • USB or Auxiliary Serial (AUX RX/TX) connection to Notecard
  • Serial terminal application
  1. Connect the Notecard to your serial terminal app using one of the following serial port configurations
Connection Serial Configuration Abbreviated
USB Baud Rate : 9600, 8 bit, no parity, 1 stop bit 9600 8N1
AUX RX/TX Baud Rate: 115200, 8 bit, no parity, 1 stop bit 115200 8N1
  1. Enable the serial terminal app to log responses (if the app has this feature)

  2. Enable the trace with the following request

{"req":"card.trace","mode":"on"}
  1. Perform operations that you want to capture. For network connectivity related inquiries, this usually is a hub.sync request
{"req":"hub.sync"}
  1. Disable the trace with
{"req":"card.trace","mode":"off"}

See also:


On-Board Notecard Storage

Stores trace messages on Notecard. The stored messages can be retrieved as a Notecard JSON request via any connection method.

Important
This method stores trace message data onto Notecard FLASH memory. Use sparingly to minimize wearing of the FLASH memory.

Requires

  • You already have configured a method that sends requests and receives responses from Notecard. This could be any of the UART interfaces or I2C.
  1. Enable the trace by sending the following request
{"req":"card.trace","start":true}
  1. Perform operations that you want to capture. For network connectivity related inquiries, this usually is a hub.sync request
{"req":"hub.sync"}
  1. To halt the trace and gather the results, send the following request
{"req":"card.trace","stop":true}

The response from the request in the last step will include the trace message information in the JSON string.