Advertisement / Annons: |
Project:
|
Contents:
Related projects:
Note: |
7: Setup GPSDAs told earlier, correct time and observatory location is important to get star positioning working correct. When having the astro equipment as a portable unit you get a new location whenever you change your location. The time is not correct either because there is no battery backup clock in the Raspberry. When on a stationary place and have access to internet there is no need for a GPS device, Astroberry will find correct time and location from internet. There are two ways to fix this, either through the GPS in the smartphone or with a GPS dongle connected to the Raspberry. He is how to setup with a GPS dongle connected to the Raspberry with the driver GPSD. This the most difficult to setup but when it works it's very useful. I have got a lot of help of my friend and from INDI forum. GPSD:There are five very important steps to get it to work:
I already have a GPS dongle and would like to use it for this purpose. Here are others instructions how to setup GPSD:
I never got this setup to work that easy, maybe my GPS dongle is too old. In Raspberry / Astroberry this is handling by the GPSD driver. |
1, Find the port that the GPS is connected to:Open the commando window, from here you can type in commands, it looks like an old DOS system. The commando windows icon is on the top list. I have collected the most common commands on a page here: Good to know commands. There is no need to have the KStars and Ekos up and running during this setup other when doing test. ![]() Give this command:
Maybe it ask for the password, it's astroberry if you didn't change anything. In the command window of Raspberry it list all tty ports. I expect the GPS dongle to show up in this list later, but it's not connected yet: I connect the USB dongle to a USB port on the HUB. It's important to always use the same port, I have set a label on the HUB to not mix the devices. ![]() I gave the same command once again:
Now a new port has appeard, the port with "/dev/ttyUSB1" as its device name on the last line. Now I know where my GPS dongle is connected. Make a not of it, you need it later. |
2, A first test with GPSD INDI Control Panel:Before doing any changes it's vice to do a test, maybe it configured itself, but don't expect that :-) ![]() Start KStars and Ekos, go to the Indi Control Panel. Example of how it could look at the setup of GPSD. When clicking on the GPS refresh button it looks that it receive information from the GPS dongle, but it work as well even when the GPS dongle is indoors with no reception. If it has real contact with the GPS dongle it will change the location with small amounts sometimes when you click the Refresh button. Here it take the information from a local site on internet or locally what's stored on this computer, the default setup Geographic Location I did in the beginning, even at the end of this page. This is because it's setup to Virtual GPS mode as default and that must be disabled in the GPSD setup properly. One more test, open the commando windows once again if it isn't already open. ![]() From the terminal window give this command:
Quit with: "Ctrl C". Even here it could look as if it's connected to the GPS dongle. If it's receiving a satellite signal you will see them in the column to the right, here it's empty. |
3, Disable Virtual GPS:This is important. When using a GPS device you must stop the Virtual GPS. If not, this Virtual GPS take over and not listen to the real GPS signal. The Virtual GPS take the information through internet and will not work without an internet connection. These two commands disable and stop Virtual GPS:
Now the GPSD driver must be stopped and restarted. ![]() The GPSD service must be stopped and restarted. Give the following commands:
Note: Open the GPS window in the commando window. ![]() Give the command:
Now there are no location from Virtual GPS anymore, it's empty. The GPS dongle is active now but normally no data coming yet. You quit the GPS window with: "Ctrl C". |
4, Set GPS device to NMEA protocol:There were no satellite data in the window above because the GPS dongle is not setup correctly, it must be in NMEA mode. When I used this GPS dongle in my earlier Windows system there were a software to run to setup the GPS, one of the setups was if it should send data with the NMEA standard, sort of ASCII text. My friend found how to do the same in Linux, these two commands are needed:
Note: There is a way to listen to the data traffic on the port but you need to install a tool for it, screen. You don't need to do this test normally, I just show how it looks. ![]() With this command you can listen on the USB port:
If the GPS dongle is in the NMEA mode text strings shall be received and show up on the screen like this. You quit the data stream with: "Ctrl a" k y. ![]() Execute the command once again:
Now all GPS satellite data show up in the right column and you get the correct location for your place. You quit the GPS window with: "Ctrl C". |
5a, Direct ID to a given port:It could be a problem that the GPS doesn't always connect to the same port, there is a way to lock it. With the information I got earlier I can now setup this. ![]() Give this command:
Now I have to change the information in this file with my device name. With "Ctrl K" it's possible to edit the information in the window above. You can't use the mouse, use the arrows on the key board. Set the parameters to the port you found in the beginning of this page. In my case it was: ttyUSB1. DEVICES="/dev/ttyUSB1" GPSD_OPTIONS="" When you stop the process with "Ctrl X" it will ask if you want to save it (y=yes). ![]() A check that everything went okay.
Quit with "Ctrl X". |
5b, Direct Path to a given port:The above procedure wasn't without problems, here is an alternative. ![]() Open the map: /dev/serial/by-path, where the file is that has the path ttyUSB1 (in this case it has changed to ttyUSB0). Right click on the files one by one until you find the correct file and choose properties. The information in the yellow circle is what we shall use, copy it, be careful to get the whole string, it's longer than the window's length.
Note: ![]() In commando window, give the command:
Replace the DEVICES="" with the path name from above. Edit with: "Ctrl K". You can't use the mouse, use the arrows on the key board. The idea is to have it always found correct port even if the device numbers are changed. If it works ? Who knows ? It's complicated ! Quit with "Ctrl X" and save. |
6, Change Geographic Location:If the GPS receiver fails it's good if the Raspberry's base setting is correct set for your location as a backup. ![]() You find it at: Preferences > Geographic Location. ![]() I set the location with no decimals, then it's easy for me to see what source the position use. |
7, Setup how to use GPS data in INDI:In INDI it can be setup from which source the location and clock updates from. In this case it's setup to use the GPS as a source. ![]() |
8, Restart GPSD and Kstars/Ekos:Sometimes when starting up the system the GPSD driver doesn't start as it should. To fix that, shut down EKOS and KStars. Open the commando window and type in this command:
Commands that are used often can be setup as a script, look here how to do it: Good to know commands, at bottom of page. After the GPSD has been restarted it's time to start KStars and activate Ekos with its drivers. ![]() Click on the Refresh GPS button, if it's connected to the GPS dongle it sometimes changes the decimals of the Location Lat/Lon. You must have a free view to the sky for the GPS receiver and it could take some minutes the first time for it to lock to the satellites. At the KStars lower left corner you will see that it take the location from GPS. |
|
|