Coder Social home page Coder Social logo

f1_adx's Introduction

Formula 1 - Telemetry Analytics with Azure Data Explorer

The project aims to use Azure Data Explorer(ADX) to analyze Formula 1 telemetry data from F1 202x game (by Codemasters) running on Microsoft Xbox, Sony Playstation .

ADX blog - https://techcommunity.microsoft.com/t5/azure-data-explorer-blog/f1-telemetry-analysis-with-azure-data-explorer-adx/ba-p/3283911

Overview:

Arch

The formula 1 telemetry library, used to decode the UDP packets, works with the F1 2019 game format. It's possible to have the project working with F1 2020 & F1 2021 game by selecting the "2019" UDP packet format in the Telemetry settings on the game.

Repo structure

/grafana - grafana dashboard to visualize the data.

/kusto - code to ingest data in ADX

/f1_telemetry - server.py includes the code to listen to udp stream, f1_2019_struct.py - structure for F1 2019 format.

main.py - main module to start listening to udp stream, parse data & send it to ADX

How to run F1 telemetry with the game

  1. Install python dependencies

pip install -r requirements.txt

  1. Create ADX Cluster and a DB, run the scripts in /kusto/initialization/schema.kql to create necessary tables. Upload the data in /kusto/initialization/data to corresponding tables.

  2. Create Azure AD application registration and configure following properties in /kusto/ingest.js

clusterpath, appid, appKey, apptenant, dbName

  1. Install the ADX Data Explorer Data Source in your Grafana instance. Upload the grafana dashboard to the instance, and provide necessary conenction properties from Step #3.

  2. Start the F1 202x game, and turn on the UDP telemetry by providing UDP IP Address of your machine running python code. Step by step instructions

By default, the code listens on port 20777 (default port for F1), and 0.0.0.0 IP. You can change the values in server.py

  1. Start the python engine

python main.py

  1. Set the grafana dashboard to 1s or 500ms to visualize the real-time charts. You will need to change the min_refresh_interval to 1s/500ms via the config.

How to test F1 telemetry without running the game

If you want to test it without running the game, you can replay a previously recorded session captured with wireshark or tcpdump and use send-pcap.py to send the UDP packets.

Usage

Configure the following parameters inside send-pcap.py. Change the dst_ip to the local IP of your machine.

  src_ip = ""
  dst_ip = ""
  infile = "f1pc.pcap"

After that run it with "python send-pcap.py" to replay udp stream. To start listening to udp, and send data to Kusto - run "python main.py"

Dashboard Visualizations

visuals1

visuals2

visuals3

visuals4

visuals5

f1_adx's People

Contributors

anshulsharmas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.