2022年12月30日金曜日

メディアサーバー構築2

メディアサーバー構築2

書こう書こうと思っていたら、9ヶ月近く経過していた。
時間が経つのはおそろしい。

メディアサーバーとして、ミニPCを入手した。もろもろ準備を行う。

wifi有効化

システム > ドライバーマネージャー


インストール

  • kodi
  • nextcloud clinet
  • ssh server

nextcloud クライアント

kodiのソース設定でwebdavを選ぶことが出来たが、webdavはちょっと遅かったので、nextcloud clientで同期した。
nextcloudのクライアントアプリで、同期するフォルダやファイルサイズの制限ができる。

これで、勝手に同期してくれる。

kodi

kodi自動起動

[設定マネージャー]→[セッションと起動]→kodiとnextcloudを指定する

ソース設定

nextcloudのディレクトリを指定する

ssh server

ホスト名でアクセスしたい

mDNSでホスト名でアクセスしたい。
avahiを使用しない方法があるのか
https://wiki.archlinux.jp/index.php/Systemd-resolved#mDNS
https://qiita.com/slug/items/4c7121af229b9a6c92c4
https://0e39bf7b.blog/posts/mdns-on-ubuntu-server/

が、ホスト名.localでアクセスすることが出来なかった。

仕方がないので、avahiをインストール
https://wiki.archlinux.jp/index.php/Avahi

sudo apt-get install avahi-daemon libnss-mdns
adeno@nipogi:~$ sudo systemctl status avahi-daemon.service 
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
     Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-12-30 10:50:04 JST; 10min ago
TriggeredBy: ● avahi-daemon.socket
   Main PID: 7685 (avahi-daemon)
     Status: "avahi-daemon 0.7 starting up."
      Tasks: 2 (limit: 14065)
     Memory: 1.4M
     CGroup: /system.slice/avahi-daemon.service
             ├─7685 avahi-daemon: running [nipogi.local]
             └─7687 avahi-daemon: chroot helper

sshサーバー

一応、公開鍵暗号認証方式にして、パスワード認証を切っておく
https://wiki.archlinux.jp/index.php/SSH_鍵
https://blog.htkyama.org/ssh_ed25519

リモコンが欲しい

wiiリモコンを中古でゲット
https://wiki.archlinux.jp/index.php/XWiimote
https://github.com/xwiimote/xwiimote
https://manpages.ubuntu.com/manpages/jammy/en/man4/xorg-xwiimote.4.html

キーのマッピングは以下を参考
https://ja.gadget-info.com/46371-20-kodi-keyboard-shortcuts-every-kodi-user-should-know
http://hide817.blog.fc2.com/blog-entry-6.html?sp
https://kodi.wiki/view/Keymap#Keyboards

変更無しで動いたもの

- +:音量アップ
- -:音量ダウン
- A:決定(リターン)
- B:なし
- HOME:なし
- 1:なし
- 2:なし
- 十字キー:操作

変更する

- B:BackSpace(戻る)
- HOME:ESC(取消)
- 1:スペース(スライドショー)
- 2:なし

sudo apt-get install xwiimote libxwiimote xserver-xorg-input-xwiimote
sudo usermod -aG input kodi

sudo xwiishow 1
xwiikeymap
/usr/share/X11/xorg.conf.d/50-xorg-fix-xwiimote.conf

adeno@nipogi:~$ cat /usr/share/X11/xorg.conf.d/50-xorg-fix-xwiimote.conf 
# X11 xorg Wii Remote raw input config
# XWiimote reports accelerometer and IR data as absolute axes. Disable them to
# avoid weird mouse behaviour. To use IR data as mouse input, use the xwiimote
# tools or xf86-input-xwiimote which overwrites this.
# This only disables the raw input from the kernel devices. If you use the
# xwiimote tools to emulate mouses/keyboards, then they are not affected by
# this.

Section "InputClass"
	Identifier "Nintendo Wii Remote Raw Input Blacklist"
	MatchProduct "Nintendo Wii Remote"
	Option "Ignore" "on"
	Option "MapB" "KEY_BACKSPACE"
    Option "MapHome" "KEY_Escape"
    Option "MapOne" "KEY_Space"
    Option "MapTwo" "KEY_I"
EndSection

これでとりあえずはいいか?