semenaa Posted December 2, 2015 Share Posted December 2, 2015 Hello. I'm having trouble with infrared receiver. Whether the sunxi_cir driver installed in kernel or not, there is nothing in /dev/input except "event0", which is the power controller. Dmesg doesn't show anything neither. Version: Armbian 4.5 Lamobo-r1 Debian jessie next (unofficial), kernel 4.2.3. IR support was declared on download web page, so I decided to get vanilla kernel. That's because I had already tried Bananian with 3.18 kernel, and there were huge problems with kernel ppp (up to freezes of whole device). Has anybody encountered this problem? Link to comment Share on other sites More sharing options...
zador.blood.stained Posted December 2, 2015 Share Posted December 2, 2015 I'm using IR receiver with mainline kernel, but as raw LIRC device (/dev/lirc0), not via devinput driver. However I do have input devices created by IR module. Please load these modules sunxi_cir lirc_dev ir_lirc_codec and post output of these commands: dmesg | grep sunxi-ir dmesg | grep lirc cat /proc/bus/input/devices lsmod Link to comment Share on other sites More sharing options...
semenaa Posted December 2, 2015 Author Share Posted December 2, 2015 (edited) dmesg | grep sunxi-ir shows nothing. % dmesg | grep lirc [250575.979154] lirc_dev: IR Remote Control driver registered, major 248 % cat /proc/bus/input/devices I: Bus=0000 Vendor=0000 Product=0000 Version=0000 N: Name="axp20x-pek" P: Phys=m1kbd/input2 S: Sysfs=/devices/platform/soc@01c00000/1c2ac00.i2c/i2c-0/0-0034/axp20x-pek/input/input0 U: Uniq= H: Handlers=kbd event0 B: PROP=0 B: EV=3 B: KEY=100000 0 0 0 see? there's only the power controller. % lsmod Module Size Used by ir_lirc_codec 4287 0 lirc_dev 7734 1 ir_lirc_codec sunxi_cir 3735 0 xt_TCPMSS 3026 1 xt_tcpudp 2077 1 iptable_mangle 1390 1 ipt_MASQUERADE 1019 1 nf_nat_masquerade_ipv4 1817 1 ipt_MASQUERADE iptable_nat 1469 1 nf_conntrack_ipv4 6729 1 nf_defrag_ipv4 1300 1 nf_conntrack_ipv4 nf_nat_ipv4 4352 1 iptable_nat nf_nat 10937 2 nf_nat_ipv4,nf_nat_masquerade_ipv4 nf_conntrack 68650 4 nf_nat,nf_nat_ipv4,nf_nat_masquerade_ipv4,nf_conntrack_ipv4 ip_tables 11101 2 iptable_mangle,iptable_nat x_tables 10666 5 ip_tables,xt_tcpudp,ipt_MASQUERADE,xt_TCPMSS,iptable_mangle l2tp_ppp 15625 4 l2tp_netlink 7667 1 l2tp_ppp l2tp_core 15168 2 l2tp_ppp,l2tp_netlink ip6_udp_tunnel 1514 1 l2tp_core udp_tunnel 1527 1 l2tp_core bnep 9700 2 bluetooth 295282 5 bnep brcmfmac 159174 0 brcmutil 4893 1 brcmfmac rtl8192cu 88371 0 rtl_usb 11860 1 rtl8192cu rtl8192c_common 55558 1 rtl8192cu rtlwifi 80197 3 rtl_usb,rtl8192c_common,rtl8192cu mac80211 353201 3 rtl_usb,rtlwifi,rtl8192cu evdev 9492 1 dwmac_sunxi 2111 0 sun4i_ts 3926 0 sg 21882 0 I already had added the sunxi_cir module in /etc/modules and rebooted couple times. Edited February 26, 2016 by wildcat_paris the spoiler maniac has updated the message Link to comment Share on other sites More sharing options...
zador.blood.stained Posted December 2, 2015 Share Posted December 2, 2015 Hm. Then what is output of cat /proc/device-tree/model cat /proc/device-tree/soc@01c00000/ir@01c21800/status Maybe IR node is not enabled in device tree or wrong dtb is loaded? Link to comment Share on other sites More sharing options...
semenaa Posted December 2, 2015 Author Share Posted December 2, 2015 % cat /proc/device-tree/model Lamobo R1 however: % cat /proc/device-tree/soc@01c00000/ir@01c21800/status disabled there is another one: cat /proc/device-tree/soc@01c00000/ir@01c21c00/status disabled what should I do? Link to comment Share on other sites More sharing options...
zador.blood.stained Posted December 2, 2015 Share Posted December 2, 2015 You should recompile /boot/dtb/sun7i-a20-lamobo-r1.dtb, changing "disabled" to "okay". ir@01c21800 { compatible = "allwinner,sun4i-a10-ir"; clocks = <0x29 0x6 0x2a>; clock-names = "apb", "ir"; interrupts = <0x0 0x5 0x4>; reg = <0x1c21800 0x40>; status = "disabled"; }; Use this post as example: http://forum.armbian.com/index.php/topic/382-armbian-on-pcduino3/#entry2444 Edit: you also need to add pinctrl values and ir0_rx_pins_a label: ir@01c21800 { compatible = "allwinner,sun4i-a10-ir"; clocks = <0x29 0x6 0x2a>; clock-names = "apb", "ir"; interrupts = <0x0 0x5 0x4>; reg = <0x1c21800 0x40>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&ir0_rx_pins_a>; }; ir0_rx_pins_a: ir0@0 { allwinner,pins = "PB4"; allwinner,function = "ir0"; allwinner,drive = <0x0>; allwinner,pull = <0x0>; linux,phandle = <0x33>; phandle = <0x33>; }; Link to comment Share on other sites More sharing options...
semenaa Posted December 2, 2015 Author Share Posted December 2, 2015 Thanks. I just tried your dtb file, and now: cat /proc/device-tree/soc@01c00000/ir@01c21800/status okay dmesg shows this: [ 8.681762] /soc@01c00000/ir@01c21800: could not get #clock-cells for /soc@01c00000/pinctrl@01c20800/uart3@1 [ 8.681794] ERROR: could not get clock /soc@01c00000/ir@01c21800:apb(0) [ 8.681850] sunxi-ir 1c21800.ir: failed to get a apb clock. [ 8.681906] sunxi-ir: probe of 1c21800.ir failed with error -2 take note that the source of messages is sunxi-ir somehow. Link to comment Share on other sites More sharing options...
zador.blood.stained Posted December 2, 2015 Share Posted December 2, 2015 Sorry, I copypasted block from other file and didn't notice it has different values sun7i-a20-lamobo-r1.tar Link to comment Share on other sites More sharing options...
semenaa Posted December 2, 2015 Author Share Posted December 2, 2015 Thanks. Now it shows devices in /dev/input, however I can not see anything from my RC though evtest. Can this be connected with settings in the dtb file? Anyway, I have to go now, thanks a lot for your help, will continue to work tomorrow, maybe. Link to comment Share on other sites More sharing options...
zador.blood.stained Posted December 2, 2015 Share Posted December 2, 2015 First, test your receiver with irrecord, something like this (load lirc modules from message #2 in this topic): sudo irrecord -d /dev/lirc0 /tmp/remote.conf If dots are appearing when you start to learn, then Device Tree settings are correct. Next thing you need to check - if you want to use devinput, you should probably load kernel keymap decoder (Edit: no need, they are built-in) and configure input device to use it. Check cat /sys/class/rc/rc0/protocols for list of available and selected (in brackets) protocols, try selecting protocol with sudo sh -c "echo nec > /sys/class/rc/rc0/protocols" or something like this. Edit 2: Or install ir-keytable 1 Link to comment Share on other sites More sharing options...
semenaa Posted December 3, 2015 Author Share Posted December 3, 2015 Thank you very much, it works. Now I also read through the LIRC documentation and things get much clearer. The only question I have is why there was wrong dtb file. Guess it happens with small community distributions like this. Anyway, thanks again. 1 Link to comment Share on other sites More sharing options...
Rui Ribeiro Posted December 9, 2015 Share Posted December 9, 2015 Hi, I tried to follow those steps with the last armbian, and when doing sudo dtc -I dts -O dtb sun7i-a20-lamobo-r1.dts -o /boot/sun7i-a20-lamobo-r1.dtb I got the error: ERROR (explicit_phandles): /gmac-3v3 has duplicated phandle 0x33 (seen before at /soc@01c00000/ir0@0) ERROR (explicit_phandles): /gmac-3v3 has duplicated phandle 0x33 (seen before at /soc@01c00000/ir0@0) ERROR: Input tree has errors, aborting (use -f to force output) What can I do about it? It seems this block is already using phandle 0x33 gmac-3v3 { compatible = "regulator-fixed"; pinctrl-names = "default"; pinctrl-0 = <0x39>; regulator-name = "gmac-3v3"; regulator-min-microvolt = <0x325aa0>; regulator-max-microvolt = <0x325aa0>; startup-delay-us = <0x186a0>; enable-active-high; gpio = <0x1c 0x7 0x17 0x0>; linux,phandle = <0x33>; phandle = <0x33>; }; Link to comment Share on other sites More sharing options...
zador.blood.stained Posted December 9, 2015 Share Posted December 9, 2015 You don't need to add whole block, just append label before one that already exists ir0_rx_pins_a: Edit: since it's impossible to change font inside code blocks, I marked parameters that should be added or changed: 1 Link to comment Share on other sites More sharing options...
dobriloff Posted February 21, 2016 Share Posted February 21, 2016 Hello I have the same issue with Infrared on BananaPi R1. My device was installed with Armbian_5.00_Lamobo-r1_Debian_jessie_4.4.1 This is the output from commands: cat /proc/device-tree/modelLamobo R1 cat /proc/device-tree/soc@01c00000/ir@01c21800/status disabled I try to modify /boot/dtb/sun7i-a20-lamobo-r1.dtb to proposed above value but , it's still not working. I try to check again the value in /boot/dtb/sun7i-a20-bananapi-r1.dtb and I saw two value are changed strange pinctrl-0 = <0x2d>; it was pinctrl-0 = <&ir0_rx_pins_a>; vabel ir0_rx_pins_a missing on ir0@0 It looks dtc program change the values. This is the way how I convert the file. dtc -I dtb -O dts /boot/dtb/sun7i-a20-bananapi-r1.dtb -o /tmp/temp.dts vi /tmp/temp.dts dtc -I dts -O dtb /tmp/temp.dts -o /boot/dtb/sun7i-a20-bananapi-r1.dtb Additionally I have IR LED transmitter which I intent to connect to some of GPIO , can you help me with that too. I saw in release history , that the image have support for that but I cannot find the module. added LIRC GPIO receive and send driver for legacy Allwinner Link to comment Share on other sites More sharing options...
Igor Posted February 21, 2016 Share Posted February 21, 2016 LED transmitter driver is working only on kernel 3.4.x , all other info is provided in the link you posted here. Link to comment Share on other sites More sharing options...
dobriloff Posted February 21, 2016 Share Posted February 21, 2016 Hello Igor, Thank you for quick answer , now I'll download Armbian_5.00_Lamobo-r1_Debian_jessie_3.4.110 image. Can you advice me about the way to start transmitter ? Walking around in Internet , I found only posts about lirc_rpi module where I can set options like modprobe lirc_rpi gpio_in_pin=23 gpio_out_pin=16. I mean after I connect IR LED , for example to physical pin 10 which is gpio 16 , how to became operational in LIRC , irsend . Until now I make tests few days in Bananian but I get error: hardware does not support sending added LIRC GPIO receive and send driver for legacy Allwinner -- Was my reason to switch to armbian , because I need to send IR signals to few devices. Link to comment Share on other sites More sharing options...
dobriloff Posted February 21, 2016 Share Posted February 21, 2016 Now I saw there are module lirc_gpio which have desired options for pin. How I can get pin number of embedded IR receiver. Link to comment Share on other sites More sharing options...
erpomata Posted May 7, 2016 Share Posted May 7, 2016 HelloI'm trying to activate the IR receiver, but when I try to re convert the dts I have this error: ERROR (explicit_phandles): / soc @ 01c00000 / IR0 @ 0 has duplicated phandle 0x33 (seen before at / soc @ 01c00000 / pinctrl @ 01c20800 / i2c0 @ 0) ERROR (explicit_phandles): / soc @ 01c00000 / IR0 @ 0 has duplicated phandle 0x33 (seen before at / soc @ 01c00000 / pinctrl @ 01c20800 / i2c0 @ 0) ERROR: Input tree has errors, aborting (use -f to force output) I try to use the -f option?My kernel is 4.5.2-SunXi (SMP) armv7lThank you Resolved with this Link to comment Share on other sites More sharing options...
Recommended Posts