Has anyone made an RMT IR Receive library for ESP32/arduino?

marcmerlin
Posts: 14
Joined: Mon Apr 17, 2017 12:50 am

Has anyone made an RMT IR Receive library for ESP32/arduino?

Postby marcmerlin » Mon Mar 25, 2019 1:06 am

I know about this library, https://github.com/z3t0/Arduino-IRremote , I contributed the ESP32 support for it 2 years ago.
That being said, that library is all interrupt driven and the ESP32 support I added doesn't make use of RMT, which would be a pretty complex change in that library.

Has anyone written another ESP32 RMT IR receive library that I may be able to use?

u063096
Posts: 22
Joined: Wed Feb 13, 2019 3:27 pm

Re: Has anyone made an RMT IR Receive library for ESP32/arduino?

Postby u063096 » Mon Mar 25, 2019 4:35 pm

I was struggling to find a RMT library to deal with 433MHz data delivered on a GPIO pin. There simply is none in the public, so I wrote my own classes to handle that. It works quite nicely now, but it is special from the point where the RMT has delivered the captured signal data into the ring buffer.
I attached the relevant files*; basically, the ManchesterRX class will process the RMT output in a separate task, generating BitStream buffers with the found signal sequences in binary form. The host will have to process the BitStreams as seems fit and release the buffers again for re-use by ManchesterRX.
The speciality comes from the omission of any other signals than Manchester or PWM encoded messages (the latter with two different phase lengths only) - for IR you certainly will have to extend it.
Feel free to use anything you may need. I will be happy discussing what you may find ;)

*it seems not to be possible to add more than three files to a post here, so please find the BitStream files in the next.
Attachments
ManchesterRX.h
(1.8 KiB) Downloaded 254 times
ManchesterRX.cpp
(9.63 KiB) Downloaded 258 times

u063096
Posts: 22
Joined: Wed Feb 13, 2019 3:27 pm

Re: Has anyone made an RMT IR Receive library for ESP32/arduino?

Postby u063096 » Mon Mar 25, 2019 4:35 pm

BitStream files included here.
Attachments
BitStream.h
(1.76 KiB) Downloaded 262 times
BitStream.cpp
(2.9 KiB) Downloaded 237 times

marcmerlin
Posts: 14
Joined: Mon Apr 17, 2017 12:50 am

Re: Has anyone made an RMT IR Receive library for ESP32/arduino?

Postby marcmerlin » Thu Mar 28, 2019 2:10 pm

Thanks for sharing. I think Infrared is 38Khz, but I'll see if your code can be made to used anyway.

u063096
Posts: 22
Joined: Wed Feb 13, 2019 3:27 pm

Re: Has anyone made an RMT IR Receive library for ESP32/arduino?

Postby u063096 » Thu Mar 28, 2019 4:15 pm

It all depends on the clock divider in rmt_config. The RMT is capable of up to 4MHz AFAIK. I am using a relatively high divider of 150, giving a sampling rate of 80MHz/150=533 kHz. Even that would be about 14 times oversampling for a 38kHz signal.

Oh, BTW: I am sampling a 2000bd signal, not the 433MHz carrier :mrgreen:

marcmerlin
Posts: 14
Joined: Mon Apr 17, 2017 12:50 am

Re: Has anyone made an RMT IR Receive library for ESP32/arduino?

Postby marcmerlin » Wed Apr 10, 2019 5:17 pm

I was pointed to https://github.com/lbernstone/IR32 and was able to use it.
It has some small unreliabilities I'm still working with, but overall it works.

fabltd
Posts: 2
Joined: Wed Oct 16, 2019 7:59 pm

Re: Has anyone made an RMT IR Receive library for ESP32/arduino?

Postby fabltd » Wed Oct 16, 2019 8:33 pm

Hi

I am struggling with trying to receive 433 Mhz data myself. My data is not manchester encoded. I am not sure how to use your bitstream lib.

I need to detect the start of a transmission. 15.6 MS LOW followed by 2.6 MS HIGH then capture 64 bits.

A Logic 0 is 0.88 ms low and 0.44 HIGH and a Logic 1 is 0.44 LOW and 0.88 HIGH.

I have tried using digital read but cannot capture the LOGIC signals in time. I think the RMT is what i need but I am now stuck as no idea how to use it.

Help...

JT

Who is online

Users browsing this forum: MSN [Bot] and 16 guests