[Unit]
Description=ESP32 Audio Stream to FIFO
After=default.target
Requires=dev-ttyESP32.device
BindsTo=dev-ttyESP32.device

[Service]
ExecStartPre=/bin/mkdir -p /tmp
ExecStartPre=/bin/rm -f /tmp/esp32_audio
ExecStartPre=/usr/bin/mkfifo /tmp/esp32_audio

ExecStart=/bin/sh -c '/home/radxa/serial_audio_catcher/serial_to_stdout /dev/ttyESP32 > /tmp/esp32_audio'

Restart=always
RestartSec=2

[Install]
WantedBy=default.target
