Software based IR decoding, and sending, my first public git rep

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
Marius
Posts: 21
Joined: Fri Nov 30, 2018 2:08 pm

Software based IR decoding, and sending, my first public git rep

Post by Marius » Fri Feb 07, 2020 4:05 pm

I been a super fan of Micropython ever since i manage to install it to an old esp8266(first version, "arduino wifi module") and blinked my first led 2-3 years ago. I think it will help change the world of HW as we know it, and i really want to contribute as best as i can with that.

Im fairly new to programming. Ive been doing it in my spare time for a couple of years but nothing like many people here. This is a very early ugly draft and it hurts like hell to sharew it, but i tought it could be smart to show it to someone in a early stage, incase someone has any feedback or tips.

I rewrote a repo written for Raspberry Pi, that you can find here, https://github.com/Lime-Parallelogram/IR-Code-Decoder-- I linked to the repo in my repo, but i didnt fork it since its for Micropython (not sure if that was the right thing to do).

My repo-link. https://github.com/MariusHeier/ir_captu ... icropython

Its two files.
capture.py :
Times high, low values and then stores it in a list. The the list is decoded to a binary value, and then printed as hex.

send.py
I've used the data from capture.py as a test to see if it works. The data used is the high low timing values and not the decoded data. For some reason which i probably will find out soon it works about 50% of the times.

This is the captured list of timing values im sending.
[(0, 68), (1, 282), (0, 8827), (1, 4489), (0, 579), (1, 565), (0, 578), (1, 559), (0, 579), (1, 567), (0, 578), (1, 559), (0, 579), (1, 558), (0, 578), (1, 577), (0, 571), (1, 559), (0, 579), (1, 1668), (0, 579), (1, 1669), (0, 579), (1, 1669), (0, 580), (1, 1669), (0, 579), (1, 1669), (0, 578), (1, 1669), (0, 579), (1, 1669), (0, 579), (1, 1673), (0, 579), (1, 569), (0, 586), (1, 1661), (0, 570), (1, 1687), (0, 570), (1, 559), (0, 580), (1, 558), (0, 589), (1, 557), (0, 581), (1, 549), (0, 578), (1, 569), (0, 589), (1, 557), (0, 570), (1, 558), (0, 579), (1, 560), (0, 589), (1, 1659), (0, 597), (1, 1661), (0, 581), (1, 1659), (0, 589), (1, 1658), (0, 590), (1, 1668), (0, 578), (1, 1659), (0, 589)]
Hex: 0x501fec03f
Binary: 10100000001111111101100000000111111
Binary length: 35


And this is the list that i receive about 50% times when its wrong. It adds an extra timed 0, (0, 675), for some reason. If anyone would know why, let me know.
[(0, 68), (1, 282), (0, 675), (1, 499), (0, 8802), (1, 4708), (0, 604), (1, 714), (0, 623), (1, 753), (0, 612), (1, 760), (0, 658), (1, 703), (0, 620), (1, 751), (0, 605), (1, 733), (0, 612), (1, 751), (0, 613), (1, 1881), (0, 606), (1, 1823), (0, 649), (1, 1829), (0, 604), (1, 1874), (0, 612), (1, 1844), (0, 623), (1, 1825), (0, 658), (1, 1816), (0, 614), (1, 1853), (0, 640), (1, 713), (0, 605), (1, 1871), (0, 630), (1, 1833), (0, 573), (1, 790), (0, 623), (1, 723), (0, 615), (1, 752), (0, 623), (1, 761), (0, 587), (1, 732), (0, 658), (1, 693), (0, 640), (1, 723), (0, 640), (1, 721), (0, 570), (1, 1911), (0, 623), (1, 1826), (0, 657), (1, 1803), (0, 623), (1, 1853), (0, 569), (1, 1882), (0, 649), (1, 1824), (0, 649)]
Hex: 0x901fec03f
Binary: 100100000001111111101100000000111111
Binary length: 36

Ill share some photos of the setup in post two.

Marius
Posts: 21
Joined: Fri Nov 30, 2018 2:08 pm

Re: Software based IR decoding, and sending, my first public git rep

Post by Marius » Fri Feb 07, 2020 4:19 pm

Some modules i made for prototyping. And some cnc milled irboards with rx/tx ir leds.
modules.jpg
modules.jpg (78.81 KiB) Viewed 2537 times

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

Re: Software based IR decoding, and sending, my first public git rep

Post by pythoncoder » Fri Feb 07, 2020 6:58 pm

There is a MicroPython decoder for NEC IR remotes in this repo.
Peter Hinch
Index to my micropython libraries.

Marius
Posts: 21
Joined: Fri Nov 30, 2018 2:08 pm

Re: Software based IR decoding, and sending, my first public git rep

Post by Marius » Sat Feb 08, 2020 7:11 am

pythoncoder wrote:
Fri Feb 07, 2020 6:58 pm
There is a MicroPython decoder for NEC IR remotes in this repo.
Thanks Peter. Cant seem to get it to work. Here is the output.

Invalid start pulse Address: 0x0
Invalid start pulse Address: 0x0
Invalid start pulse Address: 0x0
Error: overrun Address: 0x0 <--- When i press the remote

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

Re: Software based IR decoding, and sending, my first public git rep

Post by pythoncoder » Sun Feb 09, 2020 3:06 pm

What 38KHz decoder chip are you using?
Peter Hinch
Index to my micropython libraries.

Post Reply