-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
64 lines (49 loc) · 1.55 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
.PHONY: compile st serial ota terminals terminal mqtt test format clean erase
compile:
pio run
clean:
pio run -t clean
# eg make st port=1
st: compile serial terminal
stt: compile serial terminalt
fst: compile format serial terminal
erase:
@./handle_serial.py --port=$$port -f
serial:
@./handle_serial.py --port=$$port
@#esptool.py --port `python -m serial.tools.list_ports 2>/dev/null|grep "usb"` erase_flash
@#pio run --target upload
# available esp nodes. Their name must beginn with "esp-xy"
# @ suppresses output of command run
# nmap solution: https://stackoverflow.com/questions/503171/send-a-ping-to-each-ip-on-a-subnet
esps:
@nmap -sn 192.168.1.*|grep -i esp_|perl -pe 's/.* (esp_[^ ]*) \(([^)]*)\)/http:\/\/\1.local: \2/i'
@#@nmap -n -sP 192.168.1.0/24
@#@arp -a|grep esp|sed 's/\([^ ]*\) (\(.*\)).*/\1: \2/'
# ping broadcast to activate mDNS services
ping:
@ifconfig|grep -o "broadcast [0-9.]*"|cut -f 2 -d " "|xargs ping -c 2 2>&1 >/dev/null
# call make ota ip=192.168.1.6 or w/o argument
ota:
@./ota.sh $$ip
info:
@./handle_serial.py --info --port=$$port
fuse:
@./handle_serial.py --fuse --port=$$port
terminals:
@./handle_serial.py --list --port=$$port
@#pio device list
terminal:
@./handle_serial.py --monitor --port=$$port
@#pio device monitor
terminalt:
@./handle_serial.py --monitor --port=$$port | ./ts
format:
@./handle_serial.py --format --port=$$port
test:
@read -p "Do you wish to install this program? " yn; \
case $$yn in \
[Yy]*) echo "Good choice." ;; \
[Nn]*) echo "Better choice." ;; \
*) echo "no choice" ;; \
esac