> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/status-lights-and-diagnostics.md).

# Status lights and diagnostics

What each light and error code means, the bootloader codes, and Workbench diagnostic categories.

There are 8 System Status LEDs on the front panel of the RTU. The red **ER** LED will flash a certain number of times corresponding to that error condition. Diagnostics are used to monitor RTU activity whilst connected to QTech Workbench, including i/o and communications activity.

{% hint style="info" %}
**Applies to:** XL4 Plus, firmware v7.x.
{% endhint %}

## Front panel lights

| Light | Colour | Meaning                                                                                                                                                                                                                                          |
| ----- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ON    | Blue   | Power is on. If power is connected and the LED is not on this could indicate that the supply voltage is low or that the Q22 fuse has blown.                                                                                                      |
| OK    | Green  | Fades slowly on and off at a slow regular interval to indicate that the Q04 Processor is running. The LED will flash 6 times rapidly whenever a system reset occurs. System resets occur at system power up or if the watch dog timer times out. |
| IP    | Yellow | Flashes on for approximately 0.5 seconds every time a valid communications packet is received for this module address from another module on the RS485 bus.                                                                                      |
| MU    | Yellow | Turns on when the mute gate in the radio connected to the RS232-B port opens showing the radio channel is busy. The module will not transmit data when MU (mute) LED is on.                                                                      |
| Rx    | Yellow | Turns on whenever a valid data carrier is detected from the RS232-B port.                                                                                                                                                                        |
| KY    | Yellow | Turns on whenever the modem attached radio's transmitter on the RS232-B port is requested to be turned on.                                                                                                                                       |
| TX    | Yellow | Turns on whenever the RTU is transmitting data from the RS232-B port.                                                                                                                                                                            |
| ER    | Red    | Error codes (below)                                                                                                                                                                                                                              |

{% hint style="info" %}
The XL4 Plus RTU indicates OK differently to the XL4 RTU. The XL4 Plus RTU uses a slow fade of the OK LED to indicate the RTU is running OK on XL4 Plus firmware. The previous XL4 RTU used a 1 second flash of the OK LED to indicate OK status.
{% endhint %}

## ER light codes

The LED will flash a certain number of times corresponding to that error condition. The LED pulses are separated by a 2 second period allowing multiple error codes to be indicated. This list defines the number of error light flashes for each of the error/fault codes.

| Flashes                | Meaning                                                                                                                                                                                                                              |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 1                      | Main battery failure (low)                                                                                                                                                                                                           |
| 2                      | Clock battery low. However, if the OK LED is not slow fading, this indicates there is no application program loaded. See [Troubleshooting](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/troubleshooting.md). |
| 3                      | Communications with Base Station has failed                                                                                                                                                                                          |
| 4                      | IPB communications failure (expansion modules)                                                                                                                                                                                       |
| 5                      | One or more real digital outputs have failed                                                                                                                                                                                         |
| 6                      | One or more analog input is out of range                                                                                                                                                                                             |
| 7                      | The DLP is not loaded or is corrupted                                                                                                                                                                                                |
| 8                      | Modbus serial master communications failure                                                                                                                                                                                          |
| 9                      | Not used                                                                                                                                                                                                                             |
| 10                     | Modbus TCP client communications failure                                                                                                                                                                                             |
| 11                     | QComms serial master communications failure                                                                                                                                                                                          |
| 12                     | QComms TCP server communications failure                                                                                                                                                                                             |
| Rapid continuous flash | The RTU is not licenced to operate any protocols. Please contact QTech to obtain a firmware licence. See [Licensing and features](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/licensing-and-features.md).   |

## Bootloader codes

The following is a list of the bootloader fault codes.

| Code | Name                                                                                                  |
| ---- | ----------------------------------------------------------------------------------------------------- |
| 1    | ELFLOADER\_OK                                                                                         |
| 2    | ELFLOADER\_FILESYS\_ERROR: the bootloader can't access the file system, or can't find the application |
| 3    | ELFLOADER\_BAD\_ELF\_HEADER                                                                           |
| 4    | ELFLOADER\_NO\_SYMTAB                                                                                 |
| 5    | ELFLOADER\_NO\_STRTAB                                                                                 |
| 6    | ELFLOADER\_NO\_TEXT                                                                                   |
| 7    | ELFLOADER\_SYMBOL\_NOT\_FOUND                                                                         |
| 8    | ELFLOADER\_SEGMENT\_NOT\_FOUND                                                                        |
| 9    | ELFLOADER\_NO\_STARTPOINT                                                                             |

Code 2 will be flashed in ms (200 on, 200 off, 200 on, 200 off, 1000 off, repeat).

During a firmware update the status LEDs will flash in sequence to indicate programming is in progress.

## Other lights

* **Digital input lights (green):** the state of each digital input is indicated with a corresponding green status LED. ON indicates the input is grounded.
* **Digital output lights (outputs 1–4):** the first bank of the digital outputs has 4 status LEDs to indicate the state of the corresponding digital output channel. Output Protection and Open Circuit Detection status information can be reported by flashing the status LEDs.
* **Analogue lights:** each analog channel has a status LED to indicate the state of the channel. OFF indicates that the analog input is at 0V, 0mA, or less than 4mA, depending on the mode configured. ON indicates that the analog input is within the specified voltage or current range, depending on the mode configured. FLASHING indicates that the analog input is at full scale or higher dependent upon the mode configured.
* **Ethernet socket:** the Ethernet socket has a green and an orange LED. The orange LED is the Link LED and turns on when a good link is established then flashes off for Ethernet traffic. The green LED is the Speed LED and turns on for 100 MBit connections and off for 10 MBit connections.

### Processor board lights

The status of the Q04 Plus processor is displayed on 5 LEDs on the top left of the PCB (they are not visible when the XL4 Plus case is in place).

| Light                | Meaning                                                                                                                                                                                                                                                            |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| PWR (blue)           | Blue LED - shows that power is applied to the Q04 Plus.                                                                                                                                                                                                            |
| OK (green)           | Green LED - shows the status of the central processing unit. The LED blinks slowly when the CPU is functioning correctly. The LED blinks 6 times quickly whenever a system reset has occurred. Any other condition of this LED indicates a malfunction of the CPU. |
| MSG, A1, B1 (orange) | Orange LED - unused.                                                                                                                                                                                                                                               |

## Diagnostics in QTech Workbench

Diagnostic data is interpreted by the RTU and transmitted as a fully formed human readable message which can be displayed in QTech Workbench over USB. The RTU provides a category value with each message so the data can be filtered, especially if only certain aspects of the RTU operation are being monitored.

* Enabling a category adds any associated diagnostics into the stream that is output by the RTU, until the RTU is rebooted (or the category disabled).
* Categories can be enabled so that diagnostic messages appear as soon as the RTU powers up by declaring them to be **persistent** in Workbench.
* Each diagnostic message is output in the form `<Timestamp RTU Time><Category><message>`. Modem AT commands and responses are displayed in their Hayes format.
* The raw frame can be viewed by additionally selecting the **DBG\_SERIAL** category.

| Category            | Shows                                                                                                                                                                                                  |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| DBG\_SYS            | RTU System: System capability e.g. memory size and allocation etc.; License validation; Process task execution state (starting stopping); Catch all for messages that don’t fit into a simple category |
| DBG\_PHY            | Ethernet Port: TCP/IP configuration; Cable connection state                                                                                                                                            |
| DBG\_SERIAL         | Serial Comms: Port name and configuration parameters, e.g. baud rate; Raw data                                                                                                                         |
| DBG\_WORKBENCH      | QTech Workbench: procedure calls and commands from workbench to the RTU; transaction history bulk transfer of data; (used primarily by QTech development)                                              |
| DBG\_MB\_MASTER     | Modbus Master: Commands sent/received; exceptions; process/task status                                                                                                                                 |
| DBG\_MB\_SLAVE      | Modbus Slave: process/task status; Commands sent/received; exceptions                                                                                                                                  |
| DBG\_MB\_CLIENT     | Modbus Client: (Ethernet) process/task status; Commands sent/received; Exceptions; Tcp connection status and events                                                                                    |
| DBG\_IPB\_MASTER    | IPB Master (expansion modules): process/task status; comms exceptions, status                                                                                                                          |
| DBG\_QCOMMS\_MASTER | DATRAN Master: process/task status; commands set/recvd; comms state events (e.g. slave failed); store and forward events                                                                               |
| DBG\_QCOMMS\_SLAVE  | DATRAN Slave: process/task status and driver mode; link level connection status; communication timer retries and timeouts; store and forward events                                                    |
| DBG\_QCOMMS\_SERVER | DATRAN Server: (Ethernet) process/task status and driver mode; link level connection status; communication timer retries and timeouts; store and forward events; Tcp connection status and events      |
| DBG\_MODEM          | Modem Communications: link level data and command/response messages over the serial ports; (Hayes commands); Connection state                                                                          |
| DBG\_DNP3\_SLAVE    | DNP3 Slave: process/task status; (DNP3 has its own inbuilt diagnostic capability)                                                                                                                      |
| DBG\_DNP3\_STACK    | DNP3 System: process/task status; exposes DNP3 diagnostics (part of the DNP3 protocol)                                                                                                                 |
| DBG\_SPIFFS         | File System: File allocation; Exceptions; Debugging info for QTech                                                                                                                                     |
| DBG\_DATA           | Data Table: summary information of allocated inputs and outputs                                                                                                                                        |
| DBG\_DATALOGGING    | Data Logging: process/task status; database integrity; datalogging events                                                                                                                              |
| DBG\_DLP            | DLP Runtime: process/task status; DLP loaded/running/error state; Some events show up in qcomms                                                                                                        |
| DBG\_CONFIG         | Configuration File: processing and parsing of config file; errors e.g. invalid syntax; data validation; schema version exceptions                                                                      |
| DBG\_TEST           | Test: factory automated test results; self test results                                                                                                                                                |
| DBG\_DF1            | DF1: process/task status; commands sent/received; exceptions (e.g. out of range)                                                                                                                       |
| DBG\_FTP            | FTP: file transfer protocol task state; link level events                                                                                                                                              |
| DBG\_VOLTAGE\_ALM   | Voltage Alarms: process/task status; alarms and exceptions                                                                                                                                             |
| DBG\_NTP\_CLIENT    | NTP Client: process/task status; time updates                                                                                                                                                          |

The categories DBG\_LWIP, DBG\_EVT and DBG\_SETTINGS are not recommended for customer use.
