5.4 KiB
Executable file
20240204184839 Raspi4 家サーバー 作業ログ
#tech #raspi #server
買ったもの
-
【国内正規代理店品】Raspberry Pi4 ModelB 4GB ラズベリーパイ4 技適対応品【RS・OKdo版】 https://amazon.co.jp/dp/B081YD3VL5
-
Smraza Raspberry Pi 4 USB-C (Type C)電源、5V 3A ラズベリーACアダプター RPi 4b Model B 1GB / 2GB / 4GB/ 8GB適用 https://amazon.co.jp/dp/B07DN5V3VN
-
Flirc ラズベリーパイ4ケース シルバー https://amazon.co.jp/dp/B07WG4DW52
-
Ediloca EN760 SSD ヒートシンク付き 1TB PCIe Gen4x4 NVMe M.2 2280 PS5動作確認済み 最大読込: 5000MB/s 最大書き:4500MB/s 3D NAND TLC 内蔵SSD ダイナミック SLC キャッシュ メーカー5年保証 https://amazon.co.jp/dp/B0C9TD1FM4
-
ORICO M.2 SSDケース USB-C to NVMe M-Key / B&M Key(Nvmeのみ)に対応 USB 3.1 Gen2 10Gbps 外付けケース ABS+アルミ材質 UASPサポート2230/2242/2260/2280 SSD対応 M.2 SSD 変換アダプタ エンクロージャ ケース 黑 M2PV-BK https://amazon.co.jp/dp/B08GC326LL
セットアップ色々
ルーターの設定
- DHCPスタティックIP設定を追加。 avahiに対応しているし、cloudflareでトンネル作るので実際には不要だったかも
起動
microSDに必要なデータを書きこんだら、Raspi 4に挿して、LANケーブルなど繋いで起動。 wsl2上のubuntuから、sshで接続確認。(名前とパスワード。後で無効化する)
ここまでできたら、SSD bootの設定をする。
OSを最新に
これは日々やる作業
$ sudo apt update
$ sudo apt full-upgrade
...
$ sudo reboot (最新にしたので再起動)
オーバークロック
Before:
$ watch -n 1 vcgencmd measure_clock arm
でCPUの周波数が表示される。ダイナミックに変わるので一定しないが、1800MHzくらい。
/boot/firmware/config.txt
の
#arm-freq=800
を2000に変更、#を外す
over_voltage=6 gpu_freq=750
を追記。それぞれ 電圧を CPUの1.5Vに上げ、GPUを750MHzにする
After:
$ watch -n 1 vcgencmd measure_clock arm
2000MHzくらいになった。
cf.
WEBサーバー
Raspi4 Cloudflareでトンネルを作る
- 20240211141946 Raspi4 Cloudflareでトンネルを作る
- 20240211202623 Raspi4 Cloudflare tunnel経由でhttpsサーバーを公開する
- 20240211185359 Raspi4 Cloudflareでsshアクセスできるようにする
Gitea
20240215215031 Raspi4にGiteaをインストール
Node.js
$ sudo apt install nodejs npm
$ sudo npm install n -g
$ sudo n lts
$ sudo n latest
Dropbox
Arm64 linuxは公式には対応していない。 Dropbox-Uploader というbash scriptを使う。
$ git clone https://github.com/andreafabrizi/Dropbox-Uploader.git
$ cd Dropbox-Uploader/
$ ls
CHANGELOG.md Dockerfile.pi dropShell.sh README.md
Dockerfile dropbox_uploader.sh LICENSE testUnit.sh
ここに入っている dropbox_updloader.shを実行してみると、指示が表示される。その通りにやる。 App nameはこのnoteの同期用なので、 "kazbo_note_sync" にした。
$ ./dropbox_uploader.sh
This is the first time you run this script, please follow the instructions:
(note: Dropbox will change their API on 2021-09-30.
When using dropbox_uploader.sh configured in the past with the old API, have a look at README.md, before continue.)
1) Open the following URL in your Browser, and log in using your account: https://www.dropbox.com/developers/apps
2) Click on "Create App", then select "Choose an API: Scoped Access"
3) "Choose the type of access you need: App folder"
4) Enter the "App Name" that you prefer (e.g. MyUploader68212467426140), must be unique
Now, click on the "Create App" button.
5) Now the new configuration is opened, switch to tab "permissions" and check "files.metadata.read/write" and "files.content.read/write"
Now, click on the "Submit" button.
6) Now to tab "settings" and provide the following information:
App key: ****
App secret: ****
Open the following URL in your Browser and allow suggested permissions: https://www.dropbox.com/oauth2/authorize****
Please provide the access code: *****
> App key: ********
> App secret: '****
> Access code: '*****'. Looks ok? [y/N]: y
The configuration has been saved.
$
cf. 第54回「SORACOM応用編!ラズベリーパイからDropboxへファイルをアップロード(1)Dropbox-Uploader」 | Device Plus - デバプラ