-
-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
168 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash | ||
|
||
NON_ESP_WARNING="WARNING: it appears this device does not use an ESP82xx and therefore cannot install ESP based firmware" | ||
|
||
get_macs_from_wifi_log () { | ||
grep AP-STA-CONNECTED smarthack-wifi.log | | ||
cut -d ' ' -f3 | | ||
sort | uniq | ||
} | ||
|
||
get_ouis_from_wifi_log () { | ||
get_macs_from_wifi_log | | ||
tr -d : | grep -Po "^.{6}" | ||
} | ||
|
||
psk_02 () { | ||
grep -q "ID: 02" smarthack-psk.log | ||
} | ||
|
||
web_non_esp () { | ||
grep -q "$NON_ESP_WARNING" smarthack-web.log | ||
} | ||
|
||
udp_non_esp () { | ||
grep -q "$NON_ESP_WARNING" smarthack-udp.log | ||
} | ||
|
||
esp_oui () { | ||
get_ouis_from_wifi_log | grep -iqf- oui/esp.txt | ||
} | ||
|
||
non_esp_oui () { | ||
get_ouis_from_wifi_log | grep -iqf- oui/nonesp.txt | ||
} | ||
|
||
check_for_common_issues () { | ||
if psk_02; then | ||
echo "Your device's firmware is too new." | ||
echo "Tuya patched the PSK vulnerability that we use to establish a connection." | ||
echo "You might still be able to flash this device over serial." | ||
echo "For more information and to follow progress on solving this issue see:" | ||
echo "https://github.com/ct-Open-Source/tuya-convert/wiki/Collaboration-document-for-PSK-Identity-02" | ||
exit 1 | ||
fi | ||
if web_non_esp || udp_non_esp || non_esp_oui; then | ||
echo "Your device does not use an ESP82xx." | ||
echo "This means you cannot flash custom ESP firmware even over serial." | ||
exit 1 | ||
fi | ||
if esp_oui; then | ||
echo "An ESP82xx based device connected according to your wifi log." | ||
echo "If this is the device you are trying to flash, another issue may be preventing it from flashing." | ||
echo "Otherwise, it could be that the device does not use an ESP82xx or it did not connect." | ||
else | ||
echo "No ESP82xx based devices connected according to your wifi log." | ||
echo "Here is a list of all the MAC addresses that connected:" | ||
get_macs_from_wifi_log | ||
echo | ||
echo "If you see your IoT device in this list, it is not an ESP82xx based device." | ||
echo "Otherwise, another issue may be preventing it from connecting." | ||
fi | ||
echo "For additional information, check the *.log files inside the scripts folder." | ||
echo "Please include these logs when opening a new issue on our GitHub issue tracker." | ||
} | ||
|
||
check_for_common_issues | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# "Espressif Inc." OUIs | ||
# updated Jan 26 2021 | ||
083AF2 | ||
0CDC7E | ||
10521C | ||
18FE34 | ||
240AC4 | ||
2462AB | ||
246F28 | ||
24A160 | ||
24B2DE | ||
2C3AE8 | ||
2CF432 | ||
30AEA4 | ||
3C6105 | ||
3C71BF | ||
40F520 | ||
483FDA | ||
4C11AE | ||
4C7525 | ||
500291 | ||
545AA6 | ||
5CCF7F | ||
600194 | ||
6055F9 | ||
68C63A | ||
70039F | ||
7C9EBD | ||
7CDFA1 | ||
807D3A | ||
840D8E | ||
84CCA8 | ||
84F3EB | ||
8CAAB5 | ||
8CCE4E | ||
9097D5 | ||
943CC6 | ||
94B97E | ||
98CDAC | ||
98F4AB | ||
9C9C1F | ||
A020A6 | ||
A0764E | ||
A47B9D | ||
A4CF12 | ||
A4E57C | ||
A8032A | ||
AC67B2 | ||
ACD074 | ||
B4E62D | ||
B8F009 | ||
BCDDC2 | ||
BCFF4D | ||
C44F33 | ||
C45BBE | ||
C4DD57 | ||
C82B96 | ||
CC50E3 | ||
D8A01D | ||
D8BFC0 | ||
D8F15B | ||
DC4F22 | ||
E09806 | ||
E0E2E6 | ||
E868E7 | ||
E8DB84 | ||
ECFABC | ||
F008D1 | ||
F4CFA2 | ||
FCF5C4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Known unsupported OUIs including | ||
# "Tuya (HK) Limietd" | ||
# "Tuya Smart Inc." | ||
# "Beijing Winner Microelectronics Ltd" | ||
# updated Jan 26 2021 | ||
000D8A | ||
000F89 | ||
10D561 | ||
1869D8 | ||
286DCD | ||
68572D | ||
708976 | ||
807484 | ||
84E342 | ||
D4A651 | ||
DC446D | ||
E078A3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters