Device info
What this example shows
Asking the onboard TT-SC1 receiver who it is. The sketch puts the receiver into its CONFIGURATION state, prints its serial number, firmware version and device type, runs a connection test, dumps every setting and the receiver's built-in help text, and then returns the receiver to normal aircraft tracking.
The example code
This is 2_DeviceInfo.ino from the pinned library, without the file's header
comment. The sketch body is exactly as shipped. The library's default wiring
(UART1 on IO17 and IO18, reset on IO21) matches this board, so the constructor
needs no arguments.
#include "ADSB-Receiver-SOLDERED.h"
// Create an instance of the ADS-B object
ADSBReceiver adsb;
void setup()
{
Serial.begin(115200);
adsb.begin(115200);
// Print every raw line the module sends, useful to see what is really happening.
adsb.onLine([](const String &line) {
Serial.print("[module] ");
Serial.println(line);
});
// Only in CONFIGURATION state can settings be read or written.
Serial.println("Entering CONFIGURATION state...");
if (!adsb.enterConfiguration())
{
Serial.println("Failed to enter CONFIGURATION state.");
return;
}
String value;
// Read the module's serial number.
if (adsb.getSerialNumber(value))
{
Serial.print("Serial number: ");
Serial.println(value);
}
// Read the currently installed firmware version.
if (adsb.getFirmwareVersion(value))
{
Serial.print("Firmware version: ");
Serial.println(value);
}
// Read the device type string reported by the module.
if (adsb.getDeviceType(value))
{
Serial.print("Device type: ");
Serial.println(value);
}
// Simple connectivity check, the module should always answer AT+OK.
Serial.print("Connection test (AT+TEST): ");
Serial.println(adsb.test() ? "OK" : "FAILED");
// Ask the module to list every setting and its current value.
Serial.println();
Serial.println("--- AT+SETTINGS? ---");
String settings;
if (adsb.getAllSettings(settings))
Serial.println(settings);
// Ask the module for its full built-in help text.
Serial.println();
Serial.println("--- AT+HELP ---");
String help;
if (adsb.getFullHelp(help))
Serial.println(help);
// Leave CONFIGURATION and resume normal aircraft tracking.
Serial.println();
Serial.println("Returning to RUN state...");
adsb.exitConfiguration(115200); // must match the BAUDRATE setting printed above
}
void loop()
{
}
Expected result
Open Tools → Serial Monitor, set the baud rate to 115200 and reset the
board. The sketch runs once in setup() and loop() stays empty, so the output
appears once and then stops.
The lines come in this order: Entering CONFIGURATION state..., then the serial
number, firmware version and device type lines, then the connection test line
(OK or FAILED), the --- AT+SETTINGS? --- block, the --- AT+HELP ---
block and finally Returning to RUN state.... Every reply the module sends
while the sketch talks to it is also printed, starting with [module] ,
because onLine() is registered before the first command. The connection
test's reply lands on the same line as its Connection test (AT+TEST): label,
because the sketch prints the label before it sends the command.
Entering CONFIGURATION state...
[module] AT+OK
[module] AT+CONFIG=1
[module] AT+SERIAL_NUMBER=33-0004127
Serial number: 33-0004127
[module] AT+FIRMWARE_VERSION=2.89.28.0
Firmware version: 2.89.28.0
[module] AT+DEVICE=TT-SC1
Device type: TT-SC1
Connection test (AT+TEST): [module] AT+OK
OK
--- AT+SETTINGS? ---
[module] AT+BAUDRATE=0
[module] AT+BOOT=0
[module] AT+CONFIG=1
[module] AT+DEVICE=TT-SC1
[module] AT+FIRMWARE_VERSION=2.89.28.0
[module] AT+LOCK=0
[module] AT+SERIAL_NUMBER=33-0004127
[module] AT+SYSTEM_LOG=0
[module] AT+SYSTEM_STATISTICS=0
[module] AT+ADSB_RX_PROTOCOL_DECODED=CSV
[module] AT+ADSB_RX_PROTOCOL_INC=0
[module] AT+ADSB_STATISTICS=CSV
AT+BAUDRATE=0
AT+BOOT=0
AT+CONFIG=1
AT+DEVICE=TT-SC1
AT+FIRMWARE_VERSION=2.89.28.0
AT+LOCK=0
AT+SERIAL_NUMBER=33-0004127
AT+SYSTEM_LOG=0
AT+SYSTEM_STATISTICS=0
AT+ADSB_RX_PROTOCOL_DECODED=CSV
AT+ADSB_RX_PROTOCOL_INC=0
AT+ADSB_STATISTICS=CSV
--- AT+HELP ---
[module] SETTINGS:
[module] SYSTEM:
[module] AT+BAUDRATE=0
[module] AT+BOOT=0
[module] AT+CONFIG=1
[module] AT+DEVICE=TT-SC1
[module] AT+FIRMWARE_VERSION=2.89.28.0
[module] AT+LOCK=0
[module] AT+SERIAL_NUMBER=33-0004127
[module] AT+SYSTEM_LOG=0
[module] AT+SYSTEM_STATISTICS=0
[module] ADSB:
[module] AT+ADSB_RX_PROTOCOL_DECODED=CSV
[module] AT+ADSB_RX_PROTOCOL_INC=0
[module] AT+ADSB_STATISTICS=CSV
[module] COMMANDS:
[module] AT+HELP
[module] AT+REBOOT
[module] AT+REBOOT_BOOTLOADER
[module] AT+SETTINGS_DEFAULT
[module] AT+TEST
AT+BAUDRATE=0
AT+BOOT=0
AT+CONFIG=1
AT+DEVICE=TT-SC1
AT+FIRMWARE_VERSION=2.89.28.0
AT+LOCK=0
AT+SERIAL_NUMBER=33-0004127
AT+SYSTEM_LOG=0
AT+SYSTEM_STATISTICS=0
AT+ADSB_RX_PROTOCOL_DECODED=CSV
AT+ADSB_RX_PROTOCOL_INC=0
AT+ADSB_STATISTICS=CSV
AT+HELP
AT+REBOOT
AT+REBOOT_BOOTLOADER
AT+SETTINGS_DEFAULT
AT+TEST
Returning to RUN state...
[module] AT+OK
[module] AT+CONFIG=0
Functions used
ADSBReceiver()returns NoneCreates the receiver object. With no arguments it uses the library's board defaults: hardware UART 1, IO17 for the receiver's TX line, IO18 for its RX line and IO21 for its RESET line, which is how this board is wired.
ReturnsConstructor; no return value.
Parameters
| Type | Name | Description |
|---|---|---|
uint8_t | uartNum | ESP32 hardware UART to use. Optional, default 1. Avoid 0, which is usually the USB console. |
int8_t | rxPin | ESP32 GPIO wired to the module's TX pin. Optional, default 17. |
int8_t | txPin | ESP32 GPIO wired to the module's RX pin. Optional, default 18. |
int8_t | resetPin | ESP32 GPIO wired to the module's RESET pin. Optional, default 21. Pass -1 if it is not connected. |
begin(uint32_t initialBaud, size_t rxBufferSize)returns voidOpens the UART link to the receiver. Call it once in setup(). It also makes the RESET pin a high-impedance input, so the pin is only driven during hardwareReset().
ReturnsNothing.
Parameters
| Type | Name | Description |
|---|---|---|
uint32_t | initialBaud | Baud rate to start at. Optional, default 115200. Use 115200 unless the module's BAUDRATE setting was changed earlier. |
size_t | rxBufferSize | Size of the UART receive buffer in bytes. Optional, default 4096, larger than the ESP32 core's 256 bytes so busy traffic is not truncated. |
onLine(LineCallback cb)returns voidRegisters a function that is called for every complete line the receiver sends, before the line is parsed, including the AT replies to the commands you send. The example uses it to print each line with a [module] prefix.
ReturnsNothing.
Parameters
| Type | Name | Description |
|---|---|---|
void (*)(const String &line) | cb | The function to call, given the line without its line ending. A lambda that captures nothing, as in the example, works. |
enterConfiguration()returns boolMoves the receiver from RUN to CONFIGURATION state. It sends AT+CONFIG=1, switches the local UART to 115200 (the receiver's fixed CONFIGURATION baud rate) and then confirms the new state with AT+CONFIG?. Reading and writing settings only works in this state.
Returnstrue if the receiver reports being in CONFIGURATION state, false otherwise.
getSerialNumber(String &out)returns boolReads the receiver's serial number with AT+SERIAL_NUMBER?.
Returnstrue if the receiver answered, false otherwise.
Parameters
| Type | Name | Description |
|---|---|---|
String & | out | Receives the serial number. |
getFirmwareVersion(String &out)returns boolReads the receiver's firmware version with AT+FIRMWARE_VERSION?.
Returnstrue if the receiver answered, false otherwise.
Parameters
| Type | Name | Description |
|---|---|---|
String & | out | Receives the firmware version. |
getDeviceType(String &out)returns boolReads the device type string the receiver reports, with AT+DEVICE?.
Returnstrue if the receiver answered, false otherwise.
Parameters
| Type | Name | Description |
|---|---|---|
String & | out | Receives the device type. |
test()returns boolSends AT+TEST, a simple connection check. A healthy receiver answers AT+OK.
Returnstrue if the answer contains AT+OK, false otherwise.
getAllSettings(String &out)returns boolAsks the receiver for every setting and its current value with AT+SETTINGS?. The answer has several lines, so the function keeps reading until the receiver has been quiet for 150 ms, for at most 1500 ms.
Returnstrue if at least one line came back, false otherwise.
Parameters
| Type | Name | Description |
|---|---|---|
String & | out | Receives the reply lines, joined with newlines. |
getFullHelp(String &out)returns boolAsks the receiver for its built-in help text with AT+HELP. It reads the multi-line answer the same way as getAllSettings().
Returnstrue if at least one line came back, false otherwise.
Parameters
| Type | Name | Description |
|---|---|---|
String & | out | Receives the help text, joined with newlines. |
exitConfiguration(uint32_t runBaud)returns boolMoves the receiver from CONFIGURATION back to RUN state. It sends AT+CONFIG=0, switches the local UART to runBaud and confirms the new state with AT+CONFIG?.
Returnstrue if the receiver reports being in RUN state, false otherwise.
Parameters
| Type | Name | Description |
|---|---|---|
uint32_t | runBaud | Baud rate for RUN state. Optional, default 115200. It must match the receiver's stored BAUDRATE setting, which is why the example's comment points at the settings dump. |
Putting it together
The receiver has to be in CONFIGURATION state for the getters and settings
calls, so enterConfiguration() comes first and
exitConfiguration() closes it. Each getter fills the String you pass in and
returns true when the receiver answered, so the example prints a line only for
the answers it got.
The sketch never calls poll(), so it does not decode aircraft reports. It is a
one-shot health check, not a tracker. For aircraft output, use the
Read aircraft reports
sketch.