Crates.io | pca9956b |
lib.rs | pca9956b |
version | 0.1.3 |
source | src |
created_at | 2019-04-06 14:44:03.775396 |
updated_at | 2020-05-31 19:21:45.198428 |
description | A RESTful HTTP microservice for controlling PCA9956B devices |
homepage | https://github.com/packom/pca9956b |
repository | https://github.com/packom/pca9956b |
max_upload_size | |
id | 126167 |
size | 177,418 |
A RESTful HTTP microservice for controlling PCA9956B devices.
This is currently a work in progress - most of the API is implemented, but not all of it.
git clone https://github.com/packom/pca9956b
cd pca9956b
cargo build
pca9956b uses environment variables for configuration, as it's intended to be run within a container. You must have an instance of the i2cbus microservice providing access to the appropriate I2C bus - use the I2CBUS_IP and I2CBUS_PORT variables to point to that.
To run bound to localhost:8080 with INFO level logging:
env SERVER_IP=localhost \
env SERVER_PORT=8080 \
env RUST_LOG=INFO \
env I2CBUS_IP=localhost \
env I2CBUS_PORT=8081 \
cargo run
Use environment variable HTTPS (no value is necessary) to enable HTTPS support, e.g.:
env SERVER_IP=localhost \
env SERVER_PORT=8443 \
env HTTPS= \
env RUST_LOG=INFO \
env I2CBUS_IP=localhost \
env I2CBUS_PORT=8081 \
cargo run
pca9956b expects to find certificate and key files at the following paths (which are not currently configurable):
/ssl/key.pem
/ssl/cert.pem
To see other options run:
cargo run -- --help
To see examples controlling a PCA9956B device see here.