LoginSignup
14
15

More than 5 years have passed since last update.

Raspberry PIで温度と湿度を測定する

Last updated at Posted at 2015-04-14

使ったもの

設定手順

OSのインストール、ネットワークの設定は割愛します。

1. USBRHをRaspberryに差し込む


>$ dmesg
[省略]
[    3.742108] usb 1-1.3: Manufacturer: Strawberry Linux Co.,Ltd.

2. ライブラリのインストール


>$ sudo apt-get install gcc libusb-dev

USBRHからドライバを取得します。


>$ /tmp/
>$ wget http://ftp.nsysu.edu.tw/FreeBSD/ports/local-distfiles/sanpei/usbrh-0.05.tar.gz
>$ tar xvfz usbrh-0.05.tar.gz
>$ sudo cp -rf usbrh-0.05 /usr/local/src/usbrh-0.05
/usr/local/src/usbrh-0.05/usbrh_main.c
if((rc = usb_set_configuration(dh, dev->config->bConfigurationValue))<0){
    if( rc = usb_detach_kernel_driver_np(dh, dev->config->interface->altsetting->bInterfaceNumber)<0 ){ # ここが追加
        puts("usb_set_configuration error");
        usb_close(dh);
        exit(3);
    } # ここが追加
}

修正が終わったら、makeを実行する。


>$ cd usbrh-0.05
>$ sudo make

>$ sudo chown root:root usbrh
>$ sudo chmod u+s usbrh
>$ sudo mv -i usbrh /usr/local/bin/

試しに動かしてみる


>$ usbrh
24.34 21.81
14
15
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
14
15