Files
tuya-convert/scripts/smartconfig/main.py
Colin Kuebler e3168b8339 Remove hostapd.conf writer from setup_ap, and instead include a static file
Cut hostapd.conf down to bare configuration
Added hostapd ctrl interface
Reduce log noise by specifying hostapd log level info
Specify interface for hostapd by argument rather than config
No password on vtrust-flash
Updated smartconfig for no password
2019-10-12 16:07:46 -04:00

37 lines
818 B
Python
Executable File

#!/usr/bin/env python3
# encoding: utf-8
"""
main.py
Created by kueblc on 2019-01-25.
Configure Tuya devices via smartconfig for tuya-convert
"""
ssid = "vtrust-flash"
passwd = ""
region = "US"
token = "00000000"
secret = "0101"
from smartconfig import smartconfig
from time import sleep
print('Put device in EZ config mode (blinking fast)')
print('Sending SSID '+ssid)
print('Sending wifiPassword '+passwd)
print('Sending token '+token)
print('Sending secret '+secret)
for i in range(10): # Make 10 attempts
smartconfig( passwd, ssid, region, token, secret )
print()
print('SmartConfig complete.')
for t in range(3, 0, -1):
print('Auto retry in %ds. ' % t, end='', flush=True)
sleep(1)
print(end='\r')
print('Resending SmartConfig Packets')