]> apps.delaporte.us Git - dotfiles.git/blob - invoke/esptool/tasks.py
454cc47e1f7beef6e7fdef8872a692f8b7c9973e
[dotfiles.git] / invoke / esptool / tasks.py
1 from invoke import task
2
3 from datetime import datetime as dt
4 import os
5
6 HOME = os.path.expanduser('~')
7 TODAY = dt.now().strftime('%Y.%m.%d')
8
9 @task
10 def usbdiff(c):
11 input('Un-plug in the device...')
12 c.run('lsusb > /tmp/before.txt')
13 input('Plug in the device...')
14 c.run('lsusb > /tmp/after.txt')
15 result = c.run('diff /tmp/before.txt /tmp/after.txt')
16 print(result.stdout)
17 # breakpoint()
18
19
20 # Set power to 'off' state
21 # Hold 'Go' while booting
22
23 # Maybe https://thelastoutpostworkshop.github.io/ESPConnect/ in Chromium?
24
25 @task
26 def listusb(c):
27 c.run('ls /dev/ttyUSB*')
28 c.run('ls /dev/ttyACM*')
29
30 @task()
31 def status(c):
32
33 c.run('esptool --port /dev/ttyUSB0 chip-id')
34