Uploading the Firmware - hwstar/9-Valve-Sprinkler-Controller GitHub Wiki
Required Hardware
- Sprinkler controller PCB removed from enclosure.
- 24VAC wall transformer
- FTDI Cable
- Wire to connect the transformer to the Sprinkler controller.
Installation of ESPHome
Prerequisites
If you haven't already done so, solder the 2 pushbutton switches to the board. These must be installed prior to loading your customized firmware on the board. The 2 pushbutton switches are supplied in the kit.
If ESPHome isn't already installed on your PC, you'll need to install it before proceeding with the next section. The sprinkler firmware requires ESPHome 2023.6.1 or later. Since this is relatively new, a manual installation of ESPHome on a personal computer is recommended.
https://esphome.io/guides/installing_esphome.html contains detailed instructions on how to install ESPHome on your PC.
Compiling and Uploading the Firmware
You will need to create a secrets file. Save a copy of secrets-sample.yaml as secrets.yaml, then modify that file with the passwords you want to use.
Select the .yaml file which you want to use. There are 2 of them: esp32-sprinkler.yaml, and esp32-sprinkler-without-improv.yaml. The yaml file esp32-sprinkler.yaml utilizes the improv provisioning feature. If you want to configure without using improv, use the esp32-sprinkler-without-improv.yaml file.
There are 2 tact switches on the board which are only accessible with the front cover removed. One is labeled BOOT, and the other is labeled EN. To place the firmware in boot mode, connect the 24VAC transformer to the 2 pin power connector, and the serial cable to J201 (FTDI black wire is pin 1), power up the board, and then press the EN switch and BOOT switch. While keeping the BOOT switch depressed, release the EN switch. One second after the red LED lights, release the EN switch. The red LED should stay lit if this is done correctly.
The board is now ready to accept firmware upload via the serial cable.
esphome run esp32-sprinkler.yaml
-or-
esphome run esp32-sprinkler-without-improv.yaml
You should then see something like:
.
.
.
========================= [SUCCESS] Took 18.63 seconds =========================
INFO Successfully compiled program.
Found multiple options, please choose one:
[1] /dev/ttyUSB0 (FT232R USB UART - FT232R USB UART)
[2] Over The Air (esp32-sprinkler.local)
When prompted for upload options, choose option 1.
Once the firmware completes loading. Press the EN button to reboot. The display should now show status.
If you wait 30 seconds after boot then press and hold B3, then the IP address of the controller will be displayed on the second line of the display as long as B3 remains pressed.
Using the IP address you can view the status of the sprinkler controller by using a web browser.
Once your firmware is loaded and running correctly, you can also do Over-The-Air Firmware updates from this point forward.
At this point, check Home Assistant to see if the Sprinkler controller shows up as a new device.