LoginSignup
8
5

More than 5 years have passed since last update.

StretchにおけるLIRCの設定方法に関して(2019/03/21)

Last updated at Posted at 2019-03-21

殴り書きなので要注意

背景

日立エアコンの赤外線解析して色々したい
→ Arduino UNO (and ESP32) + VS1838B + IRRemoteを使ってで試してみる
→ SRAMが小さくてBufferが足りない
→ 手持ちのRaspberry Pi 2B+で解析してみる
→ 『LIRCでRPiTPH Monitor/RPZ-IR-Sensorの赤外線制御』に従ってLIRCを導入してみる

mode2 -d /dev/lirc0

→ イケるやろ!!(謎の自信)


(出典:なんでも実況(ジュピター))






→ cannot initiate device /dev/lirc0

→ チ~ン(笑)

環境

  • Raspberry Pi 2B+ (SSH接続)
    • Distributor ID: Raspbian
    • Description: Raspbian GNU/Linux 9.8 (stretch)
    • Release: 9.8
    • Codename: stretch
  • LIRC 0.9.4c-9
  • 赤外線受信モジュール VS1838B
  • ジャンパワイヤ3本 メスメス

改善法

LIRCの設定において

/boot/config.txt
# Uncomment this to enable the lirc-rpi module
dtoverlay=lirc-rpi
dtparam=gpio_in_pin=18

とする部分を

/boot/config.txt
# Uncomment this to enable the lirc-rpi module
dtoverlay=gpio-ir, gpio_pin=18

と変更する.
おしり.
こんな感じで表示されれば成功です
(ちなみにPWMのところで851行ありました)

mode2 -d /dev/lirc0 | tee SwitchCoolerOn27C
Trying device: /dev/lirc0
Using device: /dev/lirc0
Using driver default on device /dev/lirc0
space 16777215
pulse 29693
space 49443
pulse 3302
space 1737
pulse 341
space 1336
pulse 340...

なんでこれで行けたんだろ??

適当にググって出てきたページから手当たり次第試したら出来ました
正直なところよくわかってないです
LibreElecのWikiサイト中のInfrared Remotesのやり方見たら
『Change dtoverlay=lirc-rpi to dtoverlay=gpio-ir in /flash/config.txt to switch to the newer gpio-rc-recv driver which replaces lirc-rpi.』
て書いてあったもんで試したら行けちゃったんですよねー
よく調べれば原因もわかりそうなんですけど
Raspbianにも上の仕様適応されたんですかね...(適当)

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