Welcome to CUBE Pi Case repository
当製品の日本語版マニュアル資料は、こちらからご取得ください。
Set up auto-startup
Set up auto-startup
Set up auto-startup1. Learning objectives2. Preparation before the experiment3. Set up the boot-up service1. Copy files2. Manage configuration3. Manage service4. Run kill_oled.sh4. Experimental phenomenon
1. Learning objectives
- Understand the basic use of service
- Set up a custom startup program at startup
- Master the addition and cancellation of file execution permissions
Use the relevant files that have been written to set the relevant status of the OLED display, fan and RGB light strip after the Raspberry Pi series motherboard is turned on. The specific principle is not analyzed here. Read the relevant code to understand it yourself.
2. Preparation before the experiment
Install the Raspberry Pi chassis according to the assembly video tutorial. You can also refer to the "Raspberry Pi Chassis_Hardware Wiring" tutorial document for installation. The chassis expansion board and related hardware connections are shown here.

| Chassis expansion board | 3Pin interface | 2Pin interface |
|---|---|---|
| RGB light bar | Fan |
3. Set up the boot-up service
Copy the CubeRaspberry.zip file in the data to the Raspberry Pi motherboard system. After unzipping the file, you need to change the path names in the kill_oled.sh and yahboom_oled.service files according to your own directory; if the paths are different, modify the location in the figure below.

The following command operations may require password input, just remember to enter
1. Copy files
Open the terminal in the CubeRaspberry folder and use the following command to copy yahboom_oled.service to the /etc/systemd/system path.
xxxxxxxxxxsudo cp yahboom_oled.service /etc/systemd/system
2. Manage configuration
Use the systemctl tool to load and manage configuration.
xxxxxxxxxxsystemctl daemon-reload
3. Manage service
Manage the yahboom_oled service.
- Start yahboom_oled service
xxxxxxxxxxsystemctl start yahboom_oled
- Stop yahboom_oled service
xxxxxxxxxxsystemctl stop yahboom_oled
- Restart yahboom_oled service
xxxxxxxxxxsystemctl restart yahboom_oled
- Set yahboom_oled service to start automatically at boot
xxxxxxxxxxsystemctl enable yahboom_oled
- Disable yahboom_oled service to start automatically at boot
xxxxxxxxxxsystemctl disable yahboom_oled

Note: The picture shows the effect of each command after running. Run the command according to your needs.
4. Run kill_oled.sh
Running the kill_oled.sh file will stop the yahboom_oled service and the yahboom_oled service process, and the OLED display will not display anything.
- Add executable permissions
xxxxxxxxxxchmod +x kill_oled.sh
- Cancel executable permissions
xxxxxxxxxxchmod -x kill_oled.sh
Note: Generally, the file name of the executable file is in green font
- Run the kill_oled.sh file
xxxxxxxxxx./kill_oled.sh

- Running effect

4. Experimental phenomenon
Follow the steps in the tutorial to realize the automatic startup of the yahboom_oled service.
After the Raspberry Pi series motherboard is turned on, the OLED display will display relevant information of the system, and the fan and RGB light strip will also work in the corresponding state.
