The online racing simulator
Possible to use two OutGauge at same time?
Hello!!

Is it possible to use two OutGauge addon at same time?

Want to use Analog gauges and revlimiter together.
Both uses OutGauge in cfg.txt

I´m using LFS S2 patch V

//Johan
#2 - senn
a bit off topic, but why are you using such an old version?

Also IIRC you can only use 1 outgauge at a time (i think, for now anyway...)
No.. I'm pretty sure you can have more than 1, you just need to assign different ports and a different ID to it, but otherwise you can have multiple, just duplicate the entrys in the cfg.txt
No that doesn't work. LFS sends OG packets to no more than 1 port, either the one specified in the config or the one specified in the UDPPort of an IS_ISI via InSim.
A simple relay will do the trick though, one receiving application that simply forwards the OG packets to the other OG apps.
In Python it could look like this
import socket

HOST = 'localhost'
OG_PORT = 6090 # OutGauge port as defined in LFS's cfg.txt
BUFFER_SIZE = 1024
FORWARD_TO = (6091, 6092) # Ports to forward the packets to

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
s.bind((HOST, OG_PORT))
except (socket.error, socket.herror), err:
pass
try:
while True:
try:
data = s.recv(BUFFER_SIZE)
except (socket.error, socket.herror), err:
pass
for port in FORWARD_TO:
s.sendto(data, (HOST, port))
finally:
s.close()

Works fine for me
How can I compile it?
Python is interpreted, you can pack it into an exe with the Python runtime, but I suggest you get the interpreter from python.org.
If it doesn't work with Python 3, try 2.6
#7 - Crady
Quote from morpha :No that doesn't work. LFS sends OG packets to no more than 1 port, either the one specified in the config or the one specified in the UDPPort of an IS_ISI via InSim.
A simple relay will do the trick though, one receiving application that simply forwards the OG packets to the other OG apps.
In Python it could look like this
import socket

HOST = 'localhost'
OG_PORT = 6090 # OutGauge port as defined in LFS's cfg.txt
BUFFER_SIZE = 1024
FORWARD_TO = (6091, 6092) # Ports to forward the packets to

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
s.bind((HOST, OG_PORT))
except (socket.error, socket.herror), err:
pass
try:
while True:
try:
data = s.recv(BUFFER_SIZE)
except (socket.error, socket.herror), err:
pass
for port in FORWARD_TO:
s.sendto(data, (HOST, port))
finally:
s.close()

Works fine for me

Wow - that is so simple, I reckon I'll add an OutGauge/OutSim relay class to the next release of pyinsim.

FGED GREDG RDFGDR GSFDG