何も対策をせずにubuntu12.04をインストールして、SCR3310-NTTComを使おうとすると、録画に失敗する事がありますので、スマートカードリーダ関係のパッケージはバージョンを固定してインストールする必要がある。
$ server-admin@mythen:~$ sudo aptitude remove pcscd libpcsclite-dev libpcsclite1 libccid libpcsc-perl pcsc-tools
deb http://ftp.jaist.ac.jp/pub/Linux/ubuntu maverick main universe deb-src http://ftp.jaist.ac.jp/pub/Linux/ubuntu maverick main universe deb http://security.ubuntu.com/ubuntu maverick-security main universe deb-src http://security.ubuntu.com/ubuntu maverick-security main universe
$ server-admin@mythen:~$ sudo apt-get update $ server-admin@mythen:~$ sudo apt-get install pcscd=1.5.5-3ubuntu2.1 libpcsclite1=1.5.5-3ubuntu2.1 libccid=1.3.11-1 pcsc-tools=1.4.16-1
server-admin@mythen:~$ sudo dpkg --list | grep "pcscd\|libpcsclite1\|libccid\|pcsc-tools" hi libccid 1.3.11-1 PC/SC driver for USB CCID smart card readers hi libpcsclite1 1.5.5-3ubuntu2.1 Middleware to access a smart card using PC/SC (library) hi pcsc-tools 1.4.16-1 Some tools to use with smart cards and PC/SC hi pcscd 1.5.5-3ubuntu2.1 Middleware to access a smart card using PC/SC (daemon side)
server-admin@mythen:$ sudo apt-get install wajig
$ server-admin@mythen:~$sudo wajig hold pcscd $ server-admin@mythen:~$sudo wajig hold libpcsclite1 $ server-admin@mythen:~$sudo wajig hold libccid $ server-admin@mythen:~$sudo wajig hold pcsc-tools
server-admin@mythen:~$ sudo dpkg --get-selections | grep hold libccid hold libpcsclite1 hold pcsc-tools hold pcscd hold
server-admin@mythen:~$ sudo pcsc_scan
PC/SC device scanner
V 1.4.16 (c) 2001-2009, Ludovic Rousseau <ludovic.rousseau@free.fr>
Compiled with PC/SC lite version: 1.5.3
Scanning present readers...
0: SCM SCR 3310 NTTCom 00 00
Sat Dec 1 12:41:34 2012
Reader 0: SCM SCR 3310 NTTCom 00 00
Card state: Card inserted, Shared Mode,
ATR: 3B F0 12 00 FF 91 81 B1 7C 45 1F 03 99
ATR: 3B F0 12 00 FF 91 81 B1 7C 45 1F 03 99
+ TS = 3B --> Direct Convention
+ T0 = F0, Y(1): 1111, K: 0 (historical bytes)
TA(1) = 12 --> Fi=372, Di=2, 186 cycles/ETU
21505 bits/s at 4 MHz, fMax for Fi = 5 MHz => 26881 bits/s
TB(1) = 00 --> VPP is not electrically connected
TC(1) = FF --> Extra guard time: 255 (special value)
TD(1) = 91 --> Y(i+1) = 1001, Protocol T = 1
-----
TA(2) = 81 --> Protocol to be used in spec mode: T=1 - Unable to change - defined by interface bytes
TD(2) = B1 --> Y(i+1) = 1011, Protocol T = 1
-----
TA(3) = 7C --> IFSC: 124
TB(3) = 45 --> Block Waiting Integer: 4 - Character Waiting Integer: 5
TD(3) = 1F --> Y(i+1) = 0001, Protocol T = 15 - Global interface bytes following
-----
TA(4) = 03 --> Clock stop: not supported - Class accepted by the card: (3G) A 5V B 3V
+ Historical bytes:
+ TCK = 99 (correct checksum)
Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3B F0 12 00 FF 91 81 B1 7C 45 1F 03 99
Japanese Chijou Digital B-CAS Card (pay TV) <---- ■ 正しく BS 赤カードを認識していることを確認 ■
wget http://hg.honeyplanet.jp/pt1/archive/c44e16dbb0e2.zip unzip c44e16dbb0e2.zip cd pt1-c44e16dbb0e2/arib25 make sudo make install
$ tar -zxvf pt1-drv_20111001.tar.gz $ cd pt1-7662d0ecd74b/recpt1
server-admin@mythen:~$ cat Downloads/pt1-7662d0ecd74b/recpt1/pt1_dev.h
/* -*- tab-width: 4; indent-tabs-mode: nil -*- */
#ifndef _PT1_DEV_H_
#define _PT1_DEV_H_
char *bsdev[NUM_BSDEV] = {
"/dev/pt3video1",
"/dev/pt3video0",
"/dev/pt3video5",
"/dev/pt3video4",
"/dev/pt3video9",
"/dev/pt3video8",
"/dev/pt3video13",
"/dev/pt3video12"
};
char *isdb_t_dev[NUM_ISDB_T_DEV] = {
"/dev/pt3video2",
"/dev/pt3video3",
"/dev/pt3video6",
"/dev/pt3video7",
"/dev/pt3video10",
"/dev/pt3video11",
"/dev/pt3video14",
"/dev/pt3video15"
};
以下は変更なし$ ./autogen.sh $ ./configure --enable-b25 $ make clean $ make $ sudo make install
<ドライバインストール時の注意事項>
Ubuntu 10.10 からは標準ドライバ(DVB版)が使われるようになったらしいのですが、
以前より使われているchardev版の方を利用します。
$ sudo echo "blacklist earth-pt1" >> /etc/modprobe.d/blacklist.conf $ git clone https://github.com/m-tsudo/pt3.git $ cd pt3/ $ git log $ make clean ; make $ sudo make install
$ server-admin@mythen:~$ ls -la /dev/pt* | grep video crw-rw-rw- 1 root video 249, 0 11月 24 09:11 /dev/pt3video0 crw-rw-rw- 1 root video 249, 1 11月 24 09:11 /dev/pt3video1 crw-rw-rw- 1 root video 249, 2 11月 24 09:11 /dev/pt3video2 crw-rw-rw- 1 root video 249, 3 11月 24 09:11 /dev/pt3video3
server-admin@mythen:~$ recpt1 --b25 --strip 27 20 test.ts using B25... enable B25 strip pid = 3882 C/N = -nandB Recording... Recorded 21sec
sudo apt-get install apache2 php5 libapache2-mod-php5 php5-cli mysql-server php5-mysql
cd epgdumpr2 make clean ; make sudo cp epgdump /usr/local/bin
mysql -uroot -p <--- mysqladmin を入力
server-admin@mythen:/$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 67 Server version: 5.5.41-0ubuntu0.14.04.1 (Ubuntu) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> drop database epgrec; Query OK, 0 rows affected (0.00 sec) mysql> create database epgrec; Query OK, 1 row affected (0.00 sec) mysql> grant all on epgrec.* to epgrec@localhost identified by 'epgrecadmin'; Query OK, 0 rows affected (0.02 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.01 sec)
lrwxrwxrwx 1 root root 26 11月 18 16:08 epgrec -> /raid_vol/www/html/epgrec/
%PROCESS($TITLE$,$LIMIT$,120,$REPLACE$,"~","ー")%_%TYPE%_%CH%
epgrec で録画済ファイルを削除しようとしたときに、”Error過去の録画予約です”と表示され、削除できなくなることがある。
server-admin@mythen:~$ mysql -u root -p Enter password: <--- mysqladmin Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 185 Server version: 5.5.28-0ubuntu0.12.04.2 (Ubuntu)
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | epgrec | | gallery3 | | mysql | | performance_schema | | test | +--------------------+ 6 rows in set (0.00 sec) mysql> use epgrec Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed
mysql> select id, complete from Recorder_reserveTbl where endtime < now(); +----+----------+ | id | complete | +----+----------+ | 2 | 0 | | 7 | 1 | | 17 | 0 | | 35 | 1 | +----+----------+ 7 rows in set (0.00 sec)
mysql> start transaction; Query OK, 0 rows affected (0.00 sec) mysql> update Recorder_reserveTbl set complete = 1 where id =2; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> update Recorder_reserveTbl set complete = 1 where id =17; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> commit; Query OK, 0 rows affected (0.00 sec)
mysql> select id, complete from Recorder_reserveTbl where endtime < now(); +----+----------+ | id | complete | +----+----------+ | 2 | 1 | | 7 | 1 | | 17 | 1 | | 35 | 1 | | 36 | 1 | | 37 | 1 | | 43 | 1 | +----+----------+ 7 rows in set (0.00 sec) mysql> \q; Bye
$filename = preg_replace("/\x{301c}/u","_", trim($filename) ); // U+301C WAVEDASH
$filename = preg_replace("/\x{ff5e}/u","_", trim($filename) ); // U+FF5E FULLWIDTH TIL
server-admin@mythen:~$ cd /raid_vol/www/html/epgrec/ server-admin@mythen:/raid_vol/www/html/epgrec$ ./recomplete.php [録画ID]
何らかの理由でエラーが発生しているがphp.ini内のerror_reportingディレクティブにnoneなどが設定されているためにエラー表示が行われない状態です。ディストリビューションの一部(CentOSあたりがそう)はerror_reportingの設定をnoneにしているようです。まず、php.iniを探し(普通は/etc/php/などの下にありCLI、CGI、Apacheモジュールのそれぞれで異なるファイルが使われるので注意してください)error_reportingの右辺をAllなどに変更してWebサーバーを再起動させましょう。 その上でトップページにアクセスすればエラーメッセージが表示されるはずです。その表示からなにかわかるでしょう。 なお、error_reportingをnoneに設定するのは公開Webサーバーでエラーが表示されると見かけが悪いという理由によります(サーバー用のCentOSがそうしているのはたぶんそのため)。epgrecのようにパブリックには公開されていないWebサーバでnoneにする意味はなく、トラブルの原因をわからなくする素敵な役割しかありませんのでnoneにするのはやめた方がいいでしょう。
munakata@mythen:~ (master #)$ sudo pcsc_scan
PC/SC device scanner
V 1.4.22 (c) 2001-2011, Ludovic Rousseau <ludovic.rousseau@free.fr>
Compiled with PC/SC lite version: 1.8.10
Using reader plug'n play mechanism
Scanning present readers...
0: NTT Communications Corp. SCR3310-NTTCom USB SmartCard Reader [Vendor Interface] 00 00
Mon Jan 2 15:39:39 2017
Reader 0: NTT Communications Corp. SCR3310-NTTCom USB SmartCard Reader [Vendor Interface] 00 00
Card state: Card inserted, Shared Mode,
ATR: 3B F0 12 00 FF 91 81 B1 7C 45 1F 03 99
ATR: 3B F0 12 00 FF 91 81 B1 7C 45 1F 03 99
+ TS = 3B --> Direct Convention
+ T0 = F0, Y(1): 1111, K: 0 (historical bytes)
TA(1) = 12 --> Fi=372, Di=2, 186 cycles/ETU
21505 bits/s at 4 MHz, fMax for Fi = 5 MHz => 26881 bits/s
TB(1) = 00 --> VPP is not electrically connected
TC(1) = FF --> Extra guard time: 255 (special value)
TD(1) = 91 --> Y(i+1) = 1001, Protocol T = 1
-----
TA(2) = 81 --> Protocol to be used in spec mode: T=1 - Unable to change - defined by interface bytes
TD(2) = B1 --> Y(i+1) = 1011, Protocol T = 1
-----
TA(3) = 7C --> IFSC: 124
TB(3) = 45 --> Block Waiting Integer: 4 - Character Waiting Integer: 5
TD(3) = 1F --> Y(i+1) = 0001, Protocol T = 15 - Global interface bytes following
-----
TA(4) = 03 --> Clock stop: not supported - Class accepted by the card: (3G) A 5V B 3V
+ Historical bytes:
+ TCK = 99 (correct checksum)
Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3B F0 12 00 FF 91 81 B1 7C 45 1F 03 99
Japanese Chijou Digital B-CAS Card (pay TV)
munakata@mythen:~/Download (master #)$ wget http://www.wazoku.net/softcas.zip --2017-01-02 12:59:58-- http://www.wazoku.net/softcas.zip www.wazoku.net (www.wazoku.net) をDNSに問いあわせています... 216.34.181.97 www.wazoku.net (www.wazoku.net)|216.34.181.97|:80 に接続しています... 接続しました。 HTTP による接続要求を送信しました、応答を待っています... 200 OK 長さ: 31446 (31K) [application/octet-stream] `softcas.zip' に保存中 100% [================================================================================ ====================================>] 31,446 181KB/s 時間 0.2s 2017-01-02 12:59:59 (181 KB/s) - `softcas.zip' へ保存完了 [31446/31446]
munakata@mythen:~/Download (master #)$ unzip softcas.zip Archive: softcas.zip inflating: softcas/Crypto.cpp inflating: softcas/Crypto.h inflating: softcas/Decoder.h inflating: softcas/Decoder-ECM.cpp inflating: softcas/Global.h inflating: softcas/Keyset.cpp inflating: softcas/Keyset.h inflating: softcas/softcas.sln inflating: softcas/softcas.vcxproj inflating: softcas/softcas.vcxproj.filters creating: softcas/Win32/ inflating: softcas/Win32/winscard.dll inflating: softcas/Win32/winscard.ini inflating: softcas/winscard.cpp creating: softcas/x64/ inflating: softcas/x64/winscard.dll inflating: softcas/x64/winscard.ini
munakata@mythen:~/Download (master #)$ cd softcas munakata@mythen:~/Download/softcas (master #)$ ls -l 合計 80 -rw-rw-r-- 1 munakata munakata 13209 4月 13 2016 Crypto.cpp -rw-rw-r-- 1 munakata munakata 296 4月 13 2016 Crypto.h -rw-rw-r-- 1 munakata munakata 1917 4月 13 2016 Decoder-ECM.cpp -rw-rw-r-- 1 munakata munakata 331 4月 13 2016 Decoder.h -rw-rw-r-- 1 munakata munakata 410 4月 13 2016 Global.h -rw-rw-r-- 1 munakata munakata 1084 4月 13 2016 Keyset.cpp -rw-rw-r-- 1 munakata munakata 486 9月 12 12:25 Keyset.h drwxrwxr-x 2 munakata munakata 4096 9月 12 12:27 Win32 -rw-rw-r-- 1 munakata munakata 1235 4月 13 2016 softcas.sln -rw-rw-r-- 1 munakata munakata 7834 9月 11 21:28 softcas.vcxproj -rw-rw-r-- 1 munakata munakata 1429 4月 13 2016 softcas.vcxproj.filters -rw-rw-r-- 1 munakata munakata 13080 9月 12 02:41 winscard.cpp drwxrwxr-x 2 munakata munakata 4096 9月 12 12:27 x64
munakata@mythen:~/Download/softcas (master #)$ wget -O Makefile http://pastebin.com/raw/FQdSixkB
--2017-01-02 13:06:06-- http://pastebin.com/raw/FQdSixkB
pastebin.com (pastebin.com) をDNSに問いあわせています... 104.20.208.21, 104.20.209.21
pastebin.com (pastebin.com)|104.20.208.21|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 特定できません [text/plain]
`Makefile' に保存中
[ <=> ] 364 --.-K/s 時間 0s
2017-01-02 13:06:07 (21.5 MB/s) - `Makefile' へ保存終了 [364]
munakata@mythen:~/Download/softcas (master #)$ wget -O winscard.cpp http://pastebin.com/raw/5144Ah9g
--2017-01-02 13:04:33-- http://pastebin.com/raw/5144Ah9g
pastebin.com (pastebin.com) をDNSに問いあわせています... 104.20.208.21, 104.20.209.21
pastebin.com (pastebin.com)|104.20.208.21|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 特定できません [text/plain]
`winscard.cpp' に保存中
[ <=> ] 3,463 --.-K/s 時間 0s
2017-01-02 13:04:33 (142 MB/s) - `winscard.cpp' へ保存終了 [3463]munakata@mythen:~/Download/softcas (master #)$ sed -i "/LONG SCardGetStatusChange/s/LPSCARD_READERSTATE_A/LPSCARD_READERSTATE/g" winscard.cpp
munakata@mythen:~/Download/softcas (master #)$ sed -i "s/SCARD_IO_REQUEST g_rgSCardT1Pci;/const SCARD_IO_REQUEST g_rgSCardT1Pci= { SCARD_PROTOCOL_T1, sizeof(SCARD_IO_REQUEST) };/g" winscard.cppmunakata@mythen:~/Download/softcas (master #)$ cp ../softcas_win/Keys.h . munakata@mythen:~/Download/softcas (master #)$ cp ../softcas_win/Keys.cpp .
munakata@mythen:~/Download/softcas (master #)$ nkf -Lu --overwrite *.cpp munakata@mythen:~/Download/softcas (master #)$ nkf -Lu --overwrite *.h munakata@mythen:~/Download/softcas (master #)$ nkf -Lu --overwrite Makefile
munakata@mythen:~/Download/softcas (master #)$ ls -l 合計 80 -rw-rw-r-- 1 munakata munakata 13209 4月 13 2016 Crypto.cpp -rw-rw-r-- 1 munakata munakata 296 4月 13 2016 Crypto.h -rw-rw-r-- 1 munakata munakata 1917 4月 13 2016 Decoder-ECM.cpp -rw-rw-r-- 1 munakata munakata 331 4月 13 2016 Decoder.h -rw-rw-r-- 1 munakata munakata 410 4月 13 2016 Global.h -rw------- 1 munakata munakata 1834 1月 2 13:08 Keys.cpp -rw------- 1 munakata munakata 447 1月 2 13:08 Keys.h -rw-rw-r-- 1 munakata munakata 1084 4月 13 2016 Keyset.cpp -rw-rw-r-- 1 munakata munakata 486 9月 12 12:25 Keyset.h -rw-rw-r-- 1 munakata munakata 364 1月 2 13:06 Makefile drwxrwxr-x 2 munakata munakata 4096 9月 12 12:27 Win32 -rw-rw-r-- 1 munakata munakata 1235 4月 13 2016 softcas.sln -rw-rw-r-- 1 munakata munakata 7834 9月 11 21:28 softcas.vcxproj -rw-rw-r-- 1 munakata munakata 1429 4月 13 2016 softcas.vcxproj.filters -rw-rw-r-- 1 munakata munakata 3517 1月 2 13:07 winscard.cpp drwxrwxr-x 2 munakata munakata 4096 9月 12 12:27 x64
munakata@mythen:~/Download/softcas (master #)$ make g++ -g -fPIC -O2 -I /usr/include/PCSC -c -o Keys.o Keys.cpp Keys.cpp:11:1: error: too many initializers for ‘const Keyset_t’ }; ^ Keys.cpp:19:1: error: too many initializers for ‘const Keyset_t’ }; ^ Keys.cpp:27:1: error: too many initializers for ‘const Keyset_t’ }; ^ Keys.cpp:35:1: error: too many initializers for ‘const Keyset_t’ }; ^ Keys.cpp:43:1: error: too many initializers for ‘const Keyset_t’ }; ^ Keys.cpp:51:1: error: too many initializers for ‘const Keyset_t’ }; ^ Keys.cpp:59:1: error: too many initializers for ‘const Keyset_t’ }; ^ make: *** [Keys.o] エラー 1
Keys.cppのname("WOWOW"等)をcomment outすることでコンパイルできた。