> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/ask/flat/chapter-23-embedded-platforms-and-development-environments/di-23.2-jie-shu-mei-pai-freebsd-shi-yong.md).

# 23.2 Using FreeBSD on Raspberry Pi

After installing FreeBSD on the Raspberry Pi, you need to complete SSH configuration, timezone correction, and firmware updates.

## SSH Login Method

When using terminal emulation software such as XShell to log into the Raspberry Pi, the default username and password are both `freebsd`. To obtain root privileges, execute the `su` command after logging in and enter the root password.

## Importance and Methods of Timezone Configuration

Timezone configuration is a necessary step in system initialization. An incorrect system timezone may affect the accuracy of timestamps, log analysis, and other operations.

Execute the following command to launch the timezone configuration tool:

```sh
# tzsetup
```

In the interactive configuration interface, sequentially select `No` (do not set the hardware clock to UTC) → `Asia` → `China` → `Beijing Time`. When the system prompts "Is the above information correct?" or a similar confirmation message, select `Yes` to confirm the configuration.

## NTP Service Configuration

After timezone configuration, you also need to configure the system time synchronization mechanism.

All Raspberry Pi models prior to the Raspberry Pi 5 lack an onboard Real Time Clock (RTC) hardware module, and the system time relies on the Network Time Protocol (NTP) service for time synchronization. The Raspberry Pi 5 is the first model in the series with a built-in RTC module, which can maintain clock operation after power loss by connecting an external battery via the onboard J5 battery connector.

Inaccurate system time may affect SSL/TLS certificate verification, log timestamp accuracy, and the normal operation of multiple network services.

Add the following configuration to the **/etc/rc.conf** file:

```ini
ntpd_enable="YES"               # Enable the NTP daemon
```

Use the `ntpd` service to synchronize the system time:

```sh
# ntpd -q -g pool.ntp.org
```

View the current system date and time:

```sh
# date
Tue Aug  1 16:45:55 CST 2023
```

### Hostname Configuration

The hostname is the system's identifier in the network environment. Setting an easily recognizable hostname facilitates network management and device identification. Edit **/etc/rc.conf**, modify the `hostname` parameter, and replace `generic` in `hostname="generic"` with the actual desired hostname.

## Frequency Scaling Configuration

Properly configuring the CPU dynamic frequency scaling mechanism can balance computing performance and power consumption. The adjustable frequency range is typically 600 MHz to 1500 MHz (Raspberry Pi 4) or 600 MHz to 2400 MHz (Raspberry Pi 5), depending on the hardware model. The actual maximum frequency depends on the powerd dynamic scaling policy and firmware limitations; sysctl output may show a lower maximum frequency (e.g., 2000 MHz).

Execute the following commands to enable and configure the `powerd` service:

```sh
# sysrc powerd_enable="YES"     # Set powerd service to start at boot for dynamic CPU frequency scaling
# service powerd restart        # Restart the powerd service to apply the configuration immediately
```

## Temperature Information Query Method

Continuously monitoring CPU temperature helps detect cooling anomalies in a timely manner. Execute the following command to list all system kernel parameters and filter entries containing temperature information:

```sh
# sysctl -a | grep temperature
hw.cpufreq.temperature: 50598
dev.cpu.0.temperature: 51.0C
```

If you need to view the temperature information of individual CPU cores, execute the following command:

```sh
# sysctl dev.cpu | grep temperature
dev.cpu.0.temperature: 50.1C
```

## CPU Frequency Levels and Current Frequency

Execute the following command to display the available frequency levels and current frequency of CPU core 0:

```sh
# sysctl dev.cpu.0.freq_levels
dev.cpu.0.freq_levels: 2000/-1 600/-1
```

## References

* FreeBSD Project. FreeBSD/ARM on the Raspberry Pi family\[EB/OL]. \[2026-03-25]. <https://wiki.freebsd.org/arm/Raspberry%20Pi>. Detailed documentation on FreeBSD's official wiki about ARM architecture support for the Raspberry Pi.
* Chinese FreeBSD Community (CFC). Raspberry Pi Chinese Documentation\[EB/OL]. \[2026-03-25]. <https://rpicn.bsdcn.org>. A guide for installation, configuration, and use of the Raspberry Pi on FreeBSD.
* Raspberry Pi Ltd. Real Time Clock (RTC)\[EB/OL]. \[2026-04-17]. <https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#real-time-clock-rtc>. Official documentation for the Raspberry Pi 5's built-in RTC module, covering battery connector and wake function descriptions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.bsdcn.org/ask/flat/chapter-23-embedded-platforms-and-development-environments/di-23.2-jie-shu-mei-pai-freebsd-shi-yong.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
