• Welcome to MX Bikes Official Forum. Please login or sign up.
 
August 18, 2019, 06:07:21 pm

News:

MX Bikes beta11d available! :)


UDP Proxy

Started by PiBoSo, July 18, 2018, 05:43:59 pm

Previous topic - Next topic

PiBoSo

July 18, 2018, 05:43:59 pm Last Edit: December 08, 2018, 10:17:33 pm by PiBoSo
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.

PizzaChet

July 18, 2018, 06:41:52 pm #1 Last Edit: July 19, 2018, 04:08:29 pm by PizzaChet
Since it's all Greek to me, what does this achieve? It must be to improve online racing.
Quote from: YodaIf no mistake have you made, yet losing you are ... a different game you should play.

HornetMaX

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.

PizzaChet

Ah ok. Data for a motion platform or bike controller maybe?
Quote from: YodaIf no mistake have you made, yet losing you are ... a different game you should play.

HornetMaX

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 :)

PiBoSo

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.

PiBoSo

December 08, 2018, 10:18:30 pm #6 Last Edit: December 08, 2018, 10:22:38 pm by PiBoSo

First post updated to add information about the extra packets that it is possible to enable starting with Beta10.