Hi all,
I did succeed in flashing a device with the new tuya sdk with tuya-convert.
Changes needed are in my own fork, for reference
https://github.com/M4dmartig4n/tuya-convert
It is not ready for a pull-request, since it drops support for older sdk atm.
Enjoy !
Hey, are you saying this works for new firmware that was previously not compatible?
Yes.
Obviously, I haven't tested it against all new firmware, so your mileage may vary.
I hope it will work for the latest tuya devices, bought some door sensors and stuff that would be handy to flash like this.
I just tried this on a Nedis WIFIP310FWT that couldn't be flashed using the old method. I can confirm that this worked very well
Amazing job well done! Care to give a brief overview of how you figured it out? Just to satisfy my curiosity, I'm really interested! Thanks!
I'll be checking this out tonight got 4 gosunds with the new firmware on them I'll report back if they work.
So just use the build from CT? And import the recent files from you?
@M4dmartig4n Go ahead and open a PR and we can work together to get this merged. Will require a few small tweaks to be compatible with #226. You can reach me directly at my gmail of the same name.
@kueblc I will be afk for a moment, but will do that.
Apart from my coding style ;) , we need to figure a way to identify devices with previous/new sdk in order to provide them the right answers (for example, mqtt messages, and upgrade answers are quite different).
Maybe there is a parameter in the request, I dunno.
A "hack" would be to check the source ip in fake_registration server, since new sdk requests are proxyfied through psk-frontend and thus come from 127.0.0.1.
@EverythingSmartHome I will probably write a small blog post about it in the near future
@kueblc I will be afk for a moment, but will do that.
Do you have Telegram or Signal?
Apart from my coding style ;) , we need to figure a way to identify devices with previous/new sdk in order to provide them the right answers (for example, mqtt messages, and upgrade answers are quite different).
Maybe there is a parameter in the request, I dunno.
Sure, check for et=1
A "hack" would be to check the source ip in fake_registration server, since new sdk requests are proxyfied through psk-frontend and thus come from 127.0.0.1.
This would work fine too, this entire project is a "hack" :stuck_out_tongue:
Thanks for the efforts. I was unable to install as the pre-req libssl-dev seemed to be missing/absent. I tried a Kali-linux environment, along with my own Proxmox/Debian LXC container script previously working well for Tuya 1.0.
I fixed the error, and was able to proceed.
I attempted conversion with Teckin Sp20 outlet with no success. I can see it finds the device and talks to it, and I would say it engages stage one - but never actually backs up or proceeds. It does the leave the device crippled/bricked and unable to proceed. (that is ok it is a test unit and has serial connections ready to re-flash back to stock). I am able to re-flash back to stock firmware which DOES work, and I am able to add it to the APP and it detects v1.0.3 and updates it, blocking Tuya Convert v1 -- as expected.
I have another AliExpress plug that doesn't have a firmware update for it, and therefor I can't test with.
[-=SrZ=-]
@SirRedZ can you elaborate on what you mean by "bricked"? You can't put it back into EZ config mode after attempting the process?
Another missing prerequisite is git ;)
@SirRedZ can you elaborate on what you mean by "bricked"? You can't put it back into EZ config mode after attempting the process?
Correct. The module's behavior is modified, and button access is unresponsive. Unplugging and plugging in flashes the light once, but that is it. I recognize this behavior after the bootloader has been applied??? mid-state? Only serial flashing allows me to recover.
Since you already have it connected to serial, it would be great to get a backup of the firmware in this state. Did you back it up before reflashing?
Along with the missing libssl-dev pre-req which was already mentioned I noticed another issue with my Smart Connect bulbs.
After connecting it is posting to the following URL a couple of times (and failing):
POST /d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=14&uuid=_some UUID_&v=4.1&sign=_some hex string_
It seems to be asking for some sort of configuration, but I'm not sure which
i'm trying for an hour. i got the smart bulb in config mode. tuya convert is searching. but no luck. do i need to start pairing this device thrue my phone?if yes wich app do you use?
@haubke,
You only need to connect to the WiFi with your phone, no apps or anything else
If it doesn’t switch to continuous and keeps on flashing, repeat the process. It took me 10 times for it to finally to connect
yes flashing 2 times a sec.
no it wont stop flashing. i will check logs when i tried a few times. i will post logs in a minute.
I checked the logs, nothing usefull there. Everything seems ok. i will dig deeper.
i guess i found a problem.
log PSK
Traceback (most recent call last):
File "./psk-frontend.py", line 8, in
from Crypto.Cipher import AES
ImportError: No module named 'Crypto'
sudo apt-get install libssl-dev
...and then boom, it worked. Saved me from having to try to solder pins that are about 1/8 away from a tall plastic switch soldered to the pcb.
THANK YOU!!!
still no luck, thanks anyhow. i will keep trying and post my findings.
Hi All,
seeing this in the smarthack-web.log with the new sdk setup
URI:/gw.json?a=tuya.device.upgrade.silent.get&gwId=63120466c44f33863260&t=26&v=4.1&sign=31d615cf31fbc6a63e0031d0685a06c7
Answer s.gw.upgrade.get
b'{"result":{"auto":3,"size":"506587","type":9,"pskUrl":"https://10.42.42.1/files/upgrade.bin","hmac":"7BA1C83AD95ED48CBAB9A3BA731B79DE1CFC61DEDC12CE84BBD480F49833F5F9","version":"9.0.0"},"t":10,"e":false,"success":true}'
[I 190919 17:29:55 web:2246] 200 POST /gw.json?a=tuya.device.upgrade.silent.get&gwId=63120466c44f33863260&t=26&v=4.1&sign=31d615cf31fbc6a63e0031d0685a06c7 (10.42.42.29) 24.65ms
URI:/gw.json?a=s.gw.dev.timer.count&gwId=63120466c44f33863260&t=167&sign=28d676260773c01b4dbfba9d8a94d556
WARN: unknown request: s.gw.dev.timer.count (/gw.json?a=s.gw.dev.timer.count&gwId=63120466c44f33863260&t=167&sign=28d676260773c01b4dbfba9d8a94d556)
[I 190919 17:32:32 web:2246] 200 POST /gw.json?a=s.gw.dev.timer.count&gwId=63120466c44f33863260&t=167&sign=28d676260773c01b4dbfba9d8a94d556 (10.42.42.29) 5.93ms
The last line keeps repeating
This should be resolved when we merge this with #226
Colin, do you still want a copy of firmware in the 'frozen state' ?
I thought after reading the comments above I should check my logs.... Maybe it was working and crashed for me?>
URI:/gw.json?a=tuya.device.upgrade.silent.get&gwId=88020554cc50e3cf1954&t=7&v=4.1&sign=fab950f88c43806fa17e9bcca40bdf34
Answer s.gw.upgrade.get
b'{"result":{"auto":3,"size":"506587","type":9,"pskUrl":"https://10.42.42.1/files/upgrade.bin","hmac":"7BA1C83AD95ED48CBAB9A3BA731B79DE1CFC61DEDC12CE84BBD480F$
^[[32m[I 190919 07:53:07 web:2246]^[[m^O 200 POST /gw.json?a=tuya.device.upgrade.silent.get&gwId=88020554cc50e3cf1954&t=7&v=4.1&sign=fab950f88c43806fa17e9bcca$
^CTraceback (most recent call last):
File "./fake-registration-server.py", line 160, in
main()
File "./fake-registration-server.py", line 156, in main
tornado.ioloop.IOLoop.current().start()
File "/usr/local/lib/python3.5/dist-packages/tornado/platform/asyncio.py", line 148, in start
self.asyncio_loop.run_forever()
File "/usr/lib/python3.5/asyncio/base_events.py", line 421, in run_forever
self._run_once()
File "/usr/lib/python3.5/asyncio/base_events.py", line 1388, in _run_once
event_list = self._selector.select(timeout)
File "/usr/lib/python3.5/selectors.py", line 445, in select
fd_event_list = self._epoll.poll(timeout, max_ev)
KeyboardInterrupt
@SirRedZ Yes, I can use the backup to hopefully debug what went wrong. Doesn't look like the server crashed, it's a KeyboardInterrupt exception, which is what Ctrl-C throws (the ^C at the beginning of the error message).
This should be resolved when we merge this with #226
Worked with the changes. Thanks guys for all the great work.
teckin_sp20_afterfw_convertattempt.zip
Here is the FW in "bricked" state. Here are the exact steps.
Restarted flashing process, unplugged module and plugged back in. Mopdule reports online. Firmware backup fails again (expected - file exists?)
JUMP - UP - AND - DOWN - SUCCESS !!!!!
Sonoff-xxx access point visible. IT WORKS. I had to jump through hoops - it works.
This was the device I originally used to report the failure- block also!
GREAT WORK!.
[-=SrZ=-]
My current conclusion is brute force (unplug/plugin/restart tuya convert process, etc...) gets it to go eventually.
Lightbulbs are a No-go after trying 4-5 different bulbs Zero response. I did my test module 4 times andDigiBlurDIY did 2 or 3 different devices and all eventually converted. There were all previously confirmed BLOCKED in the past. All were added to the app to make sure they had latest firmware, and then removed from the app to begin the conversion.
Thanks everyone- I hope this helps!
[-=SrZ=-]
Unfortunately this didn't work for my light bulbs either, great we are moving forward with this though!
Happy to report: I does work for my Action LSC Smart bulb.
======================================================
Getting Info from IoT-device
VTRUST-FLASH 1.1
(c) VTRUST GMBH https://www.vtrust.de/35c3/
READ FLASH: http://10.42.42.42/backup
ChipID: XXXX
MAC: XXXXX
BootVersion: 7
BootMode: normal
FlashMode: 1M DOUT @ 40MHz
FlashChipId: 144051
FlashChipRealSize: 1024K
Active Userspace: user2 0x81000
======================================================
Happy to report: I does work for my
ActionLSC Smart bulb.======================================================
Getting Info from IoT-device
VTRUST-FLASH 1.1
(c) VTRUST GMBH https://www.vtrust.de/35c3/
READ FLASH: http://10.42.42.42/backup
ChipID: XXXX
MAC: XXXXX
BootVersion: 7
BootMode: normal
FlashMode: 1M DOUT @ 40MHz
FlashChipId: 144051
FlashChipRealSize: 1024K
Active Userspace: user2 0x81000======================================================
That is strange, I have the same bulbs and they keep posting to the following URL a couple of times (and failing):
POST /d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=14&uuid=some UUID&v=4.1&sign=some hex string
Can you check your logs if you see that string coming by?
I did a tweak to the HOSTAPD settings (./setup_ap.sh):
cat <<- EOF >/etc/hostapd/hostapd.conf
interface=$WLAN
driver=nl80211
ssid=$AP
hw_mode=g
channel=9
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=$PASS
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
ieee80211n=1
EOF
ieee80211n=1 adds WIFI N channel support, and channel 9 is better then channel 1 I think.
IMHO WIFI N is working better then G.
@ThaStealth, nope.
URI:/gw.json?a=s.gw.token.get&et=1&gwId=XX&other={"token":"00000000","region":"US","tlinkStat":{"configure":"smartconfig","time":1,"source":"ap","path":"broadcast"}}&t=7&v=3.0&sign=YY
URI:/gw.json?a=s.gw.token.get&et=1&gwId=XX&other={"token":"00000000","region":"US","tlinkStat":{"configure":"smartconfig","time":1,"source":"ap","path":"broadcast"}}&t=7&v=3.0&sign=YY
Answer s.gw.token.get
ESC[32m[I 190920 11:20:49 web:2246]ESC[m^O 200 GET /gw.json?a=s.gw.token.get&et=1&gwId=XX&other={"token":"00000000","region":"US","tlinkStat":{"configure":"smartconfig","time":1,"source":"ap","path":"broadcast"}}&t=7&v=3.0&sign=YY
8686 (127.0.0.1) 9.44ms
URI:/gw.json?a=s.gw.dev.fk.active&et=1&gwId=XX&other={"token":"00000000"}&t=7&v=3.0&sign=yy
92
Answer s.gw.dev.pk.active
READ GW ID xx
ESC[32m[I 190920 11:20:50 web:2246]ESC[m^O 200 POST /gw.json?a=s.gw.dev.fk.active&et=1&gwId=XX&other={"token":"00000000
"}&t=7&v=3.0&sign=YYY (127.0.0.1) 54.88ms
URI:/gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=XX&t=9&v=1.0&sign=YY
Answer tuya.device.dynamic.config.get
READ GW ID XX
ESC[32m[I 190920 11:20:51 web:2246]ESC[m^O 200 POST /gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=XX&t=9&v=1.0&si
gn=YY (127.0.0.1) 5.75ms
URI:/gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=XX&t=0&v=1.0&sign=YY
Answer tuya.device.dynamic.config.ack
READ GW ID XX
TRIGGER UPGRADE IN 10 SECONDS
Trigger upgrade in 10 seconds
ESC[32m[I 190920 11:20:52 web:2246]ESC[m^O 200 POST /gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=XX&t=0&v=1.0&sign=YY (127.0.0.1) 62.27ms
Sonoff-Tasmota v6.5.0 also flashed successfully
curl http://10.42.42.42/flash3
Can now switch the bulb on/off with simple requests: ;)
curl http://192.168.0.xx/cm?cmnd=Power%20off
curl http://192.168.0.xx/cm?cmnd=Power%20on
You´re the Män!!
Sucessfully flashed all my SP22 Adapters which all had new tuya FW before!
Thanks a lot!
Worked with two Brilliant Smart (Au) plugs. One of them needed the fixes in #226 and the other failed until I pulled those changes out. Really not sure on the difference.
Had some garden lights that seemed to get close.
The trigger_upgrade.sh ran - but then got a disconnect on the MQTT log: "1568993822: Socket error on client P1, disconnecting."
Worked with two Brilliant Smart (Au) plugs. One of them needed the fixes in #226 and the other failed until I pulled those changes out. Really not sure on the difference.
Had some garden lights that seemed to get close.
The trigger_upgrade.sh ran - but then got a disconnect on the MQTT log: "1568993822: Socket error on client P1, disconnecting."
I have experienced that also.
It works! I just flashed 12 Teckin SP22 smart sockets. THANK YOU!
Only Action LSC Smart White bulbs have success, Action Smart Connect RGB bulbs fail to flash here. They only sometimes stop flashing in the initial phase, but then a 404 shows up in ..web.log:
ESC[33m[W 190920 18:20:47 web:2246]ESC[m^O 404 POST /d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=21&u
uid=yy&v=4.1&sign=xx (127.0.0.1) 60.44ms
ESC[33m[W 190920 18:20:49 web:2246]ESC[m^O 404 POST /d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=21&u
uid=yy&v=4.1&sign=xx (127.0.0.1) 54.38ms
FYI Smart Connect RGB bulbs have ID's that are 2 characters longer then white filament bulbs, can that be the cause?
@haubke I had the same issue you had and was able to fix it by running the following two commands
sudo apt-get install python3-dev
pip3 install pycrypto
@janghou
I have the issue, didn’t find a solution yet, however if you google tuya.device.config.get you’ll find a page from tuya itself which looks like an MQTT server info request
@Janghou looks like you have a unique firmware there. It would be great to get a copy of it for research.
As far as your current issue, looks like it's making a request to /d.json instead of /gw.json. Duplicate this line and change one of the gw to d. Let us know how it goes.
@kueblc
I have the same bulb, changed the line to test it, but it still doesn't work:
URI:/d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=35&uuid=removed&v=4.1&sign=removed
WARN: unknown request: tuya.device.config.get (/d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=35&uuid=removed&v=4.1&sign=removed)
^[[32m[I 190920 19:25:00 web:2246]^[[m^O 200 POST /d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=35&uuid=removed&v=4.1&sign=removed(127.0.0.1) 52.80ms
Note that "tuya.device.config.get" is not implemented in the JSONHandler
@ThaStealth thanks for testing and following up. Try removing .dynamic from this line
@ThaStealth @kueblc
URI:/d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=10&uuid=xxx&v=4.1&sign=yy
Answer tuya.device.dynamic.config.get
READ GW ID son?a=tuya.device.co
ESC[32m[I 190920 19:41:18 web:2246]ESC[m^O 200 POST /d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=10&uuid=xx&v=4.1&sign=yy (127.0.0.1) 58.63ms
@Janghou so, did it work?
I've tried about 3 or 4 bulb types with 2.0 and they don't work yet. One does this..
RI:/gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=70007862b4e62d5ccf37&t=8&v=1.0&sign=7e4d82fbbf61fb1b0a786abd035778ad
Answer tuya.device.dynamic.config.get
READ GW ID 70007862b4e62d5ccf37
[32m[I 190919 01:10:22 web:2246][m 200 POST /gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=70007862b4e62d5ccf37&t=8&v=1.0&sign=7e4d82fbbf61fb1b0a786abd035778ad (127.0.0.1) 5.47ms
URI:/gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=70007862b4e62d5ccf37&t=0&v=1.0&sign=9849fa1adcceb0159eaf9ec21b309081
Answer tuya.device.dynamic.config.ack
TRIGGER UPGRADE IN 10 SECONDS
Trigger upgrade in 10 seconds
[32m[I 190919 01:10:22 web:2246][m 200 POST /gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=70007862b4e62d5ccf37&t=0&v=1.0&sign=9849fa1adcceb0159eaf9ec21b309081 (127.0.0.1) 60.66ms
b'2.2\x8e\xf6\x14X85542492\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91m\x8d\xb2~AK\xa9\xe2\xcf\xe7\x9a\xd8\xd8S\xf25P\xa89\x12\nX\xf1vdR\xd7c\n!\xed\x7fB\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5EL(\x95\xab\x04\x9c\x1b\xd5\xae=\xaa\xe4\x02\xd5\x0bNl\xcd\xackG\xe0\xf9\x12\x8dT)O\xb0\x9b\x05u\xe6'
@Janghou so, did it work?
I tried it and it repeats a couple of times but it doens't continue (got the same output @Janghou has)
@kueblc No, hanging on above message. missing gwID in the response I guess, see
READ GW ID son?a=tuya.device.co
Good to know, thanks for reporting. I'll follow up later tonight.
flash fails with the following repeating in the mqtt.log:
1569008459: New connection from 127.0.0.1 on port 1883.
1569008459: Client 08702840840d8ea3877d already connected, closing old connection.
1569008459: Socket error on client 08702840840d8ea3877d, disconnecting.
1569008459: New client connected from 127.0.0.1 as 08702840840d8ea3877d (c1, k60, u'AAAAAI56VcDYRHclIcnZCVaQ').
1569008459: No will message specified.
1569008459: Sending CONNACK to 08702840840d8ea3877d (0, 0)
1569008459: Received SUBSCRIBE from 08702840840d8ea3877d
1569008459: smart/device/in/08702840840d8ea3877d (QoS 0)
1569008459: 08702840840d8ea3877d 0 smart/device/in/08702840840d8ea3877d
1569008459: Sending SUBACK to 08702840840d8ea3877d
1569008462: New connection from 127.0.0.1 on port 1883.
1569008462: New client connected from 127.0.0.1 as P1 (c1, k60).
1569008462: No will message specified.
1569008462: Sending CONNACK to P1 (0, 0)
1569008462: Received PUBLISH from P1 (d0, q0, r0, m0, 'smart/device/in/08702840840d8ea3877d', ... (111 bytes))
1569008462: Sending PUBLISH to 08702840840d8ea3877d (d0, q0, r0, m0, 'smart/device/in/08702840840d8ea3877d', ... (111 bytes))
1569008462: Socket error on client P1, disconnecting.
URI:/gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=08702840840d8ea3877d&t=8&v=1.0&sign=4737418eb266715d269b52c1d7167bb1
Answer tuya.device.dynamic.config.get
READ GW ID 08702840840d8ea3877d
[I 190920 20:44:57 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=08702840840d8ea3877d&t=8&v=1.0&sign=4737418eb266715d269b52c1d7167bb1 (127.0.0.1) 3.99ms
web log:
URI:/gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=08702840840d8ea3877d&t=0&v=1.0&sign=b666fbf0c00aa28138972a2af1d002d2
Answer tuya.device.dynamic.config.ack
READ GW ID 08702840840d8ea3877d
TRIGGER UPGRADE IN 10 SECONDS
Trigger upgrade in 10 seconds
[I 190920 20:44:57 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=08702840840d8ea3877d&t=0&v=1.0&sign=b666fbf0c00aa28138972a2af1d002d2 (127.0.0.1) 16.46ms
b"2.2\xc4\xd2\x91\x1900870007\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91m\x8c\x1e\x84\x1dY\xde\xae\xcfzh7\xd6\x16)\xe0\x0f\xb3/\x16\xab\xb954v\xd2\xf0\x08\xc7\xf7%\x13\xe1\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5ELX{\xbc\xaf$\x0f'\xfbz~WV\xb6\xbe\x03>\xfdZ\x08\xc8b\x8f\x06F3\x8c[\xa9'\x99\xae\xe1"
Great Job guys!
Where is the moment in tutorial when I have to change something? Big Thanks
I think you only need to use the other repo url in the installation when you git clone.
I.e. in https://github.com/M4dmartig4n/tuya-convert#installation do git clone https://github.com/M4dmartig4n/tuya-convert.git instead of git clone https://github.com/ct-Open-Source/tuya-convert
I am convinced this is my issue. Any ideas for me to try @kueblc ??
Tried this on a raspberry pi 3 tonight and getting this issue when attempting to run the ./install_prereq.sh
I had this working (on the same pi) before the firmware was released and flashed 3 plugs and 2 bulbs correctly. So not sure why it is having issues with this step now.
Seems to be failing on this line
sudo pip3 install git+https://github.com/M4dmartig4n/sslpsk.git
`pi@raspberrypi:~/tuya-convert $ ./install_prereq.sh
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Hit:3 https://deb.nodesource.com/node_11.x stretch InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
curl is already the newest version (7.52.1-5+deb9u9).
haveged is already the newest version (1.9.1-5+deb9u1).
mosquitto is already the newest version (1.4.10-3+deb9u4).
net-tools is already the newest version (1.60+git20161116.90da8a0-1).
python3-setuptools is already the newest version (33.1.1-1).
python3-wheel is already the newest version (0.29.0-2).
screen is already the newest version (4.5.0-6).
dnsmasq is already the newest version (2.76-5+rpt1+deb9u1).
hostapd is already the newest version (2:2.6-21~bpo9~rpt1).
python3-pip is already the newest version (9.0.1-2+rpt2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Collecting git+https://github.com/M4dmartig4n/sslpsk.git
Cloning https://github.com/M4dmartig4n/sslpsk.git to /tmp/pip-_t0g0dmb-build
Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.5/dist-packages
Requirement already satisfied: pyaes in /usr/local/lib/python3.5/dist-packages
Requirement already satisfied: tornado in /usr/local/lib/python3.5/dist-packages
Installing collected packages: sslpsk
Running setup.py install for sslpsk ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-_t0g0dmb-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-gstdi5kq-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.5
creating build/lib.linux-armv7l-3.5/sslpsk
copying sslpsk/__init__.py -> build/lib.linux-armv7l-3.5/sslpsk
copying sslpsk/sslpsk.py -> build/lib.linux-armv7l-3.5/sslpsk
creating build/lib.linux-armv7l-3.5/sslpsk/test
copying sslpsk/test/test_sslpsk.py -> build/lib.linux-armv7l-3.5/sslpsk/test
copying sslpsk/test/__init__.py -> build/lib.linux-armv7l-3.5/sslpsk/test
copying sslpsk/test/example_client.py -> build/lib.linux-armv7l-3.5/sslpsk/test
copying sslpsk/test/example_server.py -> build/lib.linux-armv7l-3.5/sslpsk/test
copying sslpsk/test/__main__.py -> build/lib.linux-armv7l-3.5/sslpsk/test
running build_ext
building 'sslpsk._sslpsk' extension
creating build/temp.linux-armv7l-3.5
creating build/temp.linux-armv7l-3.5/sslpsk
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-6waWnr/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c sslpsk/_sslpsk.c -o build/temp.linux-armv7l-3.5/sslpsk/_sslpsk.o
sslpsk/_sslpsk.c:19:25: fatal error: openssl/ssl.h: No such file or directory
#include
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-_t0g0dmb-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-gstdi5kq-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-_t0g0dmb-build/
`
@chaotic Read this thread, the issue and solution were posted a couple of times already..
The fix for the sslpsk failure is to install the libssl libraries.
sudo apt-get install libssl-dev -y
Thanks, guys... I was able to flash some plugs that were just sitting around that 1.0 failed to flash. Nice work!
i´m not able to finish .-prereq install.
ive searched, could not find anything. i'm on armbian opi pc+. i know the above error. th
libssl is already installed.
sslpsk/_sslpsk.c:17:10: fatal error: Python.h: No such file or directory
#include
python is installed(python 3.7-minimal). can somebody point me in the direction i need to go?
edit:
Never mind python dev not installed.
for opi pc+ users, install
apt-get install python3-dev
sudo apt-get install libssl-dev
sudo apt-get install python3-dev
pip3 install pycrypto
Those commands should fix the issue. And you might not need all 3 I just did them all to make sure.
yes thank you, i have contact with the bulbs. no luck yet flashing it though.
Update:
I helped my brother flash 4 x Teckin Sp25 modules that were blocked upon arrival from Amazon (months ago). Every module converted smoothly, with no issues.
That made me wonder why I had to monkey around and use 'brute force' methods.... so I tried a few things...
I have discovered that I was working too close too my NUC with Intel WiFI interface built-in. I took a brand new Teckin Sp20 out of the package, updated the FW to enable the block (via APP) and walked down the hallway and plugged it in. I put it in pairing mode, and proceeded to Tuya-Convert (via this fork) with no issues. I'll also point out that the backup completed correctly, and quickly.
I then repeated the process with my teckin Sp20 test (serial wired) module had exactly the same results. No monkey business required.
Previously I prepared the Tuya-Help.doc file with version 1.0. It helped several people overcome obstacles. I am attaching it here also, if it helps just one person, it was worth it.
[-=SrZ=-]
worked for me with the "Mirabella Genio WiFi Power Plug with USB"
Thank you
I can confirm the BSD 29 smart plugs are now flashable. This is fantastic, a $5 smart plug with full ESP home!!!
Please note that these are UK plugs
https://www.aliexpress.com/i/32960088441.html?spm=2114.12057483.0.0.1afa31f9nfYpOn
I'm trying to flash some Teckin SP23's fresh out of the box and getting nothing form them unfortunately.
Also no luck with any bulbs i've tried.
the smarthack-wifi.log contains the below :
Backing up /etc/dnsmasq.conf...
Writing dnsmasq config file...
Creating new /etc/dnsmasq.conf...
Writing hostapd config file...
Configuring AP interface...
Applying iptables rules...
Starting DNSMASQ server...
RTNETLINK answers: File exists
Starting AP on wlan0 in screen terminal...
Configuration file: /etc/hostapd/hostapd.conf
Failed to create interface mon.wlan0: -95 (Operation not supported)
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:73:0e:db and ssid "vtrust-flash"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
wlan0: STA 98:09:cf:00:22:34 IEEE 802.11: associated
wlan0: AP-STA-CONNECTED 98:09:cf:00:22:34
wlan0: STA 98:09:cf:00:22:34 RADIUS: starting accounting session 112FA288F5446681
wlan0: STA 98:09:cf:00:22:34 WPA: pairwise key handshake completed (RSN)
it nevers gets any further
Using this I was able to flash some Gosund SP1s that came with the new firmware on them.
I have this exact same problem with my RGBW bulb as @digiblur and @l3ok . My web logs look pretty much the same as this. Here the MQTT log for reference. Any help would be appreciated. I'm this close to getting this to work.
If anyone else has managed to get their RGB bulbs flashed successfully, posting your logs would be appreciated.
1569067432: New connection from 127.0.0.1 on port 1883.
1569067432: New client connected from 127.0.0.1 as P1 (p2, c1, k60).
1569067432: No will message specified.
1569067432: Sending CONNACK to P1 (0, 0)
1569067432: Received PUBLISH from P1 (d0, q0, r0, m0, 'smart/device/in/25070471bcddc232ba41', ... (111 bytes))
1569067432: Sending PUBLISH to 25070471bcddc232ba41 (d0, q0, r0, m0, 'smart/device/in/25070471bcddc232ba41', ... (111 bytes))
1569067432: Received DISCONNECT from P1
1569067432: Client P1 disconnected.
Not yet, trying though, same log output as you.
in case the device you are performing the flashing is connected to internet, just disconnected and try the flashing process again.
When I start, all the Tuya products do the same error
I start the procces
connect my phone to the WIFI
Put the device in fast blinking.
Wait....
Press enter...
After a few sec. the device stop blinking and the dots continue on my screen........
And get this error: Socket error on client P1, disconnecting.
my mosquitto log:
1569019444: mosquitto version 1.5.7 starting
1569019444: Using default config.
1569019444: Opening ipv4 listen socket on port 1883.
1569019444: Opening ipv6 listen socket on port 1883.
1569019457: New connection from 127.0.0.1 on port 1883.
1569019457: New client connected from 127.0.0.1 as 21020567a4cf12af99bc (c1, k60, u'21020567a4cf12af99bc').
1569019457: No will message specified.
1569019457: Sending CONNACK to 21020567a4cf12af99bc (0, 0)
1569019457: Received SUBSCRIBE from 21020567a4cf12af99bc
1569019457: smart/device/in/21020567a4cf12af99bc (QoS 0)
1569019457: 21020567a4cf12af99bc 0 smart/device/in/21020567a4cf12af99bc
1569019457: Sending SUBACK to 21020567a4cf12af99bc
1569019468: New connection from 127.0.0.1 on port 1883.
1569019468: New client connected from 127.0.0.1 as P1 (c1, k60).
1569019468: No will message specified.
1569019468: Sending CONNACK to P1 (0, 0)
1569019468: Received PUBLISH from P1 (d0, q0, r0, m0, 'smart/device/in/21020567a4cf12af99bc', ... (111 bytes))
1569019468: Sending PUBLISH to 21020567a4cf12af99bc (d0, q0, r0, m0, 'smart/device/in/21020567a4cf12af99bc', ... (111 bytes))
1569019468: Socket error on client P1, disconnecting.
1569019496: New connection from 127.0.0.1 on port 1883.
1569019496: Client 21020567a4cf12af99bc already connected, closing old connection.
1569019496: Socket error on client 21020567a4cf12af99bc, disconnecting.
1569019496: New client connected from 127.0.0.1 as 21020567a4cf12af99bc (c1, k60, u'21020567a4cf12af99bc').
1569019496: No will message specified.
1569019496: Sending CONNACK to 21020567a4cf12af99bc (0, 0)
1569019496: Received SUBSCRIBE from 21020567a4cf12af99bc
1569019496: smart/device/in/21020567a4cf12af99bc (QoS 0)
1569019496: 21020567a4cf12af99bc 0 smart/device/in/21020567a4cf12af99bc
1569019496: Sending SUBACK to 21020567a4cf12af99bc
1569019507: New connection from 127.0.0.1 on port 1883.
1569019507: New client connected from 127.0.0.1 as P1 (c1, k60).
1569019507: No will message specified.
1569019507: Sending CONNACK to P1 (0, 0)
1569019507: Received PUBLISH from P1 (d0, q0, r0, m0, 'smart/device/in/21020567a4cf12af99bc', ... (111 bytes))
1569019507: Sending PUBLISH to 21020567a4cf12af99bc (d0, q0, r0, m0, 'smart/device/in/21020567a4cf12af99bc', ... (111 bytes))
1569019507: Socket error on client P1, disconnecting.
1569019586: Client 21020567a4cf12af99bc has exceeded timeout, disconnecting.
1569019586: Socket error on client 21020567a4cf12af99bc, disconnecting.
1569019468: Received PUBLISH from P1 (d0, q0, r0, m0, 'smart/device/in/21020567a4cf12af99bc', ... (111 bytes))
1569019468: Sending PUBLISH to 21020567a4cf12af99bc (d0, q0, r0, m0, 'smart/device/in/21020567a4cf12af99bc', ... (111 bytes))
1569019468: Socket error on client P1, disconnecting.
There is no error, this is as intended.
I'm getting the same output log. But it doesn't seem to be working on a Tuya LED strip.
1569081130: New client connected from 127.0.0.1 as 4680526184f3ebc47e9d (c1, k60, u'4680526184f3ebc47e9d').
1569081130: No will message specified.
1569081130: Sending CONNACK to 4680526184f3ebc47e9d (0, 0)
1569081130: Received SUBSCRIBE from 4680526184f3ebc47e9d
1569081130: smart/device/in/4680526184f3ebc47e9d (QoS 0)
1569081130: 4680526184f3ebc47e9d 0 smart/device/in/4680526184f3ebc47e9d
1569081130: Sending SUBACK to 4680526184f3ebc47e9d
1569081132: New connection from 127.0.0.1 on port 1883.
1569081132: New client connected from 127.0.0.1 as P1 (c1, k60).
1569081132: No will message specified.
1569081132: Sending CONNACK to P1 (0, 0)
1569081132: Received PUBLISH from P1 (d0, q0, r0, m0, 'smart/device/in/4680526184f3ebc47e9d', ... (111 bytes))
1569081132: Sending PUBLISH to 4680526184f3ebc47e9d (d0, q0, r0, m0, 'smart/device/in/4680526184f3ebc47e9d', ... (111 bytes))
1569081132: Socket error on client P1, disconnecting.
The mqtt logs are not helpful as they don't contain any errors. Please post the web log.
Here are my web logs:
READ GW ID 4680526184f3ebc47e9d
[I 190921 17:01:10 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=4680526184f3ebc47e9d&t=8&v=1.0&sign=daf9b0e7db48a223a6a211a54e63ff6f (127.0.0.1) 4.29ms
URI:/gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=4680526184f3ebc47e9d&t=0&v=1.0&sign=811d8e440082f6ca679f174b14178288
Answer tuya.device.dynamic.config.ack
READ GW ID 4680526184f3ebc47e9d
TRIGGER UPGRADE IN 10 SECONDS
Trigger upgrade in 10 seconds
[I 190921 17:01:10 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=4680526184f3ebc47e9d&t=0&v=1.0&sign=811d8e440082f6ca679f174b14178288 (127.0.0.1) 17.29ms
b'2.2\xa7<\x99\xc908167282\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91m\x0c\xfc]\xeapqhY\xb9\xb5^x\xfb\xcf\xa8\x19%\xb1\xf22:\x1b,d\xc6\xeb\xe0\x96\xa3\xc6\xf3\xf3\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5EL\xf5\xad\xf4\xb8sDw\xff\xb3\t\xa1\xf6\x1djK\xc0\xbdH\x91\xb0\x896-\x7fHE\x9f\xbf\x81.\x9a\xd9'
URI:/gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=4680526184f3ebc47e9d&t=8&v=1.0&sign=daf9b0e7db48a223a6a211a54e63ff6f
Answer tuya.device.dynamic.config.get
READ GW ID 4680526184f3ebc47e9d
[I 190921 17:01:17 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=4680526184f3ebc47e9d&t=8&v=1.0&sign=daf9b0e7db48a223a6a211a54e63ff6f (127.0.0.1) 4.36ms
URI:/gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=4680526184f3ebc47e9d&t=0&v=1.0&sign=811d8e440082f6ca679f174b14178288
Answer tuya.device.dynamic.config.ack
READ GW ID 4680526184f3ebc47e9d
TRIGGER UPGRADE IN 10 SECONDS
Trigger upgrade in 10 seconds
[I 190921 17:01:18 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=4680526184f3ebc47e9d&t=0&v=1.0&sign=811d8e440082f6ca679f174b14178288 (127.0.0.1) 16.84ms
b'2.2\xf83c,08168075\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91m\x0c\xfc]\xeapqhY\xb9\xb5^x\xfb\xcf\xa8\x19%\xb1\xf22:\x1b,d\xc6\xeb\xe0\x96\xa3\xc6\xf3\xf3\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5EL\xf5\xad\xf4\xb8sDw\xff\xb3\t\xa1\xf6\x1djK\xc0\xf1k\x86?\xb2F\xe4\xc6\x11n%\xd5\x9a\xd5\xa10'
b"2.2\xa8(2\x9208168867\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91m\x0c\xfc]\xeapqhY\xb9\xb5^x\xfb\xcf\xa8\x19%\xb1\xf22:\x1b,d\xc6\xeb\xe0\x96\xa3\xc6\xf3\xf3\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5EL\xf5\xad\xf4\xb8sDw\xff\xb3\t\xa1\xf6\x1djK\xc0b=:\x8c\x83!\x90'\xa8'Y+\x83\x04>\xd5"
URI:/gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=4680526184f3ebc47e9d&t=11&v=1.0&sign=a570df9b8f1239313beca57ce8ceb57d
Answer tuya.device.dynamic.config.get
READ GW ID 4680526184f3ebc47e9d
[I 190921 17:01:28 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=4680526184f3ebc47e9d&t=11&v=1.0&sign=a570df9b8f1239313beca57ce8ceb57d (127.0.0.1) 2.50ms
URI:/gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=4680526184f3ebc47e9d&t=0&v=1.0&sign=811d8e440082f6ca679f174b14178288
Answer tuya.device.dynamic.config.ack
READ GW ID 4680526184f3ebc47e9d
TRIGGER UPGRADE IN 10 SECONDS
Trigger upgrade in 10 seconds
[I 190921 17:01:29 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=4680526184f3ebc47e9d&t=0&v=1.0&sign=811d8e440082f6ca679f174b14178288 (127.0.0.1) 18.20ms
Great, thanks for sharing. I believe I will have a fix ready for this issue soon.
Thank you very much, I can't wait to get get rid of tuya cloud :D
^CTraceback (most recent call last):
File "./fake-registration-server.py", line 179, in
main()
File "./fake-registration-server.py", line 175, in main
tornado.ioloop.IOLoop.current().start()
File "/usr/local/lib/python3.7/dist-packages/tornado/platform/asyncio.py", line 148, in start
self.asyncio_loop.run_forever()
File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
self._run_once()
File "/usr/lib/python3.7/asyncio/base_events.py", line 1739, in _run_once
event_list = self._selector.select(timeout)
File "/usr/lib/python3.7/selectors.py", line 468, in select
fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt
Listening on port 80
^CTraceback (most recent call last):
File "./fake-registration-server.py", line 179, in
main()
File "./fake-registration-server.py", line 175, in main
tornado.ioloop.IOLoop.current().start()
File "/usr/local/lib/python3.7/dist-packages/tornado/platform/asyncio.py", line 148, in start
self.asyncio_loop.run_forever()
File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
self._run_once()
File "/usr/lib/python3.7/asyncio/base_events.py", line 1739, in _run_once
event_list = self._selector.select(timeout)
File "/usr/lib/python3.7/selectors.py", line 468, in select
fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt
Listening on port 80
URI:/gw.json?a=s.gw.token.get&et=1&gwId=21020567a4cf12af99bc&other={"token":"00000000","region":"US","tlinkStat":{"configure":"smartconfig","time":1,"source":"ap","path":"broadcast"}}&t=6&v=3.0&sign=d36f8fd07e70aee3fd157679adafb916
[32m[I 190921 17:10:18 web:2246][m 200 GET /gw.json?a=s.gw.token.get&et=1&gwId=21020567a4cf12af99bc&other={"token":"00000000","region":"US","tlinkStat":{"configure":"smartconfig","time":1,"source":"ap","path":"broadcast"}}&t=6&v=3.0&sign=d36f8fd07e70aee3fd157679adafb916 (127.0.0.1) 6.93ms
snip
URI:/gw.json?a=s.gw.token.get&et=1&gwId=21020567a4cf12af99bc&other={"token":"00000000","region":"US","tlinkStat":{"configure":"smartconfig","time":1,"source":"ap","path":"broadcast"}}&t=147&v=3.0&sign=8159eee24e42f7edee61ed27bce66bf9
[32m[I 190921 17:12:39 web:2246][m 200 GET /gw.json?a=s.gw.token.get&et=1&gwId=21020567a4cf12af99bc&other={"token":"00000000","region":"US","tlinkStat":{"configure":"smartconfig","time":1,"source":"ap","path":"broadcast"}}&t=147&v=3.0&sign=8159eee24e42f7edee61ed27bce66bf9 (127.0.0.1) 4.12ms
Thanks for reporting @maffemuis. I've abbreviated your log posting so as not to clog up this thread. Unfortunately this is a different issue entirely and this fix won't work for you. We'll keep you posted if and when we can share a workaround.
sorry i start over again. I modifed some thinks to search the problem. So I think thats way its a ugly log :)
This is a cleaner log and running from a new GIT installed without modifications:
Same process. link phone, link Tuya, running.. a lot of dots. and flashing stops afther 3 a 8 sec.
download-2019.9.21_18.24.18-pi-(raspberrypi.).tar.gz
And a lamp stops at this in WEB:
URI:/gw.json?a=tuya.device.dynamic.config.ack&gwId=58067784ecfabc9d6e0f&t=9&v=1.0&sign=bb99a2d7383492f68ae5f4fbf785f319
Answer tuya.device.dynamic.config.ack
READ GW ID 58067784ecfabc9d6e0f
TRIGGER UPGRADE IN 10 SECONDS
Trigger upgrade in 10 seconds
[32m[I 190921 17:53:45 web:2246][m 200 POST /gw.json?a=tuya.device.dynamic.config.ack&gwId=58067784ecfabc9d6e0f&t=9&v=1.0&sign=bb99a2d7383492f68ae5f4fbf785f319 (10.42.42.38) 15.49ms
b'2.2\x1bR\x12\xf008483634\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91m\x7fC\x1eu\x11\xec0\xea\xbd\xa1\x1f#\xd3F\xa6\x86:\x1a0\xb4\x906\x9d\xee\xccP\xef\xbc\xa6\x87b]\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5EL\x90\xd7\x08EO\x12X\x86\xa5\xb6\x9e\xe8k\xee\x9a\xd5n=\x06O\xa8\xb6\x9ed\xdc-AM\x1c\xe1\x07\xdd'
URI:/gw.json?a=tuya.device.upgrade.silent.get&gwId=58067784ecfabc9d6e0f&t=21&v=4.1&sign=d9a2b676dbb4f799aeab27ac9b489477
Answer s.gw.upgrade.get
b'{"result":{"auto":3,"size":"506587","type":9,"pskUrl":"https://10.42.42.1/files/upgrade.bin","hmac":"7BA1C83AD95ED48CBAB9A3BA731B79DE1CFC61DEDC12CE84BBD480F49833F5F9","version":"9.0.0"},"t":10,"e":false,"success":true}'
[32m[I 190921 17:54:00 web:2246][m 200 POST /gw.json?a=tuya.device.upgrade.silent.get&gwId=58067784ecfabc9d6e0f&t=21&v=4.1&sign=d9a2b676dbb4f799aeab27ac9b489477 (10.42.42.38) 29.65ms
Wich device are you trying to flash?
First device:
LSC Smart Connect movement sensor from a dutch store Action
The sec: The lamp:
Woox Smart WiFi Light LED RGB Color Changing Dimmable E27 Bulb
Lsc movement should work(atleast thrue serial), i have not tried it. I did get the smart socket to flash.
Lsc light bulb gu10 not flashable at this moment.
Thanks! I've just flashed a few devices that previously didn't work, including one of these:

Has anyone played with these before? I loaded Tasmota 6.6.0.10 which worked on a light switch I have but suspect there will need to be some changes for it to work with the wall power sockets. Would happily give ESPHome a go as well as I have a few devices using running that too.
Original firmware for this device is linked in the post below
Thank you for the work, was able to flash newer bn-link plugs with your repo.
Does this error from the wifi.log indicate anything that could be going wrong for me?
Failed to create interface mon.wlan0: -95 (Operation not supported)
Successfully flashed three Blitzwolf BW SHP6 shocket. Bought them back in March just when the new firmware started to appear.
Worked for Gosnund SP1 v2.4 !!! Great JOB!
With all these guys having success with this, I'm starting to think my pi is broken :( got 2 of the new design Teckin SP23 (without energy monitoring) and they don't appear to do much of anything. vTrust shows up and I can connect to it but beyond that nothing is going on. No messages in web / WiFi or MQTT logs
I've tried the new-sdk branch of @kueblc ( https://github.com/kueblc/tuya-convert.git ). Still does not work at the moment with my LSC Smart Connect Smart LED (bought at Action). The device sends a request to the cloud similar to curl --globoff --insecure -H 'Host: a2.tuyaus.com' -H 'User-Agent: TUYA_IOT_SDK' --data 'data=[64 or 32 characters uppercase hex]' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Connection: keep-alive' 'https://a2.tuyaus.com/d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"EU"}&t=108&uuid=[uuid_here]&v=4.1&sign=[32characterlowercasehex]'
{"result":"[always 172 character string containing uppercase/lowercase alphanumeric and forward slashes, ending with an equals sign. base64 decodes to 128 bytes]","t":[timestamp],"sign":"[signature]"}
(where I removed some parameters). My device sent the US region value but the cloud rejected it ({"t":[timestamp],"e":false,"success":false,"errorCode":"ILLEGAL_REGION","errorMsg":"Invalid usage region"}) but the EU region got me this result.
So instead of a plain json response, the response is encoded. It looks like the cloud validates the UUID, but other things like shortening the sign or data parameters works.
In the result field of the response, only the first 16 bytes seem to change on a per-request basis. The rest is always the same, even when I change the hex in the POST data. It could still be unique to the UUID (I cannot test since I only have one light bulb). Could this response be AES-128 encrypted?
Just did 4 Gosund WP3 with 1.0.5 firmware. All went well. Great job guys.
I've tried the
new-sdkbranch of @kueblc ( https://github.com/kueblc/tuya-convert.git ). Still does not work at the moment with my LSC Smart Connect Smart LED (bought at Action).
Thanks for testing, not quite ready as you have found but will be soon.
The device sends a request to the cloud similar to
curl --globoff --insecure -H 'Host: a2.tuyaus.com' -H 'User-Agent: TUYA_IOT_SDK' --data 'data=[64 or 32 characters uppercase hex]' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Connection: keep-alive' 'https://a2.tuyaus.com/d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"EU"}&t=108&uuid=[uuid_here]&v=4.1&sign=[32characterlowercasehex]' {"result":"[always 172 character string containing uppercase/lowercase alphanumeric and forward slashes, ending with an equals sign. base64 decodes to 128 bytes]","t":[timestamp],"sign":"[signature]"}
(where I removed some parameters). My device sent theUSregion value but the cloud rejected it ({"t":[timestamp],"e":false,"success":false,"errorCode":"ILLEGAL_REGION","errorMsg":"Invalid usage region"}) but theEUregion got me this result.
Useful information, thank you
So instead of a plain json response, the response is encoded. It looks like the cloud validates the UUID, but other things like shortening the
signordataparameters works.In the result field of the response, only the first 16 bytes seem to change on a per-request basis. The rest is always the same, even when I change the hex in the
POSTdata. It could still be unique to theUUID(I cannot test since I only have one light bulb). Could this response be AES-128 encrypted?
It is indeed AES-128 ECB encrypted with secKey ("0000000000000000" in tuya-convert) and then base64 encoded. Inside is another JSON encoded string.
I have tested using this encoding but unfortunately I'm still having issues. I'll be doing some further research on this today and will report back.
If anyone has any firmware backups to share, that would be greatly appreciated, and please note whether it flashed OTA successfully or not and include any web logs.
If anyone has any firmware backups to share, that would be greatly appreciated, and please note whether it flashed OTA successfully or not and include any web logs.
@kueblc: for what it's worth I flashed the dump in #256 (link) to a NodeMCU using:
python3 -m esptool --port /dev/ttyUSB0 write_flash --erase-all --flash_size 1MB -fm dout 0x0 HYS_01_115_02_SOCKET.bin and started M4dmartig4n's tuya-convert and got these log message's
[err]tuya_tls.c:834 mbedtls_ssl_handshake returned ffff8d80 -29312
[err]http_inf.c:46 Open session failed: https://a3.tuyaus.com/gw.json?a=s.gw.token.get&et=1&gwId=HIDDEN&other={"token":"00000000","region":"US","tlinkStat":{"configure":"smartconfig","time":2,"source":"ap","path":"broadcast"}}&t=38&v=3.0&sign=a79a0cb643f4e607e0cba2e6b11a8095 (-29312)
[err]gw_intf.c:1141 httpc_gw_dev_token err:48
[notice]mqtt_client.c:573 gw wifi stat is:6
[err]tuya_tls.c:834 mbedtls_ssl_handshake returned ffffffff -1
[err]http_inf.c:46 Open session failed: https://a3.tuyaus.com/gw.json?a=s.gw.token.get&et=1&gwId=HIDDEN&other={"token":"00000000","region":"US","tlinkStat":{"configure":"smartconfig","time":2,"source":"ap","path":"broadcast"}}&t=41&v=3.0&sign=2b3dcd077d47636d43a4a03ff4e8f472 (-1)
[err]gw_intf.c:1141 httpc_gw_dev_token err:48
[notice]mqtt_client.c:573 gw wifi stat is:6
Which seems to indicate that the SSL handshake failed?
Thanks @TimelessNL
Yes, -29312 corresponds to MBEDTLS_ERR_SSL_CONN_EOF. I believe -1 indicates no response whatsoever. Maybe psk-frontend halted?
Only Action LSC Smart White bulbs have success, Action Smart Connect RGB bulbs fail to flash here. They only sometimes stop flashing in the initial phase
@Janghou: which 'filament' style bulbs did you flash successfully?
the E27 or E14 fitting bulbs? I suspect they are all basically the same other than the fact they look different.
Yes, -29312 corresponds to
MBEDTLS_ERR_SSL_CONN_EOF. I believe -1 indicates no response whatsoever. Maybepsk-frontendhalted?
@kueblc: yeah maybe... for some reason I only get a screenlog.0 file in the scripts folder and no sign of these *.log files. So I guess there is something wrong in my git clone.
For what I can see is that the psk-frontend does log some stuff:
new client on port 443 from ('10.42.42.37', 9408)
new client on port 443 from ('10.42.42.37', 2607)
new client on port 443 from ('10.42.42.37', 8397)
new client on port 443 from ('10.42.42.37', 871)
new client on port 443 from ('10.42.42.37', 5184)
new client on port 443 from ('10.42.42.37', 17348)
But that's about it.
I'm trying it on a feit electric bulb and getting:
[I 190922 20:40:01 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=052371532cf43200f470&t=8&v=1.0&sign=415dc432065631b3ffd9e34008406fa6 (127.0.0.1) 4.07ms
URI:/gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=052371532cf43200f470&t=0&v=1.0&sign=4e2d155e0e05178e1037019a8a9a4b2f
Answer tuya.device.dynamic.config.ack
READ GW ID 052371532cf43200f470
TRIGGER UPGRADE IN 10 SECONDS
[I 190922 20:40:01 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=052371532cf43200f470&t=0&v=1.0&sign=4e2d155e0e05178e1037019a8a9a4b2f (127.0.0.1) 66.04ms
Trigger upgrade in 10 seconds
b'2.2u\xf3\xf5\x9818120443\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91mi+M\x81\xb1\xf9k\x02x\x91X{\xcd\xafX\x9f\xe7\x06f{\xfa\xcd\x94\x9a\x88\xa8|\xdd\xa7"+\x88\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5ELS=v\xaax\x0f\xd6\xaan\xa6\xdd$2#\xb2\xb6\x1c\xa3+\x89\xf5[\xb6\xf0\xbe\xf7\x07\xf7\x1b5\x84\xf5'
URI:/gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=052371532cf43200f470&t=8&v=1.0&sign=415dc432065631b3ffd9e34008406fa6
Answer tuya.device.dynamic.config.get
READ GW ID 052371532cf43200f470
[I 190922 20:40:09 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=052371532cf43200f470&t=8&v=1.0&sign=415dc432065631b3ffd9e34008406fa6 (127.0.0.1) 3.85ms
URI:/gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=052371532cf43200f470&t=0&v=1.0&sign=4e2d155e0e05178e1037019a8a9a4b2f
Answer tuya.device.dynamic.config.ack
READ GW ID 052371532cf43200f470
TRIGGER UPGRADE IN 10 SECONDS
[I 190922 20:40:09 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=052371532cf43200f470&t=0&v=1.0&sign=4e2d155e0e05178e1037019a8a9a4b2f (127.0.0.1) 68.28ms
Trigger upgrade in 10 seconds
b'2.2p\x1e\x0b"18121221\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91mi+M\x81\xb1\xf9k\x02x\x91X{\xcd\xafX\x9f\xe7\x06f{\xfa\xcd\x94\x9a\x88\xa8|\xdd\xa7"+\x88\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5ELS=v\xaax\x0f\xd6\xaan\xa6\xdd$2#\xb2\xb6"\x16\x8b\x10W\xe2\xe7\x7f\x05F\xbf\xfc\x1d\xe9#\xdc'
URI:/gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=052371532cf43200f470&t=8&v=1.0&sign=415dc432065631b3ffd9e34008406fa6
Answer tuya.device.dynamic.config.get
READ GW ID 052371532cf43200f470
[I 190922 20:40:17 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=052371532cf43200f470&t=8&v=1.0&sign=415dc432065631b3ffd9e34008406fa6 (127.0.0.1) 4.52ms
URI:/gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=052371532cf43200f470&t=0&v=1.0&sign=4e2d155e0e05178e1037019a8a9a4b2f
Answer tuya.device.dynamic.config.ack
READ GW ID 052371532cf43200f470
TRIGGER UPGRADE IN 10 SECONDS
Trigger upgrade in 10 seconds
[I 190922 20:40:17 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=052371532cf43200f470&t=0&v=1.0&sign=4e2d155e0e05178e1037019a8a9a4b2f (127.0.0.1) 68.51ms
b'2.2\xb5w\x06c18121994\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91mi+M\x81\xb1\xf9k\x02x\x91X{\xcd\xafX\x9f\xe7\x06f{\xfa\xcd\x94\x9a\x88\xa8|\xdd\xa7"+\x88\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5ELS=v\xaax\x0f\xd6\xaan\xa6\xdd$2#\xb2\xb6\xa9\xa5\xd5\xd8X\xea[*@\xa8\xffU\xb3\xcag@'
URI:/gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=052371532cf43200f470&t=8&v=1.0&sign=415dc432065631b3ffd9e34008406fa6
Answer tuya.device.dynamic.config.get
READ GW ID 052371532cf43200f470
[I 190922 20:40:24 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=052371532cf43200f470&t=8&v=1.0&sign=415dc432065631b3ffd9e34008406fa6 (127.0.0.1) 3.88ms
URI:/gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=052371532cf43200f470&t=0&v=1.0&sign=4e2d155e0e05178e1037019a8a9a4b2f
Answer tuya.device.dynamic.config.ack
READ GW ID 052371532cf43200f470
TRIGGER UPGRADE IN 10 SECONDS
Trigger upgrade in 10 seconds
[I 190922 20:40:25 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=052371532cf43200f470&t=0&v=1.0&sign=4e2d155e0e05178e1037019a8a9a4b2f (127.0.0.1) 67.16ms
b'2.2\xf0\x88\x86E18122776\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91mi+M\x81\xb1\xf9k\x02x\x91X{\xcd\xafX\x9f\xe7\x06f{\xfa\xcd\x94\x9a\x88\xa8|\xdd\xa7"+\x88\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5ELS=v\xaax\x0f\xd6\xaan\xa6\xdd$2#\xb2\xb6\x10,A\x01v\xf8:\xd7\xcb\xbe\xac\xad7D\xed\x88'
URI:/gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=052371532cf43200f470&t=8&v=1.0&sign=415dc432065631b3ffd9e34008406fa6
Answer tuya.device.dynamic.config.get
READ GW ID 052371532cf43200f470
[I 190922 20:40:32 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=052371532cf43200f470&t=8&v=1.0&sign=415dc432065631b3ffd9e34008406fa6 (127.0.0.1) 4.02ms
URI:/gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=052371532cf43200f470&t=0&v=1.0&sign=4e2d155e0e05178e1037019a8a9a4b2f
Answer tuya.device.dynamic.config.ack
READ GW ID 052371532cf43200f470
TRIGGER UPGRADE IN 10 SECONDS
[I 190922 20:40:33 web:2246] 200 POST /gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=052371532cf43200f470&t=0&v=1.0&sign=4e2d155e0e05178e1037019a8a9a4b2f (127.0.0.1) 74.42ms
Trigger upgrade in 10 seconds
b'2.2\x85\x94.\x1718123550\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91mi+M\x81\xb1\xf9k\x02x\x91X{\xcd\xafX\x9f\xe7\x06f{\xfa\xcd\x94\x9a\x88\xa8|\xdd\xa7"+\x88\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5ELS=v\xaax\x0f\xd6\xaan\xa6\xdd$2#\
@tybritten We are aware of this issue and working on it, thanks for your patience
I couldn't flash the Gosund WP5 plug. It was bought in July from Amazon. Never connected the plug to the Gosund app. There are no indications in any of the logs, of any communication. Was able to connect to the Vtrust hotspot with an android phone.
@Janghou Thanks! I think we can add the E14 RGBWW to the 'fail' list as well. Do you by and change have a firmware dump of the working bulbs? I'm currently testing my setup and would like to experiment with a NodeMCU and a known-working tuya-firmware.
Successfully flashed ten NEO Coolcam 16A. Thank you!
Yes, -29312 corresponds to
MBEDTLS_ERR_SSL_CONN_EOF. I believe -1 indicates no response whatsoever. Maybepsk-frontendhalted?
Yeah there seemed to be something wrong with my install, I started fresh (Ubuntu Server 18.04) and those MBEDTLS_ERR_SSL_CONN_EOF error's where gone. Great!
Looks like this may need to be updated to handle the following API call - s.gw.dev.timer.count. Appears the latest version from the original repository has this, but this version does not.
@tx992 see the new-sdk branch at https://github.com/kueblc/tuya-convert.git, I'm in the process of cleaning up the fork for merge.
@tx992 see the
new-sdkbranch at https://github.com/kueblc/tuya-convert.git, I'm in the process of cleaning up the fork for merge.
Thanks!!
I'm getting the keyboard interrupt error. Is there a fix for this? Anything you need from me to post to help?
I have pulled from @M4dmartig4n and @kueblc, same error.
Listening on port 80
^CTraceback (most recent call last):
File "./fake-registration-server.py", line 160, in <module>
main()
File "./fake-registration-server.py", line 156, in main
tornado.ioloop.IOLoop.current().start()
File "/usr/local/lib/python3.7/dist-packages/tornado/platform/asyncio.py", line 148, in start
self.asyncio_loop.run_forever()
File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
self._run_once()
File "/usr/lib/python3.7/asyncio/base_events.py", line 1739, in _run_once
event_list = self._selector.select(timeout)
File "/usr/lib/python3.7/selectors.py", line 468, in select
fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt
Listening on port 80
@Kanga-Who that's benign. It is simply the message you get when you run stop_flash.
@kueblc What logs can I provide you then? Brilliant plugs (AUS) won't flash. Pairing starts, light goes solid, then nothing.
Check the wifi log to see if the device MAC address appeared. If it did, check the psk log to see if the device made an HTTPS request.
@kueblc here you go.
Backing up /etc/dnsmasq.conf...
Writing dnsmasq config file...
Creating new /etc/dnsmasq.conf...
Writing hostapd config file...
Configuring AP interface...
Applying iptables rules...
Starting DNSMASQ server...
RTNETLINK answers: File exists
Starting AP on wlan0 in screen terminal...
Configuration file: /etc/hostapd/hostapd.conf
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:70:b9:95 and ssid "vtrust-flash"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
wlan0: STA 84:0d:8e:63:ef:49 IEEE 802.11: associated
wlan0: AP-STA-CONNECTED 84:0d:8e:63:ef:49
wlan0: STA 84:0d:8e:63:ef:49 RADIUS: starting accounting session F9CAEAEF6D13E2A7
wlan0: STA 84:0d:8e:63:ef:49 WPA: pairwise key handshake completed (RSN)
Traceback (most recent call last):
File "./psk-frontend.py", line 6, in <module>
import sslpsk
ModuleNotFoundError: No module named 'sslpsk'
Seems like you did not run install_prereq. Also looks like only one device connected to your machine. Is that the device you are trying to flash?
Seems like you did not run install_prereq
Sure did, also using a fresh Raspbian Buster install specifically to do this with. Will delete all pulled files and start over (again).
I've tried 2 of the same plug, no success. I've flashed 10 of the previously on older firmware with no issues.
Worked on a Kuled KS-602S.
@Kanga-Who - run this:
sudo pip3 install paho-mqtt pyaes tornado git+https://github.com/M4dmartig4n/sslpsk.git pycrypto
@AlphaSierraHotel Thank you, this fixed it.
Can confirm the (AU) based Brilliant Plugs with SM1219 on the back can now be flashed.
Weird...just tried a build on a Rpi3 with buster and stretch, wanted to a ground up. I watched it install the new reqs with the libssl-dev and the sslpsk. I still see the message of no sslpsk found in the psk log file.
Just to update thinks... I have the branch https://github.com/M4dmartig4n/tuya-convert in one folder and the new-sdk branch at https://github.com/kueblc/tuya-convert.git in one folder on the same pi. The 1st one works fine, no errors about psk. But then the new-sdk branch throws that error about sslpsk when obviously it is on the Pi since the other folder works fine.
Traceback (most recent call last):
File "./psk-frontend.py", line 6, in
import sslpsk
ImportError: No module named sslpsk
Thanks @digiblur, that narrowed it down. Try changing python in line 1 to python3.
@kueblc totally missed that in my quick comparison of things trying to figure out the differences. Nice catch!
This made my day!!!
Finally was able to flash my second Bilikay with Tasmota without tearing the thing apart and solder wires to it.
Great job guys.
NB. I used M4d code and had to extra install libssl-dev
No luck for me with https://github.com/kueblc/tuya-convert.git. There are no logs in smarthack-web.log neither in smarthack-mqtt.log.
@M4dmartig4n I'm very interested in the concrete changes that needed to be made to make this work. I can maybe find it again using bits and pieces that i find here and in the code, but are you willing to sum it up on a few points?
@whitebird The main bit is a proxy that implements TLSv2 PSK-AES128-CBC-SHA256 found in psk-frontend.py.
It translates the HTTPS and MQTT over TLS into regular HTTP and MQTT and vice versa. The PSK (pre shared key) is generated dynamically based on the device's PSK identity, which is sent by the device as part of the handshake.
The MQTT message that triggers the update is also slightly different, only the formatting/encoding changed, the encryption is the same.
The rest of the process is more or less the same.
@jess-sys Is there anything in the psk log? Might be https://github.com/ct-Open-Source/tuya-convert/issues/273#issuecomment-533952034. This is implemented in the latest commit, update and try again.
This made my day!!!
Finally was able to flash my second Bilikay with Tasmota without tearing the thing apart and solder wires to it.
Great job guys.
NB. I used M4d code and had to extra install libssl-dev
So nice to see the 'BIG GUY' himself in here! keep up the great work -Thnx!
[-=SrZ=-]
@kueblc I manually installed sslpsk when I saw the error the first time. And there's nothing in the psk log.
PS: I manually flashed my led strips to tasmota firmware using a FTDI adapter, so I won't be able to provide logs anymore.
PPS: I'm going to buy some tuya door-opening sensors, I'll try your fork on them.
Thank you @M4dmartig4n it works also for https://blakadder.github.io/templates/smartdgm_PP-W162.html
I can confirm that flashing the Action LSC filament E27 bulbs I bought a week ago, works! You just need to use the default firmware. I failed several times because of using a thirdparty.bin that was mentioned in the video of DigiBlur https://www.youtube.com/watch?v=6_IZEa9JcC8. When using default firmware as supplied in https://github.com/M4dmartig4n/tuya-convert it works fine.
-edited-
My bad, the downloaded firmware got corrupted. Will try again with the firmware supplied by DigiBlur as soon as I have a fresh bulb.
@kueblc
Here is the firmware that was running on my 2 gang wall power socket (GPO) in this post
. Not sure many people have these devices so the firmware may be of interest.
switch-tuya-original-a3ed77.bin.zip
My device appears bricked at the moment but I have another one if you'd like any further testing done.
@opperprutser
I can confirm that flashing the Action LSC filament E27 bulbs I bought a week ago, works! You just need to use the default firmware. I failed several times because of using a thirdparty.bin that was mentioned in the video of DigiBlur https://www.youtube.com/watch?v=6_IZEa9JcC8. When using default firmware as supplied in https://github.com/M4dmartig4n/tuya-convert it works fine.
I would be interested to understand what the issue was with the 3rd party bin file provided by Digiblur. I have flashed this binary file multiple times, via serial and via Tuya Convert OTA flash.
Once you reach the ability to choose a file, the Tuya Convert process has basically been completed. Perhaps a bad download?
I flashed the E14 and E27 (all sizes) LSC smart connect filament style bulbs successfully with tuya-convert-psk. But one thing that's bothering me, all filament style bulbs produce a high pitched noise (coil whine?) when connected to the mains (both on/off/100%/10% by software). The bigger the bulb the more noticeable the sound output.
For example this bulb https://www.action.com/nl-nl/p/lsc-smart-connect-slimme-filament-ledlamp-/ produces a high pitched sound that I can clearly hear from 1m away.
I know almost all switching-mode power supplies produce sound, some more than others (based on human hearing and frequency). But I just wanted to share my findings. 100% of my 11 bulbs produce these sounds with the E14 the least noticeable since it's the smallest form factor.
I have a teckin plug(SP21), that was unplug since the day i bought and even with it being connected to the network, i can't update it.
I see the wifi log, everything seams ok, but doesn't pass the part where it's waiting for the device to connect :(
PS: Is there a way to get one full log instead of all separated?
`pi@raspberrypi:~/tuya-convert $ sudo pip3 install paho-mqtt pyaes tornado git+https://github.com/M4dmartig4n/sslpsk.git pycrypto
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting git+https://github.com/M4dmartig4n/sslpsk.git
Cloning https://github.com/M4dmartig4n/sslpsk.git to /tmp/pip-req-build-i21wsmik
Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.7/dist-packages (1.4.0)
Requirement already satisfied: pyaes in /usr/local/lib/python3.7/dist-packages (1.6.1)
Requirement already satisfied: tornado in /usr/local/lib/python3.7/dist-packages (6.0.3)
Requirement already satisfied: pycrypto in /usr/lib/python3/dist-packages (2.6.1)
Building wheels for collected packages: sslpsk
Running setup.py bdist_wheel for sslpsk ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-i21wsmik/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-y7aa2zur --python-tag cp37:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.7
creating build/lib.linux-armv7l-3.7/sslpsk
copying sslpsk/__init__.py -> build/lib.linux-armv7l-3.7/sslpsk
copying sslpsk/sslpsk.py -> build/lib.linux-armv7l-3.7/sslpsk
creating build/lib.linux-armv7l-3.7/sslpsk/test
copying sslpsk/test/__init__.py -> build/lib.linux-armv7l-3.7/sslpsk/test
copying sslpsk/test/test_sslpsk.py -> build/lib.linux-armv7l-3.7/sslpsk/test
copying sslpsk/test/example_server.py -> build/lib.linux-armv7l-3.7/sslpsk/test
copying sslpsk/test/example_client.py -> build/lib.linux-armv7l-3.7/sslpsk/test
copying sslpsk/test/__main__.py -> build/lib.linux-armv7l-3.7/sslpsk/test
running build_ext
building 'sslpsk._sslpsk' extension
creating build/temp.linux-armv7l-3.7
creating build/temp.linux-armv7l-3.7/sslpsk
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c sslpsk/_sslpsk.c -o build/temp.linux-armv7l-3.7/sslpsk/_sslpsk.o
sslpsk/_sslpsk.c:19:10: fatal error: openssl/ssl.h: No such file or directory
#include
^~~~~~~
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
Failed building wheel for sslpsk
Running setup.py clean for sslpsk
Failed to build sslpsk
Installing collected packages: sslpsk
Running setup.py install for sslpsk ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-i21wsmik/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-6w9q3e8w/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.7
creating build/lib.linux-armv7l-3.7/sslpsk
copying sslpsk/__init__.py -> build/lib.linux-armv7l-3.7/sslpsk
copying sslpsk/sslpsk.py -> build/lib.linux-armv7l-3.7/sslpsk
creating build/lib.linux-armv7l-3.7/sslpsk/test
copying sslpsk/test/__init__.py -> build/lib.linux-armv7l-3.7/sslpsk/test
copying sslpsk/test/test_sslpsk.py -> build/lib.linux-armv7l-3.7/sslpsk/test
copying sslpsk/test/example_server.py -> build/lib.linux-armv7l-3.7/sslpsk/test
copying sslpsk/test/example_client.py -> build/lib.linux-armv7l-3.7/sslpsk/test
copying sslpsk/test/__main__.py -> build/lib.linux-armv7l-3.7/sslpsk/test
running build_ext
building 'sslpsk._sslpsk' extension
creating build/temp.linux-armv7l-3.7
creating build/temp.linux-armv7l-3.7/sslpsk
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c sslpsk/_sslpsk.c -o build/temp.linux-armv7l-3.7/sslpsk/_sslpsk.o
sslpsk/_sslpsk.c:19:10: fatal error: openssl/ssl.h: No such file or directory
#include
^~~~~~~
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-i21wsmik/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-6w9q3e8w/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-req-build-i21wsmik/`
Still getting the sslpsk error on my end, going to try fresh installing buster and seeing if it makes a difference... pi 3B+
@TimelessNL you might want to use command PwmFrequency to change PWM frequency to a lower or higher value reducing noise.
@arendst Thanks! Yeah that's what I immediately tried after flashing Tasmota. Because that gave me success on other SMPS devices. But unfortunately this time it didn't :(. Even when the bulb switched 'OFF' by software the whining is there. I can even hear it reacting to HTTP requests, as soon as I open the tasmota homepage I can hear fluctuations in the whining noise. When I turn the filaments 'ON' the sound does not change.
This being a filament style bulb I suspect that the leds are directly wired in series driven from the mains. And a small transformer is supplying the ESPs VCC and that is what is generating the whining noise. But that's just a initial guess :/
And my guess why the bigger bulbs create a more noticeable sound is that the glass dome actually amplifies the sound coming from the transformer or capacitors.
@CountParadox
I don't see the installation of libssl-dev? Did you manually install it prior to running the install_prereq?
Not sure what I'm doing wrong, but have 2 different devices failing in the same way. Fresh install of buster on a Pi3B+ and the latest commits of new-api fork kueblc/tuya-convert. I have run install_prereq with no errors.
It seems like the wifi portion is working as expected cos I can see the device connecting...
Backing up /etc/dnsmasq.conf...
Writing dnsmasq config file...
Creating new /etc/dnsmasq.conf...
Writing hostapd config file...
Configuring AP interface...
Applying iptables rules...
iptables/1.8.2 Failed to initialize nft: Protocol not supported
iptables/1.8.2 Failed to initialize nft: Protocol not supported
iptables/1.8.2 Failed to initialize nft: Protocol not supported
iptables/1.8.2 Failed to initialize nft: Protocol not supported
iptables/1.8.2 Failed to initialize nft: Protocol not supported
iptables/1.8.2 Failed to initialize nft: Protocol not supported
Starting DNSMASQ server...
RTNETLINK answers: File exists
Starting AP on wlan0 in screen terminal...
Configuration file: /etc/hostapd/hostapd.conf
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:21:2e:d6 and ssid "vtrust-flash"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
wlan0: STA 88:19:08:1a:fd:b3 IEEE 802.11: disassociated
wlan0: STA 88:19:08:1a:fd:b3 IEEE 802.11: associated
wlan0: AP-STA-CONNECTED 88:19:08:1a:fd:b3
wlan0: STA 88:19:08:1a:fd:b3 RADIUS: starting accounting session 2B53563AC54BA431
wlan0: STA 88:19:08:1a:fd:b3 WPA: pairwise key handshake completed (RSN)
wlan0: STA 68:57:2d:1d:b6:62 IEEE 802.11: associated
wlan0: AP-STA-CONNECTED 68:57:2d:1d:b6:62
wlan0: STA 68:57:2d:1d:b6:62 RADIUS: starting accounting session 31E9A828ED83A2DC
wlan0: STA 68:57:2d:1d:b6:62 WPA: pairwise key handshake completed (RSN)
And the psk also seems to be doing something...
pi@raspberrypi:~ $ tail -f ~/tuya-convert/scripts/smarthack-psk.log
new client on port 443 from ('10.42.42.15', 49153)
new client on port 443 from ('10.42.42.15', 49154)
new client on port 443 from ('10.42.42.15', 49155)
new client on port 443 from ('10.42.42.15', 49156)
new client on port 443 from ('10.42.42.15', 49157)
new client on port 443 from ('10.42.42.15', 49158)
new client on port 443 from ('10.42.42.15', 49159)
new client on port 443 from ('10.42.42.15', 49160)
new client on port 443 from ('10.42.42.15', 49161)
new client on port 443 from ('10.42.42.15', 49162)
But then I see no further activity on any of the logs.
Am I missing some key step?
libssl-dev
I didnt, but after reflashing a new raspbian buster image with all extras, updating and upgrading, running the prereq script and starting over, no more errors, but its hanging on /Waiting for the device to appear/ :(
Cant seem to get it past here... the light blinks on the device, and when I press ENTER to continue, it stops blinking, but never comes back..
libssl-dev
I didnt, but after reflashing a new raspbian buster image with all extras, updating and upgrading, running the prereq script and starting over, no more errors, but its hanging on /Waiting for the device to appear/ :(
Cant seem to get it past here... the light blinks on the device, and when I press ENTER to continue, it stops blinking, but never comes back..
In exactly the same boat.. not sure what's going on to be honest.. i have 2 Teckin SP23 (new model) plugs. i also have a Teckin RGB Bulb that also does not flash.
@CountParadox and @danmed - are your logs showing something similar to mine? (https://github.com/ct-Open-Source/tuya-convert/issues/273#issuecomment-534496015)
Because lights blinking and then stopping and then nothing else happening is also exactly the same thing I'm getting
I got the same thing @danps1 ...
Lights blinking and when i start flashing, then light stopping and then nothing else happening is also exactly the same thing I'm getting
I would be interested to understand what the issue was with the 3rd party bin file provided by Digiblur. I have flashed this binary file multiple times, via serial and via Tuya Convert OTA flash.
Once you reach the ability to choose a file, the Tuya Convert process has basically been completed. Perhaps a bad download?
You are right! It never crossed my mind to check the file :-(
I just did and it turned out to be corrupted!
When I have another bulb I will check again. Thanks!
@arendst Thanks! Yeah that's what I immediately tried after flashing Tasmota. Because that gave me success on other SMPS devices. But unfortunately this time it didn't :(. Even when the bulb switched 'OFF' by software the whining is there. I can even hear it reacting to HTTP requests, as soon as I open the tasmota homepage I can hear fluctuations in the whining noise. When I turn the filaments 'ON' the sound does not change.
This being a filament style bulb I suspect that the leds are directly wired in series driven from the mains. And a small transformer is supplying the ESPs VCC and that is what is generating the whining noise. But that's just a initial guess :/
And my guess why the bigger bulbs create a more noticeable sound is that the glass dome actually amplifies the sound coming from the transformer or capacitors.
When I dimmed the brightness a bit, the noise went down.
@CountParadox and @danmed - are your logs showing something similar to mine? (#273 (comment))
Because lights blinking and then stopping and then nothing else happening is also exactly the same thing I'm getting
I'll have to try it again, i thought i checked all the logs but don't recall the psk one so will look. my wifi one definitely looks the same though.
@opperprutser definitely try again and let me know. The thirdparty.bin I created for people to copy over to their Tuya Convert installations was born due to all the people creating dead devices due to bad WiFi passwords. The sonoff-basic.bin included with TC does not have WiFi Manager enabled. You get exactly one chance to put that WiFi password in correctly. With WiFi Manager enabled in the bin I compiled you can put it in wrong as many times as you want and it will keep throwing that access point out.
After you get Tasmota on your WiFi definitely use the Firmware Upgrade button and upgrade to the full sonoff.bin file or whatever version you want as I did have to slim things down with sensors and such to get the size down much like sonoff-basic.bin is.
No luck so far with my generic 16A RGB Smart Plug. It's not clean out of the box, it was paired with the Smart Life app in August.
Results with M4d's version: there's stuff happening in the psk and web logs. The plug seemingly tries to get the firmware, doesn't like it and resets, each 10 seconds.
Results with the new-api branch from kueblc: The plug connects to the WiFi (Stops flashing red, glows steady dim red), then nothing happens, no activity in the web log.
I have the same problem @AXKuhta
@CountParadox and @danmed - are your logs showing something similar to mine? (#273 (comment))
Because lights blinking and then stopping and then nothing else happening is also exactly the same thing I'm getting
Same issue here with this bulb https://www.action.com/nl-be/p/lsc-smart-connect-slimme-filament-ledlamp-/
I've added my logs here https://gist.github.com/whitebird/1ed5f8ef6cb82c847a2c9eed3af39474
@TimelessNL Can you explane how you flash the action bowl?
I try a few things but i'm stuck at (also try EU as you see):
URI:/d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"EU"}&t=231&uuid=f77535b9953db740&v=4.1&sign=7c9467196f2495354026be9fb2aa66f0
WARN: unknown request: tuya.device.config.get (/d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"EU"}&t=231&uuid=f77535b9953db740&v=4.1&sign=7c9467196f2495354026be9fb2aa66f0)
^[[32m[I 190924 17:21:39 web:2246]^[[m^O 200 POST /d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"EU"}&t=231&uuid=f77535b9953db740&v=4.1&sign=7c9467196f2495354026be9fb2aa66f0 (127.$
Thanks @pr0ssi! Appreciate the firmware, I'll check it out later today.
@TimelessNL I too have some devices with half assed power supplies, I ended up using these whinny devices in loud environments.
@danps1 @CountParadox @danmed @AXKuhta @JPM-git would any of you be able to record your network traffic on interface ap0 while running tuya-convert?
@maffemuis what branch and fork are you running? It does not look like either of the branches with new API support.
@digiblur would you like to make a PR with your Tasmota build?
How do I monitor the traffic on ap0?
Blitzwolf BW-SHP8 which previously upgraded whit the factory firmware is successfully flashed with your tool. THX!
@danmed You can use WireShark or tcpdump ie tcpdump -i ap0 -w capture.pcap
@kueblc
I tried your branch with my LSC RGB bulbs
The psk log is showing the following:
new client on port 443 from ('10.42.42.19', 49153)
new client on port 443 from ('10.42.42.19', 49154)
new client on port 443 from ('10.42.42.19', 49155)
new client on port 443 from ('10.42.42.19', 49156)
new client on port 443 from ('10.42.42.19', 49157)
new client on port 443 from ('10.42.42.19', 49158)
new client on port 443 from ('10.42.42.19', 49159)
new client on port 443 from ('10.42.42.19', 49160)
new client on port 443 from ('10.42.42.19', 49161)
new client on port 443 from ('10.42.42.19', 49162)
Any suggestions?
@danmed You can use WireShark or
tcpdumpietcpdump -i ap0 -w capture.pcap
I have the same problem: Teckin SP21, I start flashing and the light stops blinking and stays on. Nothing else happens. I have attached pcap file from wlan0 (ap0 does not exist?) and the logfiles.
smarthack-mqtt.log
smarthack-psk.log
smarthack-smartconfig.log
smarthack-web.log
Sorry, had to compress pcap before upload
Thanks for your great work!
However, I'm having the same problem everyone else is having. Just like nicolas-1701 I get the following error in the smarthack-psk.log. Maybe this could point to the issue?
^CTraceback (most recent call last):
File "./psk-frontend.py", line 117, in
main()
File "./psk-frontend.py", line 110, in main
r,_,_ = select.select(readables, [], [])
KeyboardInterrupt
would you like to make a PR with your Tasmota build?
Sure @kueblc ! Just take over the thirdparty link that is in there now?
I`m running RP3 b+ and Raspbian and getting this error. Tried installing SSLPSK but no luck still the same error
Trying to flash LOHAS RGB E26 LED bulbs
Traceback (most recent call last):
File "./psk-frontend.py", line 6, in <module>
import sslpsk
ModuleNotFoundError: No module named 'sslpsk'
" sudo apt install libssl-dev " should take care of that for you.? @Vendo232
I was able to flash MOES 3 way now while it was not working with Tuya 1.0 but LOHAS LEDs won`t go.
They would stop blinking but no flashing
Hi, I also had the same issue that many folks seem to have.
My hardware: RPi 3B+ and Moes QS-WiFi-D01 Dimmer (up-to-date via Tuya App)
First I tried it with Raspbian Buster, and again via Noobs,
no success only dots.........
Then I grabbed 2018-11-13-raspbian-stretch-lite.img,
http://ftp.jaist.ac.jp/pub/raspberrypi/raspbian_lite/images/raspbian_lite-2018-11-15/
did all updates and took
git clone https://github.com/M4dmartig4n/tuya-convert
with addition in install_prereq.sh for libssl-dev
sudo apt-get install -y dnsmasq hostapd screen curl python3-pip python3-setuptools python3-wheel mosquitto haveged net-tools libssl-dev
and then the dimmer changed from Tuya to Tasmota within seconds 😄
BIG THX @kueblc and @M4dmartig4n 👍
Hi @kueblc
Attached is a zip with *.log and a pcap of the wlan0 interface that I filtered to just the mac of the tuya for size.
Thanks for your awesome work!
tuya-covert2-capture.zip
@ThaStealth create a network capture, that will tell us more
@nicolas-1701 the first thing I notice going wrong in your capture is that there are no responses to the DNS queries. Is dnsmasq installed and running correctly on your system?
@digiblur sure that works!
@danps1 this is great data, thank you. Looks like the TLS handshake is failing with Unknown PSK Identity. This is a good lead to identifying the issue. I'll follow up when I know more.
@danps1 try using python2 instead of python3 for psk-frontend.py, change on the first line.
You might have to install sslpsk again for python2 ie
sudo -H pip2 install git+https://github.com/M4dmartig4n/sslpsk.git
Hey all super excited about this and hoping to get some feit rgb bulbs I picked up cheap at costco flashed. Bulbs connect to vtrust and things seem to be happening but the dots just keep scrolling across the screen. Including the logs below in the hopes that someone way smarter then I can help. Sorry if there is too much info i can edit it down if needed, Thanks!
Wifi Log
Backing up /etc/dnsmasq.conf... Writing dnsmasq config file...
Creating new /etc/dnsmasq.conf...
Writing hostapd config file...
Configuring AP interface...
Applying iptables rules...
Starting DNSMASQ server...
Starting AP on wlan0 in screen terminal...
Configuration file: /etc/hostapd/hostapd.conf
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:6d:f6:63 and ssid "vtrust-flash"
wlan0: interface state UNINITIALIZED->ENABLED wlan0: AP-ENABLED
wlan0: STA 8c:45:00:a7:af:a4 IEEE 802.11: associated
wlan0: AP-STA-CONNECTED 8c:45:00:a7:af:a4
wlan0: STA 8c:45:00:a7:af:a4 RADIUS: starting accounting session 7A70B40BEABF3C30
wlan0: STA 8c:45:00:a7:af:a4 WPA: pairwise key handshake completed (RSN)
wlan0: STA dc:4f:22:bc:a3:a7 IEEE 802.11: associated
wlan0: AP-STA-CONNECTED dc:4f:22:bc:a3:a7
wlan0: STA dc:4f:22:bc:a3:a7 RADIUS: starting accounting session C255EE9D42C26F8F
wlan0: STA dc:4f:22:bc:a3:a7 WPA: pairwise key handshake completed (RSN)
wlan0: STA dc:4f:22:bc:a3:a7 IEEE 802.11: disassociated
wlan0: AP-STA-DISCONNECTED dc:4f:22:bc:a3:a7
wlan0: STA dc:4f:22:bc:a3:a7 IEEE 802.11: associated
wlan0: STA dc:4f:22:bc:a3:a7 IEEE 802.11: disassociated
wlan0: STA dc:4f:22:bc:a3:a7 IEEE 802.11: associated
PSK log
new client on port 443 from ('10.42.42.11', 9295)
PSK: b'6d5591a35b24b4bdec946047ae8ae8b02ccf2be28ea63dea39f20ea9bfcda6c9'
Web log
Listening on port 80 URI:/gw.json?a=s.gw.token.get&et=1&gwId=82038170dc4f22bca3a7&other={"token":"00000000","region":"US","t$ URI:/gw.json?a=s.gw.token.get&et=1&gwId=82038170dc4f22bca3a7&other={"token":"00000000","region":"US","t$Answer s.gw.token.get ^[[32m[I 190925 02:14:24 web:2246]^[[m^O 200 GET /gw.json?a=s.gw.token.get&et=1&gwId=82038170dc4f22bca3$ URI:/gw.json?a=s.gw.dev.fk.active&et=1&gwId=82038170dc4f22bca3a7&other={"token":"00000000"}&t=11&v=3.0&$Answer s.gw.dev.pk.active READ GW ID 82038170dc4f22bca3a7 ^[[32m[I 190925 02:14:25 web:2246]^[[m^O 200 POST /gw.json?a=s.gw.dev.fk.active&et=1&gwId=82038170dc4f2$ URI:/gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=82038170dc4f22bca3a7&t=13&v=1.0&sign=01a33ac40f$Answer tuya.device.dynamic.config.get READ GW ID 82038170dc4f22bca3a7 ^[[32m[I 190925 02:14:26 web:2246]^[[m^O 200 POST /gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=8$ URI:/gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=82038170dc4f22bca3a7&t=0&v=1.0&sign=aebe96b204f$Answer tuya.device.dynamic.config.ack READ GW ID 82038170dc4f22bca3a7 TRIGGER UPGRADE IN 10 SECONDS
^[[32m[I 190925 02:14:27 web:2246]^[[m^O 200 POST /gw.json?a=tuya.device.dynamic.config.ack&et=1&gwId=8$Trigger upgrade in 10 seconds
URI:/gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=82038170dc4f22bca3a7&t=10&v=1.0&sign=396fcef76c$Answer tuya.device.dynamic.config.get READ GW ID 82038170dc4f22bca3a7 ^[[32m[I 190925 02:14:37 web:2246]^[[m^O 200 POST /gw.json?a=tuya.device.dynamic.config.get&et=1&gwId=8$b'2.2\x96f\xa2G37407815\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91m\xc4D\xd0\xe1\xe1oj|[X\x8enO"8\$
I think this is a known issue and is being worked on. See here
@kueblc did a quick test on the new branch with python instead of python3 in psk-frontend.py, plus the suggested command (Although it seems sslpsk was already installed for python2 from the 'earlier' M4d's tuya-convert.)
The change does fix the problem with no activity -- there's stuff happening in the web log again, and the behavior is now similar to the 'earlier' version, but still no luck with flashing though. I'll try to do some packet captures tonight.
Hi @kueblc
tuya-covert-2-python2.zip
Tried using python2 in psy-frontend.py as suggested. Seems to get a bit further - this time I see entires in the web log as well as psy, however, still doesn't complete.
Logs and capture attached.
Cheers
Hi
I have a digoo nx sp202, and if I start tuya-convert, then he also switches but the points continue to run without something pasiert. why can this all be done after instruction unfortunately without success.
greeting markus
any news about Teckin SB50?
i've 4 of them to convert...
I think this is a known issue and is being worked on. See here
hmm... I wonder what the cause it.. I see people succeeding and wonder whats different
Hi @kueblc
tuya-covert-2-python2.zip
Tried using python2 in psy-frontend.py as suggested. Seems to get a bit further - this time I see entires in the web log as well as psy, however, still doesn't complete.
Logs and capture attached.
Cheers
Just been trying to decode a bit of what is (and isn't) going on here. From the packet capture (and logs) it looks like the SSL web requests are working with Python 2, but that there is no mqtt requests following that. Is that to be expected? Is mqtt over ssl part of the new process?
so, for the action bowl, if a changes some lines in the fake-registration-server.py
First I get:
URI:/d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=88&uuid=f77535b9953db740&v=4.1&sign=dfde34eb28bdd09be939efd965713542
WARN: unknown request: tuya.device.config.get (/d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=88&uuid=f77535b9953db740&v=4.1&sign=dfde34eb28bdd09be939efd965713542)
if I change some lines in only config.get en delete dynamic i get this:
Also changes all to d.json
URI:/d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=10&uuid=f77535b9953db740&v=4.1&sign=8ef275d1a9e7a24da8d1c5d4a4e4e4f8
Answer tuya.device.dynamic.config.get
READ GW ID son?a=tuya.device.co
^[[32m[I 190925 11:56:45 web:2246]^[[m^O 200 POST /d.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=10&uuid=f77535b9953db740&v=4.1&sign=8ef275d1a9e7a24da8d1c5d4a4e4e4f8 (127.0$
it is looking for: tuya.device.config.get but that is not existing in the file
I used the config writing as: @thxthx0
and the tuya.device.config.get
https://fchelp.cloud.alipay.com/helpDetail.htm?tntInstId=Dss_sP5T&helpId=89434550¤tPage=1
tuya.device.config.get | 4.0 | Getting Device Token from a Distribution Token Information | Yes
EDIT:
hmm: I also see that it is doing uuid and not gwId
I did some packet capturing. Tested the following tuya-converts:
Attached archive contains folders for the three of them, and within each folder there's:
Hope this helps
Which repo do i need to clone to get the one with the python2 change? I'm a little lost with all the chat going on in here :(
@danmed - I don't think it's a repo. I just edited the first line in the `psy-frontend.py file to python2. Not that it fully worked though!
Nope, I'm still getting the same error.. libpsk module.. I've got
libssl-Dev installed so no idea what the issue is
On Wed, 25 Sep 2019, 13:35 danps1, notifications@github.com wrote:
@danmed https://github.com/danmed - I don't think it's a repo. I just
edited the first line in the `psy-frontend.py file to python2. Not that it
fully worked though!—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ct-Open-Source/tuya-convert/issues/273?email_source=notifications&email_token=AA5S4WXIJOELG6JGCEC4773QLNLK7A5CNFSM4IYDCD6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7RXOFQ#issuecomment-535000854,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA5S4WWDUCAFAKEOLMRIOZ3QLNLK7ANCNFSM4IYDCD6A
.
For those getting stuck on tuya.device.config.get, try the latest new-sdk branch.
It seems that some devices crash if the schema is shorter than expected, so I've extended it and preliminary results look good.
Note that you'll want to start the process from the beginning (ie repeat smartconfig), since the problem is at activation time, not at the time the tuya.device.config.get request is made.
@TimelessNL Can you explane how you flash the action bowl?
I try a few things but i'm stuck at (also try EU as you see):
@maffemuis what do you mean with action bowl?
wiki: "A bowl is a round dish or container typically used to prepare and serve food"
I guess you meant bulb instead? Could you provide a link which kind you're trying to flash?
SUCCESS:
Filament E14
Filament E27 Normal
Filament E27 L
Filament E27 XL
Filament E27 XXL
FAILED:
RGBW E14
RGBW E27
RGBW GU10
@TimelessNL I too have some devices with half assed power supplies, I ended up using these whinny devices in loud environments.
@kueblc Unfortunately all my devices make whining noises :P, hopefully the frequency will change over time due to age. So they are less noticeable to the human hearing :).
@ all
I see multiple people having issues flashing their devices, even with devices other people had success with. Maybe sharing my way may helps others, take note this is still a "workaround" but I guess that's just fine. Lust like kueblc said:
this entire project is a "hack" 😛
Requirements:
Steps:
sudo dd if=/home/[user]/Download/ubuntu-18.04.3-live-server-amd64.iso of=/dev/sd[x]sudo apt-get install -y dnsmasq hostapd screen curl python3-pip python3-setuptools python3-wheel mosquitto haveged net-tools libssl-dev unzipsudo pip3 install paho-mqtt pyaes tornado git+https://github.com/M4dmartig4n/sslpsk.gitwget https://github.com/M4dmartig4n/tuya-convert/archive/master.zipunzip master.zipsudo systemctl disable mosquittocd tuya-convert-masterconfig.txt to fit your needs, use sudo ifconfig -a to get the interface names.start_flash.sh inside a screen (just run command: screen and press enter, this will open a screen)Press ENTER to continuesudo service restart dnsmasqscreen -lsscreen -r #nr ex screen -r 149239 or if only one screen screen -r@kueblc Unfortunately all my devices make whining noises :P, hopefully the frequency will change over time due to age. So they are less noticeable to the human hearing :).
Just flashed a Filament E27 XL using the "standard" procedure with m4d code. I hear no whining noises whatever dimmer/cold/warm I set. It must be MY age ;-)
NB. I failed the RGBW E27 too.
I hear no whining noises whatever dimmer/cold/warm I set. It must be MY age ;-)
Haha, maybe when I get older the problem may also magically go away :)
btw something else: me wearing my little "tinfoil hat", all tuya traces are wiped after flashing any thirdparty firmware on these devices right?
From what I know tuya-convert flashes itself to user2 and thirdparty(_tasmota_) to user1, so these are wiped for sure. But what about the actual bootloader? Not that is may be a big thread but just want to make sure :)
@kueblc With the last commit it successfully flashed my generic 16A RGB plug! Great stuff!
@TimelessNL after one tasmota OTA your flash is practically cleaned from tuya remnants. To be sure execute command reset 3 to erase flash above settings area too.
@arends oh so OTA does also flash the bootloader section? No matter when it runs in user1 or user2? Great!
Btw since you also have the RGB bulb I suspect this info may also have your interest.
So I want to add my little 'Action' findings since I bought the E14
RGBWW bulb.
To summarize: it seems to be based around the ESP8285 chip on quite an
unusual PCB.Basic hardware:
SoC: ESP8285
LED driver: SM2135E(5 Channel) controller by I2C
LEDs: 7 White & 7 Warm-White & 4 RGB
Tasmota does not have support for the SM2135E ic I think, Someone found a interesting datasheet but no proof of concept code yet.
EDIT: Attached translated datasheet: SM2135E_zh-CN_en-US_translated.pdf
@kueblc using your fork with the new-api branch and switching psk to python2 it successfully worked with the feit electric costco bulbs. Great Job!
@kueblc Thank you for your work! I just succesfully flashed a custom esphome firmware to my Action LSC LEDstrip using your new-api branch and its working flawlessly!
I've just tried the new-api branch from kueblc on a NiteBird RGBW bulb but no go. Seems to be a ssl issue.
could not establish sslpsk socket: <class 'ssl.SSLError'> returned a result with an error set
new client on port 443 from ('10.42.42.40', 49317)
could not establish sslpsk socket: <class 'ssl.SSLError'> returned a result with an error set
new client on port 443 from ('10.42.42.40', 10625)
could not establish sslpsk socket: <class 'ssl.SSLError'> returned a result with an error set
new client on port 443 from ('10.42.42.40', 17007)
could not establish sslpsk socket: <class 'ssl.SSLError'> returned a result with an error set
new client on port 443 from ('10.42.42.40', 12319)
@TimelessNL @arendst
Someone found a interesting but no proof of concept code yet.
Thanks for translating the pointed file :-)
On my way to the proof, I blew my bulb while connecting GND to the scope; it is not potential neutral... So watch out!
The E14 RGBWW bulb got TYLC5 on the GPIO_12 as SDA and GIO_14 as CLK
@ggaljoen, Ah that's unfortunate. Luckily these bulbs aren't that expensive :)
Did you by any chance, measure the voltage that is going to the LEDs? That way we can eliminate the need of the 230VAC PSU.
I've been reading the datasheet and the protocol does not seem that difficult. Only 8 bytes controlling the LEDs.
@TimelessNL @arendst Have you tried the latest new-sdk branch with your RGBW bulb?
btw something else: me wearing my little "tinfoil hat", all tuya traces are wiped after flashing any thirdparty firmware on these devices right?
From what I know tuya-convert flashes itself to user2 and thirdparty(_tasmota_) to user1, so these are wiped for sure. But what about the actual bootloader? Not that is may be a big thread but just want to make sure :)
@TimelessNL Yes, the bootloader is overwritten on /flash3 :)
@AXKuhta @tybritten Great! Thanks for reporting back
@MrPaulAR try this
@kueblc not working for the rgb bulb, but the device.config errors are gone and no more d.json request.
I've just tried the new-api branch from kueblc on a NiteBird RGBW bulb but no go. Seems to be a ssl issue.
could not establish sslpsk socket: <class 'ssl.SSLError'> returned a result with an error set new client on port 443 from ('10.42.42.40', 49317) could not establish sslpsk socket: <class 'ssl.SSLError'> returned a result with an error set new client on port 443 from ('10.42.42.40', 10625) could not establish sslpsk socket: <class 'ssl.SSLError'> returned a result with an error set new client on port 443 from ('10.42.42.40', 17007) could not establish sslpsk socket: <class 'ssl.SSLError'> returned a result with an error set new client on port 443 from ('10.42.42.40', 12319)
@MrPaulAR you need to:
sudo -H pip install git+https://github.com/M4dmartig4n/sslpsk.gitpython3 to python in the first line @maffemuis could you please share your logs?
@danps1 try using
python2instead ofpython3forpsk-frontend.py, change on the first line.You might have to install
sslpskagain forpython2ie
sudo -H pip2 install git+https://github.com/M4dmartig4n/sslpsk.git
I am trying to follow along to this as @tybritten mentioned that he got the feit electric costo bulbs working with that method, but when I change to python2 in psk-frontend.py i get the following error in the psk.log
Traceback (most recent call last):
File "./psk-frontend.py", line 8, in <module>
from Crypto.Cipher import AES
ImportError: No module named Crypto.Cipher
I checked the pip2 modules that are installed and I only have sslpsk==1.0.0, but I am not sure how to get the needed libraries listed in psk-frontend.py into into python2.
from Crypto.Cipher import AES
from hashlib import md5
from binascii import hexlify, unhexlify
@Resterday do sudo -H pip install pycrypto
@kueblc Thank, it looks like the error with psk.log is now resolved, but now I am getting "could not decrypt payload" message in the web.log
GET /gw.json?a=s.gw.token.get&et=1&gwId=82038170dc4f22bca3a7&other={"token":"00000000","region":"US","tlinkStat":{"conf$Host: a3.tuyaus.com Connection: keep-alive User-Agent: ESP8266SDK Answer s.gw.token.get reply {"e":false,"result":{"mqttsPSKUrl":"10.42.42.1","timeZone":"-05:00","mediaMqttsUrl":"10.42.42.1","gwApiUrl":"http$^[[32m[I 190925 21:31:42 web:2246]^[[m^O 200 GET /gw.json?a=s.gw.token.get&et=1&gwId=82038170dc4f22bca3a7&other={"token$ POST /gw.json?a=s.gw.dev.fk.active&et=1&gwId=82038170dc4f22bca3a7&other={"token":"00000000"}&t=9&v=3.0&sign=a4a8645598b$Host: 10.42.42.1 Connection: keep-alive Content-Length: 485 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 User-Agent: ESP8266SDK could not decrypt payload 948DF1E3BEA1B8A16DBAEAEC1C877944EAF0C7DC0172FB9E22FAC935B0244E58E75D230A7902C86D1EF6D798C9250$Answer s.gw.dev.pk.active reply {"e":false,"result":{"schema":"[{\"mode\":\"rw\",\"type\":\"obj\",\"id\":1,\"property\":{\"type\":\"bool\"}},{\"m$TRIGGER UPGRADE IN 10 SECONDS
encoding {"data":{"gwId":"82038170dc4f22bca3a7"},"protocol":15,"s":"1523715","t":"1569443513"} using protocol 2.2 b'2.2*\x89\xe6\xcb44351313\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91m\xc4D\xd0\xe1\xe1oj|[X\x8enO"8\xc9a\x8c\xfal$
After converting to python2 and installing the sslpsk module for it I'm getting a little farter in my NiteBird RGBW bulb.
[I 190925 21:38:07 web:2246] 200 POST /gw.json?a=s.gw.dev.fk.active&et=1&gwId=60282541b4e62d7af32f&other={"token":"00000000"}&t=78&v=3.0&sign=1afc835faab1989d872a5dbbc16d0735 (127.0.0.1) 62.07ms
encoding {"data":{"gwId":"60282541b4e62d7af32f"},"protocol":15,"s":"1523715","t":"1569443890"} using protocol 2.2
b"2.2$\x10I\xbd44389057\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91m\xdcx\x1d{?sO\x90\xfbV\xbc\x1ct\x1b\x85W\xc8\x06v\xc4\x17\x14a\xce_\x16G\xe7\xf0X\xb8t\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5EL\xcdW\xfa\x14\x18k|\xfa\x1c\xcak\x9d\xd2\x9b\xe2\x01\xa3\x9f\xa4J\x98r'\x0c\xfa[7\xe8\xd3\x8c\x88\xc7"
encoding {"data":{"gwId":"60282541b4e62d7af32f"},"protocol":15,"s":"1523715","t":"1569443894"} using protocol 2.2
b"2.2\xf4\xbe\xbc\x1e44389423\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91m\xdcx\x1d{?sO\x90\xfbV\xbc\x1ct\x1b\x85W\xc8\x06v\xc4\x17\x14a\xce_\x16G\xe7\xf0X\xb8t\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5EL\xcdW\xfa\x14\x18k|\xfa\x1c\xcak\x9d\xd2\x9b\xe2\x01\x83\xa2\x9d\xe3\x11s\xd8'\xec\x9d\x18\xa2\x1f\x9f@6"
encoding {"data":{"gwId":"60282541b4e62d7af32f"},"protocol":15,"s":"1523715","t":"1569443897"} using protocol 2.2
b'2.2%)\xb4\xf344389791\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91m\xdcx\x1d{?sO\x90\xfbV\xbc\x1ct\x1b\x85W\xc8\x06v\xc4\x17\x14a\xce_\x16G\xe7\xf0X\xb8t\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5EL\xcdW\xfa\x14\x18k|\xfa\x1c\xcak\x9d\xd2\x9b\xe2\x01\x02c\xd8Sf.\xb1bgW\xed)\xc4a_'`
@kueblc tried your latest new-sdk but still fails on RGB light bulb.
@Resterday that's expected for the first two activation calls. Does anything else happen in the next ~30 seconds or so of it being connected?
@MrPaulAR is that the full log? You can attach the full file so you don't have to worry about formatting.
@arendst thanks for testing, would you mind sharing your smarthack-web.log?
Attached is all the logs for the most recent attempt for the NiteBird RGBW bulb.
smarthack-mqtt.log
smarthack-psk.log
smarthack-smartconfig.log
smarthack-web.log
smarthack-wifi.log
@Resterday that's expected for the first two activation calls. Does anything else happen in the next ~30 seconds or so of it being connected?
@kueblic no it just keeps repeating over and over until I kill it.
@TimelessNL would you be willing to share your firmware backups for your successful flashes? For that matter if anyone has the firmware for their successes and failures that would be super helpful
@MrPaulAR @Resterday OK good to know, you both seem to be encountering the same issue. If we manage to get a copy of the firmware on either of these devices it will help us to debug.
For what it's worth I've got one of these bulbs disassembled but I haven't bother tracing out the GPIO to flash manually since it's impossible to put back together. If I figure out the pinout & solder it up and connect to my FTDI is there a way to extract the firmware that's useful to you?
@MrPaulAR absolutely, that would be a tremendous help. You can extract the firmware with the esptool over your FTDI. The command will be something like esptool.py read_flash 0 0x100000 firmware-backup.bin.
@kueblc I wonder how my bulbs firmware differ from @tybritten as he managed to flash the Feit bulb from costco per his comment today, maybe newer because I bought mine a week ago?:
using your fork with the new-api branch and switching psk to python2 it successfully worked with the feit electric costco bulbs. Great Job!
@kueblc I'll take a stab at that tonight. Can't make any promises though as I haven't done this (pin discovery) from scratch before.
@MrPaulAR Here is a sketch i did for the BPA800 Feit bulbs, the OM60 uses the same board "A60".
I will try and pull firmware tonight as well.

You can / should power off the 3.3 / GND pins instead of using mains for pulling the f/w. The Pads on back are super fun to solder to, i found adding some solder to the pad then using coil wire was the easiest method. You could also flash at this point and put back together, but a software approach is much easier :)
@Resterday I'm having the same issue, i received mine last week. OM60 Feit.
@kueblc not sure if any of this is useful but below are the steps im taking and the logs.
Steps: (using rpi B stretch lite)
Here are my Logs:
smarthack-mqtt.log
smarthack-psk.log
smarthack-smartconfig.log
smarthack-web.log
smarthack-wifi.log
@richterdc I don't think that's the same board but I did tone it out the best I can but not having any luck getting the flash dump. These are some pics I took when I pull it out of the socket.
Ground is the silver bars
3.3 is the first soldered header pin.
TX & RX should be the middle 2 unsoldered header pins
IO0 is labeled on the underside








Thanks @richterdc, it is indeed the same issue as @Resterday and @MrPaulAR. I'm unable to reproduce the issue with any of my devices so a firmware backup would be phenomenal.
@MrPaulAR are you still having trouble? Are you grounding GPIO0 when the module boots? Good clean pictures, thanks for documenting.
Yea, I grounded GPIO0 when it boots. Kinda punting on this for now though
since my kid just broke his arm...
On Wed, Sep 25, 2019 at 6:44 PM Colin Kuebler notifications@github.com
wrote:
@MrPaulAR https://github.com/MrPaulAR are you still having trouble? Are
you grounding GPIO0 when the module boots? Good clean pictures, thanks for
documenting.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ct-Open-Source/tuya-convert/issues/273?email_source=notifications&email_token=AA4XLQFR53OB5GC2QSILBWLQLPZVJA5CNFSM4IYDCD6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7TYROY#issuecomment-535267515,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA4XLQB7OFPYCZBEP3Q6T6DQLPZVJANCNFSM4IYDCD6A
.
@MrPaulAR Thats terrible. I hope your child is OK. I did that when I was a kid - twice.
[-=SrZ=-]
Thanks very much folks, just wanted to report in that I got 8 FEIT bulbs flashed from Costco tonight! Strong work fellas, really happy I got this done!
Adding to what others have already said, and for the benefit of folks like me who may not be familiar with cloning a branch:
git clone https://github.com/kueblc/tuya-convertcd tuya-convertcheckout new-api@mikegeeezy second person get the feit builds to work (that has posted). I'm thinking I messed up some where. Ill start with a fresh install of Raspbian tomorrow and follow your steps.
This is how I cloned (or tried to clone) the 'new-api' branch, maybe that is where I messed up?
git clone -branch new-api --single-branch https://github.com/kueblc/tuya-convert
Also, this might be a dumb question but does it matter what directory you are in when installing the libssl-dev?
Here is the flash off that NiteBird RGBW bulb. Including the command used to read it in case I need to do something differently (like increase the size). Zipped it because .bin file isn't allowed to upload.
python3 -m esptool --port /dev/ttyUSB0 read_flash 0 0x100000 firmware-backup.bin
esptool.py v2.7
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: dc:4f:22:72:79:2c
Uploading stub...
Running stub...
Stub running...
1048576 (100 %)
1048576 (100 %)
Read 1048576 bytes at 0x0 in 100.0 seconds (83.9 kbit/s)...
Hard resetting via RTS pin...
@mikegeeezy Curious what model of Feit bulb they are? on the base of the bulb do you see something that resembles a model number?
@MrPaulAR it's not a bad idea to do a flash_id command via esptool to make sure the flash is 1MB. Found one switch with a Tuya module that had 2MB and I didn't realize it until after I only backed up half the stock firmware.
Feit OM60 - Firmware Backup
$ esptool.py --port /dev/tty.usbmodem14301 read_flash 0 0x100000 firmware-backup.bin
esptool.py v2.5.1
Serial port /dev/tty.usbmodem14301
Connecting........_____....._____....._____....._____.....___
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: cc:50:e3:5e:0e:d8
Uploading stub...
Running stub...
Stub running...
1048576 (100 %)
1048576 (100 %)
Read 1048576 bytes at 0x0 in 93.1 seconds (90.1 kbit/s)...
Hard resetting via RTS pin...
@mikegeeezy second person get the feit builds to work (that has posted). I'm thinking I messed up some where. Ill start with a fresh install of Raspbian tomorrow and follow your steps.
@Resterday Attempted this tonight fresh install of wheezy lite on rpi B. no success. Same errors in logs.
This is how I cloned (or tried to clone) the 'new-api' branch, maybe that is where I messed up?
git clone -branch new-api --single-branch https://github.com/kueblc/tuya-convert
This works fine.Also, this might be a dumb question but does it matter what directory you are in when installing the libssl-dev?
No doesnt matter assuming your using apt.
Tested with two Teckin SP23 plugs and some random garage door opener that seems to be the same as this one. Unfortunately it didn't work with neither. In all devices tested, the smartconfig log shows the message about putting the device in learning mode and sending the wifi data and shortly after that the devices (both the SP23 and the garage door thingy) stop flashing the led and turn into solid red and the flash never completes.
After that, the log only shows regular connections to the 443 port from the device IP (I guess it's trying to call home).
I also tried physically connecting the garage door opener but it just quickly flashes red and blue and cc-tool timeouts, but that could be my faulty soldering skills since it was my first soldering (I still haven't opened one of the SP23s because you basically have to break the plastic).
@TimelessNL would you be willing to share your firmware backups for your successful flashes? For that matter if anyone has the firmware for their successes and failures that would be super helpful
@kueblc Sure, when I get home I'll post them. Also going to compare if there are similarities in the E27 firmware versions. I don't know if the serial number is embedded in the firmware or if it is generated at run-time. But when diffing the firmware version I probably quickly discover those things. This could change if I need to provide all firmware dumps or just one :)
Also, I'm going to dump the E14 RGBW style and upload it here. I already opened the damn thing :P

if I use the NEW-API branch and I want to flash the LSC Ledstrip I get this error
could not decrypt payload 0E9023F7CC9358EACF642FED5D4AED1A3F279884609F94A699D7AA2DBE53F00B3315EFDB3696887EE33BA863CE903F4161E9814887C9F5B7C575B15D78A877DB32C1D6AA94011341D507CDE31E5FF607A3074B70CE61D0F967A7$
Answer s.gw.dev.pk.active
reply {"result":{"localKey":"0000000000000000","schema":"[{\"id\":1,\"mode\":\"rw\",\"property\":{\"type\":\"bool\"},\"type\":\"obj\"},{\"id\":1,\"mode\":\"rw\",\"property\":{\"type\":\"bool\"},\"type\":\"o$
TRIGGER UPGRADE IN 10 SECONDS
Trigger upgrade in 10 seconds
^[[32m[I 190926 11:56:22 web:2246]^[[m^O 200 POST /gw.json?a=s.gw.dev.fk.active&et=1&gwId=60300740b4e62d6cdd4b&other={"token":"00000000"}&t=95&v=3.0&sign=e4fc1a8c0f51a2bb0db896603621180c (127.0.0.1) 60.04ms
@MrPaulAR it's not a bad idea to do a flash_id command via esptool to make sure the flash is 1MB. Found one switch with a Tuya module that had 2MB and I didn't realize it until after I only backed up half the stock firmware.
Thanks.
```python3 -m esptool --port /dev/ttyUSB0 flash_id
esptool.py v2.7
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: dc:4f:22:72:79:2c
Uploading stub...
Running stub...
Stub running...
Manufacturer: 68
Device: 4014
Detected flash size: 1MB
Hard resetting via RTS pin...
@mikegeeezy Curious what model of Feit bulb they are? on the base of the bulb do you see something that resembles a model number?
@richterdc I would say the model number is BPA800/RGBW/AG/2. I had bought a two-pack from Costco several weeks back and they flashed OK with the original tuya-convert. I went back and bought 4 more two packs last week thinking they would be off the same pallet / batch. Nope! The only difference I can tell is the first pack shows "228-19-01" and the second is "228-19-20" Just noticed there's also that SB stamp.



@M4dmartig4n Can this smart socket be reprogrammed using your branch?

https://pl.aliexpress.com/item/33020863897.html?spm=a2g0o.productlist.0.0.3a344d484SLgwL
aaaaahhhh My Woox R4553 E27 RGB bulb with the new-api is flashed! YEAH!
@mikegeeezy Curious what model of Feit bulb they are? on the base of the bulb do you see something that resembles a model number?
@richterdc I would say the model number is BPA800/RGBW/AG/2. I had bought a two-pack from Costco several weeks back and they flashed OK with the original tuya-convert. I went back and bought 4 more two packs last week thinking they would be off the same pallet / batch. Nope! The only difference I can tell is the first pack shows "228-19-01" and the second is "228-19-20" Just noticed there's also that SB stamp.
@mikegeeezy That's what i was guessing they would be. It would seem the ones ordered online at Costco as part of a 4 pack are the OM60's also sold at Amazon. And the BPA800 is sold in store at Costco in a 2x pack.
Ill grab some BPA800s today from costco and @kueblc pull firmware on them / hopefully flash them, thinking a copy of firmware that successfully flashes would be helpful?
say the model number is BPA800/RGBW/AG/2. I had bought a two-pack from Costco several weeks back and they flashed OK with the original tuya-convert. I went back and bought 4 more two packs last week thinking they would be off the same pallet / batch. Nope! The only difference I can tell is the first pack shows "228-19-01" and the second is "228-19-20" Just noticed there's also that SB stamp.
After seeing your reply @mikegeeezy, I took a look a my bulbs. I bought the two pack at costco at a price of $16.89. All the ones that I bought are BPA800/RGBW/AG/2(P) and 228-19-25. Otherwise bulbs look the same.
I popped the bulb off to see if I could directly connect to it. Bulb came off really easy without damaging it, but the LED pcv doesnt have screws like I have seen in other pictures, so I cant figure out how to get it off without damaging it. if it comes down to it I can to try and get the firmware, but I would rather not!

say the model number is BPA800/RGBW/AG/2. I had bought a two-pack from Costco several weeks back and they flashed OK with the original tuya-convert. I went back and bought 4 more two packs last week thinking they would be off the same pallet / batch. Nope! The only difference I can tell is the first pack shows "228-19-01" and the second is "228-19-20" Just noticed there's also that SB stamp.
After seeing your reply @mikegeeezy, I took a look a my bulbs. I bought the two pack at costco at a price of $16.89. All the ones that I bought are BPA800/RGBW/AG/2(P) and 228-19-25. Otherwise bulbs look the same.
I popped the bulb off to see if I could directly connect to it. Bulb came off really easy without damaging it, but the LED pcv doesnt have screws like I have seen in other pictures, so I cant figure out how to get it off without damaging it. if it comes down to it I can to try and get the firmware, but I would rather not!
@Resterday Ill try to track down these version's today soon as costco opens and should have some time to tear down grab firmware and attempt a flash. I dont mind a destroyed bulb if it helps us all out!
Thanks @richterdc. I just don't have any confidence that even if I tore into it further Id be able to do anything. If you cant find them, I can do it, but I will most likely need to be walked through it.
OMG it works. You guys are geniuses.
I've just flashed an Action E27 bulb over the air. These are really amazing. Now I have to find out how to turn on the second filament.
@infanteudora and how did you do it? Welke versie?
@InfantEudora and how did you do it? Welke versie?
I followed @mikegeeezy's 5 steps, I dindn't get it to work on python3.
You need to get the bulb in fast blinking mode. You can do that by turning if on/off for 4 times in a row.
Do you have the regular rgbw version or the filament version? (Filament is the “Edison” type bulb, filament works, nobody got the rgbw one flashed until thus far
Adding to what others have already said, and for the benefit of folks like me who may not be familiar with cloning a branch:
1. Clone new-api branch `git clone https://github.com/kueblc/tuya-convert` `cd tuya-convert` `checkout new-api` 2. install libssl-dev 2a. sudo -H pip2 install git+https://github.com/M4dmartig4n/sslpsk.git 3. in psk-frontend.py set " #!/usr/bin/env python2 " 4. ./install_prereq.sh 5. Follow "normal" procedure from here.
Thanks for reporting on your strategy @mikegeeezy! You can now simplify this down to:
git clone -b new-api https://github.com/kueblc/tuya-convert./install_prereq.sh./start_flash.shThanks for the firmware @MrPaulAR and @richterdc. I'll try to reproduce your issue today and see if I can find what's missing.
And best wishes for the swift recovery of your kid @MrPaulAR
Do you have the regular rgbw version or the filament version? (Filament is the “Edison” type bulb, filament works, nobody got the rgbw one flashed until thus far
I have the Edion type:
https://www.action.com/nl-nl/p/lsc-smart-connect-slimme-filament-ledlamp-3/
The motion sensor gives the same "could not decrypt payload" issue as the RGB light.
@InfantEudora could not decrypt payload is expected for the .active call
Do you have the regular rgbw version or the filament version? (Filament is the “Edison” type bulb, filament works, nobody got the rgbw one flashed until thus far
The LSC E27 RGB is not on ESP but got a WR3L with RTL8710BX, I rest my case...
I'm now trying to flash a generic RGBW GU10 bulb from ebay. It works with your new-sdk branch @kueblc nice work!
But one question... the flashmode is QIO:
READ FLASH: http://10.42.42.42/backup
ChipID: HIDDEN
MAC: HIDDEN
BootVersion: 7
BootMode: normal
FlashMode: 1M QIO @ 40MHz
FlashChipId: HIDDEN
FlashChipRealSize: 1024K
Active Userspace: user2 0x81000
When I flash tasmota wouldn't that break it? Since Tasmota normally usesDOUT?
Tried latest updates but not flashing yet.
smarthack-psk.log
smarthack-web.log
teckin_sp20_afterfw_convertattempt.zip
Here is the FW in "bricked" state. Here are the exact steps.
- Module defaulted to original FW (rev =unknown - via serial backup made before touching)
- Module tested for pairing mode/operation via manual button.
- Module put in to pairing mode, 6 seconds on power button.
- Device added to Tuya app per normal use.
- New FW update v1.0.3 identified, accepted and module upgraded.
- Confirm normal operation of device.
- Remove device from APP
- Attempt Tuya convert 2.0 process.
- Connect mobile device to vtrust-flash
- Device in pairing mode as a result of APP removal - GO
..... endless dots, connection made to module lights stop flashing, never flash again.
process aborted, - UNPLUG module- Restart Tuya-Convert process, reconnect to Vtrust-flash, start process and then plugin module
F/W backup actually starts - it tries, no data received. Enter a few times, multiple lines showing no data and speed of transfer declining.- Restart process, Vtrust-recovery visible, module reports flashed with userspace1 please flash with userspace 2 (after an attempt to flash 3rd party firmware)
- Flashed Userspace 2- rebooted.
- Restarted flashing process, unplugged module and plugged back in. Mopdule reports online. Firmware backup fails again (expected - file exists?)
- JUMP - UP - AND - DOWN - SUCCESS !!!!!
Sonoff-xxx access point visible. IT WORKS. I had to jump through hoops - it works.
This was the device I originally used to report the failure- block also!
GREAT WORK!.
[-=SrZ=-]
Anybody also tried some teckin sp20's. I'm just trying to figure out what his actually sequence is around step 11 to get a pair of recently bought sp20's that I tried flashing for a couple of hours with tuya-convert 1 to flash some tasmota goodness
I was able to flash my Feit Costco BPA800/RGBW/AG/2 light bulbs using the method described by @mikegeeezy . I pulled the latest version by @kueblc and switched the branch to newapi, then I loaded the ssl-psk for python2 and tried and it worked great.
My bulb has these markings 228-19-20.
@kueblc let me know if you want the backup of the firmware that was created or any of the logs. Thanks all for the awesome work! :+1:
Thanks for reporting on your strategy @mikegeeezy! You can now simplify this down to:
git clone -b new-api https://github.com/kueblc/tuya-convert./install_prereq.sh./start_flash.sh
Also need a step 1.1.) cd tuya-convert with those relative paths.
Unfortunately I was unable to reproduce the issue seen by @MrPaulAR and @richterdc. Both firmware backups ran through the tuya-convert process successfully for me.
If anyone is able to a copy of a firmware that is looping on token.get or config.get please do share.
The LSC E27 RGB is not on ESP but got a WR3L with RTL8710BX, I rest my case...
@ggaljoen that is unfortunate, they seem to be moving away from the ESP82xx
@TimelessNL that should be fine, I checked my logs and had flashed many devices with QIO successfully without even realizing it.
@l3ok what device is that? Are you able to get a copy of that firmware?
@dasb00ter that procedure is @SirRedZ documenting his experience, not formal instructions. You'll want to grab the latest new-sdk branch as described above.
@deemee awesome, thanks for the report! At this point I'm more interested in firmware that did not successfully flash OTA, but a few successful flashes are great for baseline.
Also need a step 1.1.)
cd tuya-convertwith those relative paths.
@AlphaSierraHotel good catch
@TimelessNL that should be fine, I checked my logs and had flashed many devices with
QIOsuccessfully without even realizing it.
Hehe I took the risk seconds before your reaction. And indeed it flashed/runs just fine. Later I though ofcourse... the tuya-convert loader is flashed to USER2 which booted just fine and is probably also running in DOUT mode.
maybe remove the warnings in start_flash.sh?
Installing an alternative firmware with the wrong flash mode will leave the ESP unable to boot!
The LSC E27 RGB is not on ESP but got a WR3L with RTL8710BX, I rest my case...
@ggaljoen do you have pictures of the teardown? I'm curious since the RGB E14 bulb does have an ESP :/
EDIT:
I wonder what LSC was thinking, half of their products line uses the RTL chip while the other half uses an ESP...
@kueblc That's unfortunate that you cannot duplicate my issue. I'm seeing errors in the MQTT log.
==> smarthack-mqtt.log <==
1569528929: New connection from 127.0.0.1 on port 1883.
1569528929: New client connected from 127.0.0.1 as P1 (c1, k60).
1569528929: Sending CONNACK to P1 (0, 0)
1569528929: Received PUBLISH from P1 (d0, q0, r0, m0, 'smart/device/in/60282541b4e62d7af32f', ... (111 bytes))
1569528929: Socket error on client P1, disconnecting.
1569528933: New connection from 127.0.0.1 on port 1883.
1569528933: New client connected from 127.0.0.1 as P1 (c1, k60).
1569528933: Sending CONNACK to P1 (0, 0)
1569528933: Received PUBLISH from P1 (d0, q0, r0, m0, 'smart/device/in/60282541b4e62d7af32f', ... (111 bytes))
1569528933: Socket error on client P1, disconnecting.
1569528937: New connection from 127.0.0.1 on port 1883.
1569528937: New client connected from 127.0.0.1 as P1 (c1, k60).
1569528937: Sending CONNACK to P1 (0, 0)
1569528937: Received PUBLISH from P1 (d0, q0, r0, m0, 'smart/device/in/60282541b4e62d7af32f', ... (111 bytes))
1569528937: Socket error on client P1, disconnecting.
For what it's worth I just did a git pull and still on the new apk branch. I also reran the install-prereq script and rebooted the PI before starting.
git clone -b new-api https://github.com/kueblc/tuya-convert
1.1.cd tuya-convert./install_prereq.sh./start_flash.sh
@kueblc - I just ran through this on my buster image and pip2 hadn't been installed so no /usr/bin/pip file existed. I'd recommend adding python-pip package to the list of pre-reqs and changing the sudo -H pip install... to specifically reference pip2.
I could create a PR for new-api branch, if you'd like.
Thanks @AlphaSierraHotel, added your suggestions in the latest commit.
@MrPaulAR so it seems your device isn't connecting to the MQTT broker. Keep me posted if you discover anything else and I'll keep looking into it on my end.
@TimelessNL I'm open to removing the warning if someone can confirm that's no longer relevant.
So the LSC e27 RGB is a no go for tuya convert?
Anyone got info on which e27 rgb bulbs will work? Preferably available in The Netherlands for the same price as the Action offers..
Ok so update.. went and bought more Feit bulbs from Costco, BPA800 228-19-21 and 228-19-16. Unable to flash any of those. Tried fresh wheezy image and tried rpi B & B+ Always the same error.
@Resterday my costco does not have the -25 version.
@kueblc Still seeing these errors.
==> tuya-convert/scripts/smarthack-mqtt.log <==
1569532115: New connection from 127.0.0.1 on port 1883.
1569532115: New client connected from 127.0.0.1 as P1 (c1, k60).
1569532115: Sending CONNACK to P1 (0, 0)
1569532115: Received PUBLISH from P1 (d0, q0, r0, m0, 'smart/device/in/55002573bcddc2a5c6e7', ... (111 bytes))
1569532115: Socket error on client P1, disconnecting.
1569532118: New connection from 127.0.0.1 on port 1883.
1569532118: New client connected from 127.0.0.1 as P1 (c1, k60).
1569532118: Sending CONNACK to P1 (0, 0)
1569532118: Received PUBLISH from P1 (d0, q0, r0, m0, 'smart/device/in/55002573bcddc2a5c6e7', ... (111 bytes))
1569532118: Socket error on client P1, disconnecting.
1569532122: New connection from 127.0.0.1 on port 1883.
1569532122: New client connected from 127.0.0.1 as P1 (c1, k60).
1569532122: Sending CONNACK to P1 (0, 0)
1569532122: Received PUBLISH from P1 (d0, q0, r0, m0, 'smart/device/in/55002573bcddc2a5c6e7', ... (111 bytes))
1569532122: Socket error on client P1, disconnecting.
@richterdc any psk or web activity?
@kueblc Apologies its not the full log files. Just a tail. Im setting up my rpiB+ with buster and seeing if that changes anything. Will report back.
`GET /gw.json?a=s.gw.token.get&et=1&gwId=55002573bcddc2a5c6e7&other={"token":"00000000","region":"US","tlinkStat":{"configure":"smartconfig","time":2,"source":"ap","path":"broadcast"}}&t=74&v=3.0&sign=7cdf8309600548d63c16914591d0cdfe
Connection: keep-alive
User-Agent: ESP8266SDK
Host: a3.tuyaus.com
Answer s.gw.token.get
reply {"result":{"mqttsUrl":"10.42.42.1","gwApiUrl":"http://10.42.42.1/gw.json","dstIntervals":[],"mediaMqttUrl":"10.42.42.1","gwMqttUrl":"10.42.42.1","stdTimeZone":"-05:00","timeZone":"-05:00","aispeech":"10.42.42.1","httpsPSKUrl":"https://10.42.42.1/gw.json","mqttsPSKUrl":"10.42.42.1","mqttRanges":"","mediaMqttsUrl":"10.42.42.1"},"e":false,"t":1569532122,"success":true}
[I 190926 22:08:42 web:2246] 200 GET /gw.json?a=s.gw.token.get&et=1&gwId=55002573bcddc2a5c6e7&other={"token":"00000000","region":"US","tlinkStat":{"configure":"smartconfig","time":2,"source":"ap","path":"broadcast"}}&t=74&v=3.0&sign=7cdf8309600548d63c16914591d0cdfe (127.0.0.1) 3.51ms
encoding {"data":{"gwId":"55002573bcddc2a5c6e7"},"protocol":15,"s":"1523715","t":"1569532122"} using protocol 2.2
b'2.2\xab\x04\xc3\xfe53212219\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91mGi\xb1\x99J\x06\x9f\xf7\tsM\x03\xbbZ\xe3\xdaF\x03\xb2_\xb2amuf\x8eI_v\xc3\xc6r\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5EL\xe3)\xf47\x9b,\x10m\xb2\xa2\xc7\xfcW\x18\xdb\x00&\xd3D\x9b\xf2/Z\xb0\xbb\xb3\xf06\x9a\xba\n\xe8'
POST /gw.json?a=s.gw.dev.pk.active&et=1&gwId=55002573bcddc2a5c6e7&other={"token":"00000000"}&t=74&v=3.0&sign=9f605fd090f9bcc5a3aa6a0534a827ac
Connection: keep-alive
User-Agent: ESP8266SDK
Content-Length: 485
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Host: 10.42.42.1
payload 877A46AD59AC93B30A4731B29E810DB11D90E9A89FB5E2964360294DEA9A9CD932AF94B563991E4B5AAC11B752E5AA87F28D0F38208C16C9EBE8E19DCF08B1AF3F72B9AE8A8673F1B39E9815DDA88A719A83D1D48E2102256BBD869FCA8916C5462800D6F3AB51A8BBD92CD6449EFA3FBA7F8DAD286B454C781E7AE16D84101D607386DEF5F6F487B6F2C038E81B5F6A9649BB4D258D2323FBC79F289ADE403E32AB38314B6C98903476E4B8C197A86BE0715810BA204981CE21C9D27B93D0487D4AE2B9F494F752CB018CFF7E4E8699999E34A096151BC0F224D933EB15D71BA61D93EBF1341EEE30ED4C9904D37741
Answer s.gw.dev.pk.active
reply {"result":{"schema":"[{\"property\":{\"type\":\"bool\"},\"type\":\"obj\",\"id\":1,\"mode\":\"rw\"},{\"property\":{\"type\":\"bool\"},\"type\":\"obj\",\"id\":1,\"mode\":\"rw\"},{\"property\":{\"type\":\"bool\"},\"type\":\"obj\",\"id\":1,\"mode\":\"rw\"},{\"property\":{\"type\":\"bool\"},\"type\":\"obj\",\"id\":1,\"mode\":\"rw\"},{\"property\":{\"type\":\"bool\"},\"type\":\"obj\",\"id\":1,\"mode\":\"rw\"},{\"property\":{\"type\":\"bool\"},\"type\":\"obj\",\"id\":1,\"mode\":\"rw\"},{\"property\":{\"type\":\"bool\"},\"type\":\"obj\",\"id\":1,\"mode\":\"rw\"},{\"property\":{\"type\":\"bool\"},\"type\":\"obj\",\"id\":1,\"mode\":\"rw\"},{\"property\":{\"type\":\"bool\"},\"type\":\"obj\",\"id\":1,\"mode\":\"rw\"},{\"property\":{\"type\":\"bool\"},\"type\":\"obj\",\"id\":1,\"mode\":\"rw\"}]","schemaId":"0000000000","secKey":"0000000000000000","localKey":"0000000000000000","uid":"00000000000000000000","devEtag":"0000000000"},"e":false,"t":1569532122,"success":true}
TRIGGER UPGRADE IN 10 SECONDS
Trigger upgrade in 10 seconds
[I 190926 22:08:42 web:2246] 200 POST /gw.json?a=s.gw.dev.pk.active&et=1&gwId=55002573bcddc2a5c6e7&other={"token":"00000000"}&t=74&v=3.0&sign=9f605fd090f9bcc5a3aa6a0534a827ac (127.0.0.1) 54.93ms
==> tuya-convert/scripts/smarthack-psk.log <==
new client on port 443 from 10.42.42.34:22612
PSK: c24c3fdf18d7d8340537b52a0ae7c04198b9cb27b157f0843e3c13f31defa130 ID: BAohbmd6aG91IFR1q{@BºoºB^N™Ê
Ñ∂_6ªlÆUÀìDÎS˜πËÔ
new client on port 443 from 10.42.42.34:18695
PSK: b909e0d767ed1cc7f930580e47865ee4e63f475b7a3bc3a4d40e1095a5665640 ID: BAohbmd6????????q{@BºoºB^N™Ê
Ñ∂_6ªlÆUÀìDÎS˜πËÔ
new client on port 443 from 10.42.42.34:10861
PSK: c24c3fdf18d7d8340537b52a0ae7c04198b9cb27b157f0843e3c13f31defa130 ID: BAohbmd6aG91IFR1q{@BºoºB^N™Ê
Ñ∂_6ªlÆUÀìDÎS˜πËÔ
new client on port 443 from 10.42.42.34:19185
PSK: 7c67e8ee3a6e3cfc131eb0297afc62598786041b68f9d9f3b3bb45ffcefdd10f ID: BAohbmd6aG91????q{@BºoºB^N™Ê
Ñ∂_6ªlÆUÀìDÎS˜πËÔ
new client on port 443 from 10.42.42.34:38395
PSK: c24c3fdf18d7d8340537b52a0ae7c04198b9cb27b157f0843e3c13f31defa130 ID: BAohbmd6aG91IFR1q{@BºoºB^N™Ê
Ñ∂_6ªlÆUÀìDÎS˜πËÔ
==> tuya-convert/scripts/smarthack-web.log <==
encoding {"data":{"gwId":"55002573bcddc2a5c6e7"},"protocol":15,"s":"1523715","t":"1569532125"} using protocol 2.2
b'2.2o\xab\x94\x0153212574\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91mGi\xb1\x99J\x06\x9f\xf7\tsM\x03\xbbZ\xe3\xdaF\x03\xb2_\xb2amuf\x8eI_v\xc3\xc6r\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5EL\xe3)\xf47\x9b,\x10m\xb2\xa2\xc7\xfcW\x18\xdb\x00\x07[\x87Y#\xafX\xf6\xed~\xe4\xcfJ\xb6\x1b@'
encoding {"data":{"gwId":"55002573bcddc2a5c6e7"},"protocol":15,"s":"1523715","t":"1569532129"} using protocol 2.2
b'2.2\tQ?\x1853212928\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91mGi\xb1\x99J\x06\x9f\xf7\tsM\x03\xbbZ\xe3\xdaF\x03\xb2_\xb2amuf\x8eI_v\xc3\xc6r\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5EL\xe3)\xf47\x9b,\x10m\xb2\xa2\xc7\xfcW\x18\xdb\x00K\xa1\xb7\xe6\x04\xd8\x108$}|mm\x8e\x15\xf6'
encoding {"data":{"gwId":"55002573bcddc2a5c6e7"},"protocol":15,"s":"1523715","t":"1569532132"} using protocol 2.2
b'2.2\x8e\x8d\x83m53213281\xb7\x98\xa7\x08\xc0\xc7\xa5\xc2JB\x9c_9\xed\x91mGi\xb1\x99J\x06\x9f\xf7\tsM\x03\xbbZ\xe3\xdaF\x03\xb2_\xb2amuf\x8eI_v\xc3\xc6r\x91\xfa\xef\xd4\xa8\xffL\x1a\xef\x01\r\x8e\xbd\xf5EL\xe3)\xf47\x9b,\x10m\xb2\xa2\xc7\xfcW\x18\xdb\x00\x00tJv\x086\x11:T\xdae\xe3t\x9e\xe5\xb6'`
@TimelessNL I'm open to removing the warning if someone can confirm that's no longer relevant.
I flashed 2 of these Generic RGBW GU10 Ebay bulbs that ran in QIO mode as seen in my previous message. I OTA'ed a Tasmota compiled DOUT build and it worked just fine 😄
@kueblc Success!! using RPI B+ and Buster following:
git clone -b new-api https://github.com/kueblc/tuya-convert
./install_prereq.sh
./start_flash.sh
These Devices all flashed:
FEIT BPA800 228-19-16
FEIT OM60 228-19-17
FEIT BPA800 228-19-21
FEIT BPPLUG ( random purchase at costco while buying bulbs this morning, holiday outdoor plug 2pack for $25)
It seems my issues were a ID10T error but still don't know anything specific. What I did to fix it was grab a new MicroSD card and start with a clean install of Raspian. From there did the normal steps and this time it worked the first time!
Thanks for your work with me and on this project overall!
@TimelessNL would you be willing to share your firmware backups for your successful flashes? For that matter if anyone has the firmware for their successes and failures that would be super helpful
@kueblc I gathered some firmware dumps as you requested:
SUCCESS:
Filament E27 M download firmware: link
Filament E27 XL download firmware: link
Filament E27 XXL download firmware: link
FAILED:
RGBW E14 download firmware: link
I'm especially interested why the E14 RGBW bulb fails as @arendst verified using your 'new sdk' branch. I don't know if we can flash the firmware to any random ESP though, since this bulb uses an i2c chip to control its LEDs. I don't know what will happen if the firmware is unable to detect that chip 😕
Very happy to hear you were able to resolve your issues @richterdc and @MrPaulAR!
Thank you so much for sharing these firmware files, @TimelessNL. This is great data and I'll get to work on it right away.
@TimelessNL seems that the RGBW E14 failed due to the schema issue mentioned here. Flashed successfully for me with the latest new-sdk branch.
Regarding the RGBW E27 @TimelessNL @arendst, if @ggaljoen is correct we're SOL...
Do you have the regular rgbw version or the filament version? (Filament is the “Edison” type bulb, filament works, nobody got the rgbw one flashed until thus far
The LSC E27 RGB is not on ESP but got a WR3L with RTL8710BX, I rest my case...
Success!! using RPI B+ and Buster following:
git clone -b new-api https://github.com/kueblc/tuya-convert
./install_prereq.sh
./start_flash.sh
Success with the costco bulb -25! Thanks @richterdc changing to Buster did the trick! Now I need to figure out how to configure Tasmota and or esphome for it!
@kueblc Posted a picture here https://www.mikrocontroller.net/attachment/430145/20190926_175548.jpg
Anyone any luck with action lsc gu10 lights? I will try those this evening.
@kueblc so it does appear to be a Buster thing using the new-api branch! Thanks to @SirRedZ for pushing me to test Buster as well on a fresh SD card I was able to flash all 3 of my brands of bulbs I couldn't flash before!
For a test, I formatted a fresh SD card of Stretch and did the same exact steps as I did to setup Buster. I tried on two brands of bulbs and failed on flashing using Stretch. Then I went back to the SD card with Buster and tried the same exact two bulbs that failed on Stretch and they successfully flashed without any issues on the first shot with Buster.
Note to everyone! You have to wait for the dots longer than you were used to with the older Tuya Convert or other devices. The dots actually go up to around the word "scripts" right above it. Previously went to the word "look", so that could throw some people off.
Steps to flash (used a Rpi3):
sudo apt install git
git clone -b new-api https://github.com/kueblc/tuya-convert
cd tuya-convert
./install_prereq.sh
./start_flash.sh

@ThaStealth i flashed the Woox bulb rbgww just fine.
@digiblur you are correct, i was flashing a socket and was not working. Killed to fast. Just try again and got a phonecall so the script was running longer and then it flashed.....
So you need to wait wait wait....
Only thing that is not working are battery power products and the lsc ledstrip
Woot! Managed to flash 2 Brilliant Smart (AU) RGBW bulbs using the latest commit on new-api branch.
Thanks a lot for your hard work!
A bit late, but here's a firmware backup from a successful flash of a generic 16A RGB plug (That was previously paired with a Smart Life app in August).
This worked for me to OTA flash a garage door controller and two patched Teckin SP22s! The Teckins took some tries before they worked, but both did at the end.
Anyone any luck with action lsc gu10 lights? I will try those this evening.
I just tested the GU10 bulb and it's build exactly the same as the E14 bulb.
So it contains an ESP8266 and SM2135 chip. see here
GoSung WP3-1 Smart Socket
Can add, remove, re-add and control
from Android phone but not Web portal (outside China ?)
Wi-Fi Module: 1.0.4
MCU Module 1.0.4
Trying to flash with latest Tuya-Convert using
Moto Z Play OS 8
and
Linux 19.04 (Disco Dingo) Insignia Flex-11 tablet connects
to also 19.04 HP Sprout hot spot.
Only change wlan0 to wlp5s0b1 in config.txt for Ubuntu device name
smarthack-wifi.log
AP-STA-CONNECTED (tablet MAC)
starting accounting session
WPA: pairwise key handshake completed (RSN)
then
AP-STA-DISCONNECTED
Last message
"Waiting for the upgraded device to appear ..."
No device appears
Is this right and January patch means "no work around available at this time." ?
What can I do to help ?
I have wireshark captured pcapng before and after add in separate log files using app to add then toggle on then off.
Trying to flash with latest Tuya-Convert using
Just to clarify, when you say this, are you referring to the new-api branch of kueblc's repository, as few folks have described it above?
I am not sure which branch you mean I am using master clone today clean.
EDIT: Found kueblc but need to resume later tests.
Also I have since traced an dnamasq issue with resolv running on port 53 and blocking dnamasq.
I tried with stop as per ASKUBUNTU but Google ping lacks DNS but assume not needed during flash.
I can see a lot of 10.42,42,42 with 10.42.42.1 with wireshark and no errors in logs.
Maybe this helps
So i've been trying the new-api branch on a fresh buster install..
I'm starting to lose hope with these things now :(
The Teckin SP23's can definitely be accomplished. Don't give up- 2 weeks ago none of these modules seemed possible.
https://github.com/arendst/Sonoff-Tasmota/wiki/Teckin-SP23
@danmed did you follow this 'exactly'
Steps to flash (used a Rpi3):
sudo apt install git
_git clone -b new-api https://github.com/kueblc/tuya-convert_
cd tuya-convert
./install_prereq.sh
./start_flash.sh
[-=SrZ=-]
@danmed if there is no psk log then you could be running an old branch.
I can also confirm, it works 💯
RPi 3B+ fresh SD card install:
2019-07-10-raspbian-buster-lite.img
sudo apt install git
git clone -b new-api https://github.com/kueblc/tuya-convert
cd tuya-convert
./install_prereq.sh
cd tuya-convert
./start_flash.sh
To see if the setup works (whatever your actual device may be):
you can grab one of the SUCCESS .bin from above ,
flash it on a WeMos D1, NodeMCU...
and try 😃
THX THX 👍
@danmed, my SP23s took several retries, I noticed that if at a reboot the wifi called "ESPsomething" showed up for a few seconds, it would flash, but if the wifi was called "Smartlife something" then it wouldn't.
This is exactly what I did :(
On Fri, 27 Sep 2019, 20:30 SirRedZ, notifications@github.com wrote:
@danmed https://github.com/danmed did you follow this 'exactly'
Steps to flash (used a Rpi3):
sudo apt install git
git clone -b new-api https://github.com/kueblc/tuya-convert
https://github.com/kueblc/tuya-convert
cd tuya-convert
./install_prereq.sh
./start_flash.sh—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ct-Open-Source/tuya-convert/issues/273?email_source=notifications&email_token=AA5S4WTUGZ7X5OWZOKPVLO3QLZNN3A5CNFSM4IYDCD6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7Z4HQI#issuecomment-536069057,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA5S4WR7H6OBML6OXZ6DBR3QLZNN3ANCNFSM4IYDCD6A
.
Ah.. hang on.. I don't think I was actually using the new-api branch..
damnit..I'll try again tomorrow.
On Fri, 27 Sep 2019, 20:30 SirRedZ, notifications@github.com wrote:
@danmed https://github.com/danmed did you follow this 'exactly'
Steps to flash (used a Rpi3):
sudo apt install git
git clone -b new-api https://github.com/kueblc/tuya-convert
https://github.com/kueblc/tuya-convert
cd tuya-convert
./install_prereq.sh
./start_flash.sh—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ct-Open-Source/tuya-convert/issues/273?email_source=notifications&email_token=AA5S4WTUGZ7X5OWZOKPVLO3QLZNN3A5CNFSM4IYDCD6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7Z4HQI#issuecomment-536069057,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA5S4WR7H6OBML6OXZ6DBR3QLZNN3ANCNFSM4IYDCD6A
.
Reporting BNETA smart wifi led bulb IO-WIFI60-B22 working.
On Fri, 27 Sep 2019 at 21:53, danmed notifications@github.com wrote:
This is exactly what I did :(
On Fri, 27 Sep 2019, 20:30 SirRedZ, notifications@github.com wrote:
@danmed https://github.com/danmed did you follow this 'exactly'
Steps to flash (used a Rpi3):
sudo apt install git
git clone -b new-api https://github.com/kueblc/tuya-convert
https://github.com/kueblc/tuya-convert
cd tuya-convert
./install_prereq.sh
./start_flash.sh—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<
https://github.com/ct-Open-Source/tuya-convert/issues/273?email_source=notifications&email_token=AA5S4WTUGZ7X5OWZOKPVLO3QLZNN3A5CNFSM4IYDCD6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7Z4HQI#issuecomment-536069057
,
or mute the thread
<
https://github.com/notifications/unsubscribe-auth/AA5S4WR7H6OBML6OXZ6DBR3QLZNN3ANCNFSM4IYDCD6A.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ct-Open-Source/tuya-convert/issues/273?email_source=notifications&email_token=ACJASZ7GFURK2STAOFYCXFTQLZQDRA5CNFSM4IYDCD6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7Z5ZYA#issuecomment-536075488,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACJASZ4RLS4PUOKHNMQEHGDQLZQDRANCNFSM4IYDCD6A
.
This is truly exciting ladies and gentleman. Thanks for participating and posting! ... It goes without saying, thanks to @kueblc, @M4dmartig4n and all others who have contributed.
The Proxmox variant (pulls this latest new-api) is ready to go if anyone cares to test/report back.
_https://github.com/SirRedZ/ProxMox-Tuya-Convert-2.0-Container_
Lets not forget to share with the community if your flashing a device that may not be in the Tasmota Template Database:
_( https://github.com/arendst/Sonoff-Tasmota/wiki/Templates )_
Please configure your device as per above and add it here:
_( https://blakadder.github.io/templates/ )_
@blakadder has put an absolutely brilliant database together (for those who may be new to Tuya Convert)
[-=SrZ=-]
Over not paid attention enough to see any additional access points.. will
check tomorrow
On Fri, 27 Sep 2019, 20:52 Juanjo Alvarez Martinez, <
[email protected]> wrote:
@danmed https://github.com/danmed, my SP23s took several retries, I
noticed that if at a reboot the wifi called "ESPsomething" showed up for a
few seconds, it would flash, but if the wifi was called "Smartlife
something" then it wouldn't.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ct-Open-Source/tuya-convert/issues/273?email_source=notifications&email_token=AA5S4WQ6UQW7R74MWJXYG5DQLZQBPA5CNFSM4IYDCD6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7Z5YRY#issuecomment-536075335,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA5S4WVTW74MXDU3ZIYFOALQLZQBPANCNFSM4IYDCD6A
.
Hope this helps someone.
Not able to get any flash to go but see a new Access appearing.

Also here are logs using smarthack and then the open hot spot SmartLife
while doing various sniffer utilities.
smarthack_scripts_logs.zip
Wireshark for above
GoSung_kueblc_ssl_Flex_Win10_convert.pcapng.zip
then
sniffing while connect to broadcasted as in PNG
GoSung_ hot_spot.pcapng.zip
I am seeing it to add with android app SmartLife then Google Home
The pair light is slow so I had to press to get back to fast blink.
SmartLife info
Wi-Fi Module: 1.0.4
MCU Module 1.0.4
After pairing I see
nmap -Pn 192.168.1.23
Starting Nmap 7.70 ( https://nmap.org ) at 2019-09-27 18:10 EDT
Nmap scan report for 192.168.1.23
Host is up (0.0030s latency).
Not shown: 999 closed ports
PORT STATE SERVICE
6668/tcp open irc
Nmap done: 1 IP address (1 host up) scanned in 8.03 seconds
NOTE:
I have filtered wireshark packets from PAIRED GoSund IP address showing exposed data.
@SirRedZ
I also am trying to get the teckin sp20's done that you had success with. These have never been hooked up to the app. I tried for hours with tuya-convert 1.0 without success and bc I bought them recently thought they had newer firmware which blocked Tuya-C.
I'm having the same sequence that I had with tuya 1.0 occur. I plug in the module(it flashes rapidly blue or I press the button to get it flashing rapidly blue). I start the script hook up a device to vtrust and a couple of dots and the process starts I believe. I think the blue light flashes more slowly than lights out and then red light and many dots. I wait a bit and then hit control-c to stop the script. I unplug the plug. I start the script again hook up to vtrust hit enter and plug back in and I get one blue light and then constant red? I think I have all the logs but not sure what to look for. What was your sequence that worked ...any way to know the firmware version for this plug. I do have a proxmox install I could try your image out on I'm currently using a raspberry pi updated from the previous tuya-1.0
@dasb00ter Sorry for delayed response- I was out. The red light you mention is not involved in the process, that is you operating the relay. It happens. The slow blue flash means not in paring mode.
try this.
Leave in the app, setup Tuya Convert 2.0 ( make sure you are pulling the correct branch by following my last posted instructions courtesy of many others in this thread/Digiblur's summary.
Once ready to go, before you connect to vtrust, remove the device from the app.
The SP20 will now immediately be in pairing mode, if not put it in pairing mode. Connect phone to vtrust, begin the process.
Correct behaviour will be almost immediate 'communication' the blue led stops flashing and goes solid or off, can't recall. Once this happens -- WAIT -- for me the device comes online under the word 'look'... newer devices may take longer, so this seems to happen at the word script. Regardless, let it go until the first line is full, after that, abort.
Just because it didn't work, all is not lost. Try to operate the relay with the manual device button, if unresponsive = GOOD!. likely blue light is also unresponsive, unless a quick flicker upon plugging in only.
Leave device plugged in, restart tuya convert, but DO NOT connect to Vtrust. Start the dots, and boom. The device will likely come online within the first 5 seconds, or not. If not, unplug device, plug in while dots are flowing.
This will get your module flashed.
Note: I noticed the device struggled when I was physically too close to the wifi hotspot. Make sure you are 6-10ft away from the WLAN adapter used for V-trust. (a little theory of mine) ...
let me know how it goes. Find me on discord, ( #Tollbringer ) -- I'd be happy to watch/help via screenshare.
[-=SrZ=-]
Finally got these plugs to flash! The Blue LED no longer functions.. maybe i just have to figure out what module to set it as.. the SP23 seems to work when sewt to Blitzwolf but it tries to read energy readings which these versions don't have.. Any ideas?
Will try the bulbs later!
Edit : Confirmed flashed Teckin SB50 (Brand new).. Used this template to set it up : https://blakadder.github.io/templates/teckin-sb50.html
Not sure it will allow me to use the RGBW but dimming and toggle on off works.
Hello, I'm trying to flash folowing Tuya E27 Bulb. I'm stuck on Waiting for the upgraded device to appear. I tried several times with new-api branch. I'm using Kali installation on my old laptop. I flashed succesfully Blitzwolf SHP6 Power socket with this configuration using new-api branch. This is my output in log:
smarthack-web.log:
GET /gw.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=1555001424&uuid=735f57cc10d6e53a&v=4.0&sign=8793a6767e51e2f224671e0ac6543a38
Host: a.gw.tuyaus.com
User-Agent: TUYA_IOT_SDK
Connection: keep-alive
Answer tuya.device.dynamic.config.get
reply {"result":"fn8oBaEAaJe3I+enO7OkYdd0LkD9WHnY6k8vmvctrJYxAKxTSy/OFci8V6cvjWI+9F2VBmqNqTqJcWuiX4YubNGmvQ94fVE44ynDgRtuctC7mevrGF2WUpAllBDW/Q5l","t":1555001424,"sign":"06f6e79cb0d200a0"}
[I 190411 12:50:24 web:2162] 200 GET /gw.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US
"}&t=1555001424&uuid=735f57cc10d6e53a&v=4.0&sign=8793a6767e51e2f224671e0ac6543a38 (10.42.42.10) 2.08ms
GET /gw.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=1555001425&uuid=735f57cc10d6e53a&v=4.0&sign=5d2f15f3f45e580b30371da568cfb973
Host: a.gw.tuyaus.com
User-Agent: TUYA_IOT_SDK
Connection: keep-alive
Answer tuya.device.dynamic.config.get
reply {"result":"fn8oBaEAaJe3I+enO7OkYdd0LkD9WHnY6k8vmvctrJbqpblyc0jSQ5iMjvysLXBV9F2VBmqNqTqJcWuiX4YubG8VKRgODAloT026eoxre0G7mevrGF2WUpAllBDW/Q5l","t":1555001425,"sign":"0912a546a500e9d3"}
[I 190411 12:50:25 web:2162] 200 GET /gw.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US
"}&t=1555001425&uuid=735f57cc10d6e53a&v=4.0&sign=5d2f15f3f45e580b30371da568cfb973 (10.42.42.10) 2.03ms
GET /gw.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US"}&t=1555001426&uuid=735f57cc10d6e53a&v=4.0&sign=e120f7b2be8287891cd861824d374eed
Host: a.gw.tuyaus.com
User-Agent: TUYA_IOT_SDK
Connection: keep-alive
Answer tuya.device.dynamic.config.get
reply {"result":"fn8oBaEAaJe3I+enO7OkYdd0LkD9WHnY6k8vmvctrJYZaG7sw1PYUiBphOG00NZ59F2VBmqNqTqJcWuiX4YubHcvmsggWe3bU2nCOPezn5m7mevrGF2WUpAllBDW/Q5l","t":1555001426,"sign":"bc16774c78dac39d"}
[I 190411 12:50:26 web:2162] 200 GET /gw.json?a=tuya.device.config.get&et=1&other={"token":"00000000","region":"US
"}&t=1555001426&uuid=735f57cc10d6e53a&v=4.0&sign=e120f7b2be8287891cd861824d374eed (10.42.42.10) 2.06ms
smarthack-wifi.log
Creating new /etc/dnsmasq.conf...
Writing hostapd config file...
Configuring AP interface...
Applying iptables rules...
Starting DNSMASQ server...
Starting AP on wlan0 in screen terminal...
Configuration file: /etc/hostapd/hostapd.conf
Using interface wlan0 with hwaddr 0c:60:76:62:70:73 and ssid "vtrust-flash"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
wlan0: STA 64:a2:f9:32:72:9d IEEE 802.11: authenticated
wlan0: STA 64:a2:f9:32:72:9d IEEE 802.11: associated (aid 1)
wlan0: AP-STA-CONNECTED 64:a2:f9:32:72:9d
wlan0: STA 64:a2:f9:32:72:9d RADIUS: starting accounting session 597765AF88905080
wlan0: STA 64:a2:f9:32:72:9d WPA: pairwise key handshake completed (RSN)
wlan0: STA 28:6d:cd:1c:87:20 IEEE 802.11: authenticated
wlan0: STA 28:6d:cd:1c:87:20 IEEE 802.11: associated (aid 2)
wlan0: AP-STA-CONNECTED 28:6d:cd:1c:87:20
wlan0: STA 28:6d:cd:1c:87:20 RADIUS: starting accounting session 1E005870CD816992
wlan0: STA 28:6d:cd:1c:87:20 WPA: pairwise key handshake completed (RSN)
wlan0: AP-STA-DISCONNECTED 64:a2:f9:32:72:9d
wlan0: STA 64:a2:f9:32:72:9d IEEE 802.11: authenticated
wlan0: STA 64:a2:f9:32:72:9d IEEE 802.11: associated (aid 1)
wlan0: AP-STA-CONNECTED 64:a2:f9:32:72:9d
wlan0: STA 64:a2:f9:32:72:9d RADIUS: starting accounting session CB9283536FBEE491
wlan0: STA 64:a2:f9:32:72:9d WPA: pairwise key handshake completed (RSN)
smarthack-mqtt.log
1555001197: mosquitto version 1.6.6 starting
1555001197: Using default config.
1555001197: Opening ipv4 listen socket on port 1883.
1555001197: Opening ipv6 listen socket on port 1883.
Log smarhack-psk.log is empy. Bulb is flashing rapidly and after starting pairing procedure it stops blinking. If I try command nc -u -l -k -p 6666 during pairing procedure, it returns following:
{"ip":"10.42.42.10","gwId":"6cc5b363f021939cce8a85","active":0,"ablilty":0,"encrypt":true,"productKey":"mohjv7lyalvpu5p7","version":"3.2"}
Does anybody know what could be the problem?
Thanks.
Some RGB E27 bulbs from tuya contain a Realtek chip instead of an ESP. However searching for your mac address online does not provide a clear aswer yet.
Anyone succeeded in flashing the Action LSC Smart Connect Power Plug yet? It does have an ESP but the binding procedure is different, after pressing the button for 5sec it sometimes enters smartconfig mode and other times creates it own AP. It does succeed smartconfig but does not actually connect to vtrust-flash. Otherwise I'm going to hardwire it and dump the flash contents.
Smart plug no problem Hold button at least ten seconds. Flashed with M4d code a few days ago.
Ah interesting. Tried 10sec as well a couple of times. But with the new-api branch. Will retry with the m4d code. Thanks!
Without the new branch you can flash them. Got a couple flashed. With the new api it dont work....
@maffemuis can you share more information on this please? The new-api branch is intended to be backwards compatible so if that's not the case we need to debug it.
Since I wasn't in the mood to set up Proxmox and the like, I gave it a try with a few Gosund SP1 2.4-variants and the repo by @M4dmartig4n. So far it worked marvelous with two out of four, the rest will most likely go just as smooth. Only had to install libssl-dev manually, so that the prereq-script didn't fail.
Good job!
See #279 for the latest, and please report any successes or failures against that branch so we can move forward with merge into master. Thanks again to @M4dmartig4n for tremendous work and providing the PoC.
@SirRedZ might have to take you up on your offer I'm not having success even when following your directions to a T.The app says I have 1.03 firmware already. I'm a little confused by what you mean the devices come online with the word 'look'. Do you mean instead of the usual sonoff device name. Anyways I always get a long blue at the beginning of the process then it turns off the dots just continue and the red light comes on. The button remains functional unfortunately. Tried many times now again. There is some weird behavior when if I restart the process (restart the script and the AP but without an android device connected to vtrust) the light flashes blue then back to red where it stays. The switch seems to work fine in the app. Man dont know how you did it. Good thing I got excited and ordered two more switches which arrived to day. ARRRRRGH
Test with SP21, it works in the first step :-).
The orginal tuya-convert does not work!
@maffemuis
I bought and flashed a Woox R4553, but I'm stuck at the next phase, what template did you use?
Congratulations. You have discovered and converted a device that has not yet been added to the template database. You will need to 'discover' the GPIO assignments and can 'build' the template and share once you have figured it all out. Digiblur has a couple video where he shows basically setting all GPIOs to relays and testing one at a time to figure out what does what. @ThaStealth
[-=SrZ=-]
@SirRedZ I figured as much, @maffemuis already converted this device a few days ago and reported he got it working, so if he has something up and running I can 'borrow' this from him :).
Where can I submit the template once I have something working? Make an issue in the tasmota repo?
https://github.com/arendst/Sonoff-Tasmota/wiki/Templates
Specifically, the 'add to database' here. Thank you! https://blakadder.github.io/templates/
[-=SrZ=-]
it needs to be tweaking: but for now I use this, but its not 100% ok.
{"NAME":"GlobeRGBWW","GPIO":[0,0,0,0,37,40,0,0,38,41,39,0,0],"FLAG":0,"BASE":18}
For some reason the route to 10.42.42.0/24 wasn't setup correctly in my case, so I had to manually do "ip route add 10.42.42.0/24 dev wlan0", and then after that things proceeded to work fine.
Hope this helps someone!
that is weird!-- On Another note, saw my first example of the RealTek chips coming in Tuya devices.
.. Tuya answers, but tells you nobody is home (no ESP 82xx) here !!!
**payload A304618E62221291CC001F2774A61F35
WARNING: it appears this device does not use an ESP82xx and therefore cannot install ESP based firmware**
Am I understanding this response correctly @kueblc ? (Teckin SP10) brand new inventory)
[-=SrZ=-]
WARNING: it appears this device does not use an ESP82xx and therefore cannot install ESP based firmware
I put this warning in @SirRedZ, per https://github.com/ct-Open-Source/tuya-convert/pull/279#issuecomment-536225551
I flashed 2 LSC Smart bulbs from Action.com. Both failed somehow. I get the feeling this method doesn't work on these bulbs.
@amiranees Which bulb are you trying to flash. Only the RGB E27 bulb doesn't work since it contains a RTL chip. All the others should work just fine.
EDIT:
Maybe it's time to create a success/failed table so people aren't asking the same questions each time.
@TimelessNL I flashed the non rgb version.
Tried 2 different bulbs. Both didn't work
During the flashing I get no errors and everything goes fine. When flash completes the bulbs turns off and I don't get sonoff WiFi hotspot.
I want to try to flash the LSC led strip but I am scared to brick those too
I want to try to flash the LSC led strip but I am scared to brick those too
Those can be hard/hot wired in the worst case, so don't worry!
Even the IR remote can be configured to work with Tasmota: https://www.mikrocontroller.net/attachment/430330/rules.text
@amiranees the LSC LED strip flashed perfectly using Kuebl's fork on my pc!
@amiranees did you actually flash tasmota using flash3? Only then the ESP will create it's access point. Seems to me you only flashed the tuya-convert loader.
@amiranees I din't get the LSC LED strip to flash... I think I need to do it by wire....
I flashed the LSC PIR by wire, don't know if the firmware is needed? I want to flash more PIR but it's battery powered so it lose connection but here is the firmware I want to flash the door contacts also....
Is this possible or do this things need to go by the wire solution?
All other things I csn succesfull flash with the new software
Orginal Firmware of the LSC PIR: Sonoff_backup_01.zip
@TimelessNL I have saved the log from Putty. If u have time, look at it and let me know what I did wrong.
Putty log
Edit: I see i forgot the extension :p You can open it with notepad
@TimelessNL I have saved the log from Putty. If u have time, look at it and let me know what I did wrong.
Putty log
Edit: I see i forgot the extension :p You can open it with notepad
You've used the command to flash a thirdparty.bin but i'm guessing you havn't actually made one available.. If you just want Tasmota on there (the minimal build) then just use the command
curl http://10.42.42.42/flash3
and not
curl http://10.42.42.42/flash3?url=http://10.42.42.1/files/thirdparty.bin
@amiranees I din't get the LSC LED strip to flash... I think I need to do it by wire....
I flashed the LSC PIR by wire, don't know if the firmware is needed? I want to flash more PIR but it's battery powered so it lose connection but here is the firmware I want to flash the door contacts also....
Is this possible or do this things need to go by the wire solution?All other things I csn succesfull flash with the new software
Orginal Firmware of the LSC PIR: Sonoff_backup_01.zip
As @ggaljoen said, I am going to try the OTA version. If things go wrong I can fix it by wire flash method. I ll report here later.
@danmed
I replaced the original thirdparty.bin with tasmota-6.6.0.7-generic-wifiman-2.3.0.bin from https://github.com/digiblur/Sonoff-Tasmota/tree/development/generic
Maybe it's time to create a success/failed table so people aren't asking the same questions each time.
@TimelessNL there's a compatible devices list on the wiki, do you want to set up a new page for TLS firmware or add a column to the existing list?
@amiranees I'll echo what @TimelessNL and @danmed said, you did not brick your devices. It is clearly running the intermediate firmware from your logs. You need to /flash3 and then connect to the sonoff-**** AP to configure it.
Also you can only do /flash or /undo, not both. /undo will only be able to restore you to the stock firmware if you haven't already done /flash2 or /flash3.
@danmed
I replaced the original thirdparty.bin with tasmota-6.6.0.7-generic-wifiman-2.3.0.bin from https://github.com/digiblur/Sonoff-Tasmota/tree/development/generic
I might have missed something, but why are you doing that? Why not just do the included minimal and then upgrade through the web interface?
I noticed you used undo, how long did you wait before executing this command? Because it can take up to 16sec or more to flash the tasmota image provided by the tuya-convert repo.
My advice is just to clone this repo and flash the tasmota image provided, and then upgrade using the normal tasmota OTA method. This worked for most people and is pretty reliable.
@danmed
I replaced the original thirdparty.bin with tasmota-6.6.0.7-generic-wifiman-2.3.0.bin from https://github.com/digiblur/Sonoff-Tasmota/tree/development/genericI might have missed something, but why are you doing that? Why not just do the included minimal and then upgrade through the web interface?
Good question, I followed this tutorial on youtube, or maybe I missed something.
Youtube link: https://www.youtube.com/watch?v=dyUyewiKpRA
Ok, i understand, thanks to you guys, where it went wrong. Now my question is, what I need to do to ''Repair" these bulbs and get to the point where I can do the /flash3
While start_flash is still running (vtrust-flash AP is available) and plug your device back in. If it continues automatically, you can run /flash3 and wait for the sonoff-**** AP to appear. If not, see if you can put it back in pairing mode and restart the process from the beginning. Also, it made a backup of your stock firmware, so before you do anything, post it here and I might be able to find some more details for you.
@kueblc I think it would be nice to split them up. Old/New SDK and link the appropriate page in the readme.md. So people can find it easy and quick.
Maybe it's also time to remove the "they claim... military grade security..." message in the readme. If we would like to be able to keep flash tuya devices in the future. I think it wont help much to keep mocking tuya for this priviledge :smiley:
@amiranees you ran /undo so there is a large chance it's running the tuya firmware again.
Tried flashing 2 Costco Feit bulbs marked as 228-19-25 but both failed. Neither would connect after putting them into pairing mode
@photo64 what was used in your setup? Hardware and software wise.
@digiblur Followed your setup using Rpi3B. It's the same I used to successfully convert that Esicoo smart plug that worked. What software info do you need?
Edit - Should have added All I get are the dots then eventually the vtrust connection drops
@timelessNL Just imagine I f* up with undo commands and so on.. can I save the bulbs somehow ?
@Photo64
vtrust connection drops
What do you mean by this, what does it drop on?
Also what raspbian build?
After a long stream of dots the vtrust-connection access point on my tablet says "No internet connection' so I interrupt the process at that point. It's on Raspbian Buster Lite
There is not supposed to be an internet connection through vtrust-flash, it is isolated from the internet so that the Tuya device contacts our server instead of theirs
@Photo64 attach your logs. I will also mention that using apple devices as the other device seemed problematic at times. Due in part to how they share the SSID info, how they will disco when they sleep and how they dislike not having internet.
The process appears to start correctly, the vtrust-flash on my tablet shows connected however after putting the bulb into flash mode and it not connecting after a few minutes the vtrust-flash on my tablet shows "not connected" and then goes to a "Wifi Connection Failure"
@photo64 I can also confirm having issues with Android devices but iOS works fine.
What are they expecting in the GPIOs column?
Tried using an Amazon fireHD7 tablet and my MotoG6 Android phone. Had no issues with the FireHD tablet the other day when converting the smart plug
Here are the log files
smarthack-mqtt.log
smarthack-psk.log
smarthack-smartconfig.log
smarthack-web.log
smarthack-wifi.log
What are they expecting in the GPIOs column?
@danmed you can leave it blank, just fill out what you know. The GPIO column is for mapping the pins to their functions, see the other compatible devices wiki for examples.
@Photo64 your logs indicate that the device did connect and attempt to install the intermediate firmware. It is unclear if it completed before you halted the process, you can try to resume by plugging the device back in while start_flash is still running (vtrust-flash AP should still be visible).
How would I know if it's resuming or completed? It never goes beyond just seeing the dots and then it seems the access point loses wifi connection.
It would stop printing dots. You shouldn't be losing WiFi connection, but there will be no internet access through the connection, do not confuse the two.
Also note that you do not need to put the device back into pairing mode nor connect a third device, since this is only required to start the process, not resume it.
Well after several attempts I finally was able to flash both bulbs. The one thing I noticed and I have no idea if this impacts it in any way but I couldn't get them to flash until on both bulbs I got the slow blinking first and the smart app access point to show on my tablet. Once that appeared I turned on/off the bulb to get the fast blinking and then it decided to begin the flashing. Could have been a coincident but it only worked on both when that happened.
Glad to hear it @Photo64
@amiranees I din't get the LSC LED strip to flash... I think I need to do it by wire....
I flashed the LSC PIR by wire, don't know if the firmware is needed? I want to flash more PIR but it's battery powered so it lose connection but here is the firmware I want to flash the door contacts also....
Is this possible or do this things need to go by the wire solution?
All other things I csn succesfull flash with the new software
Orginal Firmware of the LSC PIR: Sonoff_backup_01.zipAs @ggaljoen said, I am going to try the OTA version. If things go wrong I can fix it by wire flash method. I ll report here later.
Did you succeed flashing the LSC led strip via OTA? I managed to flash the LSC smart bulbs, but with the led strip no luck..
@
@amiranees I din't get the LSC LED strip to flash... I think I need to do it by wire....
I flashed the LSC PIR by wire, don't know if the firmware is needed? I want to flash more PIR but it's battery powered so it lose connection but here is the firmware I want to flash the door contacts also....
Is this possible or do this things need to go by the wire solution?
All other things I csn succesfull flash with the new software
Orginal Firmware of the LSC PIR: Sonoff_backup_01.zipAs @ggaljoen said, I am going to try the OTA version. If things go wrong I can fix it by wire flash method. I ll report here later.
Did you succeed flashing the LSC led strip via OTA? I managed to flash the LSC smart bulbs, but with the led strip no luck..
I didn't try it yet, I'll think i try tomorrow.
How did u manage to flash the smart bulbs?
@
@amiranees I din't get the LSC LED strip to flash... I think I need to do it by wire....
I flashed the LSC PIR by wire, don't know if the firmware is needed? I want to flash more PIR but it's battery powered so it lose connection but here is the firmware I want to flash the door contacts also....
Is this possible or do this things need to go by the wire solution?
All other things I csn succesfull flash with the new software
Orginal Firmware of the LSC PIR: Sonoff_backup_01.zipAs @ggaljoen said, I am going to try the OTA version. If things go wrong I can fix it by wire flash method. I ll report here later.
Did you succeed flashing the LSC led strip via OTA? I managed to flash the LSC smart bulbs, but with the led strip no luck..
I didn't try it yet, I'll think i try tomorrow.
How did u manage to flash the smart bulbs?
I flashed the filament ones (both e14 and e27) just with the 'new' OTA method. I also have a multi color led e14, but didnt try to flash that one. There isn't a template available, and I dont have experience creating one, but maybe I will try tomorrow .
@luchtgitaar
Nice to know.
During the flashing process, stays the light on or does it go off?
And also, did you chose for /flash3?
@TimelessNL I see you did great work on the LSC bulbs. Have you tried the ceiling light one?
Still need to do a first attempt at any bulb, but disassembly of this one couldn't be easier. 3 screws, some removing of covers and you've got a WR3L on a breakout board with headers :open_mouth:


@amiranees Which bulb are you trying to flash. Only the RGB E27 bulb doesn't work since it contains a RTL chip. All the others should work just fine.
EDIT:
Maybe it's time to create a success/failed table so people aren't asking the same questions each time.
@luchtgitaar I am afraid you cant flash the RGB ones.
@Beanow unfortunately the WR3L is based on the RTL8710BN and thus can't be flashed with ESP82xx firmware like Tasmota. I am not aware of any custom firmware built for the RTL8710BN at this time, though I would be thrilled to learn otherwise.
Bummer. But this may be a fun one to test with. And looks like there's a fair bit of info on https://github.com/TuyaInc/tysdk_for_rtl8710bn/blob/master/wifisdk_for_rtk_871x/component/soc/realtek/8711b/misc/rtl8710b_ota.c
@Beanow yeah I also bought that ceiling light myself. I had to do allot of rework on mine since the overall production quality of these is very low... couple of dry solder joints, flux remains and solder balls floating around.
In the process I did replace the RTL chip with an ESP-12. They are pin compatible after all. So running Tasmota after replacing the SoC was quite easy.
There isn't a template available, and I dont have experience creating one, but maybe I will try tomorrow .
@luchtgitaar It isn't just a 'template' that needs to be worked on. the RGBW E14/GU10's use a rather unknown 5channel i2c chip that controls the LED power. So you can't just pwm your way out of this one😄. There is a proof of concept in Tasmota-dev if you're interested.
In the process I did replace the RTL chip with an ESP-12. They are pin compatible after all. So running Tasmota after replacing the SoC was quite easy.
That's one way to do it. Guessing the one TYWE2S/TYWE3S are the ones you can use right? Like the one in the motion sensor.
I suppose so yes. But it don't have to be a tuya module though.
Bummer. But this may be a fun one to test with. And looks like there's a fair bit of info on https://github.com/TuyaInc/tysdk_for_rtl8710bn/blob/master/wifisdk_for_rtk_871x/component/soc/realtek/8711b/misc/rtl8710b_ota.c
It's funny you linked this file in particular @Beanow, I was just looking into it myself :stuck_out_tongue:
@kueblc and @Beanow did you see this github? https://github.com/8devices/platformio-realtek-rtl8710b
I am no programmer, so... It would be great to be able to flash the LSC Smart Bulb RGB E27 :blush:
I suppose so yes. But it don't have to be a tuya module though.
Well I was thinking about this in terms of easily removing Chinese spyware _useful data-mining, just not useful for the buyer_, from consumer IoT products OTA. So the tuya ones are interesting there.
It's funny you linked this file in particular @Beanow, I was just looking into it myself
It is the file that said OTA so yeah I would look at that first :P
@Xenomes I hadn't seen that. But looks like PlatformIO is some kind of abstraction layer to make the development process more unified. It isn't a ready-to-go firmware, it's tools to build firmware. Frankly though unless we have a financial sponsor I won't be able to pick up a project to build the firmware from scratch. A few too many projects I'm already maintaining :sweat_smile:
Successfully flashed 4x Teckin SP22. So I ve ordered again the same modules from Amazon.
But the new ones didn´t flash. After starting "start_flash.sh" the module goes off- and then again online, but the script is staying at "Waiting for the upgraded device to appear" ...
Maybe all have an upgraded rom?
Logfiles attached.
smarthack-mqtt.log
smarthack-psk.log
smarthack-smartconfig.log
smarthack-web.log
smarthack-wifi.log
@angomania couple things, the latest can be found at #279, the fork isn't being maintained. And unfortunately your new Teckins are not using an ESP82xx so you won't be able to use Tasmota or other ESP based firmware, OTA or otherwise.
Please do all testing and reporting against #279 so we can move forward with merge. Locking this issue so users see this and do not accidentally install an older unmaintained version.
Most helpful comment
Great, thanks for sharing. I believe I will have a fix ready for this issue soon.