I got the RATGDO 32 Disco and would like to program it ideally from my esphome dashboard, otherwise from the web page via chromium. When I connect the device’s USB-C port to my Linux PC, it shows up at /dev/ttyACM1. However, I can’t program it, presumably because I didn’t connect GPIO0 to ground when powering on the board. The web downloader tells me to try holding the BOOT button, but I don’t see one.
A possibly related question is how do I get the RATGDO board out of the 3D-printed case? Maybe there’s a boot button in there but I just can’t get access to it with the blue case. I can’t for figure out how to remove the case and don’t want to break anything.
Well, I was able to get the board out by prying the blue case open, so that’s at least one mystery solved. Unfortunately, there’s no button or obvious access to GPIO0. I was able to connect to the existing firmware, but there’s no security–any device on the WiFi network can connect to ratgdo over insecure http. So I need to be able to A) upload my own firmware from the esphome dashboard, and B) unbrick my device over a serial port if I push an update that doesn’t work.
I still haven’t solved this problem, but I will point out that something happens when I plug the device into my USB port and start programming it with esphome, because the device does not join the WiFi network. Moreover, the device starts clicking from the speaker. However, the programming never gets beyond the “Connecting” phase.
I’ve programmed about a dozen esphome devices successfully from the same host. However, for all of them I used my own USB-serial UART and manually connected the RX, TX, and ground pins, as well as shorting GPIO0 pin to ground when powering up. On this device I’m using the RATGDO’s built-in USB-C port, and I just can’t figure out how to do the programming on linux.
Okay, out of desparation I borrowed a Windows machine, and was able to flash the device from chrome on Windows. Of course this doesn’t help me because I want to flash over serial using esphome. But at least this suggests that maybe GPIO0 is hardwired to ground so pushing the BOOT button is not the problem.
Okay, finally some progress. I was able to flash without any BOOT button, but only by using the CLI tool esphome run ratgdo.yaml --device /dev/ttyACM0 or by installing on the “device builder” machine from the web. Attempting a serial flash from chromium does not work.
ChatGPT suggested that in the absence of a boot button, esphome relies on the CH9102F’s RTS/DTR auto-reset wiring, and while linux supports this, chromium on linux does not.
Also put a ratgdo_ota_password and ratgdo_web_password in your secrets.yaml file–without these (and by default), anyone can access your garage door over the web or even just reflash arbitrary firmware.
Then plug the UCB C port of your RATGDO Disco device into a USB A port of your computer using the cable it came with. Use journalctl -k -n 20 or ls -alrt /dev/tty* to see the name of the new device, probably /dev/ttyACM0 or /dev/ttyACM1.
Finally, flash the device by running
esphome run gdo.yaml --device /dev/ttyACM1
Henceforth, you can update the device over WiFi just like any of your other esphome devices using the esphome dashboard.
Note that I don’t recommend using the default configuration, which lets anyone on your network reflash your RATGDO device in two different ways–either using esphome’s OTA protocol, or by going to the embedded HTTP server which be default has no security.
I’m no expert with esp32, but I think you able to connect an esp device directly via usb to a home assistant/haos box and use the esp device builder addon to manually flash, instead of having to setup a different pc to do it.
or do the flashing in HAOS cli with terminal addon.