Skip to content

lispnik/clog-gpio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clog-gpio

A visual Raspberry Pi GPIO control panel built with CLOG. Each header pin gets a card with a direction selector, an LED indicator, a live value readout, and a toggle button.

When run on something that isn't a Pi (e.g. your laptop), it switches to a simulation mode.

Screenshot

Requirements

  • SBCL (probably works with other Common Lisp implementations.
  • sudo apt-get install gpiod (uses sub processes for now)

Build

Dependencies are pinned in ocicl.csv and vendored into ocicl/. On a fresh checkout, fetch them with:

make deps        # runs `ocicl install`

Then build the standalone binary:

make             # produces ./clog-gpio  (~68 MB self-contained SBCL image)

Run

./clog-gpio

Auto-opens your default browser at http://127.0.0.1:8080.

CLI flags

clog-gpio [OPTIONS]
  -p, --port PORT     HTTP port to listen on (default 8080)
      --bind ADDR     Interface to listen on (default 0.0.0.0)
  -B, --no-browser    Don't auto-open the system browser
  -h, --help          Show this help and exit

To run on a remote Pi and view from another machine:

./clog-gpio --no-browser --port 8080

then point your laptop browser at http://<pi-ip>:8080.

If you're putting this behind nginx (see Reverse proxy with HTTPS notes), bind to loopback only so the backend port isn't world-reachable:

./clog-gpio --no-browser --bind 127.0.0.1 --port 8080

The binary is self-contained — CLOG's bootstrap assets are compiled in, and the favicon is embedded at build time. No static/ directory is needed at runtime; you can copy just the executable to the Pi.

Run as a service on the Pi

A systemd unit is in systemd/clog-gpio.service. After deploying the project to /home/pi/clog-gpio/ and building the binary, install and start it with:

sudo install -m 644 systemd/clog-gpio.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now clog-gpio

Useful follow-ups:

systemctl status clog-gpio          # is it running?
journalctl -u clog-gpio -f          # tail logs
sudo systemctl restart clog-gpio    # after a new build

Other make targets

make run PORT=9090   # build + run on the given port
make repl            # SBCL REPL with the system loaded
make clean           # remove the binary

Safety

Treat each toggle as if it really drives the pin: don't flip something to OUTPUT HIGH if you don't know what's wired to it. That would be dumb.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors