Integrated Astronomical Observation System①

System Setup


1. Integrated Astronomical Observation System

This system is an integrated astronomical observation system designed for enjoying outdoor stargazing. It uses the Raspberry Pi 5—a compact, credit-card-sized computer—as its core to control and operate the observation equipment.

The Raspberry Pi 5 functions as a command center, controlling an equatorial mount (in this case, OnStep) using the INDI (Instrument Neutral Distributed Interface) communication protocol. INDI supports a wide variety of devices and offers flexible expandability.
Furthermore, by integrating with high-performance planetarium and observation control software such as KStars and EKOS, it enables automatic alignment and advanced observation support.

Furthermore, since you can operate the Raspberry Pi 5 desktop via a VNC connection from a Windows PC, you can control the telescope wirelessly from a remote location, such as inside a vehicle.

This page will guide you through the setup process for the Raspberry Pi 5, including network configuration.


2. System Configuration

2.1 Hardware Configuration

The system is configured to minimize cumbersome setup work in the field and prioritize smooth operation.
The Raspberry Pi 5 is set up as a Wi-Fi access point, and a Windows PC and OnStep’s SWS connect to that network as clients.
Furthermore, the Raspberry Pi 5 and OnStep are connected via USB and communicate and control each other through INDI.

Since the Raspberry Pi 5 is often connected to the internet at home, we assign the local Wi-Fi network to the observation system and a wired LAN connection to the home network. Simply plugging in a LAN cable provides internet access while simultaneously maintaining the Wi-Fi network for observations, allowing for smooth setup and data transfer.

HWRaspberry PI 5 (8G)
OSRaspberry Pi OS (64-bit) Bookworm
Release 25-11-24

The following is a list of network environments. Please note that this is merely an example; feel free to modify it as needed.

🌌
operations in field
🏠
operations at home
RPi 5Wi-Fi access point nameFieldAPFieldAP
wifi IP address192.168.50.1
(Access Point)
192.168.50.1
(Access Point)
Internet connectionN/AVia Ethernet (wired LAN)
Onstep SWSWi-Fi networkFieldAPFieldAP
wifi IPaddress192.168.50.20192.168.50.20
Windows PCWi-Fi networkFieldAPFieldAP
wifi IP address192.168.50.100192.168.50.100
Internet connectionVia USB tethering, etc.Via Ethernet (wired LAN), etc.

2.2 Software Configuration

The following is a list of the software we use. All of it is open source and available for free.

INDI
Device Control and Communication ProtocolsIt is an open-source communication protocol for controlling various astronomical observation devices, such as telescopes, cameras, focusers, and filter wheels. INDI runs on Linux and can be operated smoothly even on lightweight computers like the Raspberry Pi.
KStarsPlanetarium softwareThis is a free, feature-rich planetarium software program that runs on Linux, Windows, and macOS, allowing you to view real-time star charts, search for celestial object information, and automatically align a telescope.
EkosObservation Automation and Instrument Control ModuleThis is an observation automation and instrument control module built into KStars. It allows you to control observation equipment such as telescopes, cameras, focusers, and autoguiders via INDI.

3. Installing Raspberry Pi OS

Note: As of October 2023, Raspberry Pi OS has transitioned from being based on Debian 11 (Bullseye) to being based on Debian 12 (Bookworm). This change has resulted in significant changes to network behavior and initial setup.

You will need a Windows PC, a Raspberry Pi 5, a micro SD card, a wired LAN connection to the internet, and a power cable compatible with the Raspberry Pi 5.
First, install the OS on the Raspberry Pi 5. Using a Windows PC and the Raspberry Pi Imager, proceed with the installation onto the SD card.
Select “Raspberry OS (64-bit) Bookworm” as the OS.

Follow the steps in the app to configure the settings, but be sure not to check the box for “Use Wi-Fi” or make any related settings. This is to prevent configuration conflicts when you later set up the Raspberry Pi in access point mode.


4. VNC Settings

Once the SD card has finished writing, insert it into the Raspberry Pi and power it on. First, connect a monitor, keyboard, and mouse to the Raspberry Pi to set it up. The first step is to set up the VNC (remote desktop) environment.

4.1 Changes to the Windows system

Open a terminal and run the following command to launch raspi-config.

The Raspberry Pi 5 uses a new windowing system called “Wayland,” but there are some compatibility issues with VNC (remote desktop). Therefore, to ensure stable remote operation, we will switch to the traditional X11 (X Window System) method.

 → 6 Advanced Options
 → A7 Wayland
 → W1 X11


After configuring the settings, restart the system.

4.2 Enabling VNC

After restarting, launch Raspi-config again and enable VNC.

 3 Interface Options
 → I3 VNC


This will display the VNC icon in the upper-right corner of the screen, confirming that VNC is enabled. Clicking the icon will allow you to view the Raspberry Pi’s IP address. You can then use Real VNC Viewer on your Windows PC to control the Raspberry Pi via Remote Desktop. Note that Real VNC Viewer can be installed from the Microsoft Store.

*At this stage, the connection will be via a wired LAN, but we will configure it for a Wi-Fi connection later.


5. Turning a Raspberry Pi into an Access Point

Set up the Raspberry Pi as a Wi-Fi access point (AP). This allows the Raspberry Pi to act as a host, enabling the Onstep mount controller and Windows PCs to connect to it as clients.

It should now be available for selection as a Wi-Fi access point on your Windows PC.


6. Windows PC Settings

Configure your Windows PC to allow VNC connections over Wi-Fi.

6.1 固定IP化

To prevent DHCP failures on the Raspberry Pi 5 and ensure a stable connection, assign a static IP address to the Wi-Fi adapter on your Windows PC.

 IP address: 192.168.50.100
 Gateway: 192.168.50.1

6.2 Configuring Routing Rules

Since the Windows PC is connected to both a wired LAN and Wi-Fi, it automatically selects which connection to use. To ensure stable operation, we will explicitly define routing rules.

1. Type “Command Prompt” or “PowerShell” into the Windows search bar.

2. Right-click the app that appears and select “Run as administrator.”

3. Enter the following command to view the list of interfaces:

4. From the list displayed, note the interface number (e.g., 17) corresponding to the Wi-Fi adapter (e.g., Intel(R) Wi-Fi 6 AX201 160MHz).

5 To ensure that traffic destined for the Raspberry Pi 5 (192.168.50.1) is routed through the Wi-Fi adapter, add the following rule:

*Please replace “IF 17” with the interface number that corresponds to your environment.

This allows your Windows PC to reliably use both an internet connection and a local Wi-Fi network connection simultaneously. Once the setup is complete, connect your Windows PC to the Raspberry Pi 5 (FieldAP), and use Real VNC to connect by specifying the Raspberry Pi’s Wi-Fi IP address.


7. Samba (Shared Folder) Settings

Samba is software that enables file sharing between a Raspberry Pi and a Windows PC. With it, you can easily share files over a network.

7.1 Installing Samba

First, install Samba using the following command.

7.2 Backing Up and Editing Configuration Files

Before editing the Samba configuration file \etc\samba\smb.conf, make a backup just in case.

7.3 Disable Guest Access

This setting determines whether to allow access as a “guest” when authentication fails. For security reasons, we will comment it out and disable it in this case.

7.4 Disabling [homes] section

Samba has a section called [homes] that automatically creates a shared folder with the same name as the logged-in username. Since we don’t need this in this case, we’ll disable it by commenting out all the lines as shown below.

7.5 Add shared folder settings

Please add the following code to the bottom of your Samba configuration file.

In this example, we are configuring the Public folder in the user’s home directory as a shared folder that can be accessed from Windows.

  • In the “path” section, specify the path to the folder you want to share. Here, we’re using “\home\Public,” but you can change it as needed.
  • Please replace with the <username> you are actually using on your Raspberry Pi.
  • The “[PiShare]” part is the folder name that appears in Windows. For example, it will appear as \raspberrypi\PiShare in Windows Explorer. You can change this to any name you like.

Run the following command to set the password required for access.

7.6 Setting Passwords for Samba Users

Set a password to access the shared folder. Use the following command to add a user for Samba.

*Please replace with the username you are actually using on your Raspberry Pi.

7.7 Restarting Samba

After configuring the settings, restart Samba using the following command. This completes the configuration on the Raspberry Pi.

If you access \192.168.xx.xx\PiShare from a Windows PC, you will be able to connect to the shared folder.


8. Configuring the Firewall on the Raspberry Pi 5(option)

For security reasons, we will install UFW (a firewall). With this configuration, VNC connections via the wired LAN will no longer be possible; VNC connections will only be allowed via the local Wi-Fi network.

Configure the firewall to allow access only to specific ports. You may need to change the allowed ports as necessary.

CommandIntent of the RuleAllow “Port”Role in the system
sudo ufw default deny incomingReject All (Default)All portsFrom this point on, unless otherwise specified, all external communications will be blocked. This forms the foundation of our security.
sudo ufw default allow outgoingAllow All (Default)All portsAllow the Pi 5 to freely send data to external sources for communications it initiates itself (e.g., internet access for updates, sending INDI data to OnStep, etc.).
sudo ufw allow from 192.168.50.0/24 to any port 22 proto tcpWithin the local network(192.168.50.x)SSH (22)Command-line operations (maintenance) on the Pi 5 are permitted only from devices (such as operator terminals) connected to the dedicated observation AP.
sudo ufw allow from 192.168.50.0/24 to any port 5900 proto tcpWithin the local network(192.168.50.x)VNC (5900)Allow remote control of the Pi 5 desktop (including KStars and Ekos) only from devices connected to the dedicated observation AP.
sudo ufw allow from 192.168.50.0/24 to any app SambaWithin the local network(192.168.50.x)SambaAllow Samba access only from devices connected to the observation-only AP.
CommandMeaning
sudo ufw enableEnable UFW
sudo ufw disableDisabling UFW
sudo ufw statusDisplaying the ufw status

9. Smart Web Server

We will modify the source code so that OnStep automatically connects to the Raspberry Pi’s access point as a client. We will modify the OnStep SWS (Wemos) source file and upload it. With this change, OnStep will automatically connect to the RPi 5’s access point.

📄ExtentedConfig.h

11. Installing INDI / Kstars

The easiest way to install INID Kstar / Ekos is to use the batch file available here. Run the following shell script.

*Installation takes about an hour.

git clone https://gitea.nouspiro.space/nou/astro-soft-build.git

Move to the folder, run the shell script (install-dependencies.sh), and install the dependency files.

You can build both the stable version and the latest version, but run the shell script for the stable version (build-soft-stable.sh).

Now you can launch Kstars by clicking the raspberry icon in the upper-left corner of the screen, then selecting “Education” and “Kstars.”


12. Automatic Wi-Fi Connection on Windows PCs (Optional)

In Windows, if an Ethernet connection is active, the system may not automatically connect to Wi-Fi at startup. In this guide, I’ll show you how to use a batch file and Task Scheduler to automatically connect to Wi-Fi at startup.

10.1 Creating a batch file

Open Notepad and copy and paste the following text. Save the file with a name such as “ConnectWiFi.bat”. When saving, change the “File type” to “All Files” and make sure the file extension is .bat.

10.2 Task Scheduler Settings

To automatically run a batch file when your PC starts up, using the Task Scheduler is the most reliable method. It is more stable than placing the file in the Startup folder, and allows you to set administrator permissions and a delay (e.g., 30 seconds).

1. Type “Command Prompt” or “PowerShell” into the Windows search bar and press Enter.
2. Run the following command to launch Task Scheduler.

3. Creating a Task

Click “Create Task…” in the menu on the right.

 📌 General Tab Settings
  Name: Enter any name you like, such as “Auto_WiFi_Connect”.

  Security options:
   Select “Run only when the user is logged on.”
   Check the box next to “Run with highest privileges.”

 📌 Trigger Tab Settings
   Click the “New…” button.
Task start: Select “At logon” from the drop-down menu.
Specify delay: Select 30 seconds.
(This duplicates the timeout /t 30 command in the batch file, but we’re setting it here just to be safe.)

 📌Settings for the Operations Tab
Click the “New…” button.
  Action: Select “Start a program.”

  Program/Script: Enter the full path to the “ConnectWiFi.bat” file you created in step 9.1
  (Example: C:\Users\YourName\Documents\ConnectWiFi.bat).

 📌Settings on the Conditions tab
  Uncheck the box labeled “Start the task only when the computer is connected to AC power.”

Click “OK” to save the task.

✅Approximately 30 seconds after the PC starts up, the Wi-Fi connection command is executed. This automatically enables Wi-Fi even if a wired LAN connection is active, and connects to the specified SSID.