The online racing simulator
OutGauge - now available in T6
(165 posts, started )
hi folks.... I had a 16x2 parallel LCD... how can i use it as a gauge??? it's possible???
is there any program that i can download and configure???

ps: i'm a noob in gauges...
How does it work?
Scawen, i think out gauge could send lfs version with data, this would be very useful to detect posible future diferences in outgauge packets between LFS versions.
Quote from su3_zero :hi folks.... I had a 16x2 parallel LCD... how can i use it as a gauge??? it's possible???
is there any program that i can download and configure???

ps: i'm a noob in gauges...

I think that you have to buy PIC micro controller, and that you will have to buy programmer, and write a program in micro c, or similar program... coding is not hard. I had a chance to see micro c and saw that commands are very similar to c...
sorry to bump such an old thread, but someone mentioned using an old 3310 as an lcd display. How would I go about setting it up? Also, how do I implement outgage into the cfg.txt file? It just resets everytime I run LFS.
Quote from dougie-lampkin :Also, how do I implement outgage into the cfg.txt file? It just resets everytime I run LFS.

You probably use Insim to communicate with some Insim program. When you set /insim <port>, the 'OutGauge Mode' is set to 0 (and overwritten in the cfg file). So you cannot use Insim and Outgauge in paralel :-(.
Quote from Kada_CZ :You probably use Insim to communicate with some Insim program. When you set /insim <port>, the 'OutGauge Mode' is set to 0 (and overwritten in the cfg file). So you cannot use Insim and Outgauge in paralel :-(.

I don't think I use insim. That is, I havnt set it up to run with any external program. Unless LFS does that by default.
LFS doesn't use insim by default. Maybe you have it in script/autoexec.lfs. Anyway, it can be checked by typing: /insim (with no parameters). It should give you: "Insim not initialised".
Quote from Kada_CZ :Anyway, it can be checked by typing: /insim (with no parameters). It should give you: "Insim not initialised".

It does say that. Now how do I stop cfg.txt from reseting when editing it?
From my experience that only happens when an insim app starts to communicate with lfs, or when I edit cfg.txt while running lfs.
I would advise to enable outgauge via insim though, because it is 10 times more reliable
Quote from mikey_G :I would advise to enable outgauge via insim though, because it is 10 times more reliable

How do I do that? (im pretty much a n00b when it comes to the tech side of LFS!!!)
First of all, you need to begin a insim connection to your lfs. You can search documentation for that in lfs>docs>insim.txt

secondly you should send a packet to lfs containing this:
// DASHBOARD PACKETS (Initialising OutGauge from InSim - See "OutGauge" below)
// =================

// To request Dashboard Packets from the currently viewed car, send this IS_SMALL :

// ReqI : 0
// SubT : SMALL_SSG (Start Sending Gauges)
// UVal : interval (time between updates - zero means stop sending)

// The SSG packet makes LFS start sending UDP packets if in game, using the OutGauge
// system as documented near the end of this text file.

// You do not need to set any OutGauge values in LFS cfg.txt - OutGauge is fully
// initialised by the SSG packet.

// The OutGauge packets will be sent to the UDP port specified in the InSimInit packet.

that's it i think, of course you need to do something with the outgauge packets. Easiest way to get this going is with sdether's lfsLib insim library
OK i solved the problem of the disapearing cfg.txt text, but i don't know what i did!!! Anyway, im thinking of biulding a small program in C++ or yabasic (preferably yabasic) to communicate with outgage. How can i set my program to listen on an outgage port?
You setup a socket to listen on the port, of your choosing. How you do this depends on which language you choose. For YABasic, I suggest consulting the YABasic manual.

Edit: a very brief googling (less than 2 minutes) suggests that there is no socket support in YABasic, which means that you either need to modify it, or use something else.

Edit 2: This post appears to confirm my results, and proposes a ridculously stupid solution.
http://yab.beosmax.org/viewtopic.php?t=66
Quote from the_angry_angel :You setup a socket to listen on the port, of your choosing. How you do this depends on which language you choose. For YABasic, I suggest consulting the YABasic manual.

Edit: a very brief googling (less than 2 minutes) suggests that there is no socket support in YABasic, which means that you either need to modify it, or use something else.

Edit 2: This post appears to confirm my results, and proposes a ridculously stupid solution.
http://yab.beosmax.org/viewtopic.php?t=66

Thanks, but my browser wont display the link!

EDIT: also, do you have a link for doing this in C++? cant find much on google, but im not sure what to look up!
If you go down the route of editing the config file, then the following will apply.

This (http://64.233.183.104/search?q ... l=uk&client=firefox-a) is a start. It explains how to use Winsock under C and C++, and half way down as "a UDP server program", which is effectively what you'll be making to get Outgauge packets. Its not perfect though, and will need modification.

There's a number of C++ wrappers for the socket functions which might make your life easier (so you don't have to deal with all the sa_addr stuff). I can't recommend any particular one though.

However, if you go down the route of initialising Outgauge through Insim (as mikey_G suggests).. well that's a whole different kettle of fish...
q 'n' d way.

// socket handling
WSADATA wsaData;
SOCKET ogSocket;
int iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
if (iResult != NO_ERROR)
{
cout << "Error at WSAStartup()" << endl;
return 0;
}
ogSocket = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);
if(ogSocket == INVALID_SOCKET)
{
cout << "Error at socket(): " << WSAGetLastError() << endl;;
WSACleanup();
return 0;
}
sockaddr_in service;
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr("127.0.0.1");
service.sin_port = htons(27015);
if (bind( ogSocket, (SOCKADDR*) &service, sizeof(service)) == SOCKET_ERROR)
{
cout << "bind() failed." << endl;
closesocket(ogSocket);
WSACleanup();
return 0;
}

How to get rpm and more?
unit init;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdUDPServer, IdBaseComponent, IdComponent, IdUDPBase,
IdUDPClient, IdSocketHandle;

type
THead = record
Size: Byte;
ISP_: Byte;
Reql: Byte;
Data: Byte;
end;
TInit = record
Size: Byte;
ISP_: Byte;
ReqI: Byte;
Data: Byte;
UDPPort: Word ;
Flags: Word;
Sp0: Byte;
Prefix: Byte;
Interval: Byte;
Admin: array[0..15] of char;
PName: array[0..15] of char;
end;
TVer = record
Version: array[0..7] of char;
Product: array[0..5] of char;
InSimVer: Word;
end;
TForm1 = class(TForm)
IdUDPClient1: TIdUDPClient;
IdUDPServer1: TIdUDPServer;
Button1: TButton;
Button2: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure IdUDPServer1UDPRead(Sender: TObject; AData: TStream; ABinding: TIdSocketHandle);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
Head: THead;
Ver: TVer;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var Init: TInit;
begin
Init.Size:=44;
Init.ISP_:=1;
Init.ReqI:=1;
Init.Data:=0;
Init.UDPPort:=30000;
Init.Flags:=0;
Init.Sp0:=0;
Init.Prefix:=0;
Init.Interval:=1;
Init.Admin:='';
Init.PName:=' aaaaaaa';
IdUDPClient1.SendBuffer(Init, SizeOf(Init));
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Head.Size:=4;
Head.ISP_:=3;
Head.Reql:=0;
Head.Data:=2;
IdUDPClient1.SendBuffer(Head, SizeOf(Head));
end;

procedure TForm1.IdUDPServer1UDPRead(Sender: TObject; AData: TStream;
ABinding: TIdSocketHandle);
var init:tinit;
begin
Application.ProcessMessages;
Adata.Read(Head, sizeof(Head));
if (Head.Size = Adata.Size) and (Head.ISP_ = 3) and (Head.Data = 0) then
begin
Head.Size:=4;
Head.ISP_:=3;
Head.Reql:=0;
Head.Data:=0;
IdUDPClient1.SendBuffer(Head, SizeOf(Head));
end;
if (Head.Size = Adata.Size) and (Head.ISP_ = 2) and (Head.Data = 0) then
begin
Adata.Read(Ver, sizeof(Ver));
Memo1.Lines.Add('Version: '+Ver.Version);
Memo1.Lines.Add('Product: '+Ver.Product);
Memo1.Lines.Add('InSimVer: '+init.PName);

end;
end;

end.

Help me!
Seeing as this is kinda the official OutGauge thread:

Would it be possible to put the clutch temperature in the outgauge struct?
There already are EngTemp and OilPressure, but since those don't have a place in LFS (yet) I can't help wonder why the clutch temp isn't there.
Maybe because engine temperature and oil pressure are viewable on gauges, whereas you can't look at one for clutch temperature?
#121 - gru
Quote from blackbird04217 :Maybe because engine temperature and oil pressure are viewable on gauges...

throttle, brake, clutch indicators aren't

OG was made some time ago (before clutch changes), i guess Scawen had no time to add it
i agree it would be nice to have OutGauge updated
Quote from mikey_G :Would it be possible to put the clutch temperature in the outgauge struct?

I actually asked Scawen for this feature twice in the test patch threads just before patch Y was released. He never responded to the request.
I think its pretty important to have max rpm, and perhaps top speed information from outgauge. The way it is now we have to either let the user imput them manually, or have the program guess. Guessing isn't reliable for a few reasons: not all styles of driving or car/track combinations have the player going to max RPM (when using a clutch pedal particularly), and going by the shift light won't work because it doesn't necessarily come on at the same RPM for every gear. It makes for a much better user experience if the gauges we program just work, showing the correct range of values as soon as you get in the car. Right now there is no way to do this.
Quote from Almadiel :I think its pretty important to have max rpm, and perhaps top speed information from outgauge. The way it is now we have to either let the user imput them manually, or have the program guess. Guessing isn't reliable for a few reasons: not all styles of driving or car/track combinations have the player going to max RPM (when using a clutch pedal particularly), and going by the shift light won't work because it doesn't necessarily come on at the same RPM for every gear. It makes for a much better user experience if the gauges we program just work, showing the correct range of values as soon as you get in the car. Right now there is no way to do this.

Dude, you can just program all that yourself. With all the rev bar hardware I made (be it over parallel, serial or usb port) I always made sure my program was recording the max rpm's for each individual gear, and tbh, writing and debugging such an algorithm only takes 20 minutes.
And recording top speed from outgauge? Have you ever programmed with outgauge (or programmed at all)?
i thought that monkey looked familiar...

as far as finding out the max RPM of each vehicle its pretty easy once you have an outguage program displaying RPM numerically. put car in neutral and pin the throttle, record max RPM,

OutGauge - now available in T6
(165 posts, started )
FGED GREDG RDFGDR GSFDG