- 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.
Receive and transmit IR remote codes
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Receive and transmit IR remote codes
I have now produced a hopefully stable release. Any users are advised to update. These are the major changes:
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Receive and transmit IR remote codes
This now supports the Raspberry Pi Pico in addition to Pyboards and ESP32. The receiver supports ESP8266.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 6
- Joined: Wed Aug 12, 2020 11:09 am
Re: Receive and transmit IR remote codes
Thanks Peter, for this and all the other contributions you have done for programmers.
Re: Receive and transmit IR remote codes
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
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
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Receive and transmit IR remote codes
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.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Receive and transmit IR remote codes
Hi,pythoncoder wrote: ↑Thu Apr 01, 2021 8:48 amBut 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.
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
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
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
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Receive and transmit IR remote codes
Given that you know you have a Sony 12 bit remote you should be able to run
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.
Code: Select all
from ir_rx.test import test
test(2) # The specific test for Sony 12 bit
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Receive and transmit IR remote codes
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.
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.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Receive and transmit IR remote codes
Please see the micropython-remote library which does this.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.