41 lines
1.3 KiB
Markdown
41 lines
1.3 KiB
Markdown
|
# Go gPIo app
|
||
|
|
||
|
Binarys befinden sich unter https://nc.masilux.de/index.php/s/bEzP2msezHPzyee
|
||
|
|
||
|
Zum Kompilieren folgende Go-Abhängigkeiten installieren:
|
||
|
- `go get github.com/gorilla/mux`
|
||
|
- `go get github.com/stianeikeland/go-rpio`
|
||
|
- `go get github.com/frickelblog/surgemq/service`
|
||
|
- `go get github.com/frickelblog/message`
|
||
|
|
||
|
Kompilieren mit: `go build main.go -o gPIo.bin`
|
||
|
Kompilieren unter Windows (Powesrhell) mit Zielsystem Linux/ARM: `$env:GOOS="linux"; $env:GOARCH="arm"; go build -o gPIo.arm`
|
||
|
|
||
|
|
||
|
**Konfiguration**
|
||
|
Die Konfiguration erfolgt in der Datei `config.json`, z.B:
|
||
|
```
|
||
|
{
|
||
|
"debug": true,
|
||
|
"enablefilesystem": true,
|
||
|
"enablemqttserver": true,
|
||
|
"enablemqttclient": true,
|
||
|
"mqttserverhost": "127.0.0.1",
|
||
|
"mqttservertcpport": "1883",
|
||
|
"mqttserverwsport": "8080",
|
||
|
"mqttclientaddress": "127.0.0.1",
|
||
|
"mqttclientport": "1883",
|
||
|
"mqttclientuser": "",
|
||
|
"mqttclientpass": "",
|
||
|
"pins": [
|
||
|
{ "pin":17, "io":"in", "state":"0", "file":"", "mqtttopic":"/pin/17" },
|
||
|
{ "pin":20, "io":"out", "state":"1", "file":"", "mqtttopic":"/pin/20" },
|
||
|
{ "pin":21, "io":"in", "state":"0", "file":"", "mqtttopic":"/pin/21" },
|
||
|
{ "pin":22, "io":"in", "state":"0", "file":"","mqtttopic":"/pin/22" }
|
||
|
]
|
||
|
}
|
||
|
```
|
||
|
|
||
|
**Anwendung**
|
||
|
|