Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Serial and Debug Logging

The puara-module library provides a simple interface for serial communication, allowing you to send data and receive commands via the serial port.


Starting Serial Listening

Serial listening is started automatically when you call puara.start(). You can also start it manually:

bool success = puara.start_serial_listening();

Returns: true if serial listening was successfully started, false otherwise.

When serial listening is active, the device will listen for incoming commands on the serial port, allowing you to interact with and configure the device via a serial terminal.


Sending Serial Data

You can send data over the serial port using the send_serial_data() method:

puara.send_serial_data("Hello, world!");

Monitor Types

You can specify the serial monitor type when calling the start() method:

// Use JTAG monitor with debug-level logging
puara.start(PuaraAPI::JTAG_MONITOR, ESP_LOG_DEBUG);

Available Monitors

MonitorDescription
PuaraAPI::UART_MONITORStandard UART serial monitor (default).
PuaraAPI::JTAG_MONITORJTAG-based debugging monitor.
PuaraAPI::USB_MONITORUSB serial monitor.

Debug Levels

The second parameter of start() sets the ESP-IDF logging level:

LevelDescription
ESP_LOG_NONENo logging output.
ESP_LOG_ERROROnly error messages.
ESP_LOG_WARNWarnings and errors (default).
ESP_LOG_INFOInformational messages, warnings, and errors.
ESP_LOG_DEBUGDebug messages and all above.
ESP_LOG_VERBOSEAll messages including verbose output.