GPS and TunerStudio with a Pi Dash

For discussion of Phil Tobin's Tuner Studio software (Only about the tuning software itself, not about how to tune or firmware features)

Moderator: LT401Vette

Post Reply
VLC-05L
Experienced MS/Extra'er
Posts: 208
Joined: Wed Jan 21, 2015 3:11 am
Location: Australia

GPS and TunerStudio with a Pi Dash

Post 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.
CB70 12V 3cyl 993cc Daihatsu | MS2X Sequential Fuel and Spark | Flex Fuel Launch Control | Raspberry Pi Dash
LT401Vette
Super MS/Extra'er
Posts: 12697
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: GPS and TunerStudio with a Pi Dash

Post 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
Phil Tobin
EFI Analytics, helping to simplify EFI
Next Generation tuning software.
Supporting all MegaSquirt versions and firmwares.
http://www.TunerStudio.com
http://www.efiAnalytics.com/MegaLogViewer/
Support the firmware running your engine:
http://www.msextra.com/doc/donations.html
VLC-05L
Experienced MS/Extra'er
Posts: 208
Joined: Wed Jan 21, 2015 3:11 am
Location: Australia

Re: GPS and TunerStudio with a Pi Dash

Post 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.*
CB70 12V 3cyl 993cc Daihatsu | MS2X Sequential Fuel and Spark | Flex Fuel Launch Control | Raspberry Pi Dash
LT401Vette
Super MS/Extra'er
Posts: 12697
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: GPS and TunerStudio with a Pi Dash

Post 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.
Phil Tobin
EFI Analytics, helping to simplify EFI
Next Generation tuning software.
Supporting all MegaSquirt versions and firmwares.
http://www.TunerStudio.com
http://www.efiAnalytics.com/MegaLogViewer/
Support the firmware running your engine:
http://www.msextra.com/doc/donations.html
VLC-05L
Experienced MS/Extra'er
Posts: 208
Joined: Wed Jan 21, 2015 3:11 am
Location: Australia

Re: GPS and TunerStudio with a Pi Dash

Post 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.
CB70 12V 3cyl 993cc Daihatsu | MS2X Sequential Fuel and Spark | Flex Fuel Launch Control | Raspberry Pi Dash
VLC-05L
Experienced MS/Extra'er
Posts: 208
Joined: Wed Jan 21, 2015 3:11 am
Location: Australia

Re: GPS and TunerStudio with a Pi Dash

Post by VLC-05L »

Here is a link to a video I took of the mini-terminal.

https://youtu.be/wi32vC0V3HQ
CB70 12V 3cyl 993cc Daihatsu | MS2X Sequential Fuel and Spark | Flex Fuel Launch Control | Raspberry Pi Dash
LT401Vette
Super MS/Extra'er
Posts: 12697
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: GPS and TunerStudio with a Pi Dash

Post by LT401Vette »

It looks like it is putting out the messages needed.
Is it dropping fix?
Phil Tobin
EFI Analytics, helping to simplify EFI
Next Generation tuning software.
Supporting all MegaSquirt versions and firmwares.
http://www.TunerStudio.com
http://www.efiAnalytics.com/MegaLogViewer/
Support the firmware running your engine:
http://www.msextra.com/doc/donations.html
VLC-05L
Experienced MS/Extra'er
Posts: 208
Joined: Wed Jan 21, 2015 3:11 am
Location: Australia

Re: GPS and TunerStudio with a Pi Dash

Post 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.
CB70 12V 3cyl 993cc Daihatsu | MS2X Sequential Fuel and Spark | Flex Fuel Launch Control | Raspberry Pi Dash
VLC-05L
Experienced MS/Extra'er
Posts: 208
Joined: Wed Jan 21, 2015 3:11 am
Location: Australia

Re: GPS and TunerStudio with a Pi Dash

Post 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?
CB70 12V 3cyl 993cc Daihatsu | MS2X Sequential Fuel and Spark | Flex Fuel Launch Control | Raspberry Pi Dash
LT401Vette
Super MS/Extra'er
Posts: 12697
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: GPS and TunerStudio with a Pi Dash

Post by LT401Vette »

Probably not, perhaps the antenna is not quite pulling it off?
Phil Tobin
EFI Analytics, helping to simplify EFI
Next Generation tuning software.
Supporting all MegaSquirt versions and firmwares.
http://www.TunerStudio.com
http://www.efiAnalytics.com/MegaLogViewer/
Support the firmware running your engine:
http://www.msextra.com/doc/donations.html
VLC-05L
Experienced MS/Extra'er
Posts: 208
Joined: Wed Jan 21, 2015 3:11 am
Location: Australia

Re: GPS and TunerStudio with a Pi Dash

Post 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.
CB70 12V 3cyl 993cc Daihatsu | MS2X Sequential Fuel and Spark | Flex Fuel Launch Control | Raspberry Pi Dash
VLC-05L
Experienced MS/Extra'er
Posts: 208
Joined: Wed Jan 21, 2015 3:11 am
Location: Australia

Re: GPS and TunerStudio with a Pi Dash

Post 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?
CB70 12V 3cyl 993cc Daihatsu | MS2X Sequential Fuel and Spark | Flex Fuel Launch Control | Raspberry Pi Dash
VLC-05L
Experienced MS/Extra'er
Posts: 208
Joined: Wed Jan 21, 2015 3:11 am
Location: Australia

Re: GPS and TunerStudio with a Pi Dash

Post 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?
CB70 12V 3cyl 993cc Daihatsu | MS2X Sequential Fuel and Spark | Flex Fuel Launch Control | Raspberry Pi Dash
LT401Vette
Super MS/Extra'er
Posts: 12697
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: GPS and TunerStudio with a Pi Dash

Post by LT401Vette »

Doesn't seem like it if it is working sometimes, then you must have permissions for the serial port.
Phil Tobin
EFI Analytics, helping to simplify EFI
Next Generation tuning software.
Supporting all MegaSquirt versions and firmwares.
http://www.TunerStudio.com
http://www.efiAnalytics.com/MegaLogViewer/
Support the firmware running your engine:
http://www.msextra.com/doc/donations.html
Av8shunmeckaneck
MS/Extra Newbie
Posts: 23
Joined: Mon Dec 23, 2019 7:06 pm

Re: GPS and TunerStudio with a Pi Dash

Post by Av8shunmeckaneck »

:Bump:

Any update on this?
Turbo6inKY
MS/Extra Newbie
Posts: 3
Joined: Tue Jul 31, 2018 8:26 am

Re: GPS and TunerStudio with a Pi Dash

Post 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
Turbo6inKY
MS/Extra Newbie
Posts: 3
Joined: Tue Jul 31, 2018 8:26 am

Re: GPS and TunerStudio with a Pi Dash

Post 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.
Post Reply