TEMPerのUSB温度計が届いた

上海問屋のUSB温度計はPCsensor OEMで紹介したUSB温度計ですが、上海問屋では売り切れだったので、DealExtremeで購入しました。

12/11:発注
12/13:DXから発送連絡
12/15:上海の郵便局の消印
12/22:東京に到着

という感じで、RegisterMailでないのに、2週間で届くというなかなかの好タイムでした。

DVC00113.JPG
DVC00114.JPG

こんなパッケージで届きました。

とりあえず、Windows8パソコンに指してみたところ、Windows標準のHIDドライバで認識されました。
認識直後から現在温度が自動的に入力される、という自体に陥りました。

ですが、とりあえず、1回、はずして、もう1回さしたところ、それは止まりました。
が・・・何かあったら、自動入力されそうで、ちょっと怖いです・・・

Linuxサーバでの実験は明日おこなう予定です。

なお、USBでの認識は以下でした。

HID\VID_0C45&PID_7401&REV_0001&MI_00

その後、Windows PC 4台に接続してみたのですが、いきなり入力状態にはなりませんでした。
なんだったんでしょうかねぇ・・・・

上海問屋のUSB温度計はPCsensor OEM

上海問屋取り扱いで、799円のUSB温度計 DNSB-35137 なるものが発売されるとのこと。

対応はWindowsとあるが、Linuxで使えないか可能性を調査。

写真に書いてある「TEMPer」で探したところ、あっさりと判明。

PCsensor.comの取り扱い商品の「TEMPer gold」でした。
メーカ直販リンク:「temperature controllers,USB PC thermometer, gold TEMPer
このメーカ、AliexpresseBayなどにも出しているので、お好きなところから買うこともできます。
その他だと、DealExtremeが送料込みで安いようですね。(いま←から輸入してますがいつ届くかな・・・)

Windows用のソフトウェアはメーカのSoftwareページにあります。
2012/12/10現在では、「27番」にあるドライバとソフトウェアのセット、TEMPer V23.5.zipが該当していると思われます。

Linuxでの利用については、いろいろ例があるようです。
TEMPerには「専用ドライバを必要とするもの」と「HIDとして認識され、キー入力として値が認識されるもの」の2種類があるようです。

「TEMPer gold」表面に記載されている「Caps lock to excel」という文面から察するに、おそらくこちらの製品はHIDとして認識されるタイプだと思われます。

で、使えるドライバについては、正直、まだ情報が整理できていないですね。

TEMPer Temperature Sensor Linux Driver
(2012/12/25修正)
HIDタイプ向けのドライバのようだ。
「HID\VID_1130&PID_660c」用のソフト。
コメント欄に様々な情報がある

http://www.isp-sl.com/pcsensor-0.0.1.tgz
上記のblogコメントにあった。
「HID\VID_0C45&PID_7401」用のソフト

https://github.com/edorfaus/TEMPered
C library and program for reading the TEMPer family of thermometer and hygrometer devices.
「HID\VID_1130&PID_660c」「HID\VID_0C45&PID_7401」「HID\VID_0C45&PID_7402」で使えるようだ。
コンパイルにはCMake 2.8以上が必要。

Amazon.co.jpの類似製品ページのレビュー
いろいろヒントが書いてあった。

ThermoHID
Windows向けのGUIソフト


2013/03/22追記
Linux用ドライバとして、うちで改良したものを「pcsensor-1.0.2 for TEMPerV1.2 with multi device support」で公開しています。

CentOS4の2012年03月以降のパッチ

検索でこの記事に来た人へ

2015年1月29日現在、ここにあるような個別で適用したりするのでは無く、Oracle Linux 4に切り替えてしまう、というのが楽でいいでしょう。
詳細は「RHEL4/CentOS4をOracle Linux4に!」で紹介しています。


CentOS4は、RHEL4のサポート期限終了に伴い、2012年2月末以降のパッチが公式に提供されていません。

とはいえ、まだ使いたい場合にどうするか?

同じRHELベースのOracle Enterprise Linuxのサイトで「Lifetime Support Policy: Coverage for Oracle Linux and Oracle VM」を見てみると2013年2月までサポートが続いているようだ。
そこで、Oracle Enterprise Linux 4.0のソースRPMディレクトリを見ると、2012年3月以降の日付のものがちらほら・・・

そんなわけで、そこからファイルを持ってきて使うことにする。

うちのサーバ(の1つ)で必要なものをリストアップすると、以下の4ファイル。

# wget https://oss.oracle.com/el4/SRPMS-updates/bind-9.2.4-38.0.2.el4.src.rpm
# wget https://oss.oracle.com/el4/SRPMS-updates/glibc-2.3.4-2.57.el4.1.src.rpm
# wget https://oss.oracle.com/el4/SRPMS-updates/openssl-0.9.7a-43.18.0.1.el4.src.rp
# wget https://oss.oracle.com/el4/SRPMS-updates/tzdata-2012i-2.0.1.el4.src.rpm

ダウンロードして、「rpmbuild –rebuild ファイル名」でRPMパッケージ作成し、インストール・・・っと。


追記1:

tzdataのchangelogを見ると、2012年5月の変更分からoracleの人が変更履歴を書いているので、RedHatの延長サポートとかとは関係なく、Oracle主体でSRPMを作っているようです。

以下はtzdata.specからの引用。

* Mon Nov 26 2012 Keshav Sharma <~@oracle.com> - 2012i-2.0.1.el4
- Backported fixes from 2012i-2 version of Oracle Linux 5
- Preserve hardlinks that zic leaves behind, install with cp -d (Petr Machata -~@redhat.com)
- Upstream 2012i
  - Cuba switched to DST
- Switch back to using system zic, ignore upstream Makefile at all. (Petr Machata - ~@redhat.com)
- Drop Factory from distribution (Petr Machata - ~@redhat.com)
- Upstream 2012h
  - Brazilian state Bahia no longer has DST.
  - Brazilian state Tocantins now has DST.
  - Israel has new DST rules next year.
  - Jordan stays on DST this winter.
- Upstream 2012g
  - Adjust the packaging for new Makefile
  - Palestine: Fall transition was Sep 21, not Sep 28
  - Samoa: Daylight Saving Time commences on Sunday 30th September
    2012 and ends on Sunday 7th of April 2013.
- Upstream 2012f
  - Fiji will start daylight savings at 2 am on Sunday 21st October 2012
    and end at 3 am on Sunday 20th January 2013.  Guess it will be like
    that in following years as well.
- Upstream 2012e
  - Tokelau is in time zone UTC+13, not UTC+14 (and always was)
- Upstream 2012d
  - Morocco will not observe DST during the month of Ramadan.
    DST cessation end date was corrected.
  - Drop tzdata-2012c-morocco.patch

* Thu Jul 19 2012 Keshav Sharma <~@oracle.com> - 2012c-1.0.2.el4
- Backported fixes from 2012c-3 version of Oracle Linux 5
   -- Morocco will not observe DST during the month of Ramadan

* Thu May 23 2012 Keshav Sharma <~@oracle.com> - 2012c-1.0.1.el4
- Backported fixes from 2012c-1 version of Oracle Linux 5
   - Haiti observes DST from 2012 on
   - Gaza Strip and Hebron observe DST in 2012
   - Change start of DST in Syria to last Friday in March

* Fri Mar 16 2012 Petr Machata <~@redhat.com> - 2012b-3.el4
- Morocco moved DST entry to last Sunday of April
- Resolves: #802542

追記2 2013/07/22

timezoneデータだけ地味にアップデートし続けています。
現在は2013/07/05更新の「tzdata-2013c-1.0.1.el4.src.rpm」が最新です。

ApacheのFancyIndexと文字化け

Apacheのauto index機能を使って、「http://~/ディレクトリ/」を開いた時に、ファイル一覧を取得できるようにしようと考えた。

が・・・
日本語UTF-8のファイル名を置いたところ、文字化けが発生。

調べると、サーバが返すレスポンスが「Content-Type: text/html;charset=ISO-8859-1」となっている、ということが判明。

いろいろ、試した結果、最終的に、「apache の mod_autoindex が ISO-8859-1 になってカオス」の情報にたどり着きました。

つまり、設定ファイルに以下の様な形で、autoindexにキャラクタセットのオプションを指定してしまう、というのが解決策でした。

Options ExecCGI Indexes
IndexOptions Charset=UTF-8

・・・マニュアルに書いていないオプションがあるとは・・・と思ったけど、探したら英語版マニュアルには書いてあった・・・

これだから日本語版マニュアルは・・・

安USBメモリ16GBにCentOS6を入れてみた

秋葉で安く売っていたSiliconPowerの16GB USBメモリにCentOSを入れてみた。

インストールに時間がかかるなぁ・・・とは思っていたが、まぁ、放置してたので、実時間はよくわからなかった。

で、先ほど、「yum check-update」したら27個のアップデートがあったので「yum update -y」を実施してみた。

17:38開始で、19:13にupdate自体は終了。
そこからcleanupを開始して、20:11まで。

で、usbutilsとpciutilsが入ってなかったので、「yum install usbutils pciutils」を実行したら4パッケージのインストールに10分程度。

そんな素敵なUSBメモリの「lsusb -v」の出力結果は以下です。

Bus 001 Device 002: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) 64MB QDI U2 DISK
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x090c Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.)
  idProduct          0x1000 64MB QDI U2 DISK
  bcdDevice           11.00
  iManufacturer           1 UFD 2.0
  iProduct                2 Silicon-Power16G
  iSerial                 3 1206049000100XXX
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval             255
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval             255
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)

hdparmで測ってみてもこの程度の速度。

# hdparm -t /dev/sda

/dev/sda:
 Timing buffered disk reads:   56 MB in  3.04 seconds =  18.42 MB/sec
#

まぁ・・・そんなもんですかねぇ・・・