-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesp
58 lines (53 loc) · 1.17 KB
/
esp
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
#!/bin/bash
path=`pwd`
float=$path/image/float.bin
int=$path/image/int.bin
menus() {
clear
tput setaf 6
echo " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
tput sgr0
echo " M A I N - M E N U "
tput setaf 6
echo " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
tput sgr0
echo " 1. Checking Flash ID"
echo " 2. Erase Flash"
echo " 3. Flash NodeMCU Default Firmware"
echo " 4. Exit"
tput setaf 6
echo " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
tput sgr0
echo ""
}
option(){
local choice
read -p " Enter choice [ 1 - 4] : " choice
case $choice in
1) flashid ;;
2) erase ;;
3) flashnodemcu;;
4) exit 0;;
*) echo -e "${RED}Error...${STD}" && sleep 2
esac
}
erase(){
echo -n " Enter Port :";
read port;
sudo esptool.py --port $port erase_flash
menus
}
flashid(){
echo -n " Enter Port :";
read port;
sudo esptool.py --port $port flash_id
sleep 5
menus
}
flashnodemcu(){
echo -n " Enter Port :";
read port;
sudo esptool.py --port $port write_flash -fm dio 0x00000 $float
}
menus
option