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.

Capture Methods:

There are 2 methods for gathering trace info. Please read carefully to determine which methods are available to you and your situation.

Direct Serial Connection to Notecard

Requires a direct connection to the Notecard via USB or the auxiliary serial connection (AUX RX/TX).

Use a serial terminal application to enable the Notecard trace info, and capture the resulting messages.

Here are 2 means of access via a serial Terminal:

  • Notecard Playground (a browser based serial terminal)
  • Generic serial terminal app

Using Notecard Playground

Requires

  • USB connection to Notecard
  • Recent Chrome or Chrome-based browser
  1. Visit Notecard Playground - Blues 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"}

Using Serial Terminal App

Requires

  • USB or Auxiliary Serial (AUX RX/TX) connection to Notecard
  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.