×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

How to use smartphone GPS with INDI-GPSD

  • Posts: 447
  • Thank you received: 30
I am using this Python script now and I would like to use smartphone GPS with INDI.

spench.net/drupal/software/iphone-gps

That's why I have a question.
How can I change the gpsd socket with the INDI-GPSD driver?

The gpsd socket that the Python script automatically generates is a special / dev / pts / 1, so I think that you can use it if you can read the GPSD socket.

Please let me know if you know the change of the GPSD socket using the INDI - GPSD driver.

6 years 7 months ago #18981
Attachments:

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

  • Posts: 983
  • Thank you received: 375
You don't need to change anything in GPSD driver. It uses local gpsd server, which is connected to a gps receiver of your choice. Point your gpsd server to your device created by python script by editing /etc/default/gpsd - just set the proper value for DEVICES e.g. DEVICES="/dev/pts/1"
As I see in the python script, it starts its own instance of gpsd so it might be the case that you need to disable local gpsd server first, so the socket is available to python script. If this is the case GPSD driver will use gpsd instance started by python script.
The following user(s) said Thank You: T-Studio
6 years 7 months ago #19040

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

  • Posts: 447
  • Thank you received: 30
Thank you for your reply.
Changing the / etc / default / GPSD setting did not work.
/ dev / PTS / 1 seems to function as a virtual driver.

Only gpsmon could connect.
6 years 7 months ago #19133

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

  • Posts: 447
  • Thank you received: 30
Translation went wrong.
I changed the GPSD setting file as follows, but unfortunately it did not work.

/ etc / default / gpsd

START_DAEMON = "true"
USBAUTO = "false"
DEVICES = "/ dev / pts / 1"
GPSD_OPTIONS = "- n"
GPSD_SOCKET = "/ var / run / gpsd.sock"

/ dev / pts / 1 seems to be handled as a virtual device.
Only gpsmon is sudo gpsmon / dev / pts / 1
GPS reading was possible.

I would like to know if there is a way to read virtual devices even with INDI gpsd.
6 years 7 months ago #19137

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

  • Posts: 983
  • Thank you received: 375
What are the access rights to /dev/pts/1? Run ls -al /dev/pts/1 to check it out.
6 years 7 months ago #19138

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

  • Posts: 447
  • Thank you received: 30
It will be like this.
crw--w---- 1 astro tty 136, 1 9¥u6708 7 02:51 /dev/pts/1
When you run Python script, port is automatically set.
6 years 7 months ago #19141

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

  • Posts: 983
  • Thank you received: 375
With these access rights the only user that has read access rights to the device is the user "astro". Run gpsmon from this user account and check if it works OK. If it's not run chmod 644 /dev/pts/1 and try again. If it works after changing the access rights it is access rights issue. What is the port number set by python script?
6 years 7 months ago #19142

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

  • Posts: 447
  • Thank you received: 30
I reacted to the wrong place. .
Thank you for your reply.
astro is the user name I am using. I am using port number 5000. It seems that you can not connect to INDIGPSD even if you try access. (I am connected to gpsmon)
6 years 7 months ago #19183

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

  • Posts: 447
  • Thank you received: 30
chmod 644 / dev / pts / 1
The setting has been changed.
6 years 7 months ago #19184

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

  • Posts: 983
  • Thank you received: 375
Standard gpsd port is 2947 and standard gpsd socket is /var/run/gpsd.sock
If you're using anything else the driver won't work. It expects standard gpsd service available on the system. If you're emulating gpsd service from the python script make sure it mimics original gpsd values.

PS. I would rather aim at using /dev/pts /1 port to setup gpsd than emulating gpsd service. These are two different approaches. You need to try both of them anyway
Last edit: 6 years 7 months ago by Radek Kaczorek.
6 years 7 months ago #19187

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

  • Posts: 447
  • Thank you received: 30
Thank you for your reply.
/ etc / default / gpsd
I also changed the configuration file, but unfortunately it does not seem to work.
START_DAEMON = "true"
GPSD_OPTION = "- n"
DEVICES = "/dev/tty/pts/1"
USBAUTO = "true"
GPSD_SOCKET = "/var/run /gpsd.sock"
Apparently it seems that virtual sockets such as /dev/tty/pts/1 can not be handled except GPSMON.
6 years 7 months ago #19209

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

  • 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 6 months ago by Andrew.
6 years 7 months ago #19272

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

Time to create page: 0.338 seconds