Mercurial > code > home > repos > homeauto
diff espNode/tasks.py @ 1701:33747dcf57ea
rf_switch_desk update
author | drewp@bigasterisk.com |
---|---|
date | Tue, 19 Oct 2021 22:29:26 -0700 |
parents | 7831b5de3572 |
children | 2bed2f68243c |
line wrap: on
line diff
--- a/espNode/tasks.py Tue Oct 12 20:18:59 2021 -0700 +++ b/espNode/tasks.py Tue Oct 19 22:29:26 2021 -0700 @@ -1,8 +1,11 @@ from invoke import task -tag = 'esphome/esphome:dev' +port = '/dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0' + +tag = 'esphome/esphome' + esphome = f'docker run --rm -v `pwd`:/config -v /usr/share/fonts:/usr/share/fonts -it {tag}' -esphomeUsb = esphome.replace('--rm', '--rm --device=/dev/ttyUSB0') +esphomeUsb = esphome.replace('--rm', f'--rm --device={port}') # on dash for lcd code for theater display: #tag = 'esphome_dev' #esphome = '/home/drewp/Downloads/esphome/env/bin/esphome' @@ -20,7 +23,7 @@ board = board.replace('.yaml', '') print('connect gnd, 3v3, rx/tx per https://randomnerdtutorials.com/esp32-cam-video-streaming-web-server-camera-home-assistant/, ') print('rts to reset (if possible), dtr to gpio0 per https://github.com/espressif/esptool/wiki/ESP32-Boot-Mode-Selection#automatic-bootloader') - ctx.run(f"{esphomeUsb} run {board}.yaml --device=/dev/ttyUSB0", pty=True) + ctx.run(f"{esphomeUsb} run {board}.yaml --device={port}", pty=True, echo=True) @task def program_board_over_wifi(ctx, board): @@ -30,7 +33,7 @@ @task def monitor_usb(ctx, board): board = board.replace('.yaml', '') - ctx.run(f"{esphomeUsb} logs {board}.yaml --device=/dev/ttyUSB0", pty=True) + ctx.run(f"{esphomeUsb} logs {board}.yaml --device={port}", pty=True) # device up? # nmap -Pn -p 3232,6053 10.2.0.21