# Flash Tasmota via Seriale ## Prerequisiti - [ ] USB-UART (CH340G o CP2102, ~3€) - [ ] 3 fili jumper femmina-femmina - [ ] Go.Comma R9 aperto (4 viti sotto piedini in gomma) - [ ] Rock Pi 4 acceso e raggiungibile ## Passi ### 1. Collega USB-UART al Rock Pi Inserisci il cavetto in una porta USB del Rock Pi. Verifica con: ```bash ls /dev/ttyUSB* # o /dev/ttyACM* ``` ### 2. Collega i fili al Go.Comma R9 Vedi `docs/hardware.md` per lo schema esatto. **Attenzione**: GPIO0 va collegato a GND prima di accendere per entrare in flash mode. ### 3. Installa esptool.py (già fatto) ```bash pip3 install esptool ``` ### 4. Verifica connessione ```bash esptool.py --port /dev/ttyUSB0 flash_id ``` Dovresti vedere il chip ID dell'ESP8266. ### 5. Scarica Tasmota ```bash wget https://github.com/arendst/Tasmota/releases/download/v14.4.0/tasmota.bin ``` ### 6. Flasha Tasmota ```bash esptool.py --port /dev/ttyUSB0 --baud 115200 \ write_flash --flash_size=2MB 0x0 tasmota.bin ``` ### 7. Template Tasmota Dopo il flash, connettiti al WiFi `tasmota-XXXX` e configura il template: ```json {"NAME":"Go.Comma R9","GPIO":[1,1,1,1,1,1,1,1,1,1,1,1,1,1],"FLAG":0,"BASE":18} ``` | GPIO | Funzione | |---|---| | GPIO14 | IRsend | | GPIO5 | IRrecv | | GPIO4 | LED (opzionale) | | GPIO13 | Button (opzionale) | ### 8. Alternative: ESPHome In alternativa a Tasmota, si può usare ESPHome con il componente `ir_transmitter` e `ir_receiver_climate`. ## Script automatizzato Vedi `scripts/flash.sh` per una versione automatizzata.