diff espNode/tasks.py @ 726:b14020802f8a

espNode was not a service; move it to top dir Ignore-this: 3a46fb9f4d09a046dcc30ec838923d69
author drewp@bigasterisk.com
date Wed, 05 Feb 2020 16:43:46 -0800
parents service/espNode/tasks.py@438edc93e29e
children bc3516d02762
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/espNode/tasks.py	Wed Feb 05 16:43:46 2020 -0800
@@ -0,0 +1,22 @@
+from invoke import task
+
+tag = 'esphome/esphome:dev'
+
+@task
+def pull_esphome(ctx):
+    ctx.run(f"docker pull {tag}")
+
+@task
+def program_board_over_usb(ctx, board):
+    ctx.run(f"docker run --rm -v `pwd`:/config -v /usr/share/fonts:/usr/share/fonts --device=/dev/ttyUSB0 -it {tag} {board}.yaml run", pty=True)
+
+@task
+def program_board_over_wifi(ctx, board):
+    ctx.run(f"docker run --rm -v `pwd`:/config -v /usr/share/fonts:/usr/share/fonts -it --net=host {tag} {board}.yaml run", pty=True)
+
+@task
+def monitor_usb(ctx, board):
+    ctx.run(f"docker run --rm -v `pwd`:/config --device=/dev/ttyUSB0 -it {tag} {board}.yaml logs", pty=True)
+
+# device up?
+#  nmap -Pn -p 3232,6053 10.2.0.21