Aircoookie / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi!
https://kno.wled.ge
MIT License
15.04k stars 3.25k forks source link

RF433 json usermod #4234

Open kilrah opened 3 weeks ago

kilrah commented 3 weeks ago

Inspired by https://github.com/athom-tech/Sound-Reactive-WLED/tree/master/usermods/RF433 Modified to handle similar cases as other remote methods through json

Usermod for controlling WLED using a generic 433 / 315MHz remote and simple 3-pin receiver See https://github.com/sui77/rc-switch/ for details

Build:

Usage:

blazoncek commented 3 weeks ago

Thank you. Please provide a minimal "readme.md" to accompany the usermod similar as found in other usermods. Please also revert changes in platformio.ini and add the information into platformio_override.sample.ini (and readme.md)

DedeHai commented 3 weeks ago

This looks like a great addition. Did you test it to work on all ESP variants?

A few suggestions:

kilrah commented 3 weeks ago

Did you test it to work on all ESP variants?

Tested on esp32, c3 and esp8266

even better: restrict pin selection to compatible pins

How can that be done? Believe it's all of them anyway

provide an example json file

No problem to just put one in the folder?

DedeHai commented 3 weeks ago

not sure how to restrict pins but I think AR usermod does it, maybe look at others for examples but I have seen UMs where unusable pins are red. In the deep-sleep usermod I just create a list but there I do not use 'pin' because already used pins can be repurposed, so not going through pinmanager.

yea, I would just put the example json in the usermod folder, easier to find than going through KB and download an IR remote file.

blazoncek commented 3 weeks ago

FYI you cannot restrict GPIO in usermods. Not yet. Existing restrictions come from used pins.

kilrah commented 3 weeks ago

I looked around and at least for ESP32, S3 and 8266 all pins can be used as interrupts so there should not be any restriction.

kilrah commented 2 weeks ago

There, hopefully that's fine... I changed the default_env in platformio_override.sample.ini because the existing one doesn't exist anymore and so just copying the whole sample would break.