peterhinch / micropython_remote

Capture and replay 433MHz remote control codes. Control remote switched power adaptors.
MIT License
66 stars 11 forks source link

discussion about rx #3

Closed ecowitness closed 3 years ago

ecowitness commented 3 years ago

The rx code does an excellent job of sniffing the transmitted code of a remote control button. Thank you for that. This is not a complaint nor a bug report. This is a discussion in order to find a way to utilize the otherwise discarded part of a remote control pair -- the button.

I have a Sonoff RM433 8 button remote. I do not have any other Sonoff 433 devices.

I would like to use the RM433 for its intended purpose -- to send a unique code for each button. It does this well. I need a bit of code that runs all the time and receives the messages. Ideally, I'd like to send them out over mqtt. There would need to be a bit of code debounce to keep from sending the mqtt message too many times. I can write the code for message conversion and sending over mqtt. I cannot, at present time, determine how to set up a ring buffer and pull the data off. I realize that the timing of the receiver edge detection is critical and determining how to run this detection while servicing the conversion/sending code is beyond my training.

Would it be possible for you to guide me in the proper direction to adapt the rx code for continuous reception? Or, are you aware of someone who has already done this?

---- more details ----

I am using micropython on an ESP32 with one of those cheap 433 mhz receivers. This currently works with rx, though I have to change the pin to 23, where I am connected.

I have used rtl_433 and it can see the traffic. I can build a custom decoder, but it sends along as many messages at it sees, without debounce, and as the mqtt message is interpreted as a toggle by code down the line, the end device goes on and off a lot and is left in either state.

I use 433 mhz a lot in my home automation and there are a lot of other message traffic. The new rx code will have to throw away a lot of message traffic to find just the RM433. There are likely to be a lot of devices transmitting at the same time causing message corruption.

I can provide further details about the actual message, the tick differences (especially the gap), and how I make it into a mqtt topic.

Thanks.

ecowitness commented 3 years ago

Naturally, while I'm doing yet another search, I came up with a solution to my problem.

For those interested in using the Sonoff RM433 8 button remote, please look at the github for rtl_433, in the closed issues for issue #1150.

It contains an elegant decoder for this remote control which includes the debounce issue that I was having.

So....I'll be adding to the configuration file for my rtl_433 and won't be needing any advice about how to write my own code.

Thanks so much for your time and consideration in this matter.

ecowitness commented 3 years ago

Thanks for all your contributions.