# UAVCAN UI LEDS node
The node blinks LEDs either by the command received from the autopilot or by the configured behavior.
It might be used as (aviation navigation lights (opens new window)).
There are different board types.
|1||Number of LEDs||15||32|
|2||Number of CAN connectors||1||2|
# 1. Dronecan interface
This node interacts with the following messages:
|1||subscriber||uavcan.equipment.esc.RawCommand (opens new window)|
|2||subscriber||uavcan.equipment.indication.LightsCommand (opens new window)|
|3||publisher||uavcan.protocol.device.Temperature (opens new window)|
|4||publisher||uavcan.protocol.debug.LogMessage (opens new window)|
Besides required and highly recommended functions such as
GetNodeInfo this node also supports the following application-level functions:
|1||RPC-service||uavcan.protocol.param (opens new window)|
|2||RPC-service||uavcan.protocol.RestartNode (opens new window)|
|3||RPC-service||uavcan.protocol.GetTransportStats (opens new window)|
# 2. Hardware specification
# 3. Wire
This board has 3 connectors which are described in the table below.
|1||UCANPHY Micro (JST-GH 4)||Devices that deliver power to the bus are required to provide 4.9–5.5 V on the bus power line, 5.0 V nominal. Devices that are powered from the bus should expect 4.0–5.5 V on the bus power line. The current shall not exceed 1 A per connector.|
|2||6-pin Molex (502585-0670 (opens new window), 502578-0600 (opens new window))||Contacts support up to 100 V, 2 A per contact. But the board may work only with 2S-6S.|
|3||SWD||STM32 firmware updating using programmer-sniffer.|
# 4. Main function description
It works in 2 modes:
- If there is no RawCommand (opens new window) or his value is equal or less than zero, the led value will be based on LightsCommand (opens new window) value. Depending on ID configured in node parameters and PX4 parameters, it might be RGB UI led value or some UAVCAN light operation mode. Study PX4 user manual LED meaning section (opens new window) and PX4 DroneCan parameters (opens new window).
- Otherwise, the value of LED will be defined by DroneCan parameter. It might be solid, blinking or pulsing lighting.
See 6. Parameters section for mode details.
# 5. Auxiliary functions description
# 5.1 Node info
Every firmware store following info that might be received as a response on NodeInfo request. It stores:
- software version,
- hardware version (doen't work yet),
- an unique identifier.
# 5.2 Log messages
The node may inform you when something happen using uavcan.protocol.debug.LogMessage (opens new window).
At that moments the node may publishes messages only 5 second after enabling. Here we can have one of following messages:
- If everything is ok, the log level is
DEBUGand the message is
- If the node have power problems, the log level is
- If the hardware and software diagnostic fails during initialization, you will get a
CRITICALlevel message. This should not happen in normal condition, but if so, don't use it in production. In this case, the node repeats the message each 15 seconds.
A visualization of this message in
gui_tool in case of error shown on a picture below.
Fig. Visualization of log messages in uavcan_gui_tool after initialization with log_level=0
This message might be used in PX4 as logmessage (opens new window) feature.
# 5.3 Device temperature
The node has an internal temperature sensor. It sends the temperature of the stm32 controller each 0.5 seconds.
If the temperature goes above 60 °C, the controller will automatically decrease the maximum intensity. If the temperature goes above 80 °C the leds will be disabled for the safety purpose.
Typically, it's not an issue if you use only one color of the leds (red, blue or green) even with the highest intensity. But the overheat may appear if you use white color because it forces RGB leds to use all 3 internal leds.
# 6. Parameters
Below you can see a picture from
gui_tool with a whole list of parameters.
Configuration of mapping can be performed using
gui_tool or even
QGC. Below you can see the table with these params in
Table with parameters description:
|№||Parameter name||Reboot required||Description|
|1||log_level||true||Specify what level of log can be sent.|
|2||rgb_leds_max_intensity||false||Input DroneCan commands linearly scales into intensity from 0 to this value. Max value is 255.|
|3||rgb_leds_id||true||Id for DroneCan command that will be expected by the node. By default 0 id corresponds ui led.|
|4||rgb_leds_default_color||false||The color during arming state. See table below with more info.|
|5||rgb_leds_light_type||false||The type of lighting during arming state. It might be solid, blink or pulsing lighting. See table below with more info.|
|6||rgb_leds_num_of_leds||true||Number of leds on the board.|
|7||rgb_leds_blink_period_ms||false||Make sense only when |
|8||rgb_leds_blink_duty_cycle_pct||false||Make sense only when |
Table with default colors:
Table with light types:
# 7. Led indication
This board has an internal led that may allows you to understand possible problems. It blinks from 1 to 10 times within 4 seconds. By counting the number of blinks you can define the code of current status.
|Number of blinks||Uavcan health||Description|
|1||OK||Everything is ok.|
|2||OK||There is no RawCommand at least for the last 0.5 seconds, the PWM state is reset to default state.|
|3||WARNING||This node can't see any other nodes in the DroneCan network, check your cables.|
|4||ERROR||There is a problem with circuit voltage, look at the circuit status message to get details. It may happen when you power it from SWD, otherwise, be careful with the power supply.|
|5||CRITICAL||There is a problem with the periphery initialization level. Probably you load the wrong firmware.|
# 8. Debugging on a table
gui_tool doesn't support sending LightsCommand (opens new window), it is recommended to debug the node with Autopilot. You can use this utility only for parameter configuration. Go to the 9. PX4 integration section.
# 9. PX4 integration
You can integrate this node with PX4 by performing following steps:
- According to the PX4 user guide the
UAVCAN_ENABLEmust be set to one of the non-zero values.
- You need to manually set node id to each nodes you are going to use.
- You might be interested in configuration the following parameters as well: