×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

How to use smartphone GPS with INDI-GPSD

  • Posts: 1309
  • Thank you received: 226
I've been using my phone as a GPS source for my raspberry pi. It's not particularly difficult, but to use it to synchronize the clock requires additional work and scripting.
But just as a GPSD source, first install an app on your phone such as 'Share GPS' (Android). And configure it to send NMEA data as a TCP/IP host server. In Share GPS, in the connections pane, tap what you've configured to set it to listening. Connect to WiFi and determine your phone's IP on the network.

On your system side modify the GPSD configuration file /etc/default/gpsd
# Default settings for the gpsd init script and the hotplug wrapper.
 
# Start the gpsd daemon automatically at boot time
START_DAEMON="true"
 
# Use USB hotplugging to add new USB devices automatically to the daemon
USBAUTO="false"
 
# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
# Device IP and Port below
DEVICES="tcp://**.**.*.***:20175"
 
# Other options you want to pass to gpsd
GPSD_OPTIONS="-b -n"

To test open the terminal and enter
cgps -s
or
xgps
Install those with GPSD if necessary.
The following user(s) said Thank You: Jasem Mutlaq, Radek Kaczorek, T-Studio, Stephen, Tarun, Rani Ahmad
Last edit: 6 years 5 months ago by Andrew.
6 years 6 months ago #19272

Please Log in or Create an account to join the conversation.

  • Posts: 333
  • Thank you received: 24
Your steps worked great on the iPhone and my RPI3:



1. sudo apt-get install gpsd gpsd-clients
2. sudo nano /lib/systemd/system/gpsd.service

replace the ExecStart with: ExecStart=/usr/sbin/gpsd -N -b -n tcp://X.X.X.XX:XXXXXX
where x.x.x.x = the iPhone's IP address on the same wifi as RPI3
and XXXXX = the port assigned to the gps service.

3. sudo systemctl daemon-reload
4. sudo reboot
5. once on RPI3 again: systemctl status gpsd.service

Confirm running cgps -s

5. add the GPSD driver to the Auxiliary in INDI

6. On the iPhone this app worked for me: itunes.apple.com/us/app/nmea-gps/id590868529?mt=8

If you find a better app on the iPhone let me know.

Cheers!
The following user(s) said Thank You: T-Studio
6 years 6 months ago #19278

Please Log in or Create an account to join the conversation.

  • Posts: 447
  • Thank you received: 30
Thank you for your reply.
The script I used was posted on the following site.

spench.net/drupal/software/iphone-gps


I will also try the application you taught.
6 years 6 months ago #19285

Please Log in or Create an account to join the conversation.

  • Posts: 447
  • Thank you received: 30
Thank you for your reply.
The script I used was posted on the following site.

spench.net/drupal/software/iphone-gps

I will also try the application you taught.
6 years 6 months ago #19286

Please Log in or Create an account to join the conversation.

  • Posts: 333
  • Thank you received: 24
I tried the script. Although I could get the the page served, it would not find my iPhone. This is why I used the iOS app instead of the script.

Just curious, does the script work for you?


Sent from my iPhone using Tapatalk Pro
6 years 6 months ago #19298

Please Log in or Create an account to join the conversation.

  • Posts: 447
  • Thank you received: 30
Thank you for your reply.
Apparently it seems that virtual sockets such as /dev/tty/pts/1 can not be handled except GPSMON.
gpsmon /tty/pts/1
6 years 6 months ago #19303

Please Log in or Create an account to join the conversation.

  • Posts: 447
  • Thank you received: 30
It is displayed in GPSMON with the above setting.
6 years 6 months ago #19304

Please Log in or Create an account to join the conversation.

  • Posts: 447
  • Thank you received: 30
I tried the presented app.

I was checking the wireless LAN function of RaspberryPi 3, but in my environment I used RaspberryPi 3 with wireless AP, so each application, RaspberryPi 3 was recognized as a server and could not communicate.
In order to eliminate the reason why the application did not work, it seems necessary to set the wireless LAN of RaspberryPi 3 to client mode.
6 years 6 months ago #19305

Please Log in or Create an account to join the conversation.

  • Posts: 281
  • Thank you received: 29
Dear Ilhoujin,

Thanks for sharing the instructions, it is working as described!

Now what I am wondering, the moment I can see the gps coordinates in Ekos, is there anything else to be done in KStars? I checked what is maintained in KStars for my location, and it deviates (see screenshot). Maybe it does not matter?

Best, Helge
6 years 6 months ago #19595
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 1309
  • Thank you received: 226
KStars does not call upon a GPSD to set the geographic location. According to Jasem this is because it would be difficult to implement cross platform.
Something I asked about a while ago Here .

What you can do with GPSD is use it with the mount module, which I believe will improve pointing. And on an entirely separate use outside of KStars, it is possible to set the system clock with it, which is what I use it for because Raspberry Pi will not keep time when not powered.
6 years 6 months ago #19597

Please Log in or Create an account to join the conversation.

  • Posts: 333
  • Thank you received: 24
You can set Kstars to update the device with time and location. Still testing whether the GPS can be used to update the mount and then the mount is used to update KStars.
6 years 6 months ago #19598

Please Log in or Create an account to join the conversation.

  • Posts: 2876
  • Thank you received: 809
Thank you maudy, your instructions worked as described!
6 years 5 months ago #20388

Please Log in or Create an account to join the conversation.

Time to create page: 2.069 seconds