LoginSignup
5
3

More than 5 years have passed since last update.

WiringPiで「Unable to determine hardware version. I see: Hardware : BCM2835」エラー

Last updated at Posted at 2017-05-08

RaspberryPiに入門!ということでLチカなるものをやろうとしたんだけど最初からハマったのでメモ。
※学習用にただ動けばOKというレベルまでもってくだけで根本解決ではないっす。

現象

WiringPiを使ってLEDを1秒つけるだけのスクリプト実行したら下記のようなエラーになった。

$ sudo python3 led.py
Unable to determine hardware version. I see: Hardware   : BCM2835
,
 - expecting BCM2708 or BCM2709.
If this is a genuine Raspberry Pi then please report this
to projects@drogon.net. If this is not a Raspberry Pi then you
are on your own as wiringPi is designed to support the
Raspberry Pi ONLY.

ソースは下記

led.py
import wiringpi as pi
import time

LED_PIN = 4

pi.wiringPiSetupGpio()
pi.pinMode(LED_PIN, pi.OUTPUT)

pi.digitalWrite(LED_PIN, pi.HIGH)
time.sleep(1)
pi.digitalWrite(LED_PIN, pi.LOW)

環境は以下のような感じ(細かいセットアップ何したか忘れた・・・)

Raspberry Pi 3 Model B(RS components)
NOOBS 2.4.0
WiringPi: 2.44

解決方法

タイトルのエラーをググってたら「Kernelをupgradeする前は動いてたんだ!」って書き込みがどっかにあったので4.9系の前の4.4系までダウングレードしてみたら動いた。

当初のKernelバージョンは4.9.24

$ uname -a
Linux rasp-jolly 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l GNU/Linux

4.4系の最新ぽいやつのハッシュを指定してダウングレード

$ sudo rpi-update 52241088c1da59a359110d39c1875cda56496764

再起動

$ sudo reboot

再起動後のKernelバージョン

$ uname -a
Linux rasp-jolly 4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l GNU/Linux

動いた!(Lチカに1時間以上かかったorz)

5
3
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
5
3