上海問屋の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
#

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

Windows用NFSサーバ「FreeNFS」


2020/10/23追記

自分でコンパイルする必要があるのだが、User-space NFSv3 Server(unfs3)というものがあり、「Windows向け手順」を参考にMinGW環境でunfsd.exeを作成できるようだ。


FreeNFSというWindows用のNFSサーバソフトウェアが出た。

NFS v3対応、ということで、試してみたんだけど、Linuxサーバからうまく接続ができない・・・

# rpcinfo -p 172.17.44.21
   プログラム バージョン プロトコル ポート
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100005    3   tcp    635  mountd
    100005    3   udp    635  mountd
    100003    3   tcp   2049  nfs
    100003    3   udp   2049  nfs
# mount 172.17.44.21:/ /mnt
mount: mount to NFS server '172.17.44.21' failed: RPC Error: Authentication error.
# mount -v -t nfs 172.17.44.21:/ /mnt
mount: trying 172.17.44.21 prog 100003 vers 3 prot tcp port 2049
mount: mount to NFS server '172.17.44.21' failed: RPC Error: Authentication error.
#

Windowsファイアウォールの設定を解除しても同じ状況。
どこらの問題かなぁ・・・


2019/06/27追記

いまも時々このページにアクセスがあるので、そういえばどうなってるんだろ?と再チャレンジ

現在はFreeNFSと、セキュリティ関連を甘くしているぽいFreeNFSEの2種類があるようだ。

ただ、どちらで試しても同じようにエラーとなっている。

# rpcinfo -p 172.17.44.74
   program vers proto   port  service
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100005    3   tcp    635  mountd
    100005    3   udp    635  mountd
    100003    3   tcp   2049  nfs
    100003    3   udp   2049  nfs
# mount -v 172.17.44.74:/ /mnt
mount.nfs: timeout set for Thu Jun 27 11:07:24 2019
mount.nfs: trying text-based options 'vers=4.1,addr=172.17.44.74,clientaddr=172.17.44.73'
mount.nfs: mount(2): Permission denied
mount.nfs: trying text-based options 'vers=4.0,addr=172.17.44.74,clientaddr=172.17.44.73'
mount.nfs: mount(2): Permission denied
mount.nfs: trying text-based options 'addr=172.17.44.74'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 172.17.44.74 prog 100003 vers 3 prot TCP port 2049
mount.nfs: portmap query failed: RPC: Authentication error
mount.nfs: access denied by server while mounting 172.17.44.74:/
# showmount -e 172.17.44.74
rpc mount export: RPC: Procedure unavailable
#

ぐぐってみても、FreeNFSに関する事例はどれも解決していない。

だ~か~ら~「sec=nosec」とか「vers指定」とかやっても駄目だったというとるのに、なんでまた試せとかいうん?とという展開になっている。

で、「haneWIN NFS Server for Windows」という似たようなNFSサーバに逃げているようだ