raspberry-web
Control GPIO output on Raspberry Pi through a REST service
Run the server and send a GET request to http://localhost:2323/set/level/2/high:
Installation
Prerequisites on Raspbian (apart from Rust):
&&
Install using cargo deb
&&
Your user will need write permission to /usr/local/raspberry-web
unless you only want to run the program as root:
sudo chown -R $(whoami) /usr/local/raspberry-web
Usage
Installation using cargo deb
places a binary in /usr/local/bin
and a configuration file at /usr/local/raspberry-web/configuration.toml
, which should be edited before use.
Say you want to be able to swicth GPIO pins 1,2 and 3 on and off, start with GPIO pins 1 and 2 off (level low) and pin 3 on (level high), you would put the following under the section [gpioconfig]
[gpioconfig]
gpios_in_use = [1, 2, 3]
gpios_mode_output = [1, 2, 3]
gpios_level_low = [1, 2]
gpios_level_low = [3]
Now you can run the server from the command line:
You can specify an alternate config file
You could also use systemd (starting this way will read /usr/local/rasbberry-web/configuration.toml
):