Page 2 of 4

Re: Receive and transmit IR remote codes

Posted: Sun Mar 22, 2020 6:48 pm
by pythoncoder
I have now produced a hopefully stable release. Any users are advised to update. These are the major changes:
  • Support for the MCE protocol (as used to control Kodi etc).
  • Improved docs.
  • Bugfix to RC5X where polarity of extended bit was inverted (rx and tx). Also affects RC5.
  • Bugfix to NEC transmitter where MSB of address was ignored.
  • Transmitter now validates args and raises a ValueError if out of range.
There is limited support for capturing and replaying unknown IR sequences. This is not a universal remote control, for reasons explained in the docs. Tools are provided to help experimenters write code to receive, store and "blast" undocumented, proprietary protocols. This without establishing the protocol structure - a task which can be quite challenging.

Re: Receive and transmit IR remote codes

Posted: Tue Mar 09, 2021 11:57 am
by pythoncoder
This now supports the Raspberry Pi Pico in addition to Pyboards and ESP32. The receiver supports ESP8266.

Re: Receive and transmit IR remote codes

Posted: Fri Mar 26, 2021 2:16 am
by uncoded0123
Thanks Peter, for this and all the other contributions you have done for programmers.

Re: Receive and transmit IR remote codes

Posted: Thu Apr 01, 2021 7:14 am
by shegger
Hi Peter,
thanks for your code. I successfully implemented it. I saw your video on YouTube regarding the codes of different remote controls.
Is there somewhere a list of all codes of remote controls? When I have a device, which may be controlled by an remote control, do I have to buy the remote controll first, read the address and codes first? Can I use the lirc codes?

In the lirc codes I see e.g.
name Samsung_VCR
bits 16
flags SPACE_ENC|REPEAT_HEADER|CONST_LENGTH
# flags SPACE_ENC|REPEAT_HEADER
eps 25
aeps 100

header 4560 4410
one 625 1600
zero 625 490
ptrail 625
repeat 625 490
pre_data_bits 16
pre_data 0xA0A0
gap 100000
# gap 97350
# repeat_gap 48900
# repeat_gap 30800
toggle_bit 0


begin codes
KEY_POWER 0x00000000000040BF # Was: Power

Re: Receive and transmit IR remote codes

Posted: Thu Apr 01, 2021 8:48 am
by pythoncoder
shegger wrote:
Thu Apr 01, 2021 7:14 am
Hi Peter,
thanks for your code. I successfully implemented it. I saw your video on YouTube regarding the codes of different remote controls.
Is there somewhere a list of all codes of remote controls?...
I have no video on YouTube.

Unfortunately I have a minimal grasp of LIRC. My solution does assume that you have a sample of the remote and capture its codes. If you know the protocol used by a piece of kit (NEC, Sony, Philips etc) then you might be able to figure out which button transmits which code by experimentation. But if you have the piece of kit, wouldn't you also have the remote?

I am sure this information could be extracted from LIRC files, but I haven't investigated this.

Re: Receive and transmit IR remote codes

Posted: Thu Apr 01, 2021 3:38 pm
by shegger
pythoncoder wrote:
Thu Apr 01, 2021 8:48 am
But if you have the piece of kit, wouldn't you also have the remote?

I am sure this information could be extracted from LIRC files, but I haven't investigated this.
Hi,
I have a camera which is able to be controlled by a remote control, but it is an add on. So I would have to buy the remote control to get the code and then I do not need it any longer. So my guess was, to get this information from, lirc, because there are a lot of remote controls listed. I will check and if I find out how to get the codes from lirc I will inform you.

Best Stefan

Re: Receive and transmit IR remote codes

Posted: Sun Apr 11, 2021 3:58 pm
by shegger
Hi Peter,
I'm still struggling with your code. I just tried to switch off my TV via pico. So I checked what remote control I have and it is a Sony 12 bit. Fine: So the RC was recognized. Now I wanted to send the power OFF code. Therefor I recorded the code via rx code to burst.py and then send it via tx code. But it does not work. Where do I make the mistake?

Best Stefan

Re: Receive and transmit IR remote codes

Posted: Mon Apr 12, 2021 6:55 am
by pythoncoder
Given that you know you have a Sony 12 bit remote you should be able to run

Code: Select all

from ir_rx.test import test
test(2)  # The specific test for Sony 12 bit
Then make a record of the data and address value associated with each button that is of interest. Transmitting using those values using the ir_tx SONY_12 class should work.

Re: Receive and transmit IR remote codes

Posted: Fri Apr 16, 2021 9:47 pm
by KOKS
Hello Peter!

I wondering if there is possibilty to use this code to transmit the signal on 433.92MHz. I'm trying to use the RPI pico with some RF transmitter module to remotely control an electrical outlet. What should i change in your code? Could you give me some tips?
I'm pretty sure it is not so hard but it is my first time with microcontroller and i don't really know how to start doing with that.

Re: Receive and transmit IR remote codes

Posted: Sat Apr 17, 2021 11:08 am
by pythoncoder
Please see the micropython-remote library which does this.