Skip to content

Instantly share code, notes, and snippets.

@phixion
Last active October 26, 2020 05:09
Show Gist options
  • Save phixion/f9bf065bb8970bdda3d35d3842438780 to your computer and use it in GitHub Desktop.
Save phixion/f9bf065bb8970bdda3d35d3842438780 to your computer and use it in GitHub Desktop.
$ martin@ex3c0 [tuya-convert]; uname -a
Linux rc3x0 5.4.2-arch1-1 #1 SMP PREEMPT Thu, 05 Dec 2019 12:29:40 +0000 x86_64 GNU/Linux
$ martin@ex3c0 [tuya-convert]; dmesg |grep DMI
kern :info : [Mon Dec 9 22:00:42 2019] DMI: Apple Inc. MacBookAir3,1/Mac-942452F5819B1C1B, BIOS 109.0.0.0.0 12/19/2018
kern :notice: [Mon Dec 9 22:00:42 2019] ACPI: DMI detected to setup _OSI("Darwin"): Apple hardware
kern :info : [Mon Dec 9 22:00:42 2019] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
kern :notice: [Mon Dec 9 22:00:42 2019] ACPI: BIOS _OSI(Darwin) query honored via DMI
$ martin@ex3c0 [~]; dmesg |grep broadcom
$ martin@ex3c0 [1] [~]; dmesg |grep Broadcom
kern :info : [Mon Dec 9 21:44:26 2019] Broadcom 43xx driver loaded [ Features: PNLS ]
$ martin@ex3c0 [~]; cat tuya-convert/install_prereq.sh
#!/bin/bash
set -e
yay -Syu git iw dnsmasq hostapd screen curl base-devel python-pip python2-pip python2-setuptools python-setuptools python2-wheel python-wheel mosquitto haveged net-tools
PY3_DEPENDENCIES="paho-mqtt pyaes tornado git+https://github.com/M4dmartig4n/sslpsk.git pycrypto"
PY2_DEPENDENCIES="git+https://github.com/M4dmartig4n/sslpsk.git pycrypto"
if python3 -c 'import sys; exit(0) if sys.version_info.major == 3 and sys.version_info.minor < 7 else exit(1)' ;
then
sudo -H pip3 install $PY3_DEPENDENCIES
sudo -H pip2 install $PY2_DEPENDENCIES
else
sudo -H python3 -m pip install $PY3_DEPENDENCIES
sudo -H python2 -m pip install $PY2_DEPENDENCIES
fi
echo "Ready to start upgrade"
$ martin@ex3c0 [~]; dmesg |grep brcm
kern :info : [Mon Dec 9 21:44:26 2019] brcmsmac bcma0:1: mfg 4bf core 812 rev 23 class 0 irq 22
kern :info : [Mon Dec 9 21:44:26 2019] brcmsmac bcma0:1 wlp1s0b1: renamed from wlan0
kern :err : [Mon Dec 9 21:44:27 2019] brcmsmac bcma0:1: brcms_ops_bss_info_changed: qos enabled: false (implement)
kern :err : [Mon Dec 9 21:44:27 2019] brcmsmac bcma0:1: brcms_ops_config: change power-save mode: false (implement)
kern :err : [Mon Dec 9 21:44:27 2019] brcmsmac bcma0:1: brcms_ops_bss_info_changed: qos enabled: false (implement)
kern :err : [Mon Dec 9 21:44:27 2019] brcmsmac bcma0:1: brcms_ops_config: change power-save mode: false (implement)
kern :err : [Mon Dec 9 21:44:31 2019] brcmsmac bcma0:1: brcms_ops_bss_info_changed: qos enabled: false (implement)
kern :err : [Mon Dec 9 21:44:31 2019] brcmsmac bcma0:1: brcms_ops_config: change power-save mode: false (implement)
kern :err : [Mon Dec 9 21:44:35 2019] brcmsmac bcma0:1: brcmsmac: brcms_ops_bss_info_changed: associated
kern :err : [Mon Dec 9 21:44:35 2019] brcmsmac bcma0:1: brcms_ops_bss_info_changed: qos enabled: true (implement)
kern :err : [Mon Dec 9 21:44:36 2019] brcmsmac bcma0:1: brcms_ops_bss_info_changed: arp filtering: 1 addresses (implement)
kern :err : [Mon Dec 9 21:44:42 2019] brcmsmac bcma0:1: brcms_ops_bss_info_changed: arp filtering: 2 addresses (implement)
$ martin@ex3c0 [~]; tuya-convert/start_flash.sh
tuya-convert/start_flash.sh: line 12: ./config.txt: No such file or directory
tuya-convert/start_flash.sh: line 14: ./stop_flash.sh: No such file or directory
tuya-convert/start_flash.sh: line 16: pushd: scripts: No such file or directory
$ martin@ex3c0 [1] [~]; cd tuya-convert/
$ martin@ex3c0 [tuya-convert]; sudo ./start_flash.sh
Checking for network interface wlp1s0b1... Found.
Checking UDP port 53... Available.
Checking UDP port 67... Available.
Checking TCP port 80... Available.
Checking TCP port 443... Available.
Checking UDP port 6666... Available.
Checking UDP port 6667... Available.
Checking TCP port 1883... Available.
Checking TCP port 8886... Available.
======================================================
Starting AP in a screen
Starting web server in a screen
Starting Mosquitto in a screen
Starting PSK frontend in a screen
Starting Tuya Discovery in a screen
======================================================
IMPORTANT
1. Connect any other device (a smartphone or something) to the WIFI vtrust-flash
This step is IMPORTANT otherwise the smartconfig may not work!
2. Put your IoT device in autoconfig/smartconfig/pairing mode (LED will blink fast). This is usually done by pressing and holding the primary button of the device
Make sure nothing else is plugged into your IoT device while attempting to flash.
3. Press ^[[1mENTER^[[m^O to continue
======================================================
Starting smart config pairing procedure
Waiting for the device to install the intermediate firmware
.Put device in EZ config mode (blinking fast)
Sending SSID vtrust-flash
Sending wifiPassword
Sending token 00000000
Sending secret 0101
...............
SmartConfig complete.
Auto retry in 3s. ...^MAuto retry in 2s. .......................^MAuto retry in 1s. ..................................................................^MResending SmartConfig Packets
.........................
Device did not appear with the intermediate firmware
Check the *.log files in the scripts folder
Stopping smart config
@holoduke
Copy link

what is the command "yay" ?

@phixion
Copy link
Author

phixion commented Mar 22, 2020

archlinux AUR helper

See: https://github.com/Jguer/yay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment