MX Bikes Official Forum

Mods => Plugins => Topic started by: PiBoSo on July 18, 2018, 05:43:59 PM

Title: UDP Proxy
Post by: PiBoSo on July 18, 2018, 05: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:

[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

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.
Title: Re: UDP Proxy
Post by: PizzaChet on July 18, 2018, 06:41:52 PM
Since it's all Greek to me, what does this achieve? It must be to improve online racing.
Title: Re: UDP Proxy
Post by: HornetMaX on August 13, 2018, 12:49:07 PM
Quote from: PizzaChet on July 18, 2018, 06:41:52 PM
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.
Title: Re: UDP Proxy
Post by: PizzaChet on August 13, 2018, 06:36:08 PM
Ah ok. Data for a motion platform or bike controller maybe?
Title: Re: UDP Proxy
Post by: HornetMaX on August 13, 2018, 09:51:33 PM
Quote from: PizzaChet on August 13, 2018, 06:36:08 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 :)
Title: Re: UDP Proxy
Post by: PiBoSo on December 08, 2018, 04:02:10 PM
Quote from: PizzaChet on July 18, 2018, 06:41:52 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.
Title: Re: UDP Proxy
Post by: PiBoSo on December 08, 2018, 10:18:30 PM

First post updated to add information about the extra packets that it is possible to enable starting with Beta10.
Title: Re: UDP Proxy
Post by: PiBoSo on February 02, 2022, 02:48:04 PM
The plugin output has been updated to the latest proxy interface: https://www.mx-bikes.com/downloads/mxb_proxy.c