Go to file
Sven f058b94f1f Initial Commit 2019-12-07 22:59:56 +01:00
.gitignore Initial Commit 2019-12-07 22:59:56 +01:00
README.md Initial Commit 2019-12-07 22:59:56 +01:00
config.json Initial Commit 2019-12-07 22:59:56 +01:00
gpio-numbers-pi2.png Initial Commit 2019-12-07 22:59:56 +01:00
main.go Initial Commit 2019-12-07 22:59:56 +01:00
websocket.go Initial Commit 2019-12-07 22:59:56 +01:00

README.md

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