The Sensor Client will run on the Raspberry PI and will expose a Websocket endpoint for the aggregator service to obtain the sensor readings and subsequently send them to the Game Controller.
Run the sensor client:
go run *.go
The Docker image for the Sensor Client is located in Docker hub. To get the image just run
docker pull emccode/mars-challenge-client.
In the following case we are going to listen on the port 80 on our host machine that will bind to the container's exposed port 8080.
docker run -d --name=sensor -p 80:8080 emccode/mars-challenge-client
The game controller has the following dependencies:
go get github.com/gorilla/mux
go get github.com/gorilla/websockets
The websocket endpoint is located in
/ws. It sends the following JSON structure every second corresponding to the Sensor data.
||Whether there is a solar flare or not. Values are either
||Float value ranging from -142 to 35 representing the current temperature in Celsius.|
||Integer value ranging from 0 to 1000.|
The endpoint in