×

INDI Library v1.9.0 Released (23 Apr 2021)

Major INDI Library release v1.9.0 bring significant internal changes championed by @pawel-soja to modernize core INDI Library drivers and clients. New drivers for DeepSkyDad Flat Panel & Pegasus devices plus further improvements to PCM8 drivers.

How to use smartphone GPS with INDI-GPSD

  • Posts: 1112
  • Thank you received: 194
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.
INDI/KStars on Raspberry Pi 4, 4gb
Raspbian Buster with AstroPi3 script configuration
Skywatcher HEQ5 Pro Mount
Canon 600D Camera
Orion SSAG/ASI120mm @280mm Guide Scope
PHD2
Waveshare Stepper Motor Board - DIY Focuser
Adafruit GPS Module
Generic Bluetooth Joystick.
Startech 7 port powered USB Hub.
The following user(s) said Thank You: Jasem Mutlaq, Radek Kaczorek, Takito Nagai, Stephen, Tarun, Rani Ahmad
Last edit: 3 years 7 months ago by Andrew.
3 years 9 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: Takito Nagai
3 years 9 months ago #19278

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

  • Posts: 340
  • Thank you received: 25
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.
3 years 9 months ago #19285

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

  • Posts: 340
  • Thank you received: 25
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.
3 years 9 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
3 years 9 months ago #19298

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

  • Posts: 340
  • Thank you received: 25
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
3 years 9 months ago #19303

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

  • Posts: 340
  • Thank you received: 25
It is displayed in GPSMON with the above setting.
3 years 9 months ago #19304

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

  • Posts: 340
  • Thank you received: 25
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.
3 years 9 months ago #19305

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

  • Posts: 278
  • 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
3 years 8 months ago #19595
Attachments:

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

  • Posts: 1112
  • Thank you received: 194
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.
INDI/KStars on Raspberry Pi 4, 4gb
Raspbian Buster with AstroPi3 script configuration
Skywatcher HEQ5 Pro Mount
Canon 600D Camera
Orion SSAG/ASI120mm @280mm Guide Scope
PHD2
Waveshare Stepper Motor Board - DIY Focuser
Adafruit GPS Module
Generic Bluetooth Joystick.
Startech 7 port powered USB Hub.
3 years 8 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.
3 years 8 months ago #19598

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

  • Posts: 2475
  • Thank you received: 667
Thank you maudy, your instructions worked as described!
3 years 7 months ago #20388

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

Time to create page: 0.940 seconds