If you want to start programming Doly with Python, the best way is to connect to Doly through SSH and run Python code directly on Doly’s Raspberry Pi system.
Below is a beginner-friendly step-by-step guide.
1. Before You Start
Before connecting to Doly, please make sure:
- Doly is powered on.
- Your computer and Doly are connected to the same local network.
- You know Doly’s IP address.
- You have the correct SSH username and password.
- Your Doly firmware/software version is compatible with the built-in SDK/API files. For Doly versions above V.1007, the SDK/API files should already be available inside Doly.
You can find the required SSH login information here:
https://community.doly.ai/public/d/9-how-to-access-doly-via-ssh-raspberry-pi-login-credentials
2. Find Doly’s IP Address
To connect with SSH, you need Doly’s IP address.
Common ways to find it:
- Check your router’s connected devices list.
- Use a network scanner app.
- Check any Doly app or setup page if it shows the device IP.
- Look for a Raspberry Pi / Doly on your network.
The IP address usually looks something like:
192.168.1.5
Your IP address may be different.
3. Connect to Doly with SSH
SSH allows you to open a terminal session on Doly from your computer.
Windows
You can use PowerShell or Command Prompt.
Open PowerShell or Command Prompt and type:
ssh <username>@<IP_ADDRESS>
Example:
ssh doly@192.168.1.5
Replace:
<username> with the Doly SSH username
<IP_ADDRESS> with your Doly’s actual IP address
If this is your first time connecting, you may see a message asking if you trust the device. Type:
yes
Then enter the SSH password.
Alternative for Windows: PuTTY
You can also use PuTTY.
- Download and open PuTTY.
- Enter Doly’s IP address in the Host Name field.
- Make sure the connection type is SSH.
- Click Open.
- Enter the username and password when asked.
macOS / Linux
Open Terminal and type:
ssh <username>@<IP_ADDRESS>
Example:
ssh doly@192.168.1.5
Then enter the password when requested.
4. Confirm That You Are Connected
After a successful SSH login, you should see a terminal prompt from Doly’s Raspberry Pi system.
At this point, you are working directly inside Doly.
You can test the connection by running simple commands like:
pwd
This shows your current folder.
You can also run:
ls
This lists the files and folders in the current directory.
5. Read the Doly Python/API Documentation
Doly is based on Raspberry Pi, so many Raspberry Pi Python tutorials can help you understand the basics of Python programming, Linux terminal commands, GPIO concepts, and file editing.
However, if your goal is to control Doly’s own hardware, such as the LCD, motors, arms, sound, or other built-in features, you should use the Doly API.
The Doly Python/API documentation is available here:
https://robotdoly.github.io/DOLY-DIY/
The documentation includes simple examples for controlling different parts of Doly, including:
- LCD/display
- Motors
- Arms
- Sound
- Movement
- Other hardware features
I strongly recommend starting with the smallest examples first.
6. Create Your First Python File
After connecting with SSH, you can create a simple Python file.
For example:
nano test.py
This opens a simple text editor inside the terminal.
Add a small test script based on the Doly API examples from the documentation.
When finished:
- Press
CTRL + O to save
- Press
Enter
- Press
CTRL + X to exit
Then run the file with:
python test.py
If the example is correct and the required API/library is available, Doly should perform the requested action.
7. Start With Very Small Tests
When programming hardware, do not start with a large complicated program.
Start with small steps, such as:
- Print a simple message in Python.
- Run one basic API example.
- Test the LCD.
- Test a sound.
- Test one small movement.
- Combine two simple actions.
- Slowly build a larger program.
This makes it much easier to understand problems when something does not work.
8. Be Careful When Testing Motors or Movement
When testing movement, motors, arms, or any physical action:
- Place Doly on a safe flat surface.
- Keep it away from table edges.
- Make sure cables are not blocking movement.
- Start with short and slow movements.
- Do not run unknown code that may move motors unexpectedly.
- Be ready to stop the program if needed.
This is important because Python code can control real hardware.
9. Useful Terminal Commands for Beginners
Here are some common Linux/Raspberry Pi commands that may help:
Show current folder:
pwd
List files:
ls
Open a folder:
cd folder_name
Go back one folder:
cd ..
Create or edit a file:
nano filename.py
Run a Python file:
python filename.py
Stop a running program:
CTRL + C
Clear the terminal screen:
clear
10. Using AI to Help With Coding
If you are not familiar with coding, AI tools can help you learn Python and write small examples.
However, please remember that AI can make mistakes. AI-generated code may not always work the first time, especially when it controls specific hardware.
Sometimes you need to debug the code step by step.
The best way to use AI is:
- Share the Doly API documentation link with the AI.
- Share the exact API example you are trying to use.
- Ask for a very small beginner example.
- Test only one feature at a time.
- If there is an error, copy the full error message and ask for help.
- Do not ask AI to create a large project immediately.
A good AI prompt could be:
“I am programming Doly, which is based on Raspberry Pi. Here is the Doly API reference documentation: https://robotdoly.github.io/DOLY-DIY/python/api/... Please help me write a very small Python example to test only one feature first.”
11. Common Problems and What to Check
SSH does not connect
Check:
- Is Doly powered on?
- Are your computer and Doly on the same Wi-Fi/network?
- Is the IP address correct?
- Are the username and password correct?
- Did the IP address change after restarting the router or Doly?
Password does not work
Check the latest credentials from the community page:
https://community.doly.ai/public/d/9-how-to-access-doly-via-ssh-raspberry-pi-login-credentials
Make sure there are no extra spaces when copying the password.
Python file does not run
Check:
- Are you using
python3, not just python?
- Are you in the correct folder?
- Did you save the file correctly?
- Is the file name correct?
- Did you copy the API example correctly?
API import error
If Python says a module or package cannot be found, check:
- Are you running the script on Doly itself through SSH?
- Are the SDK/API files available on your Doly version?
- Are you running the script from the correct directory?
- Are you following the official Doly API example exactly?
Hardware does not respond
Check:
- Is the correct API function being used?
- Is Doly’s battery/power okay?
- Is another process already using the hardware?
- Did the script finish immediately before you noticed the action?
- Did the terminal show any error message?
12. Recommended Learning Path
For beginners, I suggest this order:
- Learn basic SSH connection.
- Learn basic terminal commands.
- Run a simple Python “hello world” script.
- Run one official Doly API example.
- Test LCD or Drive first.
- Test movement carefully.
- Modify one value in an example.
- Create your own small script.
- Combine multiple API functions.
- Ask questions in the community when stuck.
13. Ask for Help in the Community
If you need further instruction, please open a discussion on:
https://community.doly.ai/public/t/sdk
When asking for help, please include:
- Your Doly version
- Your computer operating system
- Whether SSH connection works
- The command you ran
- The Python code you tested
- The full error message, if there is one
- What you expected Doly to do
- What actually happened
This will make it much easier to help you.
Also, by posting the issue in the community, the answer may help other Doly users in the future.
Final Suggestion
Start small.
Do not try to build a big project first. Connect with SSH, run one simple Python example, confirm it works, and then continue step by step.
Once you understand the basic workflow, programming Doly with Python becomes much easier.