Raspberry Pi Setup Guide¶
This guide provides detailed instructions for setting up Ethopy on a Raspberry Pi device.
Initial Setup¶
-
Get the latest Raspberry Pi OS (Raspbian)
-
Configure Raspberry Pi settings using
raspi-config
:1
sudo raspi-config
- Enable SSH
- Disable screen blanking
-
Enable Desktop auto-login
-
(Optional) Change hostname for easier identification:
1
sudo sed -r -i s/raspberrypi/<<HOSTNAME>>/g /etc/hostname /etc/hosts
-
(Optional) Change default username:
1 2 3 4
sudo useradd -s /bin/bash -d /home/<<USERNAME>>/ -m -G sudo <<USERNAME>> sudo passwd <<USERNAME>> mkhomedir_helper <<USERNAME>> sudo userdel -r -f pi
System Dependencies¶
-
Install required system libraries:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
sudo apt update sudo apt install -y \ python-dev \ libatlas-base-dev \ build-essential \ libavformat-dev \ libavcodec-dev \ libswscale-dev \ libsquish-dev \ libeigen3-dev \ libopenal-dev \ libfreetype6-dev \ zlib1g-dev \ libx11-dev \ libjpeg-dev \ libvorbis-dev \ libogg-dev \ libassimp-dev \ libode-dev \ libssl-dev \ libgles2 \ libgles1 \ libegl1
-
Install Python packages:
1
sudo pip3 install 'numpy>=1.19.1' pygame==1.9.6 cython pybind11 scipy datajoint omxplayer-wrapper imageio imageio-ffmpeg
Hardware-Specific Setup¶
7" Raspberry Pi Touchscreen¶
Install multitouch driver:
1 2 3 |
|
3D Graphics Support¶
Install Panda3D for Raspberry Pi:
1 2 |
|
GPIO Support¶
Enable pigpio service:
1 2 3 4 |
|
X Display Configuration¶
For running graphical applications via SSH:
1 2 |
|
Remote Control Setup (Optional)¶
If you want to use Salt for remote control:
1 2 3 4 5 |
|
Ethopy Installation¶
-
Install Ethopy:
1
pip install "ethopy[obj]" # Includes 3D object support
-
Create configuration file at
~/.ethopy/local_conf.json
:1 2 3 4 5 6 7 8 9 10 11 12
{ "dj_local_conf": { "database.host": "YOUR DATABASE", "database.user": "USERNAME", "database.password": "PASSWORD", "database.port": "PORT", "database.reconnect": true, "database.enable_python_native_blobs": true }, "source_path": "LOCAL_RECORDINGS_DIRECTORY", "target_path": "TARGET_RECORDINGS_DIRECTORY" }
-
Initialize database schemas:
1
ethopy-setup-schema
Running Experiments¶
You can run experiments in two modes:
-
Service Mode (controlled by database):
1
ethopy
-
Direct Mode (specific task):
1
ethopy --task-idx 1
Troubleshooting¶
Common Issues¶
- Display Issues
- Ensure DISPLAY is set correctly in ~/.profile
- Check X server is running
-
Verify permissions with
xhost +
-
GPIO Access
- Verify pigpiod service is running:
systemctl status pigpiod
-
Check user permissions for GPIO access
-
Database Connection
- Test connection:
ethopy-db-connection
- Check network connectivity to database server
- Verify credentials in local_conf.json