先人達に感謝しつつ、動作確認までやってみる。
pip をインストール
$ curl -sL https://bootstrap.pypa.io/get-pip.py | sudo python
# バージョン確認
$ pip -V
nfcpy をインストール
$ sudo pip install nfcpy
PaSoRi を RaspberryPi に接続
認識していることを確認する。
$ lsusb
Bus 001 Device 005: ID xxx:xxx Sony Corp.
$ sudo python -m nfc
No handlers could be found for logger "nfc.llcp.sec"
This is the 0.13.5 version of nfcpy run in Python 2.7.13
on Linux-4.14.50-v7+-armv7l-with-debian-9.4
I'm now searching your system for contactless devices
** found SONY RC-S380/P NFC Port-100 v1.11 at usb:001:005
I'm not trying serial devices because you haven't told me
-- add the option '--search-tty' to have me looking
-- but beware that this may break other serial devs
2つめのコマンドは sudo をつけないと認識してくれなかった。
サンプルプログラムを実行してみる
$ curl -OL https://github.com/nfcpy/nfcpy/archive/v0.13.5.tar.gz
$ tar xzvf v0.13.5.tar.gz
$ cd nfcpy-0.13.5/examples
$ sudo python tagtool.py show
待機状態になるので試しにSuicaをかざす。
Type3Tag 'FeliCa Standard (RC-S???)' ID=xxxxxxxxxx PMM=xxxxxxxxxx SYS=0003
できた。今回はここまで。
参考
- http://nfcpy.readthedocs.io/en/latest/examples/index.html
- Raspberry Pi 2 で NFC (FeliCa) を使えるようにする
- https://github.com/nfcpy/nfcpy
- Raspberry PiでFelicaのIDmを表示する