]> apps.delaporte.us Git - dotfiles.git/commitdiff
WIP esptool commands
authorEdward Delaporte <edward@delaporte.us>
Tue, 9 Jun 2026 00:07:06 +0000 (19:07 -0500)
committerEdward Delaporte <edward@delaporte.us>
Tue, 9 Jun 2026 00:07:06 +0000 (19:07 -0500)
invoke/esptool/tasks.py [new file with mode: 0644]

diff --git a/invoke/esptool/tasks.py b/invoke/esptool/tasks.py
new file mode 100644 (file)
index 0000000..454cc47
--- /dev/null
@@ -0,0 +1,34 @@
+from invoke import task
+
+from datetime import datetime as dt
+import os
+
+HOME = os.path.expanduser('~')
+TODAY = dt.now().strftime('%Y.%m.%d')
+
+@task
+def usbdiff(c):
+    input('Un-plug in the device...')
+    c.run('lsusb > /tmp/before.txt')
+    input('Plug in the device...')
+    c.run('lsusb > /tmp/after.txt')
+    result = c.run('diff /tmp/before.txt /tmp/after.txt')
+    print(result.stdout)
+    # breakpoint()
+
+
+# Set power to 'off' state
+# Hold 'Go' while booting
+
+# Maybe https://thelastoutpostworkshop.github.io/ESPConnect/ in Chromium?
+
+@task
+def listusb(c):
+    c.run('ls /dev/ttyUSB*')
+    c.run('ls /dev/ttyACM*')
+
+@task()
+def status(c):
+
+    c.run('esptool --port /dev/ttyUSB0 chip-id')
+