Sonoff 4CH - qtoggle/espqtoggle GitHub Wiki
Device
Description
Sonoff 4CH and Sonoff 4CH Pro are 4-channel Wi-Fi smart relay boards.
By default, they run Sonoff proprietary firmware.
The following models are available:
- 4CH/4CH R2
- button inputs and relay outputs directly connected to ESP GPIOs
- 90-250V AC power
- relays control the L (live) AC power output
- 4CH Pro/4CH Pro R2
- inputs and outputs connected through a secondary MCU
- supports interlocking, self-locking and inching operating modes
- also supports 5-24V DC power
- NO/NC relay outputs available
Configuration
Provisioning configuration name: espqtoggle/sonoff/4ch
.
Flash Parameters
- flash mode: DOUT
- flash frequency: 40MHz
Pins
Number | Function | Remarks |
---|---|---|
0 | push button 1 | active low |
4 | relay 3 | active high |
5 | relay 2 | active high |
9 | push button 2 | active low |
10 | push button 3 | active low |
12 | relay 1 | active high |
13 | status LED | active low |
14 | push button 4 | active low |
15 | relay 4 | active high |
Ports
Id | Type | Description | Range/Unit | Remarks |
---|---|---|---|---|
push_button1 |
boolean | on/off button 1, setup button | ||
push_button2 |
boolean | on/off button 2, setup button | ||
push_button3 |
boolean | on/off button 3, setup button | ||
push_button4 |
boolean | on/off button 4, setup button | ||
relay1 |
boolean | relay 1 | ||
relay2 |
boolean | relay 2 | ||
relay3 |
boolean | relay 3 | ||
relay4 |
boolean | relay 4 |
Installation
Requirements
- a philips screwdriver
- a USB-to-serial adapter
- a laptop running Windows, Linux or macOS
Procedure
-
:warning: Do not power the device from mains! Do not connect it to AC at all during this procedure!
-
Read the flashing instructions and be prepared to follow the flashing procedure.
-
Open the device by unscrewing the 4 screws:
-
Take out the board and identify the RX, TX, GND and VCC connectors. For the "Pro" model, also identify the GPIO0 pad:
-
Ensure the USB-to-serial adapter is not plugged into your laptop.
-
Connect the following USB-to-serial adapter wires to their corresponding connectors on the board: RX, TX, GND and VCC.
-
Ensure device will boot into bootloader mode by:
- 4CH model: pressing and holding L1 button
- 4CH Pro model: connecting and holding the USB-to-serial adapter second GND wire to the GPIO0 pad
-
Plug the USB-to-serial adapter into your laptop, effectively powering the ESP chip on the board.
-
You can now release the L1 button or disconnect the secondary GND from GPIO0.
-
Follow the flashing procedure to flash the espQToggle firmware on the ESP chip.
-
Disconnect all wires and reassemble the device.
Next Steps
You can now power your device by connecting it to mains. Follow the initial setup instructions to connect the device to Wi-Fi and add it to your qToggle system.