Page 1 of 1

GPS and TunerStudio with a Pi Dash

Posted: Tue Jun 20, 2017 12:19 am
by VLC-05L
I have made a Raspberry Pi dash and am trying to use a GPS module for speed. I bought the Adafruit Ultimate GPS module and a cheap USB to serial converter.

I basically plugged them all together and hoped for the best. I set up the GPS configuration in Tunerstudio with the port being ttyUSB0 and a baud rate of 9600. Apparently this is what the module uses as standard. When I go to the mini-terminal in tuner studio, when I can open the port it shows the GPS data being received, even when I was inside and not getting a fix. With the module installed under my dash, while I drive around the speed doesn't show up on the dash.

My thoughts are that even if it is not getting a fix due to being under the dash, it should still show changes in speed, even if they are not all that accurate. Or is this not correct? Should I be buying a GPS antenna?

Or if this is not required, is there something else that needs to be done on tunerstudio or the Pi to help them interpret the signal. I thought I read that there are a couple of different messaging types and that I might need to tell the Pi what sort of signal I am receiving, but I haven't done anything like that.

Any help would be most appreciated.

Glen

PS. (Another problem I am having) When I accelerate the car hard, the Pi turns off... I am still testing to try and find why this happens but if anyone has any theories, happy to hear them.

Re: GPS and TunerStudio with a Pi Dash

Posted: Tue Jun 20, 2017 7:31 am
by LT401Vette
My thoughts are that even if it is not getting a fix due to being under the dash, it should still show changes in speed, even if they are not all that accurate. Or is this not correct? Should I be buying a GPS antenna?
Nope, no speed until there is a fix.

The GPS needs to put out $GPGGA and $GPRMC NEMA messages

Re: GPS and TunerStudio with a Pi Dash

Posted: Tue Jun 20, 2017 3:18 pm
by VLC-05L
LT401Vette wrote:
My thoughts are that even if it is not getting a fix due to being under the dash, it should still show changes in speed, even if they are not all that accurate. Or is this not correct? Should I be buying a GPS antenna?
Nope, no speed until there is a fix.



The GPS needs to put out $GPGGA and $GPRMC NEMA messages
Thanks for your help!

Ok, no speed until a fix. So I need an antenna then.

Is there a way to check what message format it uses? Is it just a case of looking at the terminal and seeing if the format of the data is the same as what's required? Is the messaging format usually something that can be changed, or is it fixed for each GPS module? *edit - just found that it uses NMEA 0183, 9600 baud by default.*

Re: GPS and TunerStudio with a Pi Dash

Posted: Wed Jun 21, 2017 8:24 am
by LT401Vette
Open a terminal to it. The messages start off with what they are.
So you should see rows starting with $GPGGA and $GPRMC

Some GPS's can be configured for specific messages, but most have the above by default.

Re: GPS and TunerStudio with a Pi Dash

Posted: Sun Jul 23, 2017 12:00 am
by VLC-05L
LT401Vette wrote:Open a terminal to it. The messages start off with what they are.
So you should see rows starting with $GPGGA and $GPRMC

Some GPS's can be configured for specific messages, but most have the above by default.
Thanks for that!

I ended up buying an antenna that suited the GPS module. It has a magnetic base so it can be put on the roof of the car to maximise the chance of getting a fix.

After driving the car today, it would not get a fix for any time longer than a few seconds. The GPS Active box would light up for a few seconds then turn off. It wouldn't get another fix for a few minutes and again it would only be for a couple of seconds. Not long enough to update the speed on the dash.

I looked at the default messaging format for the GPS module and it is NMEA 0183. I read that there are different forms of NMEA. Will the one I mentioned work fine?

Why else might this be? I'm unsure what I can do to test things to get this working. I kind of need this to work as I have put the fuel gauge as an input to the ECU and that doesn't work as it should, so I was going to try and rely on the fuel used calculation combined with the odometer calculation. I assume that the odometer calculation uses the speed input.

Re: GPS and TunerStudio with a Pi Dash

Posted: Sun Jul 23, 2017 4:06 pm
by VLC-05L
Here is a link to a video I took of the mini-terminal.

https://youtu.be/wi32vC0V3HQ

Re: GPS and TunerStudio with a Pi Dash

Posted: Mon Jul 24, 2017 6:39 am
by LT401Vette
It looks like it is putting out the messages needed.
Is it dropping fix?

Re: GPS and TunerStudio with a Pi Dash

Posted: Mon Jul 24, 2017 3:11 pm
by VLC-05L
LT401Vette wrote:It looks like it is putting out the messages needed.
Is it dropping fix?
Is "dropping fix" a technical term? If you just mean is it losing the fix then yes that's what it's doing. I can only tell by looking at the TS button that lights up. It lights up to say active for a few seconds only.

The GPS module has a Fix LED, I can check that to see if that is also doing the same thing. I guess that will point towards if it's the module or not.

Re: GPS and TunerStudio with a Pi Dash

Posted: Mon Jul 24, 2017 4:49 pm
by VLC-05L
So I started the car this morning and pulled the dash out to check the Fix LED on the module. It isn't staying on either. So I'm guessing it is not a tuner studio problem then?

Re: GPS and TunerStudio with a Pi Dash

Posted: Mon Jul 24, 2017 4:59 pm
by LT401Vette
Probably not, perhaps the antenna is not quite pulling it off?

Re: GPS and TunerStudio with a Pi Dash

Posted: Tue Jul 25, 2017 4:21 pm
by VLC-05L
LT401Vette wrote:Probably not, perhaps the antenna is not quite pulling it off?
It is the antenna for the module and it is mounted on the roof of the car so if it's not working right then I'm not sure why.

I think I will try another brand module and see how that goes.

Re: GPS and TunerStudio with a Pi Dash

Posted: Thu Jul 27, 2017 4:11 pm
by VLC-05L
VLC-05L wrote:
LT401Vette wrote:Probably not, perhaps the antenna is not quite pulling it off?
It is the antenna for the module and it is mounted on the roof of the car so if it's not working right then I'm not sure why.

I think I will try another brand module and see how that goes.
Thanks for your help so far.

I just checked the module instructions and the way the light is blinking actually indicates it has a fix!

So I'm again unsure what to check... Is there a log file I can take or find to post that might help?

Re: GPS and TunerStudio with a Pi Dash

Posted: Sun Jul 30, 2017 9:36 pm
by VLC-05L
I don't know a whole lot about Linux, part of the reason I got the Pi, was to learn a bit. I know that permissions are something to keep in mind. Could it be that I have not given permission for Tuner Studio to access the port that the GPS is connected to? Do I need to be running TS as an administrator or something like that?

Re: GPS and TunerStudio with a Pi Dash

Posted: Mon Aug 07, 2017 6:19 am
by LT401Vette
Doesn't seem like it if it is working sometimes, then you must have permissions for the serial port.

Re: GPS and TunerStudio with a Pi Dash

Posted: Sun Jan 26, 2020 2:07 am
by Av8shunmeckaneck
:Bump:

Any update on this?

Re: GPS and TunerStudio with a Pi Dash

Posted: Mon Jul 13, 2020 5:31 pm
by Turbo6inKY
I'm attempting the same thing with the Adafruit module.

I have TunerStudio set up, it sees the module. I even managed to figure out how to command the module to only send the $GPGGA and $GPRMC (suppressed all other output), and I got it up to 115200 with 10Hz updates. I can verify all of this via a terminal:

$GPRMC,210630.100,A,3811.3158,N,08546.2441,W,0.21,8.77,130720,,,A*7F
$GPGGA,210630.200,3811.3158,N,08546.2441,W,1,07,1.07,169.4,M,-33.2,M,,*56
$GPRMC,210630.200,A,3811.3158,N,08546.2441,W,0.21,9.18,130720,,,A*74
$GPGGA,210630.300,3811.3158,N,08546.2441,W,1,07,1.07,169.4,M,-33.2,M,,*57
$GPRMC,210630.300,A,3811.3158,N,08546.2441,W,0.21,9.56,130720,,,A*7F
$GPGGA,210630.400,3811.3158,N,08546.2441,W,1,07,1.07,169.4,M,-33.2,M,,*50
$GPRMC,210630.400,A,3811.3158,N,08546.2441,W,0.21,9.88,130720,,,A*7B
$GPGGA,210630.500,3811.3158,N,08546.2441,W,1,07,1.07,169.4,M,-33.2,M,,*51
$GPRMC,210630.500,A,3811.3158,N,08546.2441,W,0.20,10.08,130720,,,A*4B
$GPGGA,210630.600,3811.3158,N,08546.2441,W,1,07,1.07,169.4,M,-33.2,M,,*52

Just to get this information out there, if you're running Linux/Unix and have the module attached, the commands you can send to it to raise the update rate are:

Set the baud rate on your serial port (replace ttyUSB0 with whatever port your dongle's on):
stty -F /dev/ttyUSB0 9600
Send command to raise baud rate to 115200
printf "\$PMTK251,115200*1F\r\n" > /dev/ttyUSB0
Raise the baud rate for the port on the OS device:
stty -F /dev/ttyUSB0 115200
Now, set the update rate
printf "\$PMTK220,100*2F\r\n" > /dev/ttyUSB0

You need to use printf instead of echo because of the \r\n, the module expects a carriage return and a linefeed at the end of the command, or it won't recognize it, and it's hard to get echo to do that. Printf does it nicely.

The command to suppress all data fields except GPRMC and GPGGA:

printf "\$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" > /dev/ttyUSB0

So that's how to set up the module to do what TunerStudio is expecting it to do. And for me, TunerStudio is showing GPS Active and GPS updating, but I have no GPS related fields available to me in the logger.

There's no debugging information in the TunerStudio app log beyond it showing the GPS module detected and GPS functions going online.

7/13/20 5:05:01 PM :Info: Initializing GPS.
7/13/20 5:05:02 PM :Info: Read file mainController.ini: 553.58417ms
7/13/20 5:05:02 PM :Warning: No values set for GPS setting: 2nd Com Port
7/13/20 5:05:02 PM :Info: Initializing GPS Interface: RS232 Serial Interface
7/13/20 5:05:02 PM :Debug: GPS started
7/13/20 5:05:02 PM :Info: Ready

Re: GPS and TunerStudio with a Pi Dash

Posted: Wed Jul 15, 2020 5:23 pm
by Turbo6inKY
Ok, so I finally have a solution:

Downgrade.

I've been using TunerStudio 3.1.03.

I found a copy of 3.0.28 and tried that. Boom. GPS works perfectly.

So there's a problem with GPS in 3.1.