Jump to content


Photo

Lirc Input GPIO


  • Please log in to reply
24 replies to this topic

#1 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 26 January 2017 - 02:57 PM

Hello,

 

I have a special Ir Receiver which works on a raspberry but not on nano pi neo air... input levels are different ?

I can receive signal (I have pulses and spaces) but datas are corrupted and I must transmit longer to have a proper result...

 

Is it possible to change Lirc input pin ?



#2 jernej

jernej

    Advanced Member

  • Senior Members
  • PipPipPip
  • 446 posts

Posted 26 January 2017 - 07:53 PM

I have a special Ir Receiver which works on a raspberry but not on nano pi neo air... input levels are different ?

 

Can't tell if you don't provide exact part name and how is it connected to the board.

 

 

Is it possible to change Lirc input pin ? or set GPIO in pullup or pulldown modes ? Maybe it will solve this problem...

 

No, PL11 pin is the only one which supports IR RX mode. Pull-up/-down resistors are usually external, which means that you need to add it if applicable. Check schematic for any OrangePi board with IR (all of them except zero)



#3 martinayotte

martinayotte

    Advanced Member

  • Senior Members
  • PipPipPip
  • 442 posts

Posted 26 January 2017 - 07:58 PM

(all of them except zero)

Why ? PiZero has the PL11 too ...



#4 jernej

jernej

    Advanced Member

  • Senior Members
  • PipPipPip
  • 446 posts

Posted 26 January 2017 - 08:07 PM

It has a possibility, but it doesn't include IR by default, whereas other boards do. I was talking about schema from which you can clearly see how to properly connect IR.



#5 martinayotte

martinayotte

    Advanced Member

  • Senior Members
  • PipPipPip
  • 442 posts

Posted 26 January 2017 - 08:45 PM

Ah ! Ok ! I've misunderstood ... ;)



#6 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 27 January 2017 - 10:50 AM

Can't tell if you don't provide exact part name and how is it connected to the board.

 

About what can't you tell me ? Nevermind

You tell me that schematics are differents and I see PL11 it is pulled up with at 3.3V with a 10k

(http://wiki.friendly...8-Schematic.pdf Sheet 10)

 

So I better understand now :) Thank you ^^

 

I must know now how to change the lirc software input (in order to use a different input pin on which I will be able to add a pullup if necessary)

I checked script.fex, lirc hardware.conf, boot.cmd but I can't find how to manage it, I must recompile the driver ?



#7 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 27 January 2017 - 12:02 PM

I have found something in the fex file

https://github.com/l...range_pi_pc.fex

 

[s_cir0]

ir_used = 1

ir_rx = port:PL11<2><1><default><default>

 

The wiki tell to use it

https://linux-sunxi....yARM_NanoPi_NEO

 

It will be ok if I change port:PL11 => port:PA2 ? (for example)

SMC is not used... so PA2 is free I think.

After fex to bin then reboot



#8 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 27 January 2017 - 12:23 PM

Pull-up/-down resistors are usually external

 

Mmmm.... "usually" ? This is a point of view ^^ It protects the board and can be set by software when internal. Now I see the difference with rasp but never mind. I hope I will be able to change the lirc input :D



#9 zador.blood.stained

zador.blood.stained

    Advanced Member

  • Moderators
  • 1838 posts

Posted 27 January 2017 - 12:27 PM

Please read the @jernej's message fully

No, PL11 pin is the only one which supports IR RX mode. 


Spoiler

#10 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 27 January 2017 - 12:38 PM

Please read the @jernej's message fully

 

Read my message fully please Is it possible to change Lirc input pin ? I don't need the 'IR RX mode' you are talking about. Maybe I can modify the fex file in order to use lirc with another hardware input ?

 

Is it possible to change Lirc input pin ?



#11 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 27 January 2017 - 12:54 PM

If someone knows how to modify lirc input, I am still interested :) :)



#12 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 27 January 2017 - 01:34 PM

It will be ok if I change port:PL11 => port:PA2 ? (for example)

SMC is not used... so PA2 is free I think.

After fex to bin then reboot

 

Very wrong idea to use PA02 :D



#13 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 27 January 2017 - 02:27 PM

That's what I do on rapsberry :

modprobe lirc_rpi gpio_in_pin=17

 

How can I do on NanoPiNeoAir ?



#14 jernej

jernej

    Advanced Member

  • Senior Members
  • PipPipPip
  • 446 posts

Posted 27 January 2017 - 03:11 PM

I have found something in the fex file

https://github.com/l...range_pi_pc.fex

 

[s_cir0]

ir_used = 1

ir_rx = port:PL11<2><1><default><default>

 

The wiki tell to use it

https://linux-sunxi....yARM_NanoPi_NEO

 

It will be ok if I change port:PL11 => port:PA2 ? (for example)

SMC is not used... so PA2 is free I think.

After fex to bin then reboot

 

Actually, ir_rx is not used anywhere, because PL11 is the only pin which supports HW IR receive.

 

I don't need the 'IR RX mode' you are talking about.

 

Which mode you need then? TX? It is not supported by HW.

 

That's what I do on rapsberry :

modprobe lirc_rpi gpio_in_pin=17

 

How can I do on NanoPiNeoAir ?

P.S. This driver doesn't use HW unit, you should use sunxi_cir (or something like that, I can't check in this moment) for pin PL11

 

AFAIK, RPi doesn't have HW IR support. Driver emulates this functionality through GPIO and external interrupts. Some people already fiddle with it, but I did not hear any success story. I'm not sure if those people actually understand what they were doing. One of the prerequirements is that pin must support external interrupt.

 

I never bothered to try to make it work on a GPIO if HW IR on PL11 work flawlessly on basically any Orange and should on any other board too. There are some who managed to hand solder it to One and it worked.

 

You tell me that schematics are differents and I see PL11 it is pulled up with at 3.3V with a 10k

(http://wiki.friendly...8-Schematic.pdf Sheet 10)

 

According to Orange Pi PC Plus schematic that 10k pull up is ok for IR. Just add 33R resistor between 3.3V and IR receiver power pin and decoupling capacitor and you should be fine.

 

I still don't understand why you are so determined to use it on another pin.



#15 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 27 January 2017 - 03:34 PM

@jernej Stories ? I don't know. I just want to use lirc like I use it on rasp.
I retrieve pulses and spaces with rasp and I want to do it on nanopi.
 
A command line like "modprobe sunxi_cir gpio_in_pin=17" should be great if you have it.
 
I don't want a "pin which supports HW IR receive" if "RPi doesn't have HW IR support" I don't know why you are telling to me that I can't use lirc without it.
Just want to change lirc on another input pin because as far as I know PL11 and his hardware doest not do what I want.
 
So Is it possible to change Lirc input pin ?


#16 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 29 January 2017 - 06:04 PM

I removed the 10k pullup resistance, I expected to have the same input level as on rasp, but I don't... How can I do ?

 

 

According to Orange Pi PC Plus schematic that 10k pull up is ok for IR. Just add 33R resistor between 3.3V and IR receiver power pin and decoupling capacitor and you should be fine.

 

I still don't understand why you are so determined to use it on another pin.

 

What value of coupling capacitor should I use ?

 

Must I compare the gpio input pin circuitry of the BCM2835 (rasp) with the H3 ?

If somebody knows the differences and how to get the same as rasp, it should be great.....

 

I thought NanoPiAir was rasp compatible but it's not :( ?



#17 jernej

jernej

    Advanced Member

  • Senior Members
  • PipPipPip
  • 446 posts

Posted 29 January 2017 - 06:18 PM

Why do you expect that it will be completely the same as with Raspberry? They have completely different chips with nothing in common, not even the CPU cores.

 

I said that 10k pull-up should be there for receiver, I don't know why did you remove it. If you are really desperate to use same driver as on Raspberry Pi, then you will have to do dirty work of making driver H3 compatible. Please read whole thread: https://forum.armbia...ansmit/?p=24200

 

Still, you didn't answer why do you need this if not for receiver (IR RX).

I don't need the 'IR RX mode' you are talking about.



#18 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 29 January 2017 - 06:34 PM

I don't want to transmit, I just want to have the same result (input level) as I have on rasp.

 

 

Hello,

 

I have a special Ir Receiver which works on a raspberry but not on nano pi neo air... input levels are different ?

I can receive signal (I have pulses and spaces) but datas are corrupted and I must transmit longer to have a proper result...

 

Is it possible to change Lirc input pin ?

How can I make lirc working like on rasp

 


#19 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 29 January 2017 - 06:36 PM

I said that 10k pull-up should be there for receiver, I don't know why did you remove it.

 

Why did I removed it ? I think you are asking too many existential questions....

I removed it because I don't want to have a pullup (I don't have a pull up as far as I know on rasp) and because according to you it's not possible to use lirc on another input.

 

Does somebody knows how to get the same input level as on rasp ?  :D 



#20 jernej

jernej

    Advanced Member

  • Senior Members
  • PipPipPip
  • 446 posts

Posted 29 January 2017 - 06:46 PM

No, I don't, because I happily use already present IR receiver on Oranges (same chip). Maybe someone else can help you.



#21 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 29 January 2017 - 06:54 PM

I use a remote every day on beelink and it's ok, but it's not the question, please better read my topic !

I have a special receiver and I just want to make it work like on my rasp, so :

 

Does somebody knows how to get the same input level as on rasp ?    :D 

 

Or if someone knows the schematic differences ? I still don't understand what's the difference and how make things works like on rasp...

What electrical input levels or input filters are different inside the chip ?



#22 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 29 January 2017 - 07:48 PM

For example this board is sold gpio compatible with rasp, is it ?

https://www.alibaba....0508338897.html



#23 zador.blood.stained

zador.blood.stained

    Advanced Member

  • Moderators
  • 1838 posts

Posted 29 January 2017 - 08:30 PM

These boards may be similar to the Raspberry Pi, but they are not compatible with the RPi and generic Raspberry Pi knowledge and instructions may not apply to Orange Pi boards.

 

For example this board is sold gpio compatible with rasp, is it ?

https://www.alibaba....0508338897.html

Similar? Yes. Compatible? No. This board (Orange Pi One), for example, requires soldering to connect IR receiver since PL11 is not present on any pin headers.

Most of HW interfaces (UART, SPI, I2C) will be present on the same pins on the pin header, but from software PoV functionality of these pins (PWM, IR receiving, interrupts) will be different.


Spoiler

#24 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 30 January 2017 - 10:38 AM

Thank you Zador for your answer :D

 

Actually the sunxi_cir driver gives some pulses and spaces with real time precision, so software is perfect I think.

I think it's a hardware problem because when the signal of the receiver is strength enough, it works !

 

Maybe it's due to insulation or the input level is 5V or that's because it's multiplexed ?

 

I compare

http://www.mosaic-in...-specifications

And

http://dl.linux-sunx...asheet_V1.0.pdf

 

But I can't find an explaination.

Why I don't have the same result I have on rasp and how can I have it ?



#25 sirob

sirob

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 16 February 2017 - 04:08 AM

I see that sunxi_cir hardware threshold detection can be modified, usually used to reduce noise level.

http://lxr.free-elec.../rc/sunxi-cir.c

 

I don't know if it will increase pulses and spaces detection for my use...

 

I see that there are many drivers when I try a make menuconfig

/usr/src/linux-headers-3.4.113-sun8i/drivers/media/rc/Kconfig

 

I tried to use another module so I made modifications in /etc/lirc/hardware.conf

# MODULES="sunxi_cir"

MODULES="lirc_dev"
 

It does not seems to have effect, I have nearly the same wrong pulses and spaces (still a bad level detection I think).

If I modify the sunxi-cir.c how can I generate the ko ?