How do I GET 512 long frame from HTTP server

Get help using Construct 2

Post » Sun Feb 15, 2015 11:22 am

Hi!

I have a project, that takes one games information (telemetry data) that comes trough third party "Telemetry server" program, that opens datastream at localhost:19000. The protocol used is HTTP-GET and the data getting in python my Communications Software does this using this :

Python CODE wrote:
Code: Select all
   
try:
    telemetry_server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    telemetry_server.connect(('127.0.0.1', 19000))              # Setting TCP/IP connection to telemetry server
except socket.error, v:
    errorcode=v[0]
    if errorcode==errno.ECONNREFUSED:
        print "Connection refused."
        print "Please start ETS2 Telemetry server before you launch this app."

<CODE exluded, nothing to do with subject>

while 1:

    frame = telemetry_server.recv(512)                      # Receiving frame of data

    data = frame.split('#')
    telemetry = data[0].split('|')
    indicators=data[2]

    if len(telemetry) == 16:                                # To be sure that data is complete ("Index out of range" error may appear sometimes without it, that's the simplest walkaround)


<Serial port communication exluded>




So. The problem is now, i would like to implement the code to browser window at first so user can see data on browser (using the all might Construct 2 graphics!) and afterwards id like to make it ask user for IP where to get data on Local Area Network, so user could use example their mobile device, or tablet to see telemetry data like how their truck is doing (Speed, fuel quantity etc).


Take a look at:
http://www.edltech.org/telemetry.htm

FAQ:

1.
Q: Why not continue using python?
A: The problem is , that i want multiplatform, easy to use app for everyone! Current serial port streamer is easy to use, but need hardware to show data.

2.
Q: What game is this?
A: Its Euro Truck Simulator 2 from SCS-Software.

3.
Q: Where to download these server files?
A: From same page where you can see how the datastream is coming to my Serial streamer.
B
6
G
1
Posts: 1
Reputation: 456

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests