File size: 3,499 Bytes
6a7089a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | # Raspberry Pi
PinchTab runs on Raspberry Pi as long as Chromium or Chrome is available. The current implementation does not need Pi-specific feature flags, but it does benefit from conservative defaults because memory is limited.
## Recommended Baseline
- Raspberry Pi OS or Ubuntu on ARM64
- 64-bit userspace if possible
- Chromium installed locally
- headless mode by default
- low tab counts on smaller boards
## Install Chromium
On Raspberry Pi OS:
```bash
sudo apt update
sudo apt install -y chromium-browser
```
Verify the binary:
```bash
which chromium-browser
which chromium
```
If auto-detection misses it, set the binary path in config:
```bash
pinchtab config set browser.chromeBinary /usr/bin/chromium-browser
pinchtab
```
## Install PinchTab
Use your normal PinchTab install path for the platform, or build the binary from this repository:
```bash
go build -o pinchtab ./cmd/pinchtab
```
Then start it:
```bash
./pinchtab
```
## Pi-Friendly Config
Create a config file and keep most settings there instead of relying on old environment variables.
Example:
```json
{
"browser": {
"binary": "/usr/bin/chromium-browser",
"extraFlags": "--disable-gpu --disable-dev-shm-usage"
},
"instanceDefaults": {
"mode": "headless",
"maxTabs": 5,
"blockImages": true,
"blockAds": true
},
"profiles": {
"baseDir": "/home/pi/.config/pinchtab/profiles",
"defaultProfile": "default"
}
}
```
Run with it:
```bash
PINCHTAB_CONFIG=/home/pi/.config/pinchtab/config.json ./pinchtab
```
## Headless Vs Headed
For most Raspberry Pi workloads, keep the default:
```json
{
"instanceDefaults": {
"mode": "headless"
}
}
```
If you are using a desktop session and want a visible browser, switch to:
```json
{
"instanceDefaults": {
"mode": "headed"
}
}
```
Headed mode costs more RAM and is usually best kept for debugging.
## Storage
If the SD card is small or slow, move profile storage to a larger drive:
```json
{
"profiles": {
"baseDir": "/mnt/usb/pinchtab-profiles",
"defaultProfile": "default"
},
"server": {
"stateDir": "/mnt/usb/pinchtab-state"
}
}
```
This is the current supported way to relocate data. Keep using the nested config keys rather than older flat config files.
## Running As A Service
Example `systemd` unit:
```ini
[Unit]
Description=PinchTab Browser Service
After=network.target
[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi
ExecStart=/home/pi/pinchtab
Environment=PINCHTAB_CONFIG=/home/pi/.config/pinchtab/config.json
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
```
Then:
```bash
sudo systemctl daemon-reload
sudo systemctl enable pinchtab
sudo systemctl start pinchtab
sudo systemctl status pinchtab
```
## Performance Tips
- keep `instanceDefaults.maxTabs` low on 1 GB and 2 GB boards
- prefer headless mode
- block images and ads for scraping-heavy workloads
- move profiles to faster external storage if the SD card is the bottleneck
- add swap carefully if you are hitting OOM conditions often
## Troubleshooting
### Chrome Binary Not Found
Set `browser.chromeBinary` in config:
```bash
pinchtab config set browser.chromeBinary /usr/bin/chromium-browser
```
### Out Of Memory
Reduce workload in config:
```json
{
"instanceDefaults": {
"maxTabs": 3,
"blockImages": true,
"mode": "headless"
}
}
```
### Port Already In Use
Change the port in config:
```bash
pinchtab config set server.port 9868
./pinchtab
```
|