Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonoff Rf Bridge - RF Support 433_6 - Controls #386

Closed
xoseperez opened this issue Jan 10, 2018 · 5 comments
Closed

Sonoff Rf Bridge - RF Support 433_6 - Controls #386

xoseperez opened this issue Jan 10, 2018 · 5 comments
Assignees
Labels
enhancement New feature or request major rf bridge
Milestone

Comments

@xoseperez
Copy link
Owner

Originally reported by: Marlon Challouts (Bitbucket: marlonchallouts, GitHub: marlonchallouts)


Good afternoon

I'm trying to record two controls of the same model, but by pressing the "learn" button, Sonoff Rf Bridge can not learn the control.

Control = http://www.intelbras.com.br/sites/default/files/downloads/manual_xac_2000_tx_site.pdf

I made tests using the RC-switch library and the control is using protocol 6.

Can not Espurna learn controls with protocol 6?

Best regards

@xoseperez
Copy link
Owner Author

The RF bridge has a secondary microcontroller responsible for decoding RF signals. If the firmware in that microcontroller does not support the protocol then ESPurna can't do anything. There is a project to replace the firmware in that secondary microcontroller and a pull request to allow ESPurna to send custom messages through it, but it's not yet merged/tested.

@xoseperez
Copy link
Owner Author

Original comment by Marlon Challouts (Bitbucket: marlonchallouts, GitHub: marlonchallouts):


Any predictions of when it will be merge?

@xoseperez
Copy link
Owner Author

The PR was merged in the dev branch and will be released with 1.12.2, albeit disabled by default. You will have to enable the feature in ESPurna (look for RF_RAW_SUPPORT in general.h) and you will also have to flash the EFM8 with a new firmware. Head over to https://github.com/rhx/RF-Bridge-EFM8BB1 for instructions.

@xoseperez xoseperez added this to the 1.12.2 milestone Jan 24, 2018
@xoseperez
Copy link
Owner Author

This is the info in the above mentioned PR (it got lost on the migration):

By default, the Sonoff RF bridge only supports a fixed 24 bit encoding. I have forked Portisch's 8051 firmware (for the EFM8BB1 chip) that is compatible with all the original Sonoff RFBRIDGE commands, but mine now also allows sending arbitrary RF codes (consisting of up to 16 different RF timing "buckets" with precise code repetition timing):

https://github.com/rhx/RF-Bridge-EFM8BB1

This allows to use the RF bridge as a truly universal remote for common light and other home automation devices that use, e.g., tri-state or Manchester codes. Please note that truly universal learning is not possible via the RF bridge at the moment (and may exceed the capabilities of the EFM8BB1), but this can easily be done via an Arduino with an RF receiver using the RFControl library (see more details and examples below):

https://github.com/pimatic/RFControl

This pull request adds support for sending raw RF codes to Espurna using the new 0xB0 bucket send command (from the RF-Bridge-EFM8BB1 firmware). The format is documented on the RF-Bridge-EFM8BB1 github page, but here is a short summary and example of the byte sequence (spaces are for readability, but need to be removed before pasting into the RFBRIDGE web interface (switch ON or switch OFF)):

AA B0 20 04 1A 0120 01C0 0300 2710 01212122012201212121212121220121212201212203 55

  • starts with the usual preamble 0xAA 0xB0 followed by the length (0x20 = 32 bytes)
  • number of timing buckets (e.g. 4 for a tri-state remote with sync)
  • number of repetitions (0x1A = transmit 26 times, more precise than repeating via UART)
  • the 4 bucket times in micro seconds (0120 = 288us, 01C0 = 448us, 0x300 = 768us, 2710 = 10000us)
  • sequence of RF timings to transmit, 2 buckets (high/low) per byte, e.g. (0x01 means use bucket 0 time (288us) for high, bucket 1 time (768us) for low)
  • 0x55 UART sync end

So how to learn these codes? The RFControl Arduino library above comes with a "compressed" example sketch:

https://github.com/pimatic/RFControl/tree/master/examples/compressed

This sketch will output something like:

b: 288 448 768 10000 0 0 0 0
t: 01212122012201212121212121212121212122012203

which means it has detected 4 buckets (out of a possible 8, line b:) with the given timing sequence for the received commend (line t:). Putting them together (after converting the bucket times to hex) gives the 0xB0 command in the example above.

Here is an overview of the comments for the commits in this pull request:

  • Add RF_RAW_SUPPORT to rfbridge binaries
  • No raw queueing to avoid data section overflow
  • Subscribe to rfraw topic if RF_RAW_SUPPORT and show full message
  • Add raw support through web interface
  • Set on switch maxlength to 116 for raw RF codes
  • regen [re-generate web interface]

@xoseperez
Copy link
Owner Author

Will be released with 1.12.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request major rf bridge
Projects
None yet
Development

No branches or pull requests

1 participant