LoginSignup
5
5

More than 1 year has passed since last update.

Ubuntu で RC-S300/P を使うメモ

Posted at

動作確認環境

uname -a
Linux z370 5.13.0-30-generic #33-Ubuntu SMP Fri Feb 4 17:03:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

手順

依存のインストール

ビルド関係

sudo apt install gcc cmake make automake autoconf libtool pkg-config

USB 関係

sudo apt install libusb-1.0-0 libusb-1.0-0-dev

PC/SC 関係

sudo apt install libpcsclite-dev pcscd pcsc-tools

libccid のインストール

apt でもインストールできるが, 21.10 Impish では 1.4.34 が最新版 (2022/02/27 現在) であり,これは RC-S300/P に対応していない.
ソースからビルドしてもよいが,怠惰なので 22.04 Jammy 用のものをインストールする.

sudo apt install http://archive.ubuntu.com/ubuntu/pool/universe/c/ccid/libccid_1.5.0-2_amd64.deb
sudo systemctl restart pcscd # PC/SC は裏にデーモンがいるので libccid を認識させるために再起動しておく

libnfc のビルドとインストール

ビルド

デフォルトで PC/SC サポートは含まれないため,ビルドパラメータで指定する必要がある.
怠惰なので今回は all で指定した.

git clone https://github.com/nfc-tools/libnfc.git
pushd libnfc
autoreconf -vis
./configure --with-drivers=all
make

インストール

設定ファイルをコピーしておく.

sudo make install
mkdir -p /usr/local/etc/nfc
cp ./libnfc.conf.example /usr/local/etc/nfc/libnfc.conf
popd

設定

デフォルトで PC/SC デバイスをスキャンしないので,設定ファイルを変更する.

/usr/local/etc/nfc/libnfc.conf
  # Allow intrusive auto-detection (default: false)
  # Warning: intrusive auto-detection can seriously disturb other devices
  # This option is not recommended, user should prefer to add manually his device.
- # allow_intrusive_scan = false
+ allow_intrusive_scan = true

動作確認

❯ nfc-list 2>/dev/null | grep SONY
NFC device: SONY FeliCa RC-S300/P (0040232) 01 00 opened
5
5
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
5
5