diff --git a/docs/transparent-validation/msi-z690/laboratory-assembly-guide.md b/docs/transparent-validation/msi-z690/laboratory-assembly-guide.md index 9457701967..9fd825c0ce 100644 --- a/docs/transparent-validation/msi-z690/laboratory-assembly-guide.md +++ b/docs/transparent-validation/msi-z690/laboratory-assembly-guide.md @@ -37,140 +37,7 @@ to the device. ### Sonoff -The below section of the documentation is based on the -[EPSHome documentation](https://esphome.io/devices/sonoff_s20.html) - -1. Open the Sonoff case. - -1. Check if the headers are soldered to the board. If not - 4 pin header - raster 2.54 mm should be soldered to the board in accordance with the below - images. - - ![sonoff_without_header](images/sonoff_without_header.jpg) - - ![sonoff_with_header](images/sonoff_with_header.jpg) - -1. Connect the USB-UART converter to the USB port. - - ![uart connection](images/sonoff-s20-uart.jpg) - -1. Create a Sonoff configuration file. The file extension should be `.yaml` and - it should contain the device configuration. - - Example configuration: - - ```yml - esphome: - name: XXXXXX - platform: ESP8266 - board: esp01_1m - - wifi: - ssid: "XXXXXX" - password: "XXXXXX" - # manual_ip: - # # Set this to the IP of the ESP - # static_ip: 192.168.4.187 - # # Set this to the IP address of the router. Often ends with .1 - # gateway: 192.168.4.1 - # # The subnet of the network. 255.255.255.0 works for most home networks. - # subnet: 255.255.255.0 - power_save_mode: none - - - # # Enable fallback hotspot (captive portal) in case wifi connection fails - ap: - ssid: "Sonoff1 Fallback Hotspot" - password: "123456789" - - - captive_portal: - - # Enable logging - logger: - - # Enable Home Assistant API - api: - - - ota: - - - binary_sensor: - - platform: gpio - pin: - number: GPIO0 - mode: INPUT_PULLUP - inverted: True - name: "Sonoff S20 Button" - on_press: - - switch.toggle: relay - - platform: status - name: "Sonoff S20 Status" - - - switch: - - platform: gpio - name: "Sonoff S20 Relay" - pin: GPIO12 - id: relay - - output: - - platform: esp8266_pwm - id: s20_green_led - pin: GPIO13 - inverted: True - - light: - - platform: monochromatic - name: "Sonoff S20 Green LED" - output: s20_green_led - - web_server: - port: 80 - reboot_timeout: 0s - ``` - -1. Run the docker container in the folder containing created `.yaml` - configuration file: - - ```sh - docker run --rm -v "${PWD}":/config --device=/dev/ttyUSB0 -p 6052:6052 -it esphome/esphome - ``` - -1. Open the browser and type into the web browser the following address: - - ```bash - http://localhost:6052/ - ``` - -1. Put the device in flash mode. Putting the device in this mode should be done - in accordance with the - [documentation](https://esphome.io/devices/sonoff_s20.html#step-4-uploading-firmware). -1. Change the upload method from OTA to `/dev/ttyUSB0`. After this operation, - the new element with the name specified in `esphome:name` should be - displayed. - -1. Select the option `Upload`. After clicking, the program should generate - the image, compile it and upload it to the device. -1. After successful upload replug the device to the USB (**without** the button - pressed) to get out of the flashing mode. - -1. Open connection to the device in the PC terminal by typing: - - ```bash - sudo minicom -D /dev/ttyUSB0 -o -b 115200. - ``` - - > Note: `/dev/ttyUSB0` is example device - check whether `USB0` is the - correct one. - -1. Check if the device is responsible - whether network connectivity - information is generated. - - > Note: The effective range for this device is only a few meters. - -1. Based on the minicom logs read the IP address assigned to the device. +Prepare Sonoff according to [Sonoff preparation instructions](../sonoff/sonoff_preparation.md) ## Connections diff --git a/docs/transparent-validation/msi-z790/laboratory-assembly-guide.md b/docs/transparent-validation/msi-z790/laboratory-assembly-guide.md index 45c8078e0d..797267b20b 100644 --- a/docs/transparent-validation/msi-z790/laboratory-assembly-guide.md +++ b/docs/transparent-validation/msi-z790/laboratory-assembly-guide.md @@ -37,140 +37,7 @@ to the device. ### Sonoff -The below section of the documentation is based on the -[EPSHome documentation](https://esphome.io/devices/sonoff_s20.html) - -1. Open the Sonoff case. - -1. Check if the headers are soldered to the board. If not - 4 pin header - raster 2.54 mm should be soldered to the board in accordance with the below - images. - - ![sonoff_without_header](../msi-z690/images/sonoff_without_header.jpg) - - ![sonoff_with_header](../msi-z690/images/sonoff_with_header.jpg) - -1. Connect the USB-UART converter to the USB port. - - ![uart connection](../msi-z690/images/sonoff-s20-uart.jpg) - -1. Create a Sonoff configuration file. The file extension should be `.yaml` and - it should contain the device configuration. - - Example configuration: - - ```yml - esphome: - name: XXXXXX - platform: ESP8266 - board: esp01_1m - - wifi: - ssid: "XXXXXX" - password: "XXXXXX" - # manual_ip: - # # Set this to the IP of the ESP - # static_ip: 192.168.4.187 - # # Set this to the IP address of the router. Often ends with .1 - # gateway: 192.168.4.1 - # # The subnet of the network. 255.255.255.0 works for most home networks. - # subnet: 255.255.255.0 - power_save_mode: none - - - # # Enable fallback hotspot (captive portal) in case wifi connection fails - ap: - ssid: "Sonoff1 Fallback Hotspot" - password: "123456789" - - - captive_portal: - - # Enable logging - logger: - - # Enable Home Assistant API - api: - - - ota: - - - binary_sensor: - - platform: gpio - pin: - number: GPIO0 - mode: INPUT_PULLUP - inverted: True - name: "Sonoff S20 Button" - on_press: - - switch.toggle: relay - - platform: status - name: "Sonoff S20 Status" - - - switch: - - platform: gpio - name: "Sonoff S20 Relay" - pin: GPIO12 - id: relay - - output: - - platform: esp8266_pwm - id: s20_green_led - pin: GPIO13 - inverted: True - - light: - - platform: monochromatic - name: "Sonoff S20 Green LED" - output: s20_green_led - - web_server: - port: 80 - reboot_timeout: 0s - ``` - -1. Run the docker container in the folder containing created `.yaml` - configuration file: - - ```sh - docker run --rm -v "${PWD}":/config --device=/dev/ttyUSB0 -p 6052:6052 -it esphome/esphome - ``` - -1. Open the browser and type into the web browser the following address: - - ```bash - http://localhost:6052/ - ``` - -1. Put the device in flash mode. Putting the device in this mode should be done - in accordance with the - [documentation](https://esphome.io/devices/sonoff_s20.html#step-4-uploading-firmware). -1. Change the upload method from OTA to `/dev/ttyUSB0`. After this operation, - the new element with the name specified in `esphome:name` should be - displayed. - -1. Select the option `Upload`. After clicking, the program should generate - the image, compile it and upload it to the device. -1. After successful upload replug the device to the USB (**without** the button - pressed) to get out of the flashing mode. - -1. Open connection to the device in the PC terminal by typing: - - ```bash - sudo minicom -D /dev/ttyUSB0 -o -b 115200. - ``` - - > Note: `/dev/ttyUSB0` is example device - check whether `USB0` is the - correct one. - -1. Check if the device is responsible - whether network connectivity - information is generated. - - > Note: The effective range for this device is only a few meters. - -1. Based on the minicom logs read the IP address assigned to the device. +Prepare Sonoff according to [Sonoff preparation instructions](../sonoff/sonoff_preparation.md) ## Connections diff --git a/docs/transparent-validation/protectli/images/bad_cable.jpg b/docs/transparent-validation/protectli/images/bad_cable.jpg new file mode 100644 index 0000000000..60034a388f Binary files /dev/null and b/docs/transparent-validation/protectli/images/bad_cable.jpg differ diff --git a/docs/transparent-validation/protectli/images/cable_connectors.jpg b/docs/transparent-validation/protectli/images/cable_connectors.jpg new file mode 100644 index 0000000000..56ac6ac05c Binary files /dev/null and b/docs/transparent-validation/protectli/images/cable_connectors.jpg differ diff --git a/docs/transparent-validation/protectli/images/good_cable.jpg b/docs/transparent-validation/protectli/images/good_cable.jpg new file mode 100644 index 0000000000..8dc7727712 Binary files /dev/null and b/docs/transparent-validation/protectli/images/good_cable.jpg differ diff --git a/docs/transparent-validation/protectli/laboratory-assembly-guide.md b/docs/transparent-validation/protectli/laboratory-assembly-guide.md new file mode 100644 index 0000000000..1a24fa9c98 --- /dev/null +++ b/docs/transparent-validation/protectli/laboratory-assembly-guide.md @@ -0,0 +1,422 @@ +# Laboratory stand dedicated to Protectli platforms assembly guide + +## Introduction + +This document describes the assembly procedure dedicated to the Protectli +platforms (VP2410, VP2420, VP4630/VP4650/VP4670, V1210/V1410/V1610) testing +stand. + +## Prerequisites + +The below table contains information about all elements which are needed to +create the testing stand. + +* [RTE v1.1.0](https://shop.3mdeb.com/shop/open-source-hardware/open-source-hardware-3mdeb/rte/) +* RTE power supply 5V 2A Micro-USB +* 6x standard female-female connection wire 2.54 mm raster +* 6x standard female-female connection wire 2.54/2.00 mm raster +* 2x RJ45 cable: 1 for RTE and 1 for the platform + +=== "VP2410" + + * VP2410 platform + * Power supply for the platform: 12V 5A + * Micro-USB to USB-A male-male cable for console + +=== "VP2420" + + * VP2420 platform + * Power supply for the platform: 12V 5A + * Micro-USB to USB-A male-male cable for console + +=== "VP4630/VP4650/VP4670" + + * VP4630/VP4650/VP4670 platform + * Sonoff S20 type E (relay unused due to disruptions in power during high CPU load) + * USB-UART converter with 4-wire cable + * 4-pin header 2.54 mm raster + * Pomona SOIC8 clip + * Micro-USB to USB-A male-male cable for console + * Power supply for the platform: + - VP4630: 12V 5A + - VP4650/VP4670: 12V 7.5A + +=== "V1210/V1410/V1610" + + * V1210/V1410/V1610 platform + * Power supply for the platform: 12V 4A + * USB-C to USB-A male-male cable for console + +## Pre-setup activities + +The following subsections describe the method of preparing all the +components of the laboratory stand. + +### Platform + +The bottom cover has to be removed to connect wires and clips to the platform. + +### RTE + +RTE (acronym: Remote Testing Environment) should be prepared in accordance with +[Quick start guide](../rte/v1.1.0/quick-start-guide.md) documentation dedicated +to the device. + +### Sonoff + +Prepare Sonoff according to [Sonoff preparation +instructions](../sonoff/sonoff_preparation.md) for platforms that require +Sonoff for power control (see [Prerequisites](#prerequisites)). + +## Connections + +The following sections describe how to enable all of the following features: + +* serial connection to the platform, +* controlling power supply, +* enabling basic power actions with the platform (power off/power on/reset), +* external flashing with the RTE, +* CMOS reset circuit. + +### Serial connection + +Depending on platform connect the USB-C or MicroUSB to the platform console +port and the USB-A end to one of the RTE USB-A ports. + +### Power supply controlling + +=== "VP2410" + + Connect 12V power supply to RTE J13 connector, then RTE J12 connector to + DC connector. Do not use any DC jack adapters as these seem to introduce + power losses and noises, making the power connection unstable. + + Picture of the improper cable: + + ![](images/bad_cable.jpg) + + Picture of the proper cable: + + ![](images/good_cable.jpg) + + One has to solder the good cable with the half of bad cable to form a full + cable. Cut the bad cable in half and strip the isolation. Take the red wire + and solder it to the proper cables' white striped wire, this is the hot + wire with positive voltage. Isolate the connection with a tape. Take the + second black wire from the improper cable and solder it to the unstriped + wire of the proper cable. Use tape to isolate and strengthen the whole + connection. The cable is ready. Be sure to use plugs in the following way: + + ![](images/cable_connectors.jpg) + +=== "VP2420" + + Connect 12V power supply to RTE J13 connector, then RTE J12 connector to + DC connector. Do not use any DC jack adapters as these seem to introduce + power losses and noises, making the power connection unstable. + + Picture of the improper cable: + + ![](images/bad_cable.jpg) + + Picture of the proper cable: + + ![](images/good_cable.jpg) + + One has to solder the good cable with the half of bad cable to form a full + cable. Cut the bad cable in half and strip the isolation. Take the red wire + and solder it to the proper cables' white striped wire, this is the hot + wire with positive voltage. Isolate the connection with a tape. Take the + second black wire from the improper cable and solder it to the unstriped + wire of the proper cable. Use tape to isolate and strengthen the whole + connection. The cable is ready. Be sure to use plugs in the following way: + + ![](images/cable_connectors.jpg) + +=== "VP4630/VP4650/VP4670" + + Connect platform power supply EU plug to Sonoff. + +=== "V1210/V1410/V1610" + + Connect 12V power supply to RTE J13 connector, then RTE J12 connector to + DC connector. Do not use any DC jack adapters as these seem to introduce + power losses and noises, making the power connection unstable. + + Picture of the improper cable: + + ![](images/bad_cable.jpg) + + Picture of the proper cable: + + ![](images/good_cable.jpg) + + One has to solder the good cable with the half of bad cable to form a full + cable. Cut the bad cable in half and strip the isolation. Take the red wire + and solder it to the proper cables' white striped wire, this is the hot + wire with positive voltage. Isolate the connection with a tape. Take the + second black wire from the improper cable and solder it to the unstriped + wire of the proper cable. Use tape to isolate and strengthen the whole + connection. The cable is ready. Be sure to use plugs in the following way: + + ![](images/cable_connectors.jpg) + +### Basic power operations enabling + +Connect the RTE J11 header to the platform FP1/F_PANEL1 header using 2.54mm to +2mm wires as described in the table: + +| RTE | Protectli | +|:---------:|:-----------------------------:| +| J11 pin 5 | FP1/F_PANEL1 pin 6 (PWR_ON#) | +| J11 pin 6 | FP1/F_PANEL1 pin 7 (RST#) | +| J15 pin 1 | FP1/F_PANEL1 pin 9 (GND) | + +### External flashing enabling + +=== "VP2410" + + External flashing not possible with Pomona clip, the flash chip lies under + the chassis, which serves the cooling purposes. One option is to drill a + hole in the case where the flash chip lies. + +=== "VP2420" + + External flashing not possible with Pomona clip, the flash chip lies under + the SODIMM module. + +=== "VP4630/VP4650/VP4670" + + Flash chip is socketed. One has to desolder the socket, solder the flash + chip in place of the socket and connect the Pomona SOIC8 clip. + +=== "V1210/V1410/V1610" + + Connect the RTE SPI header to the platform using the 2.54mm female-female + wires as described in the table: + + | RTE SPI header | 6pin flash header | + |:-------------------:|:--------------------------------------:| + | J7 pin 1 (Vcc) | pin 1 (SPI Power) | + | J7 pin 2 (GND) | pin 2 (GND) | + | J7 pin 3 (CS) | pin 4 (BIOS SPI CS pin) | + | J7 pin 4 (SCLK) | pin 6 (SPI Clock) | + | J7 pin 5 (MISO) | pin 5 (MISO) | + | J7 pin 6 (MOSI) | pin 3 (MOSI) | + +### CMOS reset circuit + +=== "VP2410" + + Connect the RTE J11 header to the platform JCMOS1 header using 2.54mm to 2mm + wires as described in the table: + + | RTE | Protectli | + |:---------:|:--------------------------:| + | J11 pin 8 | JCMOS1 pin 1 (CLR_CMOS) | + | Any GND | JCMOS1 pin 2 (GND) | + + Resetting CMOS is required for proper external flashing. + +=== "VP2420" + + Connect the RTE J11 header to the platform JCMOS1 header using 2.54mm to 2mm + wires as described in the table: + + | RTE | Protectli | + |:---------:|:--------------------------:| + | J11 pin 8 | JCMOS1 pin 1 (CLR_CMOS) | + | Any GND | JCMOS1 pin 2 (GND) | + + Resetting CMOS is required for proper external flashing. + +=== "VP4630/VP4650/VP4670" + + Connect the RTE J11 header to the platform JCMOS1 header using 2.54mm to 2mm + wires as described in the table: + + | RTE | Protectli | + |:---------:|:--------------------------:| + | J11 pin 8 | JCMOS1 pin 2 (CLR_CMOS) | + | Any GND | JCMOS1 pin 1 (GND) | + + Resetting CMOS is required for proper external flashing. + +=== "V1210/V1410/V1610" + + Connect the RTE J11 header to the platform CLR_CMOS1 header using 2.54mm to 2mm + wires as described in the table: + + | RTE | Protectli | + |:---------:|:--------------------------:| + | J11 pin 8 | CLR_CMOS1 pin 2 (CLR_CMOS) | + | Any GND | CLR_CMOS1 pin 3 (GND) | + + Resetting CMOS is required for proper external flashing. + +### Complete Setup + +After preparing all of the connections also three activities should be +performed to enable all of the test stand features: + +1. Connect Sonoff to the mains (VP4630/VP4650/VP4670 only). For other + platforms, connect the platform power supply to the mains. +2. Connect the RTE to the Internet by using the Ethernet cable. +3. Connect the RTE to the mains by using the microUSB 5 V/2 A power supply. + +## Theory of operation + +The following sections describe how to use all of the enabled features: + +* serial connection to the platform, +* controlling power supply, +* enabling basic power actions with the platform (power off/power on/reset), +* external flashing with the RTE, +* CMOS reset. + +### Serial connection + +The method of setting and using serial connection is described in the +[Serial connection guide](../rte/v1.1.0/serial-port-connection-guide.md). + +### Power supply controlling + +=== "VP2410" + + Power supply controlling is performed with the relay module on RTE + connected to one of RTE GPIOs. Power operation should be performed using + the `rte_ctrl` script implemented in `meta-rte` (OS image dedicated to the + RTE platform). + + To toggle the power supply use the below command: + + ```bash + rte_ctrl rel + ``` + +=== "VP2420" + + Power supply controlling is performed with the relay module on RTE + connected to one of RTE GPIOs. Power operation should be performed using + the `rte_ctrl` script implemented in `meta-rte` (OS image dedicated to the + RTE platform). + + To toggle the power supply use the below command: + + ```bash + rte_ctrl rel + ``` + +=== "VP4630/VP4650/VP4670" + + Power supply controlling (in this case: controlling the state of Sonoff) + should be performed based on the `sonoff.sh` script implemented in + `meta-rte` (OS image dedicated to the RTE platform). + + > Note, that before using the above-mentioned script, it should be modified and + `SONOFF_IP` parameter should be set in accordance with obtained Sonoff IP address. + + To perform basic power operations use the below-described commands: + + 1. Turn on the power supply: + + ```bash + ./sonoff on + ``` + + 2. Turn off the power supply: + + ```bash + ./sonoff on + ``` + +=== "V1210/V1410/V1610" + + Power supply controlling is performed with the relay module on RTE + connected to one of RTE GPIOs. Power operation should be performed using + the `rte_ctrl` script implemented in `meta-rte` (OS image dedicated to the + RTE platform). + + To toggle the power supply use the below command: + + ```bash + rte_ctrl rel + ``` + +### Basic power operations + +Basic power operations should be performed based on the `rte_ctrl` script +implemented in `meta-rte` (OS image dedicated to the RTE platform). To perform +basic power operations use the below-described commands: + +1. Turn on the platform: + + ```bash + rte_ctrl pon + ``` + +1. Turn off the platform: + + ```bash + rte_ctrl poff + ``` + +1. Reset the platform: + + ```bash + rte_ctrl reset + ``` + +> Note, that in order for the above commands to work properly, the platform +should be powered up: both Sonoff and the power supply must be turned on. + +### External flashing + +The external flashing procedure should be performed based on the scripts +implemented on the RTE platform. To perform the flashing operation reproduce, +the below-described steps: + +1. By using `scp` put the requested Dasharo file to the RTE: + + ```bash + scp / root@:/tmp/coreboot.rom + ``` + + Where: + + - `path_to_firmware` - path to firmware, which should send to RTE, + - `firmware_file` - the name of the firmware file, which should be sent + to RTE, + - `RTE_IP` - IP address of the connected RTE. + +1. Login to RTE via `ssh` or `minicom`. +1. Read the flash chip by executing the following command on RTE: + + ```bash + ./flash.sh read tmp/dump.rom + ``` + +1. If the reading was successful, the output from the command above should + contain the phrase `Verifying flash... VERIFIED`. +1. Write the flash chip by executing the following command on RTE: + + ```bash + ./flash.sh write /tmp/coreboot.rom + ``` + + > Do not interrupt the flashing procedure in any way (especially by + changing connections). It may cause hardware damage! + +1. If the reading was successful, the output from the command above should + contain the phrase `Verifying flash... VERIFIED`. + +### CMOS clear + +To clear the CMOS, turn off the power with Sonoff or relay and use the +following commands: + +```bash +echo 1 > /sys/class/gpio/gpio412/value +sleep 10 +echo 0 > /sys/class/gpio/gpio412/value +``` diff --git a/docs/transparent-validation/msi-z690/images/sonoff-s20-uart.jpg b/docs/transparent-validation/sonoff/images/sonoff-s20-uart.jpg similarity index 100% rename from docs/transparent-validation/msi-z690/images/sonoff-s20-uart.jpg rename to docs/transparent-validation/sonoff/images/sonoff-s20-uart.jpg diff --git a/docs/transparent-validation/msi-z690/images/sonoff_with_header.jpg b/docs/transparent-validation/sonoff/images/sonoff_with_header.jpg similarity index 100% rename from docs/transparent-validation/msi-z690/images/sonoff_with_header.jpg rename to docs/transparent-validation/sonoff/images/sonoff_with_header.jpg diff --git a/docs/transparent-validation/msi-z690/images/sonoff_without_header.jpg b/docs/transparent-validation/sonoff/images/sonoff_without_header.jpg similarity index 100% rename from docs/transparent-validation/msi-z690/images/sonoff_without_header.jpg rename to docs/transparent-validation/sonoff/images/sonoff_without_header.jpg diff --git a/docs/transparent-validation/sonoff/sonoff_preparation.md b/docs/transparent-validation/sonoff/sonoff_preparation.md new file mode 100644 index 0000000000..9d0dd6e13f --- /dev/null +++ b/docs/transparent-validation/sonoff/sonoff_preparation.md @@ -0,0 +1,171 @@ + +# Sonoff preparation + +The below section of the documentation is based on the +[EPSHome documentation](https://esphome.io/devices/sonoff_s20.html) + +> The following procedure is for Sonoff S20. It has also been tested on + **Sonoff S26 Release 2**, however, the connection method for flashing is + different and is described [here](https://tasmota.github.io/docs/devices/Sonoff-S26-Smart-Socket/#s26-release-2). + +1. Open the Sonoff case. + +1. Check if the headers are soldered to the board. If not - 4 pin header + raster 2.54 mm should be soldered to the board in accordance with the below + images. + + ![sonoff_without_header](images/sonoff_without_header.jpg) + + ![sonoff_with_header](images/sonoff_with_header.jpg) + +1. Connect the USB-UART converter to the USB port. + + ![uart connection](images/sonoff-s20-uart.jpg) + +1. Create a Sonoff configuration file. The file extension should be `.yaml` and + it should contain the device configuration. + + Example configuration: + + ```yml + esphome: + name: XXXXXX + platform: ESP8266 + board: esp01_1m + + wifi: + ssid: "XXXXXX" + password: "XXXXXX" + # manual_ip: + # # Set this to the IP of the ESP + # static_ip: 192.168.4.187 + # # Set this to the IP address of the router. Often ends with .1 + # gateway: 192.168.4.1 + # # The subnet of the network. 255.255.255.0 works for most home networks. + # subnet: 255.255.255.0 + power_save_mode: none + + + # # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Sonoff1 Fallback Hotspot" + password: "123456789" + + + captive_portal: + + # Enable logging + logger: + + # Enable Home Assistant API + api: + + + ota: + + + binary_sensor: + - platform: gpio + pin: + number: GPIO0 + mode: INPUT_PULLUP + inverted: True + name: "Sonoff S20 Button" + on_press: + - switch.toggle: relay + - platform: status + name: "Sonoff S20 Status" + + + switch: + - platform: gpio + name: "Sonoff S20 Relay" + pin: GPIO12 + id: relay + + output: + - platform: esp8266_pwm + id: s20_green_led + pin: GPIO13 + inverted: True + + light: + - platform: monochromatic + name: "Sonoff S20 Green LED" + output: s20_green_led + + web_server: + port: 80 + reboot_timeout: 0s + ``` + +1. Run the docker container in the folder containing created `.yaml` + configuration file: + + ```sh + docker run --rm -v "${PWD}":/config --device=/dev/ttyUSB0 -p 6052:6052 -it esphome/esphome + ``` + +1. Open the browser and type into the web browser the following address: + + ```bash + http://localhost:6052/ + ``` + +1. Put the device in flash mode. Putting the device in this mode should be done + in accordance with the + [documentation](https://esphome.io/devices/sonoff_s20.html#step-4-uploading-firmware). +1. Change the upload method from OTA to `/dev/ttyUSB0`. After this operation, + the new element with the name specified in `esphome:name` should be + displayed. + +1. Select the option `Upload`. After clicking, the program should generate + the image, compile it and upload it to the device. +1. After successful upload replug the device to the USB (**without** the button + pressed) to get out of the flashing mode. + +1. Open connection to the device in the PC terminal by typing: + + ```bash + sudo minicom -D /dev/ttyUSB0 -o -b 115200. + ``` + + > Note: `/dev/ttyUSB0` is example device - check whether `USB0` is the + correct one. + +1. Check if the device is responsible - whether network connectivity + information is generated. + + > Note: The effective range for this device is only a few meters. + +1. Based on the minicom logs read the IP address assigned to the device. + +1. The device should have a statically assigned IP address based on its MAC + address - this will make it easy to find it on the network. + +The device will host the website which can be used to switch the relay. + +Bear in mind that the antenna in this device is very poorly +performing - effective range is only few meters + +--- + +## Controlling the relay switch + +To switch the relay the following bash commands may be used: + +> `192.168.43.171` should be replaced with assigned IP. + +```sh +curl -X POST http://192.168.43.171/switch/sonoff_s20_relay/toggle +curl -X POST http://192.168.43.171/switch/sonoff_s20_relay/turn_off +curl -X POST http://192.168.43.171/switch/sonoff_s20_relay/turn_on +``` + +To check the state of the component use: + +```sh +# name @ name in /home/name/workspace/sonoff/docker [16:28:02] C:1 +$ curl http://192.168.43.171/switch/sonoff_s20_relay +{"id":"switch-sonoff_s20_relay","state":"OFF","value":false} +``` diff --git a/mkdocs.yml b/mkdocs.yml index 6877f59b3f..aa7ea69c5c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -331,6 +331,8 @@ nav: - 'Laboratory stand assembly guide': transparent-validation/msi-z690/laboratory-assembly-guide.md - 'MSI PRO Z790-P': - 'Laboratory stand assembly guide': transparent-validation/msi-z790/laboratory-assembly-guide.md + - 'Protectli platforms': + - 'Laboratory stand assembly guide': transparent-validation/protectli/laboratory-assembly-guide.md - 'Supermicro X11 LGA1151 Series': - 'Theory of Operation': transparent-validation/supermicro_x11_lga1151_series/theory-of-operation.md - 'muxPi': @@ -351,6 +353,8 @@ nav: - 'Specification': transparent-validation/sd-wire/specification.md - 'Usage': transparent-validation/sd-wire/usage-validation.md - 'FAQ': transparent-validation/sd-wire/faq.md + - 'Sonoff': + - 'Sonoff preparation': transparent-validation/sonoff/sonoff_preparation.md - 'PiKVM': - 'Assembly and validation': transparent-validation/pikvm/assembly-and-validation.md - 'Twonkie':