sillyfrog / contact

Contact Me and useful links
1 stars 0 forks source link

Tasmota Unsupported Arlec 800 Multi & Warm White Led Smart WIFI String Light Low Voltage (LVE800HA) #5

Open sillyfrog opened 3 years ago

sillyfrog commented 3 years ago

Some notes for the unsupported LED string lights.

I pulled this apart, and found it had a chip labeled WB3L.

If you decide to pull one apart, don't be an idiot like me and use a knife to cut the glue, use a soldering iron or similar to melt the glue.

To pull the controller apart, I did the following:

Pop off the smaller cover over the wires. There are 2 square holes that I used a flat head screwdriver in to push it open. It was pretty tight as it was also breaking some glue holding it together, giving me this:

1

Next I broke the glue connecting the plastic and protecting the wires using a knife - don't do this (I cut the tracks and had to solder them again). Rather use a hot knife (or old soldering iron) to melt the glue away.

With that done, again using a screw driver I levered open the rest of the container. A couple of random points had glue, but slowly working my way around I was able to open it up. 2

Giving the inside of the device: 3

Getting the PCB out required some more fiddling to release any glue that was still holding it in place.

Once the main PCB is free, you can see the main controller chip and the rest of the board (this is after I repaired my cut tracks): 6

600andrew commented 3 years ago

Hi. I purchased a set of Arlec Smart 160 LED Ball Lights (LVE160HA) hoping to flash Tasmota https://www.bunnings.co.nz/arlec-grid-connect-smart-rgb-colour-changing-160-led-ball-lights_p0180228

I've opened the controller like you have, and it looks very similar.

2020-11-16 22_21_35-Window

1- Power supply to convert 12V to 3.3V 2- Tuya Wifi WB3S module 3- Looks like a microcontroller. Connects to the button, and to the Tuya module, and to 4 4- Output driver MOSFETS. Q1 and Q2.

One wire of the LED lights connects to +12V. The other wire connects to the MOSFETS and is either switches directly to 0v via Q1, or via a 51 ohm resistor to 0v via Q2.

I connected a logic analyzer to pins 1 and 2 of the microcontroller (3). Q1 is on most of the time and I guess it is to provide 12V to the LEDs. Occasionally Q1 turns off and then Q2 toggles, sending data to the LEDs. All the LEDs get the same data, so they are not individually addressable. It seems to be a pulse width data stream, with the off pulse width varying between 30uS and 39uS for 1 and 0 (or 0 and 1) I found a data sheet for the LED, but it just has some physical, electrical and environmental specs. Nothing about the data stream to control it.

It looks too hard to replicate the functionality of the micro-controller 3, so I will look at the Tuya module. There appear to be two connections from the Tuya module to the microcontroller. Tx and RX UART?. Looking through my box of bits I have a few spare ESP-07 module. https://docs.ai-thinker.com/_media/esp8266/docs/esp-07s_product_specification_en.pdf And comparing the pinout of the Tuya module (available to Tuya Developer) to the ESP-07 they are conveniently similar. The pins I am interested in are: Vcc, GND, TXD, RXD, Enable, and they are the same on both modules.

My plan is to look at the signals between the Tuya module and the microcontroller, hopefully it is RS232. Flash the ESP-07 with Tasmota, and then replace the Tuya module with the ESP07. I'll let you know how I get on.

sillyfrog commented 3 years ago

@600andrew Nice, will be very interested how you get on! I have not looked at the actual components closely (except the main controller chip - which looking on the Tuya site is based on the BK7231T). Tuya has some code here: https://github.com/TuyaInc/ty_iot_wf_bt_sdk_bk7231t - but it's in Chinese (I assume) - and I'm not even sure how to compile and upload it.

It would be great to figure out how to flash these micro-controllers like with the ESP's, but I don't have the skills to do this in any sensible amount of time.

With your lights - is there 2 wires between each light, or does it go up to 4 wires? The ones I have start with 2 wires to the first LED, then goes to 3 wires after the first LED. (I have not put a meter on it). The lights are basically 2 strings - the first is the white LED's the second is the coloured LEDs (the coloured LED's just alternate red, green, blue - there's no actual ability to change the colours), so the string has something like: white, red, white, blue, green, white etc. The patterns then just turn on the white or coloured. My original guess was it's either just polarity (one way white, the other coloured) - but based on what you're seeing, it could be that the first LED at the end of the 2 wires has some smarts to split out the signal into the 2 strings.

600andrew commented 3 years ago

It is a UART connection between the Tuya and the microcontroller. 9600 Baud. I think I've captured most combinations of settings on the Phone App, and what bytes are sent from the Tuya module to the microcontroller. It follows a predictable structure of preamble, destination, payload length, payload and then checksum. I just need to go through the Phone App settings again to make sure I've captured all the combinations, and then I'll rip out the WB3L and replace it with the ESP07.

As for the wires there are 2 from the controller to the first bulb and then 3 after that on my lights. There won't be any smarts in the first bulb. Putting all the smarts in the controller and having 3 wires from the controller would be cheaper than making the first bulb unique. I would guess that the 3rd wire is to counter the effect of voltage drop across the string of lights, and is an attempt to make sure that the lights at the end of the string are of similar brightness to the lights at the beginning by feeding power directly to the far end of the string of lights.

Looking at the picture of your controller it has additional MOSFETS located around the left middle to drive the string of LEDs. It looks like it drives one of the wires to the lights positive and the other negative to turn on one string of LEDs, and then swaps the voltage around to drive the other string of LEDs. Do this fast enough and both strings appear to illuminate at the same time.

sillyfrog commented 3 years ago

Sounds like some great progress! I'm guessing like it's the "standard" Tuya serial protocol:

So if you were able to get an ESP/Tasmota connected, it should be easy to play with it to try out all the combinations. If you make it that far, I have published a helper to assist with figuring out what everything does with Tuya: https://github.com/sillyfrog/Tasmota-Tuya-Helper

Good luck!

600andrew commented 3 years ago

That was harder than I expected. I mapped out all the commands. Not quite the same as Tuya. For example the checksum is the sum of all the bytes minus one (where the Tuya is just the sum of all the bytes). My ESP07 was an older version and I eventually found that it only had 512KB of flash and that isn't enough for Tasmota. So I ended up writing an ESPHome Custom Light, and it integrates into Home Assistant. 2020-11-25 20_54_09-esp07 Home Assistant-Light Here is the code and YAML file for ESPHome. arlec_smart_160.h.txt xmas_lights.yaml.txt

I didn't get around to implementing the different effects via the onboard MCU. If I spent any more time on them it would be Christmas and they still wouldn't be going. However it can still do Home Assistant based effects.

I hope the code can be of some help for your project.