Running the server
Download this repo and use the zipped binary
piserver on your RPi. Only tested on a Model B+ RPi as of yet.
Please install the low-level wiringpi library first on your RPi thus:
> sudo apt-get install wiringpi
Then run the binary on your RPi as either
root or by setting the environment variable in your profile as follows:
> echo "export WIRINGPI_GPIOMEM=1" >> ~/.profile
The server will run by default on
PORT=8080. You can parameterize the
PORT for the executable at runtime as follows:
> ./piserver 8081 # where 8081 is port 8081 for example
You can test the server using a simple curl like:
curl -i http://localhost:8080/piboardrev
API.md for the automatically generated API documentation. You can get this by hitting
/docs endpoint. Alternatively, any non-matched URL will return this documentation.
/health should return OK if the server is running.
Building the package on your own RPi
I installed my GHC 8.0.1 / Stack LTS 7.18 / LLVM-3.7 setup using the script here.
I include the binary as it took a long time to build. Some packages, notably
lens are probably best installed one at a time using stack before unleashing the full
My RPi build (for binary included here) is as follows:
Linux raspberrypi 4.4.34-v7+ #930 armv7l GNU/Linux Raspbian "Jessie".
|model name||ARMv7 Processor rev 5 (v7l)|
|Features||half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm|