Skip to content

Commit 8d20782

Browse files
committed
Update raspberry_pi.md
1 parent 44b237e commit 8d20782

File tree

1 file changed

+26
-134
lines changed

1 file changed

+26
-134
lines changed

docs/raspberry_pi.md

Lines changed: 26 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,48 @@
11
<!-- ToDo -->
22
# Raspberry Pi Setup Guide
33

4-
This guide provides detailed instructions for setting up Ethopy on a Raspberry Pi device.
4+
This guide provides essential commands for setting up Ethopy on a Raspberry Pi device.
55

6-
## Initial Setup
7-
8-
1. Get the latest Raspberry Pi OS (Raspbian)
9-
10-
2. Configure Raspberry Pi settings using `raspi-config`:
11-
```bash
12-
sudo raspi-config
13-
```
14-
- Enable SSH
15-
- Disable screen blanking
16-
- Enable Desktop auto-login
17-
18-
3. (Optional) Change hostname for easier identification:
19-
```bash
20-
sudo sed -r -i s/raspberrypi/<<HOSTNAME>>/g /etc/hostname /etc/hosts
21-
```
22-
23-
4. (Optional) Change default username:
24-
```bash
25-
sudo useradd -s /bin/bash -d /home/<<USERNAME>>/ -m -G sudo <<USERNAME>>
26-
sudo passwd <<USERNAME>>
27-
mkhomedir_helper <<USERNAME>>
28-
sudo userdel -r -f pi
29-
```
30-
31-
## System Dependencies
32-
33-
1. Install required system libraries:
34-
```bash
35-
sudo apt update
36-
sudo apt install -y \
37-
python-dev \
38-
libatlas-base-dev \
39-
build-essential \
40-
libavformat-dev \
41-
libavcodec-dev \
42-
libswscale-dev \
43-
libsquish-dev \
44-
libeigen3-dev \
45-
libopenal-dev \
46-
libfreetype6-dev \
47-
zlib1g-dev \
48-
libx11-dev \
49-
libjpeg-dev \
50-
libvorbis-dev \
51-
libogg-dev \
52-
libassimp-dev \
53-
libode-dev \
54-
libssl-dev \
55-
libgles2 \
56-
libgles1 \
57-
libegl1
58-
```
59-
60-
2. Install Python packages:
61-
```bash
62-
sudo pip3 install 'numpy>=1.19.1' pygame==1.9.6 cython pybind11 scipy datajoint omxplayer-wrapper imageio imageio-ffmpeg
63-
```
64-
65-
## Hardware-Specific Setup
66-
67-
### 7" Raspberry Pi Touchscreen
68-
69-
Install multitouch driver:
6+
## SSH Setup
7+
Enable SSH service for remote access:
708
```bash
71-
git clone http://github.com/ef-lab/python-multitouch ~/github/python-multitouch
72-
cd ~/github/python-multitouch/library
73-
sudo python3 setup.py install
9+
sudo systemctl enable ssh # Enables SSH to start automatically at boot
10+
sudo systemctl start ssh # Starts SSH service immediately
7411
```
7512

76-
### 3D Graphics Support
77-
78-
Install Panda3D for Raspberry Pi:
13+
## Ethopy Installation
14+
Τest database connection:
7915
```bash
80-
wget ftp://eflab.org/shared/panda3d1.11_1.11.0_armhf.deb
81-
sudo dpkg -i panda3d1.11_1.11.0_armhf.deb
16+
ethopy-db-connection # Tests database connection to verify setup
8217
```
8318

84-
### GPIO Support
85-
86-
Enable pigpio service:
19+
## GPIO Hardware Support
20+
Enable pigpio daemon for GPIO control:
8721
```bash
88-
wget https://raw.githubusercontent.com/joan2937/pigpio/master/util/pigpiod.service
89-
sudo cp pigpiod.service /etc/systemd/system
90-
sudo systemctl enable pigpiod.service
91-
sudo systemctl start pigpiod.service
22+
sudo systemctl enable pigpiod.service # Enables pigpio daemon to start at boot
23+
sudo systemctl start pigpiod.service # Starts pigpio daemon for immediate GPIO access
9224
```
9325

94-
## X Display Configuration
95-
96-
For running graphical applications via SSH:
26+
Install GPIO libraries:
9727
```bash
98-
echo 'export DISPLAY=:0' >> ~/.profile
99-
echo 'xhost + > /dev/null' >> ~/.profile
28+
pip install pigpio # Python library for pigpio daemon communication
29+
sudo apt-get install python3-rpi.gpio # Alternative GPIO library for Raspberry Pi
10030
```
10131

102-
## Remote Control Setup (Optional)
103-
104-
If you want to use Salt for remote control:
32+
## Display Configuration
33+
Configure display settings for GUI applications via SSH:
10534
```bash
106-
sudo apt install salt-minion -y
107-
echo 'master: <<YOUR_SALT-MASTER_IP>>' | sudo tee -a /etc/salt/minion
108-
echo 'id: <<HOSTNAME>>' | sudo tee -a /etc/salt/minion
109-
echo 'master_finger: <<MASTER-FINGER>>' | sudo tee -a /etc/salt/minion
110-
sudo service salt-minion restart
35+
export DISPLAY=:0 # Sets display to primary screen
36+
sed -i -e '$aexport DISPLAY=:0' ~/.profile # Persists DISPLAY setting in profile
37+
sed -i -e '$axhost + > /dev/null' ~/.profile # Allows X11 forwarding access
11138
```
11239

113-
## Ethopy Installation
114-
115-
1. Install Ethopy:
116-
```bash
117-
pip install "ethopy[obj]" # Includes 3D object support
118-
```
119-
120-
2. Create configuration file at `~/.ethopy/local_conf.json`:
121-
```json
122-
{
123-
"dj_local_conf": {
124-
"database.host": "YOUR DATABASE",
125-
"database.user": "USERNAME",
126-
"database.password": "PASSWORD",
127-
"database.port": "PORT",
128-
"database.reconnect": true,
129-
"database.enable_python_native_blobs": true
130-
},
131-
"source_path": "LOCAL_RECORDINGS_DIRECTORY",
132-
"target_path": "TARGET_RECORDINGS_DIRECTORY"
133-
}
134-
```
135-
136-
3. Initialize database schemas:
137-
```bash
138-
ethopy-setup-schema
139-
```
140-
141-
## Running Experiments
142-
143-
You can run experiments in two modes:
144-
145-
1. Service Mode (controlled by database):
146-
```bash
147-
ethopy
148-
```
149-
150-
2. Direct Mode (specific task):
151-
```bash
152-
ethopy --task-idx 1
153-
```
40+
## Screen Blanking Disable
41+
To prevent screen from turning off, run raspi-config:
42+
```bash
43+
sudo raspi-config
44+
```
45+
Navigate to "Display Options" → "Screen Blanking" → Set to "No"
15446

15547
## Troubleshooting
15648

0 commit comments

Comments
 (0)