1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ラズパイのROM化とサービスの設定など

Last updated at Posted at 2024-09-01

ROM化

有効化

sudo raspi-config nonint enable_overlayfs
sudo reboot

無効化

sudo raspi-config nonint disable_overlayfs
sudo mount -o remount,rw /boot
sudo reboot

確認

df -h

サービスの登録 (oFのアプリ)

nano /home/pi/your_app_directory/start_app.sh
#!/bin/bash
export DISPLAY=:0 #必要に応じて
cd アプリのパス
make run

実行権限を与える

chmod +x /home/pi/your_app_directory/start_app.sh

systemdサービスファイルの作成

sudo nano /etc/systemd/system/your_app.service
[Unit]
Description=My App Service
After=multi-user.target
Wants=multi-user.target

[Service]
ExecStartPre=/bin/sleep 60
Environment="DISPLAY=:0"
ExecStart=/home/pi/your_app_directory/start_app.sh
WorkingDirectory=/home/pi/of_v0.12.0_linuxarmv6l_release/apps/project/name/
Restart=always
User=pi

[Install]
WantedBy=multi-user.target

サービスのコマンド

サービスの登録と起動

sudo systemctl daemon-reload
sudo systemctl enable your_app.service
sudo systemctl start your_app.service

サービスの停止

sudo systemctl stop your_app.service

サービスの自動起動

sudo systemctl enable your_app.service

サービスの自動起動停止

sudo systemctl disable your_app.service

サービスの再起動

sudo systemctl restart your_app.service

サービスの状態確認

sudo systemctl status your_app.service

ネットワーク

固定IP

sudo nano /etc/dhcpcd.conf

HDMI

HDMIの固定出力

sudo nano /boot/config.txt
hdmi_force_hotplug=1

hdmi_group=1
hdmi_mode=16

CPU温度確認

vcgencmd measure_temp
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?