LoginSignup
0
1

More than 5 years have passed since last update.

[Resolved] Raspberry Pi > GPIO > GPIO26の出力設定(Hレベル)でssh接続が切れる > link: Why are some GPIO pins not available? | Revisionにより使えるポートはさらに変わる

Last updated at Posted at 2018-02-27

(追記 2018/03/01) 以下に記載のGPIO pins not availableについてはRaspberry Pi2とPi3には適用されない情報かもしれません。実際にRaspberry Pi 2 Model BにてGPIO26は出力操作できることも確認しました。

動作環境
Raspberry Pi 2 Model B (以下RPi)
Raspbian Jessie
Python 2.7.9

試したこと

  • /sys/class/gpioにてGPIO26を設定
    • export: 26
    • direction: out
    • value: 1
    • >> CentOSからのssh接続が切れる

参考

Why are some GPIO pins not available?

According to this guide, only the following pins are available for my use:
2, 3, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 22, 23, 24, 25, 27, with 28, 29, 30, 31

GPIO26は使えない。

アタリ。

1時間無駄にした。

GPIO hardware hacking

さらに以下の情報も見つけた。

The complete list of chipset GPIO pins which are available on the GPIO connector is:
0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25
(on the Revision2.0 RaspberryPis, this list changes to: 2, 3, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 22, 23, 24, 25, 27, with 28, 29, 30, 31 additionally available on the P5 header)

Revisionにより使えるポートはさらに変わる。

どちらのRevisionでも使えるのは以下だろう。(疲れたので、自分でリストを作りたくないのでPythonで)。

参考: リストとリストを比較して、共通する要素をリストで取り出す方法

情報感謝です。

# Python 2.7.13
gpio_rev1 = [0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25]
gpio_rev2 = [2, 3, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 22, 23, 24, 25, 27, 28, 29, 30, 31]

rev1_set = set(gpio_rev1)
rev2_set = set(gpio_rev2)
print(list(rev1_set & rev2_set))
run
[4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 22, 23, 24, 25]

GPIO09 (SPI_MISO)とGPIO10 (SPI_MOSI)には自作ピンヘッダでラベル付けしているので、これを使うと配線の時間を短縮できそう。

GPIO09とGPIO10で出力方向に設定しても、電圧が一定にならない。
何か理解してない仕組みがあるのだろう(未消化)。

解決

(追記 2018/03/01)

犯人は自分であり、GPIO26のH,L監視により、シャットダウンする機能を実行していました。

外部スイッチでのシャットダウンに使っています。

0
1
3

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
0
1