Skip to content

Commit

Permalink
Add fixed version for protoc packages
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbosch committed Oct 31, 2024
1 parent f70153a commit 5a8eb75
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/kuksa_go_client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ jobs:
go run protocInstall/protocInstall.go
export PATH=$PATH:$HOME/protoc/bin
sudo chmod +x $HOME/protoc/bin/protoc
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
# As we in protocInstall.go download a specific version of protoc we cannot use latest of the packages below
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0
export PATH=$PATH:$HOME/go/bin
go generate .
go test .
Expand Down
9 changes: 9 additions & 0 deletions kuksa_go_client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@ if you use `apt`you must manually create a folder called `proto`
```

- Run the following command to install the needed GO protocol buffers plugins:

```
> go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
> go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
```

Your `protoc` may not be compatible with the latest version.
If so you may need to specify specific versions, the examples below works for `3.19`.
```
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0
```

The plugins will be installed in $GOBIN, defaulting to $GOPATH/bin which is default HOME_DIR/go/bin. It must be in your $PATH for the protocol compiler protoc to find it.
For linux execute:
```
Expand Down
4 changes: 2 additions & 2 deletions kuksa_go_client/kuksa_client/commn.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (cc *KuksaClientCommWs) startCommunication() error {
if cc.Config.Insecure {
// Open an insecure websocket
serverUrl := url.URL{Scheme: "ws", Host: cc.Config.ServerAddress + ":" + cc.Config.ServerPort}
log.Printf("Connecting to " + serverUrl.String())
log.Printf("Connecting to %s", serverUrl.String())

// Connect to the Kuksa Websocket
var err error
Expand All @@ -94,7 +94,7 @@ func (cc *KuksaClientCommWs) startCommunication() error {
} else {
// Open a secure websocket
serverUrl := url.URL{Scheme: "wss", Host: cc.Config.ServerAddress + ":" + cc.Config.ServerPort}
log.Printf("Connecting to " + serverUrl.String())
log.Printf("Connecting to %s", serverUrl.String())

// Load Client cert
cert, err := tls.LoadX509KeyPair(cc.Config.CertsDir+"/Client.pem", cc.Config.CertsDir+"/Client.key")
Expand Down
2 changes: 1 addition & 1 deletion kuksa_go_client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func main() {
if err != nil {
log.Printf("Set Value Error: %v", err)
} else {
log.Printf("Vehicle.OBD.DTCList Set: " + valstr)
log.Printf("Vehicle.OBD.DTCList Set: %s", valstr)
}

values, err = backend.GetValueFromKuksaVal("Vehicle.OBD.DTCList", "value")
Expand Down

0 comments on commit 5a8eb75

Please sign in to comment.