Astroberry – Setting Time and Date

Astroberry time and date

Setting up your Astroberry Time and Date settings correctly can save you loads of grief especially if you take your equioment into the field where there may not be an internet connection available

Written by Jonathan Eames
September 4, 2023

Intro

Setting your Astroberry Time and Date up each time you boot up your RPi can be a painful experience, especially if you forget to do it -forget tryimng to align your GOTO mount to an expected target – it just will not be there as the sky position you are pointing to will simply be different to what is expected.

If you plan to travel with your setup away from connectedf internet then I highly recomend putting in a cheap RTC clock on your RPi board – so easy to do and once installed and configured it remebers the time and date for you. I have one on all my Rpi’s

Setting Time and Date

Astroberry can set the time and date of your Raspberry Pi using one of the following sources:

  • Internet connection: If your Raspberry Pi is connected to the internet, it will use the Network Time Protocol (NTP) to synchronize the system clock with an online server. This is the easiest and most accurate method, but it requires an internet connection.
  • RTC module: If you have a Real Time Clock (RTC) module attached to your Raspberry Pi, it will use it to keep track of the time and date even when the power is off. This is a reliable method, but it requires an additional hardware component and some configuration steps.
  • GPS module: If you have a Global Positioning System (GPS) module attached to your Raspberry Pi, it will use it to get the time and date from the satellite signals. This is a convenient method, but it requires a clear view of the sky and some configuration steps.
  • Manual configuration: If none of the above methods are available, you can manually set the time and date of your Raspberry Pi using the graphical interface or the command line. This is the least preferred method, as it may introduce errors and require frequent updates.

RTC Module

If you have an RTC module, you need to enable it in the config.txt file by adding these lines:

dtoverlay=i2c-rtc,ds3231
dtparam=i2c_arm=on

Then reboot your Raspberry Pi and run these commands:

The last command should show you the current time from the RTC module. If not, check your wiring and connections.

udo apt-get update
sudo apt-get install i2c-tools
sudo i2cdetect -y 1
sudo hwclock -r

GPS Module

If you have a GPS module, you need to enable it in the config.txt file by adding these lines

enable_uart=1
dtoverlay=disable-bt

Then reboot your Raspberry Pi and run these commands:

The last command should show you the current time from the GPS module. If not, check your wiring and connections.

sudo apt-get update
sudo apt-get install gpsd gpsd-clients python-gps
sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket
sudo gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock
cgps -s

Manually set Astroberry time and date

If none of the above methods are available, you can manually set the time and date of your Raspberry Pi using the graphical interface or the command line. To use the graphical interface, click on the clock icon on the top right corner of the screen and select “Time & Date Settings”. To use the command line, run this command:

Replace YYYY-MM-DD HH:MM:SS with your desired date and time.

sudo date -s “YYYY-MM-DD HH:MM:SS”

You may also like…

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

©2022 IoAstro.com - Astronomy Automation.

IO Astro