Goira (Go Infrared API) is a go backend for Raspberry Pi, which exposes API routes to control GPIO connected infrared LED's. Currently Goira only supports controlling air conditioners.
- Uses IRBlaster linux kernel driver to manage the IR transmission
- Exposes Restful API
- Only password authentication
- No HTTPS yet.
- Limitations of the IRBlaster kernel driver
- AC Config to binary mapping has to be made specifically for each AC manufacturer. See:
goira/internal/accontrol/mappers/
- By default only supports ChangHong AC's
- Language: Golang
- Database: BoltDB
- UUID: Google UUID
- Architecture: Clean Architecture by Uncle Bob
First, make sure you have installed IRBlaster kernel driver.
You can use the GNU make to build just the backend service or both front-end and backend.
$ make build #build just the backend
$ make frontend #build just the front-end
$ make full #build both front-end and backend
Resulting binary and front-end files will be placed in the build
folder.
After you run the binary, server will start at localhost:8080
.
If the frontend has been installed, open http://localhost:8080/
to access the web app.
- Type: POST
- Route:
/login
- Parameters:
{
"password": <password_here>
}
- Response: 200 OK for successful login
- Type: GET
- Route:
/status
- Response 200 OK for success with body (example):
{
"temp": 20, #20 celcius
"wind": 0, #wind mode 0
"mode": 0, #ac mode 0
"active": false #turned off
}
- Type: POST
- Route:
/state
- Parameters (example):
#example 1
{
"temp": 29,
"active": false,
"mode": 2
}
#example 2
{
"active": true
}
- Response 200 OK for success
- Pull requests are welcome.
- For major changes, please open an issue first to discuss what you would like to change.
- Remember to use
gofmt
to format the code before making the pull request.
- Multiple manufacturer support (Hitachi etc.)
- Support for other kinds of IR devices.