Skip to content

Commit 56cd9a4

Browse files
authored
Merge pull request #52 from alvarolobato/headless
Document headless build and update screenshot docs
2 parents 06e9cda + 27bc7cc commit 56cd9a4

3 files changed

Lines changed: 32 additions & 4 deletions

File tree

docs/commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ This can be handy for bug reporting or documentation.
285285

286286
The previous screenshot is overwritten.
287287

288-
On the **Mac desktop build**, the screenshot is saved as `screenshot.bmp` in the working directory. You can optionally pass a custom file path as a parameter. Press **F12** in the simulator window as a shortcut.
288+
On the **desktop builds** (Mac, Linux, and headless), the screenshot is saved as `screenshot.bmp` in the working directory. You can optionally pass a custom file path as a parameter. Press **F12** in the simulator window as a shortcut (windowed builds only).
289289

290290
### `service`
291291

docs/commands/system.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@ This can be handy for bug reporting or documentation.
4545

4646
The previous screenshot is overwritten.
4747

48-
On the **Mac desktop build**, the screenshot is saved as `screenshot.bmp` in the working directory. You can optionally pass a custom file path as a parameter.
48+
On the **desktop builds** (Mac, Linux, and headless), the screenshot is saved as `screenshot.bmp` in the working directory. You can optionally pass a custom file path as a parameter.
4949

5050
!!! tip
51-
Press **F12** in the simulator window to take a screenshot without using MQTT.
51+
Press **F12** in the simulator window to take a screenshot without using MQTT (windowed builds only).
52+
53+
!!! note "Headless build"
54+
The `linux_headless` build supports screenshots via MQTT without any display server or SDL2 dependency. This makes it suitable for CI/CD pipelines, Docker containers, and headless servers.
5255

5356
## `service`
5457

docs/firmware/compiling/local.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,37 @@ You can now run "Build" or "Build All" in PlatformIO to compile (all) the firmwa
9090

9191
### Native Linux build
9292

93-
For native linux_sdl builds, you also need:
93+
For native `linux_sdl` builds (with GUI window), you also need:
9494
```
9595
sudo apt update
9696
sudo apt install build-essential libsdl2-dev
9797
```
9898

99+
### Headless Linux build
100+
101+
The `linux_headless` build runs without any display server or SDL2 dependency. It uses a null display driver with an in-memory framebuffer, making it ideal for CI/CD pipelines, Docker containers, and headless servers. Screenshots are captured via MQTT.
102+
103+
No extra system packages are needed beyond a C++ compiler:
104+
```
105+
sudo apt update
106+
sudo apt install build-essential
107+
```
108+
109+
Uncomment `user_setups/linux/*.ini` in your `platformio_override.ini`, then:
110+
```
111+
pio run -e linux_headless
112+
```
113+
114+
Run the headless binary:
115+
```
116+
./program -c /path/to/config
117+
```
118+
119+
Take a screenshot via MQTT:
120+
```
121+
mosquitto_pub -t "hasp/<plate>/command/screenshot" -m "/path/to/screenshot.bmp"
122+
```
123+
99124

100125
### Native MacOS build
101126

0 commit comments

Comments
 (0)