Welcome to RDK X5 Board repository
01. Peripheral Hardware Configuration
OpenClaw Peripheral Hardware Configuration
OpenClaw Peripheral Hardware Configuration1. Course Overview2. Hardware Configuration File Description2.1 Configuration File Location2.2 Current Configuration File Coverage2.3 Peripheral Wiring Diagrams3. DHT Hardware Testing3.1 Verification Method4. RGB Hardware Testing4.1 Verification Method5. Servo Hardware Testing5.1 Verification Method6. OpenClaw Firmware Serial Port Settings6.1 Current Default Values6.2 Modification Example6.3 Verification Method7. OLED Hardware Testing7.1 Current Default Values7.2 Scenarios Suitable for Modification7.3 Common Modification ItemsModify ResolutionModify I2C AddressModify Rotation Direction7.4 Verification Method8. Camera Hardware Testing8.1 Configuration8.2 Photo Verification Method8.3 Adjustable Parameter Description
1. Course Overview
This course will introduce the default configuration files related to hardware before using OpenClaw, focusing on how to modify underlying default parameters according to the actual situation of your peripherals and complete basic verification.
Use low-level commands to verify if modifications take effect
2. Hardware Configuration File Description
2.1 Configuration File Location
The current hardware default configuration file for OpenClaw is located at:
/home/sunrise/hardware_hal_demo/hardware_config.pyIf you are following the accompanying tutorial and using the accompanying factory hardware with the default factory image, you usually do not need to modify it.
2.2 Current Configuration File Coverage
hardware_config.py currently mainly contains three types of default configurations:
OpenClaw firmware serial port default parameters
OLED default parameters
These default values are read by low-level command-line tools, such as:
rgboleddht
It should be noted that:
DHT and RGB are driven directly through the OpenClaw expansion board firmware
OLED is driven through the motherboard's I2C pins
CSI camera requires checking hardware connections
2.3 Peripheral Wiring Diagrams
The OLED and temperature/humidity sensor do not require external connections; they are directly onboard on the OpenClaw expansion board.
Servo wiring diagram: as shown below, the S1 signal pin corresponds to yellow, red corresponds to 5V, and brown corresponds to GND.

RGB light strip has a fool-proof interface, see the image below.

Please power off before inserting. For the CSI camera, insert it straight down into the slot, with metal contacts facing the white side of the interface.

3. DHT Hardware Testing
Note: If you need to continuously read DHT via the Python driver library, it is recommended to read DHT data every two seconds for better stability.
3.1 Verification Method
xxxxxxxxxxdht # Get sensor datadht_oled # Display sensor data on OLEDNormal terminal output should show temperature and humidity data on the OLED.


4. RGB Hardware Testing
4.1 Verification Method
Run in terminal:
xxxxxxxxxxrgb color --color red # All turn redrgb effect --effect breathe --color blue --speed 5 # Blue breathing lightNormal terminal output should show the RGB lights displaying normally.



Turn off the light strip:
xxxxxxxxxxrgb off


5. Servo Hardware Testing
5.1 Verification Method
Control a single servo:
xservo call-tool Servo1 --action set_angle --angle 90 # Servo 1 turns to 90 degreesservo call-tool Servo2 --action set_angle --angle 180 # Servo 2 turns to 180 degrees
# Servo1 is the servo to control# 90 is the angle to turn to


Synchronously control multiple servos:
Note: If you only have two servos, fill in the angles for two servos; the angles for the other two can be filled arbitrarily.
xxxxxxxxxx# Four servos reach specified angles simultaneouslyservo call-tool ServoAll --action set_all --angle1 90 --angle2 45 --angle3 135 --angle4 60 # All servos return to center positionservo call-tool ServoAll --action set_all --angle1 90 --angle2 90 --angle3 90 --angle4 906. OpenClaw Firmware Serial Port Settings
6.1 Current Default Values
The current default serial port parameters for OpenClaw firmware are:
port="/dev/ttyS1"baudrate=115200
Serial port naming may differ on other motherboards, for example, Jetson uses "/dev/ttyTHS1".
6.2 Modification Example
Edit the configuration file:
xxxxxxxxxxnano /home/sunrise/hardware_hal_demo/hardware_config.pyChange RDK X5 to, for example:
xxxxxxxxxx"port": "/dev/ttyS1","baudrate": 115200,
6.3 Verification Method
After saving, it is recommended to first test with any low-level command for servo or RGB, for example:
xxxxxxxxxxrgb color --color green Or:
xxxxxxxxxxservo call-tool Servo1 --action center # Servo 1 returns to center 90 degrees# All servos return to center positionservo call-tool ServoAll --action set_all --angle1 90 --angle2 90 --angle3 90 --angle4 90If the command returns normally and can control the peripheral correctly, it means the serial port link is available.

7. OLED Hardware Testing
7.1 Current Default Values
Current OLED default parameters mainly include:
width=128height=32interface="i2c"i2c_bus="5"i2c_bus_candidates=[5]i2c_address=0x3Crotate=0invert=Falsecontrast=255
7.2 Scenarios Suitable for Modification
It is recommended to modify OLED default values in the following situations:
You are using an OLED with a different resolution
I2C address is not
0x3CScreen orientation needs to be flipped
7.3 Common Modification Items
Modify Resolution
For example, change:
xxxxxxxxxx"width": 128,"height": 32,To:
xxxxxxxxxx"width": 128,"height": 64,Modify I2C Address
For example, change:
xxxxxxxxxx"i2c_address": 0x3C,To:
xxxxxxxxxx"i2c_address": 0x3D,Modify Rotation Direction
For example, change:
xxxxxxxxxx"rotate": 0,To:
xxxxxxxxxx"rotate": 180,7.4 Verification Method
After saving, run in terminal:
xxxxxxxxxxoled text --text 'Hello OpenClaw' oled clear If the OLED can display and clear normally, it means the configuration has taken effect.

8. Camera Hardware Testing
8.1 Configuration
Prerequisite is to ensure the CSI camera is connected. The current CSI camera pipeline mainly works through the following two entry points:
xxxxxxxxxx/home/sunrise/hardware_hal_demo/camera/home/sunrise/.openclaw/workspace/skills/sunrise-vision/scripts/csi_snap8.2 Photo Verification Method
Enter instructions in terminal to first directly test the photo pipeline:
xxxxxxxxxxcamera
If the photo is successful, you will usually see output files in the following directory:
xxxxxxxxxx~/.openclaw/media/csi-camera/
If the photo fails, it is likely that the camera pipeline is stuck; unplug and reinsert the camera (perform this operation while powered off).
8.3 Adjustable Parameter Description
Although the camera is not currently configured in hardware_config.py, the camera command supports some photography parameters when called, such as:
--width--height--timeout-ms--rotation--hflip--vflip--camera
For example:
xxxxxxxxxxcamera --width 1280 --height 720 