rdk-peripheral-cookbook

Drive GPIO, I2C, SPI, UART, PWM, motors, audio, and CAN peripherals on RDK boards.

3|Updated Aug 6, 2026
One-click install
npx skills add https://github.com/D-Robotics/rdk-skills --skill rdk-peripheral-cookbook-d-robotics
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rdk-peripheral-cookbook
Source: https://github.com/D-Robotics/rdk-skills/tree/main/skills/rdk-peripheral-cookbook
Command: npx skills add https://github.com/D-Robotics/rdk-skills --skill rdk-peripheral-cookbook-d-robotics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Developers on D-Robotics RDK boards struggle to wire and drive real peripherals — servos brown out the board when powered from the 40PIN rail, CAN commands differ completely between X5 (SocketCAN) and S100/S600 (MCU-domain CANHAL), and devices often appear "not detected" with no clear diagnosis path. This Skill provides board-aware, verified workflows so an AI agent gives correct wiring, commands, and troubleshooting instead of guessing. ## Core Features & Use Cases - Cross-board peripheral workflows: GPIO via libgpiod, servos via PWM/PCA9685, DC/stepper/BLDC motors, WS2812 strips over SPI MOSI, ALSA audio, and CAN bringup with per-board routing. - Deterministic probe scripts: can_mode.py answers whether a board uses SocketCAN or MCU-domain CANHAL; gpio_probe.sh reports GPIO line counts and CAN interface state as structured JSON. - Zero-driver diagnosis SOP: a 9-step dmesg/lsusb/i2cdetect checklist with a symptom-to-cause table for "device not recognized" issues. - Use Case: A user says "I ran ip link set can0 on my S100 and it failed" — the Skill explains S100 CAN lives in the MCU domain and routes them to the CANHAL /app/Can sample instead of can-utils. ## Quick Start Ask the agent how to wire and drive a specific peripheral on your RDK board, for example "help me control 4 servos on my RDK X5".

Frequently Asked Questions about rdk-peripheral-cookbook

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I control multiple servos on an RDK board?▼

Use a PCA9685 16-channel PWM expander over I2C at default address 0x40. Power the servos from an external 5V supply on the PCA9685 V+ terminal, never the 40PIN 5V rail, and confirm 0x40 appears with i2cdetect before coding.

Why does ip link set can0 fail on RDK S100 or S600?▼

S100 and S600 CAN controllers live in the MCU domain, so there is no can0 SocketCAN device. Use the CANHAL library with IPC and the /app/Can sample instead; ip link and can-utils only work on the X5, which has a TCAN4550 SocketCAN controller.

How do I drive a WS2812 LED strip on RDK?▼

Drive WS2812 from the SPI MOSI pin emulating the 800kHz timing at about 2.4MHz using the NeoPixel-SPI library. GPIO bitbang is unreliable, RPi's rpi_ws281x does not work on RDK, and the strip needs an external 5V supply with common ground.

Can I record audio on RDK without TROS installed?▼

Yes, use standard ALSA: run arecord -l to find the card, then record with arecord -D plughw:1,0 and play back with aplay. A USB microphone or sound card auto-loads snd-usb-audio and is the universal fallback.

What should I check when a device is not detected on the board?▼

Follow the 9-step SOP: dmesg, lsusb, ls /dev, i2cdetect, v4l2-ctl, aplay -l, lsmod, modprobe, and device-tree inspection. On X-series boards, also verify the pin function was switched via srpi-config so the /dev node exists.

Does Hobot.GPIO work inside a conda or venv environment?▼

No, Hobot.GPIO bindings are system-Python only, so import fails inside conda or venv. Use /usr/bin/python3, or switch to libgpiod which works across environments and across RDK, Raspberry Pi, Jetson, and Rockchip boards.