×
INDI Library v1.8.6 Released (21 Aug 2020)

August 2020 release of INDI Library v1.8.6 introduces new drivers while providing fixes and improvements to existing devices and core framework.

How to use smartphone GPS with INDI-GPSD

3 years 6 days ago
rlancaste
Supernova Explorer
Supernova Explorer
Posts: 2360
Karma: 22
More
How to use smartphone GPS with INDI-GPSD #20393
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!

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

3 years 6 days ago
maudy
Gold Boarder
Gold Boarder
Posts: 353
Karma: 2
More
How to use smartphone GPS with INDI-GPSD #20394
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!

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

3 years 6 days ago
rlancaste
Supernova Explorer
Supernova Explorer
Posts: 2360
Karma: 22
More
How to use smartphone GPS with INDI-GPSD #20395
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

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

3 years 6 days ago
T-Studio
Gold Boarder
Gold Boarder
Posts: 364
Karma: 1
More
Topic Author
How to use smartphone GPS with INDI-GPSD #20396
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).

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

3 years 6 days ago
T-Studio
Gold Boarder
Gold Boarder
Posts: 364
Karma: 1
More
Topic Author
How to use smartphone GPS with INDI-GPSD #20397
Since INDI has the Skysafari driver, it may be the smartest if the driver can read the GPS information of iPhone.

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

3 years 6 days ago
knro
Administrator
Administrator
Posts: 8461
Karma: 51
How to use smartphone GPS with INDI-GPSD #20399
But then it will be IPhone only. We need to have a solution that meets the following criteria:
1. Works on Android & iOS (and possibly others).
2. Requires no user intervention to specify IP address of any kind, nor any extra configurations to be done manually.

So if someone has something that meets the criteria above, be my guest!

Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info

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

3 years 6 days ago
T-Studio
Gold Boarder
Gold Boarder
Posts: 364
Karma: 1
More
Topic Author
How to use smartphone GPS with INDI-GPSD #20400
Jasem
Always thank you for your support.
I can not check it because I do not have a mount now, but latitude, lightness, time read from Skysafari seems to be loaded in Kstars.
(Only the time of the system has not been changed)
Is this information sent to the hand controller of the mount too?

If that can be realized the solution is already completed.

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

3 years 6 days ago
knro
Administrator
Administrator
Posts: 8461
Karma: 51
How to use smartphone GPS with INDI-GPSD #20401
Yeah but that depends on SkySafari, we need something that works for all.

Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info

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

3 years 6 days ago
T-Studio
Gold Boarder
Gold Boarder
Posts: 364
Karma: 1
More
Topic Author
How to use smartphone GPS with INDI-GPSD #20402
It seems easy, but it seems difficult.
The GPS application of iPhone and Android becomes a serial server and sends information, so if RaspberryPi 's WIFI is an access point it will not be connected. (It is necessary to change to client mode only when exchanging with GPS).
iPhone does not transmit / receive Bluetooth SPP, Android does not serial transfer with WIFI ad hoc.

By all means the application or driver that cleared the above conditions on the INDI smartphone is necessary.

Currently, it is a solution to install a router and connect RaspberryPi etc. as a client, but it is not easy as the number of packages increases.

Currently, if the Skysafari driver can send latitude, longitude, and time, I think that as a solution, I should advertise this feature more.

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

3 years 6 days ago
T-Studio
Gold Boarder
Gold Boarder
Posts: 364
Karma: 1
More
Topic Author
How to use smartphone GPS with INDI-GPSD #20404
spench.net/drupal/software/iphone-gps


The Python script mentioned earlier was close to meeting this requirement but in both cases it was treated as virtual serial and could not receive information other than GPSMON.

This is easiest if the GPSD driver can handle virtual serial driver like GPSMON.

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

3 years 5 days ago
rlancaste
Supernova Explorer
Supernova Explorer
Posts: 2360
Karma: 22
More
How to use smartphone GPS with INDI-GPSD #20411
yeah, I think either using the gpsd method is the way to go. We could modify the gpsd indi driver to allow starting up the gpsd server looking at the IP address and port of a NMEA server or USB port of a device and it could use the command

gpsd -b -n tcp://X.X.X.XX:XXXXXX

I also had a thought about this today. The issue I was having yesterday was that the gpsd service on my pi was preventing this command from working until I disabled it, but that is because we are using the same port. The above command also can be used with a port number and if we are already editing the INDI driver for gpsd, we could make it look at a different port (of course after checking the default port if someone is running it the traditional way). The command would look like this:

gpsd -S 1234 -b -n tcp://X.X.X.XX:XXXXXX

if 1234 is the port number for GPSD

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

3 years 4 days ago
T-Studio
Gold Boarder
Gold Boarder
Posts: 364
Karma: 1
More
Topic Author
How to use smartphone GPS with INDI-GPSD #20419
It would be nice if INDI Web Manager had the ability to get GPS information on smartphone.
If this is the case, Pi WiFi can also be used on the AP.

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

Time to create page: 0.727 seconds