Library to import for IR remote ESP8266

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
Shariq_newbie
Posts: 4
Joined: Wed Feb 05, 2020 7:31 pm
Location: India

Library to import for IR remote ESP8266

Post by Shariq_newbie » Thu Feb 06, 2020 4:57 am

Hello,
I'm newbie to micropython not to python.
I have ir remote that runs on nodemcu and is written in default c++ type language. However i am confused while translating it to run in micropython..

My question is which library to import for IR remote 8266 ? Im specifically trying to transmit ir.sendRC6( code,24) command.
Any idea?

User avatar
jimmo
Posts: 1633
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Library to import for IR remote ESP8266

Post by jimmo » Wed Feb 12, 2020 5:10 am

hi,

Sorry I'm not aware of a good option for this right now, hopefully someone else knows more though. It would be really nice to make this work though.

The problem is that there isn't a way to drive a pin at precisely 38kHz from MicroPython. It's not impossible, but it will require some support from the firmware (which hasn't been implemented). Have a look at this thread for more information -- viewtopic.php?f=14&t=2823 There was a note from Peter in a thread I saw here about perhaps using the PWM to generate the 38kHz carrier and a mosfet to modulate it from the TX pin of a UART (assuming the UART supports the correct baud rate).

It might be possible to use the MOSI line of the SPI peripheral (possibly at some multiple of 38kHz) to do this. You'll need a way to generate the encoded RC6 data, but that should be fairly straightforward.

Can you describe which components you're using? I assume it's just a straightforward IR LED (which needs the modulation to be done by the MCU) rather than a module with its own 38kHz carrier generator?

Shariq_newbie
Posts: 4
Joined: Wed Feb 05, 2020 7:31 pm
Location: India

Re: Library to import for IR remote ESP8266

Post by Shariq_newbie » Wed Feb 12, 2020 5:33 am

Hello Jimmo,

Thanks for your response.
jimmo wrote:
Wed Feb 12, 2020 5:10 am
Can you describe which components you're using? I assume it's just a straightforward IR LED (which needs the modulation to be done by the MCU) rather than a module with its own 38kHz carrier generator?
I am simply using a esp8266 based nodemcu and digital ir module..and just to explain what i mean here is my c++ implementation poc https://youtu.be/k4pKGrE4Z5o

Thanks again

User avatar
jimmo
Posts: 1633
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Library to import for IR remote ESP8266

Post by jimmo » Wed Feb 12, 2020 6:26 am

Shariq_newbie wrote:
Wed Feb 12, 2020 5:33 am
digital ir module
Can you provide a link to the module?

Shariq_newbie
Posts: 4
Joined: Wed Feb 05, 2020 7:31 pm
Location: India

Re: Library to import for IR remote ESP8266

Post by Shariq_newbie » Wed Feb 12, 2020 7:48 am

This is the c++ library that i took reffered
https://github.com/crankyoldgit/IRremoteESP8266

Please note i am not the creator of this scripts.

User avatar
pythoncoder
Posts: 4164
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

IR transmitters

Post by pythoncoder » Wed Feb 12, 2020 8:26 am

Most IR transmitter modules are just an IR LED. I did find this one on Ebay but there only seems to be a single source in Germany of a Chinese made unit. It looks easy to interface (via a UART) but the single source puts me off supporting it.

I did somewhere suggest using PWM on a Pyboard as a source of stable 38KHz. I don't think a UART could be used to modulate it because of the start and stop bits. My original idea was to generate the pulse train on a pin, which would be easy as it's relatively slow. A simple external gate would drive the IR LED.

On reflection this is surely silly because the PWM duty cycle could be set to 0 or 50% in code. I can feel an experiment coming on.
[EDIT]
See these results.
Peter Hinch

Post Reply