lirc config not enought to configure as input GPIO

Please report any bug found here

lirc config not enought to configure as input GPIO

Postby Darioia » 01 Nov 2017, 13:13

Hi.
I use a RPI3 Rev B and rune 0.3 beta version.
I'd like to use BCM GPIO23 (J8 pin 16) to lirc (input) and I have configured in config.txt the following line:

dtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22,gpio_in_pull=up

The gpio is still configured as Out:

[root@runeaudio ~]# gpio readall
+-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
.....
| 22 | 3 | GPIO. 3 | OUT | 1 | 15 || 16 | 0 | OUT | GPIO. 4 | 4 | 23 |
.....
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+

To solve the first problem using a python script:

#!/usr/bin/python2

import RPi.GPIO as gpio
gpio.setmode(gpio.BCM)
gpio.setup(23, gpio.IN, pull_up_down=gpio.PUD_UP)
gpio.cleanup()
exit()

and now mode2 command works.

BR
Dario

https://pastebin.com/0gcVL9a1
Darioia
 
Posts: 2
Joined: 01 Nov 2017, 02:45

Re: lirc config not enought to configure as input GPIO

Postby hondagx35 » 02 Nov 2017, 13:29

Hi Dario,

i did some tests with my latest image for the Pi2/3 and all works like it should.

What i did:
- modified config.txt
Code: Select all
dtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22,gpio_in_pull=up

- installed a TSOP receiver on Pin 23
IR_Empfänger_TSOP4838_Steckplatine.jpg
IR_Empfänger_TSOP4838_Steckplatine.jpg (47.77 KiB) Viewed 1507 times

- rebooted
- checked the port directions
Code: Select all
root@runeaudio(rw):~# echo "23" > /sys/class/gpio/export
root@runeaudio(rw):~# echo "22" > /sys/class/gpio/export
root@runeaudio(rw):~# cat /sys/class/gpio/gpio22/direction
out
root@runeaudio(rw):~# cat /sys/class/gpio/gpio23/direction
in

- tested mode2 from lirc package
Code: Select all
root@runeaudio(rw):~# mode2
Using device: /dev/lirc0
Using device: /dev/lirc0
Warning: Running as root.
space 4163330
pulse 9051
space 4409
pulse 641
space 506
pulse 622
space 487
pulse 621
space 487
pulse 645
space 483
pulse 646
space 506
pulse 600
space 506
pulse 625
space 485
.......

- used irrecord to generate a config file:
Code: Select all
# Please take the time to finish this file as described in
# https://sourceforge.net/p/lirc-remotes/wiki/Checklist/
# and make it available to others by sending it to
# <lirc@bartelmus.de>
#
# This config file was automatically generated
# using lirc-0.9.3a(default) on Thu Nov  2 13:38:29 2017
# Command line used: -d /dev/lirc0 /root/lircd.conf
# Kernel version (uname -r): 4.9.50-1-ARCH
#
# Remote name (as of config file): test
# Brand of remote device, the thing you hold in your hand:
# Remote device model nr:
# Remote device info url:
# Does remote device has a bundled capture device e. g., a
#     usb dongle? :
# For bundled USB devices: usb vendor id, product id
#     and device string (use dmesg or lsusb):
# Type of device controlled
#     (TV, VCR, Audio, DVD, Satellite, Cable, HTPC, ...) :
# Device(s) controlled by this remote:

begin remote

  name  test
  bits           32
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100

  header       9029  4432
  one           609  1634
  zero          609   512
  ptrail        611
  repeat       9033  2189
  gap          107724
  toggle_bit_mask 0x0

      begin codes
          KEY_PLAY                 0x00F90AF5 0x25745300
          KEY_NEXT                 0x00F9C03F 0x25745300
          KEY_UP                   0x00F9C23D 0x25745300
          KEY_DOWN                 0x00F950AF 0x25745300
      end codes

end remote


All works as expected!
I was not able to test this on the official version, but with latest image it works.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

support RuneAudio Donate with PayPal


Return to Bug report

Who is online

Users browsing this forum: No registered users and 1 guest