×

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: 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.

  • Posts: 2876
  • Thank you received: 809
I think a number of users could benefit from this method. However, I think it would be cumbersome out in an observing field at a star party to edit /lib/systemd/system/gpsd.service every time with your iPhone's new IP address. Is there perhaps an easier way to edit this? Maybe we could modify the indi driver to do it as an option?
6 years 5 months ago #20389

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

  • Posts: 2876
  • Thank you received: 809
I thought I would look into the problem of starting the gpsd program pointing to the correct phone IP address without having to edit the configuration file every time. There doesn't seem to be a way to change the IP & Port that the gpsd program is looking at except when you start it up (unless I missed something). Also you cannot start it from the command line if you have the service running because the service automatically starts and hogs the port. So I played around with it for a bit and I found that if you disabled the service, then you could start the gpsd program from the command line using the same command maudy used without having to edit the file or even use sudo. Since this seems to work, potentially we could use this in a software program like KStars or INDI to do it programmatically.

This procedure is similar to maudy's, but requires fewer steps and I don't think the stop or daemon-reload steps I listed here are even needed either. So possibly this setup procedure is 3 steps long.

1. sudo apt-get install gpsd gpsd-clients
sudo systemctl stop gpsd.socket (might not be needed)
2. sudo systemctl disable gpsd.socket
sudo systemctl daemon-reload (might not be needed)
3. sudo shutdown -r now

Once these steps are done, anytime you start up your raspberry pi, and want to have the GPSD driver working from your iPhone to give KStars a GPS position. Just follow these steps before pressing "Start INDI" in the client KStars program.

1. Get your iPhone on the same wifi network and find out its IP address
2. Start up the program NMEAGps that maudy recommended.
3. Set it to active and get the number for the port.
4. Run this command on the Pi: /usr/sbin/gpsd -b -n tcp://X.X.X.XX:XXXXXX
And just like maudy's post:
x.x.x.x = the iPhone's IP address on the same wifi as RPI3
and XXXXX = the port assigned to the gps service.

If you want to stop gpsd, or need to change the port or IP address, you can use killall gpsd. But be warned, if KStars is connected as a client when you do this, it won't like it. I would disconnect the devices and "Stop INDI" in the client first just in case.

Let me know what you think. Thanks!
6 years 5 months ago #20393

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

  • Posts: 333
  • Thank you received: 24
Hi,
Sorry for late reply. I have been out for a while.

I agree the IP managment is not nice. I have not dog into the solution. I use a hot spot to connect my RPI3 three and iPhone. I make the hot spot the same IP as my home network.

I hope this helps.

Cheers!
6 years 5 months ago #20394

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

  • Posts: 2876
  • Thank you received: 809
Hi maudy,

No, I wouldn't call it late, since I posted just 5 hours ago. I just was thinking yesterday that it would be nice to get gps coordinates into the Pi from my phone for imaging purposes and I came upon your solution today and it worked!

So I figured I would try to adapt it to make it more user friendly. I'm not sure it is solved yet though because I think this needs to be tested more, plus I'm not sure its the best solution because disabling the gpsd server is something everyone will want to do. But it has worked several times on my system.

Basically I'm looking for a command that can be executed without needing sudo that can start up the gpsd server to whatever IP address and port you want. If we have such a command, it can be put into INDI Web Manager, in INDI, or in KStars to make it user friendly. Then a user wanting GPSD to work from their iPhone would just have to connect their phone enter their IP address and port number and click a button to enable it. We will see if its possible.
Thanks,
Rob
6 years 5 months ago #20395

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

  • Posts: 447
  • Thank you received: 30
As mentioned above, in this method, it is necessary to make wifi of RaspberryPi 3 a client.
(If it is set to the access point, it became two servers, it could not be used.)

I found Skysafari to have a similar function, so I used it. (it need to install ser2net).
6 years 5 months ago #20396

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

  • Posts: 447
  • Thank you received: 30
Since INDI has the Skysafari driver, it may be the smartest if the driver can read the GPS information of iPhone.
6 years 5 months ago #20397

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

Time to create page: 0.753 seconds