Author Topic: UDP Proxy  (Read 972 times)

PiBoSo

  • Administrator
  • Sr. Member
  • *****
  • Posts: 988
    • View Profile
UDP Proxy
« on: July 18, 2018, 03:43:59 PM »
Starting with Beta8, MX Bikes integrates a plugin that allows to receive UDP data from the simulated bike in realtime.

To enable it and set the parameters, edit the file "proxy_udp.ini" in the MX Bikes installation folder:
Code: [Select]
[params]
enable = 1
port = 30000
ip = 127.0.0.1:30001
delay = 1

port: outbound port
ip: inbound address and, optional, port ( if missing, the outbound port is used )
delay: hundredths of second between packets

The packet format:
"data": null-terminated string
"state": integer. 0: software running; 1: on-track, simulation paused; 2: on-track, simulation running
"time": integer, milliseconds
The rest of the packet follows the "SPluginsBikeData_t" structure of the plugins interface: http://www.mx-bikes.com/downloads/mxb_example.c


In the proxy_udp.ini file, add the line
Code: [Select]
info = 1
to enable the streaming of the event, session, lap and split data.

Data format of the event packet, sent every second:
"evnt": null-terminated string
The rest of the packet follows the "SPluginsEventData_t" structure of the plugins interface.

Data format of the session packet, sent every second:
"sesn": null-terminated string
The rest of the packet follows the "SPluginsBikeSession_t" structure of the plugins interface.

Data format of the lap packet, sent five times a second:
"lap ": null-terminated string
The rest of the packet follows the "SPluginsBikeLap_t" structure of the plugins interface.

Data format of the split packet, sent five times a second:
"splt": null-terminated string
"split": integer. 0: the latest line crossed is the start / finish one; 1: the latest line crossed is a split one
The rest of the packet follows the "SPluginsBikeSplit_t" structure of the plugins interface.
« Last Edit: December 08, 2018, 09:17:33 PM by PiBoSo »

PizzaChet

  • Sr. Member
  • ****
  • Posts: 391
    • View Profile
Re: UDP Proxy
« Reply #1 on: July 18, 2018, 04:41:52 PM »
Since it's all Greek to me, what does this achieve? It must be to improve online racing.
« Last Edit: July 19, 2018, 02:08:29 PM by PizzaChet »

HornetMaX

  • Sr. Member
  • ****
  • Posts: 492
    • View Profile
Re: UDP Proxy
« Reply #2 on: August 13, 2018, 10:49:07 AM »
Since it's all Greek to me, what does this achieve? It must be to improve online racing.
Before that, if one needed to code an application that receives bike's data from GPB in real time, the only options were a GPB plugin or a separate app using the proxy plugin.
Now you can also use a separate app simply listening to the UDP port.

PizzaChet

  • Sr. Member
  • ****
  • Posts: 391
    • View Profile
Re: UDP Proxy
« Reply #3 on: August 13, 2018, 04:36:08 PM »
Ah ok. Data for a motion platform or bike controller maybe?

HornetMaX

  • Sr. Member
  • ****
  • Posts: 492
    • View Profile
Re: UDP Proxy
« Reply #4 on: August 13, 2018, 07:51:33 PM »
Ah ok. Data for a motion platform or bike controller maybe?
Amongst other stuff. The thing this new stuff adds is the ability to easily send the telemtry data to a different computer (over a LAN or the net).
If everything runs on the same computer, there's likely little need to use UDP instead of the normal proxy stuff. Unless I've missed something :)

PiBoSo

  • Administrator
  • Sr. Member
  • *****
  • Posts: 988
    • View Profile
Re: UDP Proxy
« Reply #5 on: December 08, 2018, 03:02:10 PM »
Since it's all Greek to me, what does this achieve? It must be to improve online racing.

The UDP data is mostly used to control motion platforms, but it can also be used, for example, to show data on external displays.

PiBoSo

  • Administrator
  • Sr. Member
  • *****
  • Posts: 988
    • View Profile
Re: UDP Proxy
« Reply #6 on: December 08, 2018, 09:18:30 PM »

First post updated to add information about the extra packets that it is possible to enable starting with Beta10.
« Last Edit: December 08, 2018, 09:22:38 PM by PiBoSo »