Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wiki: Flash Tuya based device without opening/soldering #1713

Closed
hyteoo opened this issue May 3, 2019 · 11 comments
Closed

Wiki: Flash Tuya based device without opening/soldering #1713

hyteoo opened this issue May 3, 2019 · 11 comments

Comments

@hyteoo
Copy link
Contributor

hyteoo commented May 3, 2019

In my search for better and cheaper devices on amazon, I came across smart sockets that can not be opened without destroying the device.
They are all using the Smart Life app made by Tuya but distributed under different brands

There is a project that fakes the OTA of the original firmware and lets you flash your own custom firmware: https://github.com/ct-Open-Source/tuya-convert

Tested it on 2 types of devices, flashed espurna directly and works like a charm!

Maybe it would be a good idea to reference this in the Wiki

@AndreasSchutz
Copy link

What firmware version/environment did you use? I've been struggling to find a firmware that doesn't make the tuya module stack dump continuously.

@hyteoo
Copy link
Contributor Author

hyteoo commented May 7, 2019

Latest master branch / PlatformIO. I just created a new device without any buttons/relays/leds defined.
Just to have espurna on the device and then OTA trial and error until I got the pins right.

Tuya convert was installed on a Pi3.

@jsponz
Copy link

jsponz commented May 7, 2019

@hyteoo Which devices you tested?

@AndreasSchutz
Copy link

Okey, thanks for getting back to me... sounds so easy when you summon it up like that! ;-)
I just got one of theese., opened it up and soldered the connections for flashing. The ESP8266ex module inside was similar to this.
Do you mind sharing your button/relay settings so that I can compare it to my findings?

At first I had some success but it was unstable, then I did a factory reset from serial and after that all I get are stack dumps.

@AndreasSchutz
Copy link

I'll answer my self for anyone interested.

  • First of all, I was using the dev branch. I don't know if that really matters but it was not what I intended... careful to select the branch you want before getting the git clone url.
  • Secondly I had to edit the "ESPURNA_CORE" entry in hardware.h, if I tried to create a new test device by copying the "ESPURNA_CORE" to a new bogus device at the end of the file my build was not the same size and my device never came out of the dump loop. (Maybe I don't get all the compile time stuff).
  • The newly flashed device needs a looooong time with core dumps before finally coming online with a web interface. Is that really the intended behavior? I was powering the device from my usb serial interface, maybe that had too little power to give??

@mcspr
Copy link
Collaborator

mcspr commented May 8, 2019

@AndreasSchutz please consider decoding those stack traces. It would be better to skip crashing 5 times before being able to use the device :)
(or at least what is sounds like, when device goes into the safe mode)

You also might be hitting some bugs already fixed in dev branch. However, please do open a separate issue about those problems if they persist. I only have already converted tuya devices, so no idea if initial flashing has any problems.

And you might be right about the power situation - it is more advisable to try to use robust 3v3 power supply, or use mains and configure things via telnet / web

@AndreasSchutz
Copy link

@mcspr
All my "bugs" went away when i reassembled the device and gave it decent power. I also had a problem where the device couldn't do OTA and only downloaded half the file before crashing and that went away too. Right amount of juice really is crucial, now it is running like a charm!

@hyteoo
Copy link
Contributor Author

hyteoo commented May 9, 2019

@AndreasSchutz glad you figured that out.
@jsponz tested devices were these:
https://www.amazon.de/gp/product/B07GF2XLMN
https://www.amazon.de/gp/product/B07CDCYLQ6

@stale
Copy link

stale bot commented Jul 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 8, 2019
@stale
Copy link

stale bot commented Jul 15, 2019

This issue will be auto-closed because there hasn't been any activity for two months. Feel free to open a new one if you still experience this problem.

@stale stale bot closed this as completed Jul 15, 2019
@mcspr
Copy link
Collaborator

mcspr commented Jul 15, 2019

I tagged another issue in the #1774, this is the relevant one.

https://github.com/xoseperez/espurna/wiki/OTA-TUYA was added
https://github.com/xoseperez/espurna/wiki/Hardware-JINVOO-VALVE-SM-AW713 has a mention that it can use such method
Sidebar now has a link near the SonOTA

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

No branches or pull requests

4 participants