21. Using OpenClaw to Control PiDog

What is OpenClaw?

Think of it as an upgraded version of ChatGPT. While traditional chatbots can only talk (generate text), OpenClaw can take action. It understands your natural language instructions and can actually perform operations on your computer, such as running commands, managing files, and calling various tools.

Here are some fantastic application scenarios:

  • Personal All-around Assistant: Let it help you manage your schedule, set reminders, and track tasks. You just need to tell it in a chat app (like Telegram, WhatsApp), and it will remember and execute.

  • Automation “Glue”: It can act as a binder for your various services. For example, you can have it monitor a website for price changes. Once a price drop is detected, it can automatically trigger an n8n automation workflow to send you an email notification.

  • Dedicated Development Assistant: Have it help you manage servers, run scripts, and check logs. You can simply say, “Check the system load for me,” and it can SSH into your server, execute the command, and return the results.

  • Hardware “Playmate”: This is a very interesting use case. You can have OpenClaw control hardware connected to a Raspberry Pi. For example, a developer used it to control a robotic vacuum cleaner with a mechanical arm, or even had it help analyze racing simulator data and display it on an LED screen. The official Raspberry Pi team even used it to build an automatic photo booth for a wedding, just through conversation, without writing a single line of code!

Important

The Raspberry Pi Zero 2W has only 512MB of RAM, while OpenClaw requires a minimum of 1GB. Therefore, it cannot run properly. A Raspberry Pi 4/5 or higher is recommended.

Quick Start OpenClaw

If you want to experience the power of OpenClaw as quickly as possible, use this method. It will automatically install and launch an interactive setup wizard.

  1. Open the terminal on your Raspberry Pi and run the following command directly. This command downloads the installation script from the official website and executes it:

    curl -fsSL https://openclaw.ai/install.sh | bash
    

    Note

    Because new versions are updated rapidly, it’s normal if your installation steps differ slightly.

  2. The script will automatically download and install OpenClaw.

    _images/install_open_claw.png
  3. You will then see a security prompt asking if you trust OpenClaw. Once you are sure it is safe and reliable, use the arrow keys to navigate to “Yes” and press Enter.

    _images/security_open_claw.png
  4. Select Quick Start, and then press Enter.

    _images/quickstart_open_claw.png
  5. Select your Model, and then press Enter. Here we use OpenAI as an example.

    _images/model_provider_open_claw.png
  6. Select OpenAI API Key.

    _images/api_key_open_claw.png
  7. Paste API key now.

    _images/paste_api_key_open_claw.png
  1. Go to OpenAI Platform and log in. On the API keys page, click Create new secret key.

    _images/llm_openai_create1.png
  2. Fill in the details (Owner, Name, Project, and permissions if needed), then click Create secret key.

    _images/llm_openai_create_confirm1.png
  3. Once the key is created, copy it right away — you won’t be able to see it again. If you lose it, you’ll need to generate a new one.

    _images/llm_openai_copy1.png
  4. Paste the key into the OpenCLaw configuration.

    _images/paste_api_key_enter_open_claw.png
  5. Select the Model you want to use. In this example, we will use Keep current.

    _images/model_config_open_claw.png
  6. Next is the channel selection. Channels refer to the communication services supported by OpenClaw, such as Telegram, WhatsApp, Discord, and more. Use the down arrow key to select the “Skip for now” option, then press Enter.

    _images/channel_open_claw.png
  7. Next, you will be prompted to configure skills immediately. Select “Yes” and press Enter.

    _images/config_skill_open_claw.png
  8. Install the skills you need. In the following example, we select the “Skip for now” option (press the spacebar to select), then press Enter.

    _images/install_skill_open_claw.png
  9. Next are Hooks; we will check “command-logger” and “session-memory”.

    _images/hooks2_open_claw.png
  10. The installation is now complete. You can start OpenClaw by Selecting “Hatch in TUI” and pressing Enter.

_images/hatch_open_claw.png

Note

You can start OpenClaw by entering the following command:

openclaw tui

And You can press ctrl+c twice to exit the tui interface.


Making OpenClaw Operate the PiDog

What is PiDog Skill?

PiDog Skill is an extension for OpenClaw that allows you to control your SunFounder PiDog V2 robot dog through natural language. Instead of remembering complex command-line parameters, you can simply tell OpenClaw what you want PiDog to do — like “make the dog sit” or “turn the LED lights purple” — and OpenClaw will execute the appropriate commands automatically.

Here are some things you can do with PiDog Skill:

  • Basic Actions: Make PiDog stand, sit, lie down, wag its tail, bark, walk forward/backward, or turn left/right

  • Pose Holding: Keep PiDog in a specific pose (like standing) for extended periods

  • LED Light Control: Change the eye colors with effects like breath, listen, boom, or solid light

  • Color Customization: Choose from red, green, blue, yellow, purple, pink, cyan, white, orange, or custom hex colors


Prerequisites

Before you can use PiDog Skill with OpenClaw, make sure you have:

  1. PiDog V2 properly assembled and connected to your Raspberry Pi

  2. OpenClaw installed and running

  3. The following directories exist on your system:

    • ~/pidog

    • ~/robot-hat

    • ~/vilib

You can verify the installation by running:

python3 -c "import pidog"

If this command runs without errors, you’re ready to proceed.


Installing PiDog Skill

Follow these steps to install the PiDog Skill for OpenClaw:

  1. Create the skills directory (if it doesn’t already exist):

    mkdir -p ~/.openclaw/workspace/skills/
    
  2. Copy the PiDog skill files to the OpenClaw skills directory:

    cp -r ~/pidog/pidog-control ~/.openclaw/workspace/skills/pidog-control/
    

    Note

    Replace ~/pidog-skill with the actual path where your PiDog skill files are located.

  3. Verify the installation by checking the skill files:

    ls ~/.openclaw/workspace/skills/pidog-control/scripts/
    

    You should see pidog_ctl.py and pidog_rgb_ctl.py in the output.


Testing PiDog Skill

Before using the skill with OpenClaw, it’s recommended to test the basic functionality directly from the terminal.

Step 1: Check PiDog Status

python3 ~/.openclaw/workspace/skills/pidog-control/scripts/pidog_ctl.py status

Step 2: Run a Safe Test

python3 ~/.openclaw/workspace/skills/pidog-control/scripts/pidog_ctl.py safe-test

Step 3: Test Basic Actions

Make PiDog sit:

python3 ~/.openclaw/workspace/skills/pidog-control/scripts/pidog_ctl.py action sit

Make PiDog stand and hold the pose:

python3 ~/.openclaw/workspace/skills/pidog-control/scripts/pidog_ctl.py action stand --hold

Make PiDog bark:

python3 ~/.openclaw/workspace/skills/pidog-control/scripts/pidog_ctl.py action bark

Step 4: Test LED Lights

Test the boom light effect with purple color:

python3 ~/.openclaw/workspace/skills/pidog-control/scripts/pidog_rgb_ctl.py light boom --color purple

Test other light effects:

# Breath effect with red color
python3 ~/.openclaw/workspace/skills/pidog-control/scripts/pidog_rgb_ctl.py light breath --color red

# Listen effect with blue color
python3 ~/.openclaw/workspace/skills/pidog-control/scripts/pidog_rgb_ctl.py light listen --color blue

# Turn off lights
python3 ~/.openclaw/workspace/skills/pidog-control/scripts/pidog_rgb_ctl.py light off

Using PiDog Skill in OpenClaw

Once you’ve verified that PiDog Skill works from the command line, you can start using it within OpenClaw.

  1. Launch OpenClaw TUI:

    openclaw tui
    
  2. Send natural language commands to control PiDog. Here are some examples:

    • “Make the dog sit”

    • “Make PiDog stand and stay”

    • “Wag the dog’s tail”

    • “Make the dog bark”

    • “Turn the LED lights purple with boom effect”

    • “Set the eye lights to breath effect with red color”

    • “Make PiDog walk forward”

  3. OpenClaw will automatically translate your request into the appropriate command and execute it on PiDog.


Available Actions and Commands

Here is the complete list of supported actions for PiDog Skill:

Action

Description

stand

Make PiDog stand up

sit

Make PiDog sit down

lie

Make PiDog lie down

wag-tail

Wag PiDog’s tail

bark

Make barking sound

forward

Walk forward

backward

Walk backward

Pose Holding:

Add --hold to any action to keep PiDog in that pose. For example: “stand –hold”

Light Effects:

Effect

Description

off

Turn off all LED lights

breath

Gentle breathing/pulsing effect

listen

Reactive listening mode

boom

Dynamic burst effect (most noticeable)

solid

Constant steady light (use boom for better effect)

Supported Colors:

red, green, blue, yellow, purple, pink, cyan, white, orange, or hex codes like #FF5733


Troubleshooting

OpenClaw Issues

  1. During installation, I get the error Error: systemctl is-enabled unavailable: Command failed: systemctl --user is-enabled openclaw-gateway.service. What should I do?

    You can ignore this for now, but you might encounter issues in the next steps. Please refer to them one by one at that time.

  1. When I run openclaw tui, I get the error -bash: openclaw: command not found. What should I do?

    Execute the following command:

    echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
    source ~/.bashrc
    

    You should now be able to start the tui interface with openclaw tui.

  1. In openclaw tui, I encounter not connected to gateway message not sent or the message gateway disconnected: closed.

    This is because your OpenClaw Gateway service is not started. Open another terminal and execute the following command to start the OpenClaw Gateway:

    openclaw gateway
    

    Then restart openclaw tui, and you can use it directly.

  1. I want to set the OpenClaw Gateway service to run in the background / start automatically on boot. How do I do that?

    Normally, your OpenClaw Gateway service should start automatically on boot. If it doesn’t, you can manually start it with the following command.

    1. Create the ~/.config/systemd/user directory:

    mkdir -p ~/.config/systemd/user
    
    1. Create the openclaw-gateway.service file:

    cat > ~/.config/systemd/user/openclaw-gateway.service << EOF
    [Unit]
    Description=OpenClaw Gateway
    After=network.target
    
    [Service]
    Type=simple
    ExecStart=$HOME/.npm-global/bin/openclaw gateway run
    Restart=on-failure
    RestartSec=10
    Environment="PATH=$HOME/.npm-global/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin"
    Environment="NODE_ENV=production"
    
    [Install]
    WantedBy=default.target
    EOF
    
    1. Then reload the systemd configuration:

    systemctl --user daemon-reload
    
    1. Start the service:

    systemctl --user start openclaw-gateway
    

    At this point, restart openclaw tui, and you can use it directly.

    1. Enable it to start on boot:

    systemctl --user enable openclaw-gateway
    
  1. My OpenClaw can not operate the system, what should I do?

    A newly installed OpenClaw may not have permission to operate your Raspberry Pi system by default; it can only chat. We need to manually configure the permissions.

    1. Open the OpenClaw configuration file:

    nano ~/.openclaw/openclaw.json
    
    1. Find the tools option and change the profile and exec as shown.

    "tools": {
        "profile": "coding",
        "exec": {
            "secrity": "full"
        }
    },
    
    1. Save and exit.

    2. Enter the following command in the terminal to restart the OpenClaw Gateway:

    openclaw gateway restart
    

    Now, OpenClaw should have read and write permissions and be able to operate your Raspberry Pi system.

PiDog Issues

  1. PiDog doesn’t respond to commands. What should I do?

    First, verify that PiDog is properly connected and powered on. Then test the basic command:

    python3 ~/.openclaw/workspace/skills/pidog-control/scripts/pidog_ctl.py status
    

    If this fails, check that the required directories exist:

    • ~/pidog

    • ~/robot-hat

    • ~/vilib

  1. The import pidog test fails.

    This means the PiDog Python library is not properly installed. Please refer to the PiDog V2 official installation guide to install the necessary libraries.

  1. LED lights don’t work as expected.

    If solid light doesn’t show clearly, use the boom effect instead — it produces the most noticeable results:

    python3 ~/.openclaw/workspace/skills/pidog-control/scripts/pidog_rgb_ctl.py light boom --color purple
    
  1. OpenClaw doesn’t recognize the PiDog skill.

    Remind OpenClaw to sync the skills by saying in the TUI: “Please rsync my skills” or restart OpenClaw gateway:

    openclaw gateway restart
    
  1. The bark action doesn’t sound right.

    The bark action uses the single_bark_1 sound by default. This is normal behavior for PiDog V2.