Skip to content

Commit 81a88b1

Browse files
authored
Merge pull request #3 from GratsakisA/fixes_RP.md
docs: Update steps in raspberry_pi.md
2 parents aff9ae0 + 1cd9bb9 commit 81a88b1

File tree

1 file changed

+95
-20
lines changed

1 file changed

+95
-20
lines changed

docs/raspberry_pi.md

Lines changed: 95 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,67 @@
11
<!-- ToDo -->
2+
23
# Raspberry Pi Setup Guide
34

4-
This guide provides essential commands for setting up Ethopy on a Raspberry Pi device.
5+
This guide provides essential commands for setting up Ethopy on a Raspberry Pi (RP) device.
56

6-
## SSH Setup
7-
Enable SSH service for remote access:
8-
```bash
9-
sudo systemctl enable ssh # Enables SSH to start automatically at boot
10-
sudo systemctl start ssh # Starts SSH service immediately
11-
```
7+
## Prerequisites
8+
9+
- Raspberry Pi image
10+
Follow the instructions in the [Raspberry Pi documentation](https://www.raspberrypi.com/documentation/) to install the image and set up your Raspberry Pi.
11+
12+
- SSH Setup
13+
Enable the SSH service to allow remote access to your Raspberry Pi via the terminal:
1214

13-
## Ethopy Installation
15+
```bash
16+
sudo systemctl enable ssh # Enables SSH to start automatically at boot
17+
sudo systemctl start ssh # Starts SSH service immediately
18+
```
1419

15-
1. Install Ethopy:
20+
## EthoPy setup
21+
22+
### Step 1: Ethopy Installation
23+
24+
Once your Raspberry Pi is set up, you can connect to it from your computer's terminal based on [Raspberry Pi documentation](https://www.raspberrypi.com/documentation/).
25+
26+
1. Verify python version:
1627
```bash
17-
pip install ethopy
28+
python --version
1829
```
1930

20-
2. Create configuration file at `~/.ethopy/local_conf.json`:
31+
EthoPy requires Python >=3.8, < 3.12
32+
33+
2. Setting Up a Virtual Environment
34+
35+
=== "Conda"
36+
```sh
37+
conda create --name myenv python=3.x
38+
conda activate myenv
39+
```
40+
[More details](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)
41+
42+
=== "venv (pip)"
43+
```sh
44+
python -m venv venv
45+
source venv/bin/activate # On Windows use: venv\Scripts\activate
46+
```
47+
[More details](https://docs.python.org/3/library/venv.html)
48+
49+
=== "uv"
50+
```sh
51+
uv venv
52+
source .venv/bin/activate # On Windows use: .venv\Scripts\activate
53+
```
54+
[More details](https://github.com/astral-sh/uv)
55+
56+
Once activated, proceed with installation.
57+
58+
3. Install Ethopy:
59+
60+
```bash
61+
pip install ethopy
62+
```
63+
64+
4. Create configuration file at `~/.ethopy/local_conf.json`:
2165
```json
2266
{
2367
"dj_local_conf": {
@@ -32,56 +76,87 @@ sudo systemctl start ssh # Starts SSH service immediately
3276
"target_path": "TARGET_RECORDINGS_DIRECTORY"
3377
}
3478
```
35-
For detailed desciption of configuration files, see [Local configuration](local_conf.md).
3679

80+
For detailed desciption of configuration files, see [Local configuration](local_conf.md).
81+
82+
### Step 2: Database connection
3783

38-
## Database connection:
3984
```bash
4085
ethopy-db-connection # Tests database connection to verify setup
4186
```
4287

43-
## GPIO Hardware Support
88+
### Step 3: GPIO Hardware Support
89+
4490
Enable pigpio daemon for GPIO control:
91+
4592
```bash
4693
sudo systemctl enable pigpiod.service # Enables pigpio daemon to start at boot
4794
sudo systemctl start pigpiod.service # Starts pigpio daemon for immediate GPIO access
4895
```
4996

5097
Install GPIO libraries:
98+
5199
```bash
52100
pip install pigpio # Python library for pigpio daemon communication
53101
sudo apt-get install python3-rpi.gpio # Alternative GPIO library for Raspberry Pi
54102
```
55103

56-
## Display Configuration
104+
### Step 4: Display Configuration
105+
57106
Configure display settings for GUI applications via SSH:
107+
58108
```bash
59109
export DISPLAY=:0 # Sets display to primary screen
60110
sed -i -e '$aexport DISPLAY=:0' ~/.profile # Persists DISPLAY setting in profile
61111
sed -i -e '$axhost + > /dev/null' ~/.profile # Allows X11 forwarding access
62112
```
63113

64-
## Screen Blanking Disable
114+
### Step 5: Screen Blanking Disable
115+
65116
To prevent screen from turning off, run raspi-config:
117+
66118
```bash
67119
sudo raspi-config
68120
```
69-
Navigate to "Display Options" → "Screen Blanking" → Set to "No"
121+
122+
Navigate to "_Display Options_""_Screen Blanking_" → Set to "No"
123+
124+
### Step 6: Run your first experiment
125+
126+
```
127+
ethopy --task-path grating_test.py --log-console
128+
```
70129
71130
## Troubleshooting
72131
73132
### Common Issues
74133
75134
1. **Display Issues**
135+
76136
- Ensure DISPLAY is set correctly in ~/.profile
77137
- Check X server is running
78138
- Verify permissions with `xhost +`
79139
80-
2. **GPIO Access**
140+
1. **GPIO Access**
141+
81142
- Verify pigpiod service is running: `systemctl status pigpiod`
82143
- Check user permissions for GPIO access
83144
84-
3. **Database Connection**
145+
1. **Database Connection**
146+
85147
- Test connection: `ethopy-db-connection`
86148
- Check network connectivity to database server
87-
- Verify credentials in local_conf.json
149+
- Verify credentials in local_conf.json
150+
151+
## Where to Go Next
152+
153+
Now that you have a basic understanding of EthoPy:
154+
155+
1. [Creating Custom Components](creating_custom_components.md)
156+
1. How to [create a Task ](https://ef-lab.github.io/ethopy_package/task_setup/)
157+
1. Explore the [Plugin System](plugin.md) to extend functionality
158+
1. Dive deeper into [Local Configuration](local_conf.md) for advanced settings
159+
1. Understand [setup configuration index](setup_configuration_idx.md)
160+
1. Learn more about [Database Setup](database_setup.md)
161+
1. Study the [API Reference](API/logger.md) for detailed documentation
162+
1. Check [Contributing](contributing.md) if you want to help improve EthoPy

0 commit comments

Comments
 (0)