Skip to content

s60sc/ESP32_Remote433

Repository files navigation

ESP32_Remote433

Dooya make tubular motors that are used in various third party electric canopies and blinds. These motors can be controlled by RF 433MHz remotes. The protocol is proprietary (not necessarily to Dooya) but not encrypted so is easily captured and decoded using an ESP and RF433 Receiver and a custom remote controller made using an ESP and RF433 Transmitter.

This ESP32 based Arduino app allows Dooya protocol commands to be captured from a proprietary remote control and incorporated into a custom ESP remote control. The custom remote controller can be boxed with its own buttons or itself accessed remotely over WiFi using a web page on browser. In addition any other unencrypted RF 433MHz OOK (On-Off Keying) type protocol can also be captured.

Requirements

ESP32-C3 Super Mini modules are small and cheap and well suited for this application. The FS1000A RF 433MHz style transmitter and receiver module pair shown with the ESP32-C3 Super Mini in the image below are widely available and cheap. The transmitter has a range of several meters even with a 5V supply from the ESP. The receiver however needs a separate 5V power supply to avoid brownouts on the ESP, and a 3V / 5V level shifter or voltage divider must be used on the data pin.

Installation

Download github files into the Arduino IDE sketch folder, removing -main from the application folder name.

Compile using arduino-esp32 core V3.x (min v3.1.1) with partition scheme:Minimal SPIFFS (...)

On first installation, the application will start in wifi AP mode - connect to SSID: ESP32_Remote433..., to allow router and password details to be entered via the web page on 192.168.4.1. The configuration data file (except passwords) is automatically created, and the application web pages automatically downloaded from GitHub to the /data folder in flash memory when an internet connection is available.

Subsequent updates to the application, or to the /data folder files, can be made using the OTA Upload tab. The /data folder can also be reloaded from GitHub using the Reload /data button on the Edit Config tab, or by using a WebDAV client.

Operation

The app has four modes of operation:

  • DOOYA_RX - Capture Dooya protocol
  • UNKNOWN_RX - Capture other RF 433MHz transmissions
  • DOOYA_TX - Output Dooya commands to act as remote control
  • CUSTOM_TX - Output other protocol commands to act as remote control

Dooya capture

Use the existing remote control to capture each of the command messages in turn which will be output to the app log on the Show Log web page and to the Arduino IDE serial monitor. Note that the remote may send out more than one message type per command, but only one of the message types per command will be recognised by the motor, so each will need to be tried in turn.

Each command in the Dooya protocol is a 48 bit sequence which is repeated several times, typically 5. The protocol is:

  • 24 bit ID specific to remote
  • 8 bit channel data, comprising:
    • 4 bit channel number used by remote (1 of 15)
    • 4 bit multichannel indicator
  • 8 bit command identifier, comprising:
    • 4 bit command representation eg: P2, Extend, Retract, Stop, LED
    • 4 bit check sequence
  • 8 bit trailer, which does not need to be sent, ie only first 40 bits need to be transmitted

It is not necessary however to understand what each bit does, the log separates the message into the four sections above where the first 24 + 8 bits are common to every command, the next 8 bits are specific to each command, and the final 8 bits can be discarded.

Unknown protocol capture

In this mode the app can capture and display the HIGH / LOW pulse durations in messages sent by a remote. The resulting pulse durations are displayed as HIGH / LOW pairs for analysis:

  • Preamble / sync. Inital HIGH + LOW durations are longer and usually indicate a message start. If preamble is not an even number of level changes, the resulting data will be misinterpreted.
  • Data bits encoding:
    • PWM (Pulse-Width Modulation (PWM): Total duration of each HIGH + LOW pair is the same, where one duration is longer than the other, eg: 750:250,300:700 - long HIGH is logic 1, short HIGH is logic 0
    • PMM (Pulse-Position Modulation): Total duration of each HIGH + LOW pair is different, but the duration of the LOW is similar, eg: 750:200,400:200 - long HIGH is logic 1, short HIGH is logic 0
    • Manchester: The duration of each pair is not relevant, it is the transition between logic levels that matter, eg: 500:500,400:300 - HIGH to LOW is logic 0, LOW to HIGH between first and second pair is logic 1
    • Tristate: Uses multiple HIGH/LOW pairs to represent three different states
    • Inverse: Any of the above where the interpretation of the logic levels is inverted
  • Message separator. A LOW duration much longer than the previous durations is used to distinguish between each message.

PWM (Dooya) and PMM are most common for simple remote controls. For the purposes of capturing from an unknown device the different data streams per command for replay, the actual protocol does not matter, just transmit the captured message with the same HIGH / LOW durations, using transmitBit() function in file rf433.cpp.

Dooya Controller

Use the information obtained from the Dooya capture process to complete the fields in the Commands section under the Edit Config tab and check if each command is recognised. For commands that have more than one message type, try each in turn until recognised.

Custom Controller

The user will need to provide their own code for the sendCustomCmd() function in file rf433.cpp.

Configuration

Configuration details accessed via Edit Config tab, which displays further buttons:

Network: Additional WiFi and webserver settings.

Pins: Assign a pin to connect to the RF Receiver and Transmitter modules. The same pin can be used as only one of the modules will be used at a time. Optionally assign pins to connect to physical buttons to invoke each remote control command.

Protocol: Defines the pulse duration parameters for a protocol. Preset with the Dooya protocol specifications. If an unknown protocol has been decoded its details can be entered here.

Commands: Enter Dooya or other known protocol bit sequences acquired from decoding and displayed in application log to enable sending remote control commands.

Press Save to make changes persistent.

Logging

The application log messages can be monitored on the web page tab Show Log.

About

Receive and transmit protocol used by Dooya tubular motors

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors