Calling all Raspberry Pi Aficionados

sallylillian

LIFE MEMBER
Oct 29, 2011
2,522
1,527
Falmouth, Cornwall
Funster No
18,670
MH
Morelo Palace Liner 88LB
Exp
2011
I want to make up a Raspberry PI with the Ultimate GPS HAT, connect that to an external antenna and Bluetooth position data to a couple of tablets.
I have bought a few parts:-
GPS SMA Antenna 3-5V 28dB 5m (External, Active)
Adafruit Ultimate GPS HAT Mini Kit
Pi GPS Case (Clear) MMP-0093
Compact Chiclet Wireless Keyboard & Optical Mouse
Raspberry Pi 3 - Model B+
16GB Micro SD - SanDisk Class 10 Pre-Loaded with NOOBS
This is my first play with Raspberry but I am now reading that to distribute the position data over bluetooth maybe a problem?
Has anyone made up a box for this task and if so may I ask for some guidance?
Thanks
Michael
 
Mar 23, 2012
3,228
6,368
sleights
Funster No
20,245
MH
c class
Exp
1
I have two spare pi's plus bits if anyone wants them free ( I have a charity you can donate to lf you like its Papyrus not my beer fund!!!!!!)
 
Aug 2, 2016
2,038
1,843
Fife
Funster No
44,376
Exp
Start of 2016
Dammit ....... thought someone was posting a recipe about a new dessert they’d made .....:(
 

DBK

Jan 9, 2013
13,477
21,514
Plympton, Devon
Funster No
24,219
MH
PVC, Murvi Morocco
Exp
2013
I've always found Bluetooth troublesome on any device! On the Pi it took me the best part of an hour to get it to connect to a Bluetooth keyboard. :)

So sorry, can't help. :(
 
OP
sallylillian

sallylillian

LIFE MEMBER
Oct 29, 2011
2,522
1,527
Falmouth, Cornwall
Funster No
18,670
MH
Morelo Palace Liner 88LB
Exp
2011
I've always found Bluetooth troublesome on any device! On the Pi it took me the best part of an hour to get it to connect to a Bluetooth keyboard. :)

So sorry, can't help. :(
I bought a 3 B+ which has an onboard Broadcom module, so I am hoping that I can get this to work.
 

DuxDeluxe

LIFE MEMBER
Jul 10, 2008
11,167
29,871
Planet Zog
Funster No
3,243
MH
A Class Le Voyageur
Exp
since 2008
I want to make up a Raspberry PI with the Ultimate GPS HAT, connect that to an external antenna and Bluetooth position data to a couple of tablets.
I have bought a few parts:-
GPS SMA Antenna 3-5V 28dB 5m (External, Active)
Adafruit Ultimate GPS HAT Mini Kit
Pi GPS Case (Clear) MMP-0093
Compact Chiclet Wireless Keyboard & Optical Mouse
Raspberry Pi 3 - Model B+
16GB Micro SD - SanDisk Class 10 Pre-Loaded with NOOBS
This is my first play with Raspberry but I am now reading that to distribute the position data over bluetooth maybe a problem?
Has anyone made up a box for this task and if so may I ask for some guidance?
Thanks
Michael
Geek heaven. My son has about 5 of them and does all sort of weird stuff...... I need lessons in switching on his TV every time I visit.
 

Gromett

Funster
Feb 27, 2011
9,705
23,265
UK
Funster No
15,452
MH
Self Build
Exp
Since 2005
Thanks for your confidence. However, not done anything with a raspberry pi.. My dev boards got nicked by my nephews before I got chance to play.
So I went out and bought a load of arduino stuff which I don't think they were so keen on :p
 
Sep 17, 2017
711
1,045
Birmingham, UK
Funster No
50,575
MH
Van conversion
Exp
2017
What software is running on the tablets that needs GPS? Does that software have the ability to get position from an external device?

Once upon a time there were bluetooth GPS devices that transmitted their NMEA GPS data is if it was a serial connection. You might be able to get the Pi to emulate one of those... by that'd only be useful if your tablets are expecting to connect to a bluetooth GPS module.
 

pappajohn

LIFE MEMBER
Aug 26, 2007
36,337
24,696
Dark side of the moon
Funster No
172
Exp
Since 2005
My nephew bought me a Pi 3+ and some other stuff to add to it a couple of years ago.
He drew a line at buying me a monitor/TV with HDMI connectivity so it's all still sat in its box.

But then.... I don't make bread, I buy it ready made.
I don't make clothes, I buy them ready made.
I don't make computers, I buy them ready made.
 
OP
sallylillian

sallylillian

LIFE MEMBER
Oct 29, 2011
2,522
1,527
Falmouth, Cornwall
Funster No
18,670
MH
Morelo Palace Liner 88LB
Exp
2011
What software is running on the tablets that needs GPS? Does that software have the ability to get position from an external device?

Once upon a time there were bluetooth GPS devices that transmitted their NMEA GPS data is if it was a serial connection. You might be able to get the Pi to emulate one of those... by that'd only be useful if your tablets are expecting to connect to a bluetooth GPS module.
OK, what I want to achieve, but first some background. I currently run 2 10inch Android tablets in the van. One is mounted on a brodit mount for driver navigation the other is my wife's normal tablet which she uses for duplicate nav. We run CoPilot Truck and Sygic Truck on these, using the app BluetoothGPS to connect to a Garmin Glo GPS. The Glo gives us accuracy of circa 4 ft. It is internal antenna only operated so needs window sight. The accuracy has resolved the issues of in-tablet GPS where it will assume we are on the roundabout over the motorway for a simple example.
I searched for a tri-ceiver (GPS Glonass Galileo) unit that also had an external antenna connection. The reason is that as I am putting new antenna up on the Morelo roof I will include an external GPS puck too. And there is the rub, I cannot find a tri-ceiver GPS with an external antenna connection. However the Raspberry GPS hat is such a beast so if I can get that working I can stuff it behind a cupboard and connect it to a roof puck and bluetooth stunningly accurate position data to my tablets. So in principle the Raspberry will do the job but I have never played with one before so my enquiry here was to shortcut any issues with the idea before I spend hours reinventing the wheel to find it has 30 spokes missing!
 
Reactions: DBK
Sep 17, 2017
711
1,045
Birmingham, UK
Funster No
50,575
MH
Van conversion
Exp
2017
All the Bluetooth GPS receivers do is emulate a wired serial connection and send GPS data over that serial link. It looks like that GPS Hat provides data over a real UART serial connection, which is convenient. That's most of the hard bit.

What you need to find out is if you can get the Pi to pretend to be a Bluetooth client device and then pipe the data down it. Still not trivial and there are probably some gotchas on the way.

... But first I'd spend a couple of hours trying to find someone else on the internet that has already done it, or something very similar...
 
OP
sallylillian

sallylillian

LIFE MEMBER
Oct 29, 2011
2,522
1,527
Falmouth, Cornwall
Funster No
18,670
MH
Morelo Palace Liner 88LB
Exp
2011
All the Bluetooth GPS receivers do is emulate a wired serial connection and send GPS data over that serial link. It looks like that GPS Hat provides data over a real UART serial connection, which is convenient. That's most of the hard bit.

What you need to find out is if you can get the Pi to pretend to be a Bluetooth client device and then pipe the data down it. Still not trivial and there are probably some gotchas on the way.

... But first I'd spend a couple of hours trying to find someone else on the internet that has already done it, or something very similar...
Thanks sort of where I was at with post 1. Searching for someone who has done just that is not so easy as their solutions may be just what I need but the description defies searching algorithms. But I will press on, unless I find a commercially available tri-ceiver with external antenna and bluetooth. What I want is a Garmin Glo with an external antenna connection. I have always meant to play with Raspberry and if I get this to work its an interesting solution for a few other things too. Please let me have any other thoughts or solutions.
 

Gromett

Funster
Feb 27, 2011
9,705
23,265
UK
Funster No
15,452
MH
Self Build
Exp
Since 2005
My guess is that getting the bluetooth to work won't be the hard bit.
The hard bit will be persuading the application to use your remote GPS device rather than the local android location services... Not sure if that is possible.
It may be possible to persuade android to use a remote GPS device (via bluetooth). rather than the inbuilt one???

Interesting project and I would interested to hear your progress.
 
OP
sallylillian

sallylillian

LIFE MEMBER
Oct 29, 2011
2,522
1,527
Falmouth, Cornwall
Funster No
18,670
MH
Morelo Palace Liner 88LB
Exp
2011
My guess is that getting the bluetooth to work won't be the hard bit.
The hard bit will be persuading the application to use your remote GPS device rather than the local android location services... Not sure if that is possible.
It may be possible to persuade android to use a remote GPS device (via bluetooth). rather than the inbuilt one???

Interesting project and I would interested to hear your progress.
Getting the Android tab to use an external GPS is easy, I do it now. There are several apps but I use Bluetooth GPS. Set Android to use Mock GPS provider which forces external GPS selection , which you can now do from the app, and it transfers immediately. In the app you can select the BT GPS provider and I use that to switch between GPS units and then look at sats being received and accuracy. So the only issue will be can I get the NMEA data spewing forth from the Raspberry bluetooth?
This may be the key?
https://learn.adafruit.com/adafruit-ultimate-gps-hat-for-raspberry-pi/use-gpsd
 
Jun 18, 2013
208
161
Stisted
Funster No
26,553
MH
Rapido 666F
Exp
Since 2015
I don't know much about Bluetooth really but, if you are interested in that level of accuracy, it would be worth trying to estimate and later measure the overall latency of the system. If you are travelling at 100kph, for example, that's 28 metres/second or 2.8 cm per millisecond, so your accuracy of 4' (120 cm) will be completely gobbled up in just over 40 milliseconds. Other speeds are available!

I expect the BT link would be the main factor contributing to the system delay, though again I don't really know. I suppose if you are currently using a BT system, you are already suffering from that delay and the only extra would be processing delays in the Pi, which should be minimal.
 
OP
sallylillian

sallylillian

LIFE MEMBER
Oct 29, 2011
2,522
1,527
Falmouth, Cornwall
Funster No
18,670
MH
Morelo Palace Liner 88LB
Exp
2011
I don't know much about Bluetooth really but, if you are interested in that level of accuracy, it would be worth trying to estimate and later measure the overall latency of the system. If you are travelling at 100kph, for example, that's 28 metres/second or 2.8 cm per millisecond, so your accuracy of 4' (120 cm) will be completely gobbled up in just over 40 milliseconds. Other speeds are available!

I expect the BT link would be the main factor contributing to the system delay, though again I don't really know. I suppose if you are currently using a BT system, you are already suffering from that delay and the only extra would be processing delays in the Pi, which should be minimal.
The accuracy is about the satalite reception and the geometry of triangulation. In early days there was dgps which was a fixed position receiving GPS and calculating the error which it retransmited and your receiver corrected itself with the known error. Now with better chips and more constellations there is the ability to see up to 66 satalites and the accuracy tighter. Speed accuracies up to 1000mph. All highly uneccessary for us, however if you are on some wierd Italian junction in combat with multiple kamikaze Italians having precision dictation of the next turn is let's say less stressful, and my preference.
 
Jun 18, 2013
208
161
Stisted
Funster No
26,553
MH
Rapido 666F
Exp
Since 2015
The accuracy is about the satalite reception and the geometry of triangulation. In early days there was dgps which was a fixed position receiving GPS and calculating the error which it retransmited and your receiver corrected itself with the known error. Now with better chips and more constellations there is the ability to see up to 66 satalites and the accuracy tighter. Speed accuracies up to 1000mph. All highly uneccessary for us, however if you are on some wierd Italian junction in combat with multiple kamikaze Italians having precision dictation of the next turn is let's say less stressful, and my preference.
The point I was making was that if you add any further delay to the data, such as passing it through a computer and a BT link, the delay will be seen as a positional lag if you are moving. The position as displayed will be where you were not where you are. If you do the sums, 4 feet disappears in the blink of an eye (or even more quickly!) at 60mph. I agree one shouldn't need an accuracy of 4 feet but that was what you quoted in an earlier post as the accuracy of the present arrangement (maybe that was static accuracy though?), so I thought that was what you wanted to achieve with a revised version.

I realise GPS itself comes with an accuracy and each message has a time stamp. Funnily enough, I did some work on a dGPS type of system about 10 years ago with a colleague. That was aimed at offshore survey ships which were close enough to use a fixed shore base station as a reference. We used a Trimble GPS unit for that, with a single board computer, a pair of dedicated modems and some custom RF stuff. My colleague was the RF expert - now there's a black art! We achieved an accuracy of about 15cm in its only proper trial, according to our French partner (the GPS expert), but we didn't get the opportunity to develop it further. They ditched us for a Spanish company, but I'm not bitter!

Maybe Trimble do a GPS unit you could roof mount?
 

DBK

Jan 9, 2013
13,477
21,514
Plympton, Devon
Funster No
24,219
MH
PVC, Murvi Morocco
Exp
2013
This thread has spurred me on to try a GPS module with my Raspberry Pi. :) Amazon should deliver the module tomorrow so I will see if I can get it working. :) What I might try for first is to link it to a Pi Zero and using a battery pack make a lightweight GPS logger which will record a track when I go for a walk to display on say Google Earth later. I can already do that with my Satmap GPS of course but that's no fun! :)
 
OP
sallylillian

sallylillian

LIFE MEMBER
Oct 29, 2011
2,522
1,527
Falmouth, Cornwall
Funster No
18,670
MH
Morelo Palace Liner 88LB
Exp
2011
This thread has spurred me on to try a GPS module with my Raspberry Pi. :) Amazon should deliver the module tomorrow so I will see if I can get it working. :) What I might try for first is to link it to a Pi Zero and using a battery pack make a lightweight GPS logger which will record a track when I go for a walk to display on say Google Earth later. I can already do that with my Satmap GPS of course but that's no fun! :)
Interesting, I can get mine working and see the NMEA streams through GPSD with cgps s. I can pair my tablet with the Raspberry over Bluetooth, what I cannot achieve is getting the serial data available on bluetooth for the tablet. So I have put it way for the moment and if you get a solution please chime in.
 

DBK

Jan 9, 2013
13,477
21,514
Plympton, Devon
Funster No
24,219
MH
PVC, Murvi Morocco
Exp
2013
Interesting, I can get mine working and see the NMEA streams through GPSD with cgps s. I can pair my tablet with the Raspberry over Bluetooth, what I cannot achieve is getting the serial data available on bluetooth for the tablet. So I have put it way for the moment and if you get a solution please chime in.
If I can get mine working I'll have a play with the Bluetooth GPS app you mention. :)
 

DBK

Jan 9, 2013
13,477
21,514
Plympton, Devon
Funster No
24,219
MH
PVC, Murvi Morocco
Exp
2013
I've managed to get a basic GPS working using a Raspberry Pi Zero and a £10 Neo-6M GPS module. The wiring arrangement below is just temporary for testing.

DSC_0131.JPG

Even looking out of a house window it manages to get a reasonable fix and found 8 satellites.

Screenshot2.jpg

Sadly, that's as far as I've managed to get. :( I'm struggling to get the Pi to pair with my phone, it connects then disconnects a few seconds later. The error message is "No usable services on this device" The Bluetooth is working on the Pi as I can pair it with a Bluetooth keyboard. It's also working on the phone as I connect it to the car radio and some Bluetooth headphones.

I've had a bit of a play with the GPS Bluetooth app and reinstalled Co-pilot on my phone but so far everything seems to fail.
 
OP
sallylillian

sallylillian

LIFE MEMBER
Oct 29, 2011
2,522
1,527
Falmouth, Cornwall
Funster No
18,670
MH
Morelo Palace Liner 88LB
Exp
2011
I've managed to get a basic GPS working using a Raspberry Pi Zero and a £10 Neo-6M GPS module. The wiring arrangement below is just temporary for testing.

View attachment 284934

Even looking out of a house window it manages to get a reasonable fix and found 8 satellites.

View attachment 284937

Sadly, that's as far as I've managed to get. :( I'm struggling to get the Pi to pair with my phone, it connects then disconnects a few seconds later. The error message is "No usable services on this device" The Bluetooth is working on the Pi as I can pair it with a Bluetooth keyboard. It's also working on the phone as I connect it to the car radio and some Bluetooth headphones.

I've had a bit of a play with the GPS Bluetooth app and reinstalled Co-pilot on my phone but so far everything seems to fail.
Well done got to base camp! Achieved all that too, the problem as I see it is that the serial data is not being served up by the Bluetooth RFcomm I think this page explains how. I had taken a break before I read this. https://raspberry-projects.com/pi/pi-operating-systems/raspbian/bluetooth/serial-over-bluetooth. I now have to get the spare monitor back out!
 

DBK

Jan 9, 2013
13,477
21,514
Plympton, Devon
Funster No
24,219
MH
PVC, Murvi Morocco
Exp
2013

DBK

Jan 9, 2013
13,477
21,514
Plympton, Devon
Funster No
24,219
MH
PVC, Murvi Morocco
Exp
2013
I've been struggling on my project to make a GPS logger. :) The rig in the image above worked perfectly until I shortened the wires and put the GPS module inside the pi zero case. I then found it was very reluctant to get an accurate fix and sometimes wouldn't get a fix at all. Thinking I'd damaged the module with my heavy handed soldering I bought another one - they only cost £10 so no great hardship but when I fitted the replacement it did exactly the same!

A few days of headscratching and experimentation found the cause - RF interference. The GPS module was resting on top of the pi zero board and in particular the CPU with only a bit cut from the anti-static bag the module came in as insulation between them.

I wrapped the module in a layer of cling film then added a layer of aluminium foil and bingo - accuracy back to within a few metres.

I don't think you will have this problem with your hardware as the HAT will be spaced above the CPU by a centimetre or so but it is worth bearing it in mind if accuracy isn't what you expect.
 
OP
sallylillian

sallylillian

LIFE MEMBER
Oct 29, 2011
2,522
1,527
Falmouth, Cornwall
Funster No
18,670
MH
Morelo Palace Liner 88LB
Exp
2011
Fortunately all my experiments have been done with Hat in position due to its connectivity and position data seems good, although frankly my focus was on the issues of the serial data management which has an additional problem on the pi3 which I eventually found in some obscure blog. Anyway my monitor is boxed up for the new van and I will need to find another.
 
SMC Motorhomes Newark
RoadPro
Johns Cross
Safeguard Motorhome Insurance
Rhino Installs
Friendly professional service from qualified technicians
Free Club Stickers
Dave Newell Leisure Vehicle Services
Top