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