Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What is going on with this article?
@nanashi-tech

RaspberryPi2のCannot find module 'rpi-gpio'を解決した

More than 3 years have passed since last update.

目的:

RaspberryPi2とAE-BME280を利用し、
mBaaSのKiiに温度湿度気圧情報を格納する。

現象:

参考URL
https://docs.kii.com/ja/guides/external_services/mythings/device_preparation/raspberrypi_setup/
において

サンプルコード
https://github.com/KiiPlatform/thing-if-node-sample

test-gpio.js
実行時に
Error: Cannot find module 'rpi-gpio'
が発生する。

処置:

npm install rpi-gpio

でインストールを試すが、エラー出力

./npm-debug.log
を確認し、
epoll@0.1.21のインストールが必要であると確認

参考URL
https://github.com/fivdi/epoll/issues/14

より

sudo npm install -f --unsafe-perm node-gyp
sudo node-gyp rebuild
sudo npm install rpi-gpio --save

により正常にrpi-gpioのインストールが完了

sudo node test-gpio.js

が正常に動作した。

環境:

Hard:Raspberry Pi2 Model B
OS:RASPBIAN JESSIE WITH PIXEL
Release date:2017-01-11
Kernel version:4.4

1
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
1
Help us understand the problem. What is going on with this article?