Notes

Start from observable symptoms and use repeatable checks to narrow down the cause.

UART

Capturing serial boot logs

Start recording in a serial terminal before resetting the board, so you can see output from both boot and application stages. Check the board manual for the connector, signal levels, and baud rate.

  • For missing output, check the selected port, ground reference, TX/RX wiring, and firmware console configuration.
  • For garbled output, check baud rate, data bits, parity, and stop bits, then inspect the signal levels and wiring.
  • Keep raw lines around the first failure and note the board, firmware version, and reproduction steps.

Related reference

TCP

Handling split and combined messages

TCP provides an ordered byte stream. A length field can define message boundaries while a receive buffer holds bytes waiting for a complete message.

  • Try a two-byte length field followed by a UTF-8 payload, using one agreed byte order.
  • After the full header arrives, check the maximum length. Process only complete payloads and keep any remaining bytes for the next message.
  • Test a split header, two messages in a single read, an oversized length, and a mid-message disconnect.

Related reference

MQTT

QoS 1 and deduplication

QoS 1 provides at-least-once delivery. Use application-level message identifiers when duplicate processing would affect a count or create extra records.

  • For an exercise, include a device ID and event ID, such as device-a and event-001.
  • Send the same event ID twice and check that the receiver creates one record. Send a different ID and verify that it creates a second record.
  • Combine the device and event IDs when deduplicating across devices. Persist processed IDs if deduplication must survive a restart.

Related reference