Using Notecard Trace Mode
All Notecards can be placed into trace mode. When enabled, a Notecard's trace mode generates a stream of messages that can help with debugging or understanding Notecard behavior.
You can utilize trace mode using:
Notecard's trace mode is available for debugging purposes only. The format of the output is not standardized and is subject to change at any time. If you need help interpreting a Notecard's trace output to debug an issue, reach out in our community forum or contact Blues support.
In-Browser Terminal
Complete the following steps to use trace mode via the In-Browser Terminal.
-
Visit the In-Browser Terminal.
-
Enable trace mode with the following request:
{"req":"card.trace","mode":"on"}
-
Perform actions that you want to debug. For example, to debug network connectivity issues you may wish to run a
hub.sync
request.{"req":"hub.sync"}
-
Disable trace mode with the following request:
{"req":"card.trace","mode":"off"}
-
(Optional) Download the trace log using the Save History button in the top-left corner of the Terminal. This will download the contents of the Terminal history to a
.log
file.
Serial Terminal Apps
Complete the following steps to use trace mode via a serial terminal app.
-
Connect a 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 note
Refer to our guides on using Tera Term and CoolTerm for more specific instructions on connecting to Notecard via those applications:
-
Enable trace mode with the following request:
{"req":"card.trace","mode":"on"}
-
Perform actions that you want to debug. For example, to debug network connectivity issues you may wish to run a
hub.sync
request.{"req":"hub.sync"}
-
Disable trace mode with the following request:
{"req":"card.trace","mode":"off"}
_log Environment Variable
You can remotely enable diagnostic logging at the device, fleet, or project
level using the _log
reserved environment variable.
When enabled, this will save trace logs to the _log.qo
Notefile on Notehub.
Please note that the trace logs saved to Notehub using this method are far less
verbose than the logs you can generate using the other methods outlined above.
Saving and syncing logging data with Notehub will impact your cellular data allocation. To avoid unnecessary usage, enable this feature only when required and disable it immediately afterward.
-
Set the
_log
environment variable using either the env.default API or the Notehub UI. -
When setting the variable, use one of the following values to specify the scope of the logging data to save:
gps
(to save high-level GPS status information)gpsmax
(to save more verbose GPS logging)power
(to save power-usage snapshots from a connected Mojo)modem
(to save modem lifecycle and network state transitions)all
(to save more broad diagnostic data)
-
Note that
_log.qo
Notes are generated only when a new Notehub session begins. If your Notecard is running incontinuous
mode, either set the_session_mins
environment variable or set aduration
value in yourhub.set
request. This allows you to define session length (in minutes) and ensure logs are created as expected. -
When finished gathering trace log data, be sure to delete these environment variables to silence logging and avoid unnecessary data usage.