Advertisement / Annons: |
My astronomy project:
|
Content:Related projects:
Note: |
1, KStars GPSD, 64-bit OS:Overview:If you always have your observatory at a stationary place with LAN connection there is no need for a GPS. But I who take the car and drive to remote dark places have a need for the GPS clock and location. The GPS installation has always been difficult, maybe easier now with the more up to date OS 64-bit Bookworm version and KStars/Ekos 64-bit. I follow this instruction partly that is told to work with Raspberry Pi5 and KStars 64-bit: Older information about KStars and GPS: GPS device:The GPS dongle I use is the recommended U-blox7. It works much better than the earlier ones I have tried. But one disadvantage, it's sensitive to electro magnetic disturbance. I can't attach it direct to the Raspberry, I must have some distance between them. An extension USB cable of 0.5 meter solve the problem. I have also placed it on the opposite side of the telescope to where the Raspberry is placed. Find the USB GPS port:To setup it correct we must know which USB it's connected to. Disconnect the USB cable and give this command in the terminal window:
And then connect the USB cable again, note which new line that appear. In my case it's the port /dev/ttyACM0 that the USB GPS connect to. As always before installing some new software, update the system before:
Installing indi-gpsd:I noticed that this driver was already installed in my KStars 64-bit package. If not in your case, do the following. The command below installs the indi-gpsd:
After one third of the installation it ask you if you want to proceed, type: Y (yes) and Enter. Activate GPSD software and driver:In the profile I have setup in KStars I add GPSD. GPSD is the driver that communicate with the GPS device. I add it on Aux 1. You find GPSD under "Others" devices. GPSD is activated, if it's okay, Save. Install gpsd:The three following commandos do the rest of the installation, enable and restart:
The following two software I'm not 100% sure that they are needed, anyway I installed them:
Enable and restart the system:
Setup GPSD file (old procedur):Follow the instructions in the link above. You can use this command to edit the file:
How I setup the GPSD file, but it will be different in your setup. In my case it's not ttyUSB1, it's ttyACM0 (old screen dump):
When you find it correct, quit with Ctrl X, type Y (yes) and Enter. After changes of GPSD setup a restart must be done:
Here are more information about GPSD:
Setup GPSD file (new better):My GPS is the U-Blox7 which is recommended but I got a lot of problem with the system clock sync and location. It ended up with another setup of the GPSD. You can use this command to edit the GPSD:
How I setup the GPSD file, but it will maybe be different in your setup:
The "F" create the gpsd.sock file which is essential for the GPS Location in KStars. When you find it correct, quit with Ctrl X, type Y (yes) and Enter. A friend had to help me with this to get it correct, complicated. This time I used the udev rules, a smarter way to address the devices if it's complex with many serial devices. Instead of: DEVICES="/dev/ttyACM0" which direct address it to a unique port I have setup it to a new name with some rules behind: DEVICES="/dev/astro_gps_ublox7". Here are information how to use udev: udev rules . Main purpose is to make it independent where you connect your USB cables, it will find it anyway. After changes of GPSD setup a restart must be done:
After this the GPS with GPDS and Chrony set the system clock and KStars set the location at startup. But there is a problem, every time the Raspberry is started up the location is lost in GPSD. I have to do a restart every time after it has started up. It's because of a bug in the GPDS, I have the version 3.22. It will be corrected later when doing an update, until then use the restart of gpds. More information about the needed update of GPSD:
If you have to give a command often you can make a script for it: Make a Script . Here are more information about GPSD:
Test of GPS receiver:To listening to what the GPSD get from the GPS receiver, type this commando:
A first test if the GPSD receive any data, this normally never works, to my surprise it connect to the satellites and receives data. Normally you need at least three satellites with a "Y" to have a location, but five or more is better. Quit with "Ctrl+C" Other tools, stop with "Ctrl C":
The commando gpsmon listen direct to the GPS what it send to GPSD. |
Install Chrony:From Astroberry version 2.0.1 it use the Chrony to sync the system clock with GPS data. Much easier now to get it to work. Earlier if the system clock was wrong KStars was set with an offset to the system clock. That's fine for the most thing you do. But when doing Polar Alignment I got a lot of problem, I think it use the system clock direct and don't correct with the offset. I setup up Chrony to set the system clock direct to get rid of this problem. Chrony isn't installed normally and you must install it. A bit complicated and asked a friend for help. Be sure to have Raspberry and KStars updated to latest version. Install Chrony with:
Check that service is running:
If correct installed both shall give a "active" as answer. Setup Chrony:To get it to work you normally has to add this line in the chrony.conf file. Place the line at the end of file. Edit the file /etc/chrony/chrony.conf according to this (GPS time through GPSD):
Look at the example above how I have done it. SHM 0 is the shared address GPSD send its data to Chrony. Open the chrony.conf with the text editor nano with this command:
Copy the command above. In terminal window you can't use the mouse, use the arrows on the key board, right click and past. Quit with Ctrl X, type Y (yes) and Enter to save. Restart Chrony:After changes of chrony setup a restart must be done:
Test if synched:Test if it's synced, in the terminal window give this command:
This is what I got, first line (GPS) has time=0, it shouldn't be 0, something wrong. With this command you can see what GPSD sending out:
It should be something like NTP0 (SHM 0) in the text string, that is what address Chrony listening to. After I fixed the problem it looked like this: Only the first line is important, the other four lines comes from internet because it's connected to internet. If the GPS work it should have some figures for the time. Chrony choose the time with best quality, if not internet connected it's only GPS there. |
Clean up installation:To clean up after the installation, type in following command:
Reboot your Raspberry. INDI Control Panel:Open: INDI Control Panel>GPSD>Main Control Next check if there is any time and location data received there from the GPS. It connects after less than a minute, it looks like the new OS 64-bit is updated and work.
Note: In the Options menu. Set your location, this is used if you don't get any GPS data. Note: I don't give the exact position, easier then to know If there is real GPS data or only default data. As time source click the System. KStars only take the Location information from the KStars/GPSD. Don't forget to Save. Sources Time and Location:There are more, open the Ekos>Mount tab. In later versions of Ekos these GPS settings has been moved from Indi to the Mount tab. With the latest changes with Chrony:
Because Chrony set the system clock with GPS data direct. This is done even if KStars isn't running. KStars' star chart:Check in the KStars star chart that it use the GPS Location. This test is done without connected to internet. If it hasn't lock to the GPS location, try to do a restart of GPSD, see above at setup GPSD. |
|
|