:::hw Etc.|PC or Laptop supporting .NET Core 2.1|1|Windows, Mac, some Linux distributions ::: :::sw SDK| .NET Core 2.1 Environment | Avalible at [https://www.microsoft.com/net/download](https://www.microsoft.com/net/download) SDK| (Optional) Visual Studio/Visual Studio Code | Avalible at [https://visualstudio.microsoft.com/downloads/](https://visualstudio.microsoft.com/downloads/) and [https://code.visualstudio.com/](https://code.visualstudio.com/) ::: ## [Source code of Cloud](https://review.tizen.org/gerrit/gitweb?p=service%2Fcloud%2Fgear-racing-cloud.git;a=summary) # 1. Cloud API ### Tip: You can obtain IP address of car through sshing to car and executing ifconfig. --- Communication between cars and controllers can be implemented using simple HTTP request for obtaining information about car. Communication description: - car sends POST to cloud with information about its IP and access point's MAC, - controller sends GET to cloud with its access point's MAC to obtaing an array of available cars, - controller start peer-2-peer connection with car on UDP. Car stops sending POST. - controller after race, disconnects from car. Car starts sending POST again. ## 2. Running a cloud ### To get better knowledge about ASP.NET Core, check out [this](https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app-xplat/start-mvc?view=aspnetcore-2.1) tutorial. If you are going just to run the cloud, do following steps: 1. Open launchSetting.json ![Solution_View.png](https://tizen-prod-craftroom.s3.amazonaws.com/uploads/2018/11/Solution_View.png) 2. Change applicationUrls to "http://0.0.0.0:63687" or your IP address ![launchSettingjson.png](https://tizen-prod-craftroom.s3.amazonaws.com/uploads/2018/11/launchSettingjson.png) 3. Start aplication with F5 or click here: ![Start.png](https://tizen-prod-craftroom.s3.amazonaws.com/uploads/2018/11/Start.png) If everything was configured properly, this view should appear (or in browser in address bar enter the path you have entered as applicationUrl like http://192.168.1.12:63687 or, if you set up it as 0.0.0.0:63687, 127.0.0.1:63687): ![Gear Racing Cloud.png](https://tizen-prod-craftroom.s3.amazonaws.com/uploads/2018/11/Gear-Racing-Cloud.png) ### Note: The same URL should be set in car's config to enable him connection with cloud. ## 3. Testing To test if cars are registering and laps are correctly noted, you can go to test page (add /test to address, for example http://192.168.1.12:63687/test). ![Gear Racing Cloud - test.png](https://tizen-prod-craftroom.s3.amazonaws.com/uploads/2018/11/Gear-Racing-Cloud-test.png) You can check if your car is connected to cloud in "Full Car View". All registered cars are displayed there (it stays registered only for 15 seconds if it disconnects). ![Gear Racing Cloud - car View.png](https://tizen-prod-craftroom.s3.amazonaws.com/uploads/2018/11/Gear-Racing-Cloud-car-View.png) ![Gear Racing Cloud - car view 2.png](https://tizen-prod-craftroom.s3.amazonaws.com/uploads/2018/11/Gear-Racing-Cloud-car-view-2.png) In columns there are informations about car's: - Id, - IP address, - Name, - Physical address of access point, - SSID of access point (network's name) They can help you in finding out which car are registered and which are not. --- If you do not need more information about cloud, you can follow to the [next step of tutorial](https://craftroom.tizen.org/tizen-racing/). ## 4. Cloud changing Of course you can edit any part of code to adjust it to your needs, apart from: - properties of Car and Lap classes - they need to be synced with JSONs sent from car, - api routes - as above. In /test there are other views that you can use to: - inject laps (laps are stored for 24 hours), - inject cars (cars are stored for 15 seconds), - display all registered laps with detailed info.