Elektroda.com
Elektroda.com
X
Elektroda.com

W600 TW02 Generic SmartPlug

iprak 1104 27
  • This is a teardown of an unbranded wifi switch named SmartPlug. The printed manual referred to Smart Life app.

    The appearance is quite generic with a single button on one side. There is a blue LED around the button.
    W600 TW02 Generic SmartPlug W600 TW02 Generic SmartPlug

    I was able to safely open using using a sharp spudger. The electronics are recessed so spudger has quite less change of damaging anything. Desoldering the power connections takes patient but I was able to do just using a desoldering wick.
    W600 TW02 Generic SmartPlug W600 TW02 Generic SmartPlug W600 TW02 Generic SmartPlug

    And here is the cleaned up board and the chip.
    W600 TW02 Generic SmartPlugW600 TW02 Generic SmartPlugW600 TW02 Generic SmartPlug

    The module had power and serial connection cleared marked and serial connection showed this.

    Code:

    <TUYA IOT SDK V:2.0.0 BS:30.01_PT:2.2_LAN:3.3_CAD:1.0.1_CD:1.0.0 >
    [FW]: TC0025_TW02_PLUG_L1_P0 | [HW]: TW-02 V2.0 | [SW]: V1.4.0 (Nov 18 2019 08:48:17) | [PID]: nqvhejakb112obkn
    [01-01 00:00:00 TUYA Notice][hw_table.c:532] wifi status is :0
    [01-01 00:00:00 TUYA Notice][wifi_hwl.c:1316] <LF> old mode is 4 <LF>
    [01-01 00:00:04 TUYA Notice][tuya_main.c:143] wf_assign_ap_scan failed(-606)
    [01-01 00:00:04 TUYA Notice][gw_intf.c:2270] gw_cntl.gw_wsm.stat:1
    [01-01 00:00:04 TUYA Info][wifi_hwl.c:1261] Low Power Mode
    [01-01 00:00:05 TUYA Notice][hw_table.c:532] wifi status is :0
    [01-01 00:00:14 TUYA Notice][tuya_device.c:694] free_mem_size:89880




    So LSP-A was actually a W600 TW-02 module.
    W600 - https://www.winnermicro.com/en/html/1/156/158...%20Wi,industrial%20and%20other%20IoT%20fields.
    There is also a FCC filing about TW-02 - https://fccid.io/2ASQV-TW-03/User-Manual/User-manual-4210975.pdf
    W600 TW02 Generic SmartPlug W600 TW02 Generic SmartPlug

    Examination of the board showed that there was actually a red and a blue LED; red was tied to the relay. W600 TW02 Generic SmartPlug


    Later I was able to adjustOpenBK7231T app to compile the W600 SDK (originally obtained from https://github.com/w600/sdk). The W600 build is now part of OpenBK7231T's standard build.

    And here are the actual connections:

    Side-A
    * 3.3V
    * Gnd
    * PA5 connected to switch pulled high
    * PA4 - No connection
    * PB16 - No connection
    * PB15 - relay tied to red LED

    Side-B
    * PB13 - No connection
    * PB18 - No connection
    * PB8 - blue LED
    * PB7 - No connection
    * Reset - No connection

    The module seems to run a bit warm and took around 80mA in stock condition before custom firmware. The FCC filing mentioned that it can consume up to 230 mA so this was well within range.

    Cool? Ranking DIY
    About Author
    iprak
    Level 3  
    Offline 
    iprak wrote 9 posts with rating 2, helped 0 times. Been with us since 2022 year.
  • #2
    p.kaczmarek2
    Level 28  
    Good job, @iprak . As far as I can tell, you're the first one in the world to flash custom IoT firmware on W600 product. I also have one W600 product in the queue (a RGBCW bulb), but I haven't found time yet to play with that. Still, there should be no problems, because even OTA is working on our W600 port.
    NOTE: W600 platform is very similar to W800, so porting was relatively easy. Of course, We also support W601 and W801, as they are basically the same.

    @iprak are you able to tell where have you bought that plug?
  • #3
    iprak
    Level 3  
    Sorry, I don't know where the plugs came from. I got it from a local guy who claimed they no longer worked.
  • #5
    p.kaczmarek2
    Level 28  
    @omelchuk890 don't worry, as far as I remember, on W600 platform you have just to use the "basic" OTA mechanism, the one from WWW panel, that takes a HTTP server link to a binary file. You can use Xampp or Node Red on your PC. The secondary OTA mechanism (the one with drag and drop) might not be ready.

    Or at least I think so. Am I right, @iprak ? I haven't gotten around much my W600 yet.
  • #6
    iprak
    Level 3  
    Yes, both W800 and W600 don't support webApp based drag-n-drop OTA update. You can use the native webApp to directly upload the firmware.[/u]
  • #7
    omelchuk890
    Level 9  
    @iprak
    Tell me how? I'm not good at the web

    Will it be enough if a file is sent to him at the request of the module?
  • #8
    p.kaczmarek2
    Level 28  
    The second option would be to implement http_rest_post_flash from rest_interface.c. I am not sure how the internals of W600/W800 OTA look like, tough.

    @omelchuk890 hmm install xampp on windows, make sure it's running, then put binary file in htdocs, then make sure it is accessible by 192.168.x.y/myFile.smth (your PC machine IP) and then pass this URL to OTA field
  • #9
    iprak
    Level 3  
    You need a local webserver, that is what Xampp or Node Red is. There are variety of other options including IIS, nodejs. I personally use IIS since it comes bundled with Windows and give you more instructions. But you need a local webserver which can serve the .img file. There is a button on the Config page to upload the firmware.
  • #10
    omelchuk890
    Level 9  
    I have a bad idea of the sequence of actions. Will such a design work?
    W600 TW02 Generic SmartPlug

    Added after 16 [minutes]:

    p.kaczmarek2 wrote:
    hmm install xampp on windows, make sure it's running, then put binary file in htdocs, then make sure it is accessible by 192.168.x.y/myFile.smth (your PC machine IP) and then pass this URL to OTA field

    Ok, tomorrow
  • #11
    p.kaczmarek2
    Level 28  
    @omelchuk890 if you have a node-red (as you shown on screenshot), then you obviously don't need xampp. That sequence could work, but please make sure that file is read as a raw binary stream. It's one of node red settings or something.
  • #12
    omelchuk890
    Level 9  
    @p.kaczmarek2
    Everything turned out using Node-Red.
    It's very simple. Absolutely.
    But a little instruction to those who follow in my footsteps.
    Copy the file we need to the home folder, I put it in the downloads folder using winscp. Copy the path.
    Next, we assemble a simple construction in NR. Insert the path and name of the file. Select "one buffer object".
    We test through the browser, if everything is OK - insert the link in the OTA configuration menu.
    We enjoy simplicity.
    W600 TW02 Generic SmartPlug

    W600 TW02 Generic SmartPlug

    W600 TW02 Generic SmartPlug

    W600 TW02 Generic SmartPlug
    W600 TW02 Generic SmartPlug
    W600 TW02 Generic SmartPlug

    P.S. 1.14.53 is the latest release that can be downloaded for the W series. There are no recent files.
    Is this the end?

    P.P.S. 1.14.66 and next - ok.
  • #13
    p.kaczmarek2
    Level 28  
    @omelchuk890 end? where? It's just the beginning. We are going to support all major platforms as long as they are possible to support.

    The release files were just missing because I didn't have to update makefiles while adding a new file.

    Also, good job with node red! And thank you for testing W600. It's hard to test all platforms by myself. I really appreciate your effort.
  • #14
    omelchuk890
    Level 9  
    @p.kaczmarek2
    board W600
    versions 70 and 71 do not work after the update. Not by ota wifi, not by com port.
    Rolled back to version 1.14.69
    After downloading 71, the network 4.1 does not appear
    W600 TW02 Generic SmartPlug
    W600 TW02 Generic SmartPlug
  • #15
    p.kaczmarek2
    Level 28  
    @omelchuk890 thank you for reporting the issue. From what I can see, our developer @iprak is already investigating it.
    https://github.com/openshwprojects/OpenBK7231T_App/issues/354

    @omelchuk890 @iprak has proposed a fix
    https://github.com/openshwprojects/OpenBK7231T_App/pull/363
  • #16
    MisterPi
    Level 3  
    I'm sure this it the wrong place for this, but the poor W600 is one of the least-supported chips out there. This project makes me happy because some time ago I bought a bag of Wemos W600-Pico boards. They have Micropython on them but that firmware hasn't been updated in ages and doesn't have (for instance) WS2812/Neopixel support in it.

    I may be blind, but I am missing a wiki entry on how to flash a W600 device (which I would do serially). Also blind: Can't find the firmware (puts on fireproof suit).

    Once I get one flashed, I can contribute as I experiment with these little boards. I love Tasmota but as time goes by and the "smart plug" manufacturers migrate to cheaper WiFi SOCs, more people will need to work on cracking the how-to-reflash nut and I see this project as a way to do it.

    Thanks!
    (Edit: feel free to move this to the appropriate forum/thread).

    This is the W600-Pico:
    W600 TW02 Generic SmartPlug
  • #19
    MisterPi
    Level 3  
    I don't know how much effort that would be on this processor, but it would be very nice to have it. The W600-Pico dev board comes with a pretty limited version of Micropython that has not been updated in several years and does not have WS2812 support ("include Neopixel" throws an error) -- I think the W600-Pico board is a dead-end for Wemos.
    I realize you aren't trying to duplicate the WLED project, but I can envision plenty of use cases where having status indication based on color implemented with a few Neopixels would be very nice. It would be nice even if you limited the number of pixels supported (because of memory constraints).
  • #20
    iprak
    Level 3  
    Sorry but I feel that features should be added based on the presence of a real device and not a dev SDK. Otherwise the testing would be very limited and might lead to overall instability. That Micropython on W600 is practically dead.

    However WS2812 and variants are quite common (at least in ESP world) but this is the first time I have heard it mentioned here.
  • #21
    p.kaczmarek2
    Level 28  
    I am working on more streamlined testing approach which might solve some problems.

    By the way, this device: https://www.elektroda.com/rtvforum/topic3930834.html is using UCS1912S LED driver, which protocol looks like a variation of WS2812 one.
  • #22
    MisterPi
    Level 3  
    iprak wrote:
    Sorry but I feel that features should be added based on the presence of a real device and not a dev SDK. Otherwise the testing would be very limited and might lead to overall instability. That Micropython on W600 is practically dead.


    1) I agree that Micropython on the W600 is dead and no longer maintained.
    2) Not sure what you mean about the dev SDK. I have several W600-Pico devices - real hardware.

    Absolutely, there are lots of devices with WS2812 support (I have several of them running here). If there were interest in adding that support to the OpenBK7231T_App project, that would be interesting. Adding it to just the W600 is not a great Idea unless that chip is used many more places than just the little boards I have.

    You guys are steering the ship here, I just got on board and am interested helping, not in demanding new features.

    And maybe we should make this a thread of its own. Or not. Your call. When I get a chance I'll try flashing one of my W600 boards with your firmware and see what happens.
  • #23
    MisterPi
    Level 3  
    Update: Flashing with the latest (OpenW600_1.15.36.fls) via serial using w600tool.py worked. Had to tinker with the parameters just a tiny bit, but it worked! So cool! Now I can actually do something with these little boards!

    Thanks and hats off!

    W600 TW02 Generic SmartPlug
    W600 TW02 Generic SmartPlug
  • #24
    p.kaczmarek2
    Level 28  
    I'm happy that it worked out, but please remember that OTA works for W600, you just need to setup a tiny HTTP server and feed a link to updated file through old WWW panel (not the "drag and drop" secondary OTA method, that is TODO)
  • #25
    MisterPi
    Level 3  
    Good to be reminded of that, thanks.
    For the next little while my W600 will remain tethered to an Apple product so that's not really an issue yet. I have lots of devices floating around which can spin up a webserver (even another W600-Pico) for that purpose. Right now I am concentrating on how to assign pins to multiple buttons/LEDs and figuring out how PWM can be used.

    I have (happily) noted the rapid development pace of this project. Although I probably can't help with the programming, I'd like to put together a little guide for the W600-Pico so it can be used in black-box projects. They are very cheap (but limited): https://www.aliexpress.us/item/2255800128442697.html
  • #26
    p.kaczmarek2
    Level 28  
    There are many, many ways how you can help without coding. Any guide, teardown of device (even non W600, non Beken, etc, anything) posted in this section is very helpful. You can also post usage guides in the Articles section. Don't forget also that we are working on global devices database here:
    https://openbekeniot.github.io/webapp/devicesList.html
    If you are able to put together some kind of guide, please do.

    PS: Did you know that currently OpenBK also runs on Windows? Even with LittleFS and scripting? That's going to be a great way to allow new users to play around our firmware without getting an IoT device first.
  • #27
    MisterPi
    Level 3  
    A global devices database is a great idea and it was the first place I went on my first visit after seeing this mentioned on Reddit.
    To get my feet wet, I want to see how much I can do with the W600 (because it's what I have).
    One thing I need is to know how to read the pin settings table on the web app. I need the correspondence between the pin table entries 0 thru 15 and the actual pins on the W600 itself.PA0, PA1, PB6-PB18. I understand that things like LEDs and Buttons can have multiple, individually numbered instances (cool) but that Rosetta Stone is the first step to enlightenment. After that comes knowing how to individual inputs and outputs are identified in MQTT. Those two things and I will be off to the races (so to speak).
    W600 TW02 Generic SmartPlug
    As for OpenBK running under Windows - that's great and I'm sure it will help. people. Bit my only Windows machine is my work laptop (locked down). I have other laptops lying around not doing anything, maybe I can re-purpose one of those.