Welcome to the Codemasters Forums! Be sure to check the FAQ and Forum Rules before you get started.

D-Box and UDP Telemetry Information

1246

Comments

  • DaveyGravyDaveyGravy Member New Car Smell
    Hi all,

    I'm the creator of the iOS app Race Dash for PCARS and am just in the process of creating a similar dash app for F1 2016.

    I'm using the game on the PS4 and have come across a couple of issues which I wondered if anyone else has seen:

    Firstly, UDP broadcast mode doesn't seem to broadcast anything. I have to turn off broadcast and enter my phones IP to see the data stream.

    Also, tyre pressures seem to be stuck at 18PSI and never change...

    Are these issues just me, just PS4 or wider problems?

    Any thoughts and help gratefully received.

    Thanks
    David
  • baxbax Member Unleaded
    ...Firstly, UDP broadcast mode doesn't seem to broadcast anything. I have to turn off broadcast and enter my phones IP to see the data stream.
    Are these issues just me, just PS4 or wider problems?
    This is a known issue about PS4.
    I've no sure infos about PC or XBOX
  • DaveyGravyDaveyGravy Member New Car Smell
    Thanks Bax, it's good to know it's not my apps fault :-)

    David
  • transfixtransfix Member Unleaded
    Hi all,

    I'm the creator of the iOS app Race Dash for PCARS and am just in the process of creating a similar dash app for F1 2016.

    I'm using the game on the PS4 and have come across a couple of issues which I wondered if anyone else has seen:

    Firstly, UDP broadcast mode doesn't seem to broadcast anything. I have to turn off broadcast and enter my phones IP to see the data stream.

    Also, tyre pressures seem to be stuck at 18PSI and never change...

    Are these issues just me, just PS4 or wider problems?

    Any thoughts and help gratefully received.

    Thanks
    David
    Hey Davey,

    UDP Broadcast helps when using multiple devices (e.g. I use iPhone as speedometer and iPad for lap times,etc) I need to plug IP address for my iPhone and make sure broadcast is on otherwise the iPad is not recognized.

    There is no tire pressure/temperatures data in the UDP stream unfortunately. 

  • DaveyGravyDaveyGravy Member New Car Smell
    transfix said:

    Hey Davey,

    UDP Broadcast helps when using multiple devices (e.g. I use iPhone as speedometer and iPad for lap times,etc) I need to plug IP address for my iPhone and make sure broadcast is on otherwise the iPad is not recognized.

    There is no tire pressure/temperatures data in the UDP stream unfortunately. 

    Agreed, broadcast is needed as I also use an iPhone and an iPad while racing. It seems to be just a bug, I've run Wireshark and literally no data is sent with broadcast on - hopefully it'll get fixed soon.

    Looking at the spec, I assumed m_wheels_pressure relates to tyre pressures and the value is 'about right'  for PSI, it just doesn't change for me on PS4. I've assumed it works on other platforms and have left it in my app for now...

    David
  • CtrMint713CtrMint713 Member New Car Smell
    I'm helping a friend with his Python dev, but don't have F1 2016 at present, so can't generate a test UDP stream.
    Is there any chance someone could post an example 'packed' string for me experiment with.
    Thanks
  • cjorgens79cjorgens79 Member Unleaded
    I'm helping a friend with his Python dev, but don't have F1 2016 at present, so can't generate a test UDP stream.
    Is there any chance someone could post an example 'packed' string for me experiment with.
    Thanks
    Here is a zip of a recording of the raw telemetry stream from a 3 lap test that you can use.
    https://www.mediafire.com/?c9csq6ux4venqhy

  • CtrMint713CtrMint713 Member New Car Smell
    I'm helping a friend with his Python dev, but don't have F1 2016 at present, so can't generate a test UDP stream.
    Is there any chance someone could post an example 'packed' string for me experiment with.
    Thanks
    Here is a zip of a recording of the raw telemetry stream from a 3 lap test that you can use.
    https://www.mediafire.com/?c9csq6ux4venqhy

    Thanks, how was the data recorded?
  • baxbax Member Unleaded
    edited November 2016
    Is the game sending UDP data in spectator view?
    If it does... which kind of data? Generic (about the circuit) or Viewed Driver specific (position, laptimes)?
  • cjorgens79cjorgens79 Member Unleaded
    Thanks, how was the data recorded?
    UDP socket just writing everything it receives to disk, i use it to simulate the output during development, saves me the hassle of loading the game up and trying to play it at the same time as testing my app. Its recorded at approx 70Htz, but you can play it back at whatever speed you want. 
  • CtrMint713CtrMint713 Member New Car Smell
    I've made some progress and seem to be getting data out now.  Although I have spotted that m_speed value is approximately half what it should be, i.e. my data says 5mph when it should be 10mph.  Of course I can just double the float but I'm wondering if I have a mistake I'm not spotting.

    I've also noticed the gears are offset, i guess due to reverse, but thats also not a problem.  I just wanted to check.

  • CtrMint713CtrMint713 Member New Car Smell
    I've made some progress and seem to be getting data out now.  Although I have spotted that m_speed value is approximately half what it should be, i.e. my data says 5mph when it should be 10mph.  Of course I can just double the float but I'm wondering if I have a mistake I'm not spotting.

    I've also noticed the gears are offset, i guess due to reverse, but thats also not a problem.  I just wanted to check.

    Sorted, was printing the wrong sort of number for the mph, :blush:
  • CtrMint713CtrMint713 Member New Car Smell

    !/usr/bin/env python # ---------------------------------------------------------------------------------------------------------------------- # Test tool to receive packed values. # Assumes packed data is of fixed size. # ---------------------------------------------------------------------------------------------------------------------- import sys import struct import socket # Configure listener IP & Port for UDP transmission of packed values udp_ip = "0.0.0.0" udp_port = 20777 def net_rx(UDP_IP, UDP_PORT): # Receive packet from wire sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP sock.bind((UDP_IP, UDP_PORT)) data, addr = sock.recvfrom(1024) # receiving from socket return data def displaygear(gear): # | car gear | data gear | Required to adjust for gear float mapping as shown # | R | 0 | # | N | 1 | # | 1 | 2 | # | 2 | 3 | # | 3 | 4 | # | 4 | 5 | # | 5 | 6 | # | 6 | 7 | # | 7 | 8 | # ------------------------ if (gear > 1): # Forward gear requires minus adjustment gear -=1 print "Current Gear :%d" % gear # print forward gear elif (gear == 1): print "Current Gear :N" # print neutral elif (gear == 0): print "Current Gear :R" # print reverse return def displaymph(mph): print "Current MPH :%f" % mph return def receiver(): fmt = '<' + '70' + 'f' # define structure of packed data s = struct.Struct(fmt) # declare structure packetCounter = 0 recordedData = [] # Infinite receiving loops while True: rx_data = net_rx(udp_ip, udp_port) unpacked_data = s.unpack(rx_data) # unpack data into tuple, requires correct 'fmt' displaygear(unpacked_data[33]) print "Current RPM :%d" % unpacked_data[37] displaymph(unpacked_data[7]) return def main(): receiver() return if __name__ == '__main__': main()
  • vinceps34vinceps34 Member New Car Smell
    edited November 2016
    Hello !
    I'm currently in the process of developping a generic codemaster UDP plugin for XSim, Focused on PS4. The good news is that F12016 supports UDP. I made a capture and what is strange is that the UDP payload is 280 bytes. Anyone has a clue on the extra bytes from the spec above ?
    I made a UDP record playback tool in python, with some samples from different gmes, including F1 2016. here: https://github.com/vthinsel/Python_UDP_Receiver (it also includes a proxy to replicate UDP streams)
    Edit: I'm trying to consolidate UDP specs for various games here: https://docs.google.com/spreadsheets/d/1UTgeE7vbnGIzDz-URRk2eBIPc_LR1vWcZklp7xD9N0Y/edit?usp=sharing 

  • versediversedi Member Champion
    edited November 2016
    vinceps34 said:
    Hello !
    I'm currently in the process of developping a generic codemaster UDP plugin for XSim, Focused on PS4. The good news is that F12016 supports UDP. I made a capture and what is strange is that the UDP payload is 280 bytes. Anyone has a clue on the extra bytes from the spec above ?
    I made a UDP record playback tool in python, with some samples from different gmes, including F1 2016. here: https://github.com/vthinsel/Python_UDP_Receiver (it also includes a proxy to replicate UDP streams)
    Edit: I'm trying to consolidate UDP specs for various games here: https://docs.google.com/spreadsheets/d/1UTgeE7vbnGIzDz-URRk2eBIPc_LR1vWcZklp7xD9N0Y/edit?usp=sharing 


    Hi, are you sure about values for DiRT Rally, specifically the Length of  Track in Total? Anyway, nice list and thanks for sharing. 
  • vinceps34vinceps34 Member New Car Smell
    No, I havent checked the track length, but it should be pretty easy using the captures on github. Right now, I'm trying to get yaw/pitch/roll heave/sway/surge from existing values.
  • vinceps34vinceps34 Member New Car Smell
    edited November 2016
    Dirt track length seems to be accurate. I cant check anymore, as I do not have the PC version anymore. However, in my capture I have a value of 
    6456,36 througout the UDP stream. Maybe it matches one of the track ? I'll check when codemasters enables UDP in DirtRallye.....

  • versediversedi Member Champion
    edited November 2016
    Hmm It's interesting because im ending at the offset 148, no data further after that in received packets on PC version of DR :(

    I suppose DR's UDP system is a bit more out-dated.


    EDIT:
    I've figured this out thanks to this link: http://www.eksimracing.com/cmps/
    I've changed the extradata field in hardware_settings to 3 and the are far more packets sent :)

     The overall distance is correct for Sweet Lamb and Col de Turini so we can assume that works. Unfortunately current track number seems to be unusable in DR cause it always stays on 0.0; 

  • value1value1 Member New Car Smell
    edited December 2016
    Hoo said:

    If anyone who uses this data wants anything added to it, or thinks of ways we could generally improve this system then please let us know. We can't guarantee that we'd be able to make every change requested, but we'll certain try to improve things wherever we can.

    Hi @Hoo
    Yes:
    float m_xv; // Velocity in car space
    float m_yv; // Velocity in car space
    float m_zv; // Velocity in car space
    and
    float m_gforce_vertical (as actually already available with extradata=0)
    would be nice indeed (then I don't have to calculate these values for motion simulation (see https://www.xsimulator.net/community/)
    Post edited by value1 on
  • DaveyGravyDaveyGravy Member New Car Smell
    I'm the creator of the iOS app Race Dash for PCARS and am just in the process of creating a similar dash app for F1 2016.
    Race Dash for F1 2016 is now live in the App Store for iPhone and iPad to pick up the UDP stream from F1 2016. More info here if interested: http://www.sllim-code.com/race-dash-for-2016-game/

    David
Sign In or Register to comment.