New gRPC server to run on Vector OSKR. It allows new commands to be implemented in the vector-go-sdk.
- Download protobuf (https://github.com/protocolbuffers/protobuf/releases)
- Generate go files from oskr.proto, from directory "proto": protoc --go_out=../pkg/oskrpb --go_opt=paths=source_relative --go-grpc_out=../pkg/oskrpb --go-grpc_opt=paths=source_relative oskr.proto
- This will generate oskr.pb.go and oskr.grpc.go The first one is for the server, the 2nd one for the client. Copy them also in the client application (for example, in vector-go-sdk)
- Run ./build.sh it will build the server executable in build/vic-oskr-server
- On the OSKR Vector, do the following: remount the /data partition as executable, and add a firewall rule to allow connections on the port 50051 where the server listens to mount -o remount,exec /data iptables -A INPUT -p tcp --dport 50051 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -p tcp --sport 50051 -m conntrack --ctstate ESTABLISHED -j ACCEPT
- Upload the vic-oskr-server on Vector: scp -i <PATH_TO_id_RSA_key> build/vic-oskr-server root@192.168.43.216:/data
- On the OSKR Vector, run the server cd /data ./vic-oskr-server
Now you can connect with a client (see https://github.com/fforchino/vector-go-sdk/blob/main/cmd/examples/navigator/main.go for an example)