Raspberry Piを使って、液晶ディスプレイ(テレビ)を情報端末にしようという試みです。
この記事では作業手順だけに絞ってあります。詳細は元記事をご確認ください。
詳しい導入手順をご用意しました

下記の作業を行うだけで
- 日本の日付と曜日
- 日本時間のデジタル時計
- 長崎の今日の天気
- 長崎の週間天気予報
- 日本の休日カレンダー
- Yahooニュース
- バックグラウンドスライドショー
・・・が表示される情報端末が簡単に出来上がります。また、同じネットワークのパソコン/タブレットから「http://ホスト名:8080」をブラウザで開くと、同じ情報が表示される設定も行っています。
登録するサンプル画像がない人は、ここらへんから適当に写真を拾ってきたり、拾った写真をイラストにして登録するとよいとおもいます。
1.Raspberry Pi OSを開く

1件目の「Raspberry Pi OS」を開いてください。
2.「Download for Windows」を押してダウンロード

3.ダウンロードしたファイルを実行


そのままRaspberry Pi Imagerを起動します。
4.「デバイスを選択」でデバイスを正しく選ぶ


5.「OSを選択」でLegacy, 32-bitを選ぶ

Raspberry Pi 4の場合は(64-bit)を選んでください。Legacy, 32-bitだと後々のインストールに失敗します。
6.書き込み先を選んで「次へ」

7.「設定を編集する」

8.環境に合わせて設定を行う


9.「はい」を押してSDカードにOSを書き込む



10.SDカードを抜いてRaspberry Piに刺して起動する

11.必須ソフト「Teraterm」「WinSCP」をインストールする
winget install teraterm winscp


wingetが使えない時は手動でインストールしてください。
・Tera Term Open Source Project
・「WinSCP」SCP/SFTP/FTPS対応のFTPクライアント – 窓の杜
12.TeraTermを起動して接続する




13.MagicMirror2をインストール
bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/raspberry.sh)"




「スクリーンセーバーを無効にする?」⇒「Y」と入力してEnter

「MagicMirror2を自動起動する」⇒「Y」と入力してEnter

「名前を変える?」⇒デフォルトで良いので何も入力せずEnter

MagicMirror2が起動します。
14.スライドショーモジュールをインストール
cd ~/MagicMirror/modules
git clone https://github.com/darickc/MMM-BackgroundSlideshow.git
cd ~/MagicMirror/modules/MMM-BackgroundSlideshow
npm install



15.無線の省電力をオフにする
sudo vi /etc/systemd/system/disable-wifi.service


キーボードの「a」を1度だけ押し、下記の内容を貼り付けてください。
[Unit]
Description=Disable WiFi on boot
After=network.target
[Service]
Type=oneshot
ExecStart=/sbin/iwconfig wlan0 power off
User=root
[Install]
WantedBy=multi-user.target


貼り付けできたら、キーボードのESCを1度だけ押し、「:」「w」「q」「!」と入力する


ファイルが保存され、元の画面に戻ってきます。
sudo systemctl enable disable-wifi.service
sudo systemctl start disable-wifi.service



16.WinSCPを起動して接続する





17.configを変更する
/home/pi/MagicMirror/config/config.js

/home/pi/MagicMirror/config/まで移動します。

config.jsを右クリック⇒編集

内容を下記のものと入れ替える
/* Config Sample
*
* For more information on how you can configure this file
* see https://docs.magicmirror.builders/configuration/introduction.html
* and https://docs.magicmirror.builders/modules/configuration.html
*
* You can use environment variables using a `config.js.template` file instead of `config.js`
* which will be converted to `config.js` while starting. For more information
* see https://docs.magicmirror.builders/configuration/introduction.html#enviromnent-variables
*/
let config = {
address: "0.0.0.0", // Address to listen on, can be:
// - "localhost", "127.0.0.1", "::1" to listen on loopback interface
// - another specific IPv4/6 to listen on a specific interface
// - "0.0.0.0", "::" to listen on any interface
// Default, when address config is left out or empty, is "localhost"
port: 8080,
basePath: "/", // The URL path where MagicMirrorツイ is hosted. If you are using a Reverse proxy
// you must set the sub path here. basePath must end with a /
ipWhitelist: [], // Set [] to allow all IP addresses
// or add a specific IPv4 of 192.168.1.5 :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
// or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
useHttps: false, // Support HTTPS or not, default "false" will use HTTP
httpsPrivateKey: "", // HTTPS private key path, only require when useHttps is true
httpsCertificate: "", // HTTPS Certificate path, only require when useHttps is true
language: "ja",
locale: "ja_JP.UTF-8", // this variable is provided as a consistent location
// it is currently only used by 3rd party modules. no MagicMirror code uses this value
// as we have no usage, we have no constraints on what this field holds
// see https://en.wikipedia.org/wiki/Locale_(computer_software) for the possibilities
logLevel: ["INFO", "LOG", "WARN", "ERROR"], // Add "DEBUG" for even more logging
timeFormat: 24,
units: "metric",
modules: [
{
module: "alert",
},
{
module: "updatenotification",
position: "top_bar"
},
{
module: "clock",
position: "top_left"
},
{
module: "calendar",
header: "JP Holidays",
position: "top_right",
config: {
calendars: [
{
fetchInterval: 7 * 24 * 60 * 60 * 1000,
symbol: "calendar-check",
url: "https://calendar.webcal.jp/JapanHolidays.ics"
}
]
}
},
{
module: "weather",
position: "top_left",
config: {
weatherProvider: "openmeteo",
type: "current",
lat: 32.773779,
lon: 129.863254
}
},
{
module: "weather",
position: "top_left",
header: "Weather Forecast",
config: {
weatherProvider: "openmeteo",
type: "forecast",
lat: 32.773779,
lon: 129.863254
}
},
{
module: "newsfeed",
position: "bottom_bar",
config: {
feeds: [
{
title: "Yahoo! News Topics - Main",
url: "https://news.yahoo.co.jp/rss/topics/top-picks.xml"
},
{
title: "Domestic - Yahoo! News",
url: "https://news.yahoo.co.jp/rss/categories/domestic.xml"
},
{
title: "International - Yahoo! News",
url: "https://news.yahoo.co.jp/rss/categories/world.xml"
},
{
title: "IT - Yahoo! News",
url: "https://news.yahoo.co.jp/rss/categories/it.xml"
},
{
title: "Nagasaki Shimbun - Yahoo! News",
url: "https://news.yahoo.co.jp/rss/media/nagasaki/all.xml"
},
{
title: "NBC Nagasaki Broadcasting - Yahoo! News",
url: "https://news.yahoo.co.jp/rss/media/nbcv/all.xml"
},
{
title: "Nagasaki International Television - Yahoo! News",
url: "https://news.yahoo.co.jp/rss/media/nib/all.xml"
}
],
showSourceTitle: true,
showPublishDate: true,
broadcastNewsFeeds: true,
broadcastNewsUpdates: true
}
},
{
module: 'MMM-BackgroundSlideshow',
position: 'fullscreen_below',
config: {
imagePaths: ['modules/MMM-BackgroundSlideshow/exampleImages/'],
transitionImages: true,
transitions: ['opacity'],
slideshowSpeed: 60000,
randomizeImageOrder: true
},
},
]
};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") { module.exports = config; }

※天気予報の位置変更や、カレンダーやRSSフィードなどは適宜変更してください。
完了したら左上の保存アイコン(もしくはCTRL+S)で保存
18.CSSを変更
/home/pi/MagicMirror/css/custom.css


次の内容を貼り付ける
*{
color:white!important;
}
.MMM-BackgroundSlideshow .images{
opacity:.5;
}

左上の保存アイコン(もしくはCTRL+S)で保存
19.スライドショー用の画像を転送する
/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/


元々の「/exampleImages」を「/exampleImages.000」とリネームしてバックアップ

/exampleImagesを作成し、そこに画像を転送する。



20.MagicMirror2をリスタート
pm2 restart all



以上
電源を落としたい時は、TeraTermから
sudo shutdown -h now