logo elektroda
logo elektroda
X
logo elektroda

[BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering

valeklubomir 11715 49
ADVERTISEMENT
  • DIN Rail WiFi switch from aliexpress

    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering
    Chipset BK7231N module model CBU
    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering
    EDIT: Power metering uses BL0942 chip.

    Pin Assignments:
    P9 - RELAY Status LED
    P15 - Wifi LED
    P17 - Button
    P24 - Bridge FORWARD
    P26 - Bridge REVERSE

    Switch uses Magnetic Polarized Relay:
    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering
    This relay must be driven with bridge driver.
    Forward direction closes contact, Reserve direction opens contact.
    Relay need to be powered only for changing contact position.
    Pulse from length 100-200 ms is requirred to change position.
    Then relay holds last position without power.
    Relay Driver IC MD7620 (Shanghai-Mingda-Microelectronics)
    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering
    Operation modes:
    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering

    Firmware:
    https://github.com/openshwprojects/OpenBK7231T_App

    The firmware do not support the bridge driver MD7620 yet, but the work is in progress.

    Cool? Ranking DIY
    About Author
    valeklubomir
    Level 5  
    Offline 
    valeklubomir wrote 5 posts with rating 13. Been with us since 2022 year.
  • ADVERTISEMENT
  • #2 20293546
    gulson
    System Administrator
    Thank you so much presentation! I would like to send you free elektroda.com gadgets, could you provide your address in the Private Message?
  • #3 20434120
    maxcoff
    Level 1  
    "The firmware do not support the bridge driver MD7620 yet, but the work is in progress."

    Hi! Any screw?
  • #4 20434291
    p.kaczmarek2
    Moderator Smart Home
    I think @valeklubomir has it implemented on his branch, but the pull request wasn't created yet.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 20435098
    p.kaczmarek2
    Moderator Smart Home
    Valek submitted PR, driver will be added today! Thank you!
    Helpful post? Buy me a coffee.
  • #6 20448000
    thealphahelix
    Level 2  
    Hey, I'm new to the forums and I have one of these I'm trying to configure.

    I've flashed the firmware over and it's working fine, but I'm now trying to work out the pin configuration... Is there a procedure for this? I've used the above information to get the LED correct and operating on the button press. I've not reconstructed the unit to see if the relay is closing (needs 12v I assume that's provided by the mains power!) but I assume that will be working by setting 24 and 26 to BridgeFWD and BridgeREV respectively.

    Do I just work out pin configurations, or is there more code to add somewhere? Sorry for the questions!
  • #7 20448030
    valeklubomir
    Level 5  
    Hello

    For the basic functionality it is enough just to setup pins. Bridge driver will start automatically after reboot.
    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering
    BridgeFWD and BridgeREV must be paired with channel ID. If device with multiple relays would apear, then multiple pair of FWD/REV could be defined.
    So button/LED/FWD/REV must have same Channel ID.
    It will behave as normal RELAY. Same functionality in MQTT or HomeAssistant.
    I also activated startup command for using BL0942 energy monitor, if installed. There is also version without energy monitor.

    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering

    Every other setup option should follow common rules.

    Lubomir
  • #8 20449950
    thealphahelix
    Level 2  
    Heroic! Thanks so much, I got this working today :) I can't believe how smooth this process was.
  • #9 20449965
    p.kaczmarek2
    Moderator Smart Home
    Valek did very good job with the driver.

    Btw @thealphahelix , have you tried "startDriver SSDP"? Device will show up in Windows:
    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering
    btw2 - my bulbs has now almost 90 days uptime!
    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering
    Helpful post? Buy me a coffee.
  • #10 20454318
    thealphahelix
    Level 2  
    >>20449965
    What? That's awesome! I'll be trying that too :)

    Thanks so much for the platform and all the help.
  • ADVERTISEMENT
  • #12 20474627
    p.kaczmarek2
    Moderator Smart Home
    You have attached images incorrectly. External links will expire over time. Please use our image hosting. I have already fixed your post, but keep it in mind.

    Why do you have a Rel_n configured?

    Are you sure that your device is also using P24 and P26 for bridge?
    Helpful post? Buy me a coffee.
  • #13 20474690
    romanfarki
    Level 6  
    i will only let know what was my problem :
    i solved it right now

    be desoldering the chip i have brake P24 pad
    also i connected it now - i have change to

    P6 (PWM0) it was near and soldered with thin cable to the route where come from relay output

    here som pictures from work

    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering


    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering

    Added after 4 [minutes]:

    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering

    Added after 13 [minutes]:

    why i dont have more reading there ?

    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering

    ON
    BL0942 Voltage=244.916381, Current=0.172250, Power=0.000000, Total Consumption=0.0 Wh (changes sent 34, skipped 570, saved 4)

    now is 75W bulb attatched on Load
  • #14 20474843
    p.kaczmarek2
    Moderator Smart Home
    What kind of desoldering method did you use?

    We will be publishing a hot air tutorial for IoT hacking soon. Please subscribe to our channel so you can see how to easily desolder the module.
    https://www.youtube.com/@elektrodacom
    Helpful post? Buy me a coffee.
  • #15 20474943
    romanfarki
    Level 6  
    i have used a hot gun, but not much practice, like you see :)

    now is second done, but why the programer needs 100 atempts to write sucesfully ?
    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering

    Added after 10 [minutes]:


    /startup_command

    backlog startDriver BL0942; SetupEnergyStats 1 30 120 0; startDriver NTP; ntp_timeZoneOfs 1; startDriver SSDP;
  • #16 20475031
    p.kaczmarek2
    Moderator Smart Home
    What kind of USB to UART converter do you have? For me it works good.

    Maybe not enough flux when soldering? Did you first add Pb solder to make joints melting point lower?
    Helpful post? Buy me a coffee.
  • #17 20475051
    romanfarki
    Level 6  
    i use this one

    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering

    no i used only gun temperature 330 Celsius

    but second i have make on board , i solder there only 5 wires _ RX,TX,VCC,GND and CEN to reboot
  • #18 20475093
    p.kaczmarek2
    Moderator Smart Home
    I don't know this board, it may be low quality or something, or more sensitive to noise.

    Using just hot gun for desoldering makes the job very hard. I think you should first apply flux, then apply Pb solder to each joints (with a simple soldering iron) to lower their melting temperature, the again add a bit more flux, and then, finally, you can use hot air gun to heat up the joints.

    Thanks to this method, the joints will be weaker and it will be easier to desolder the module.

    If you have access, you can also use a trick method without hot air, like that:



    but it can be risky.
    Helpful post? Buy me a coffee.
  • #19 20475897
    thealphahelix
    Level 2  
    To check in on this thread, we had an issue where the module kept turning itself off - not sure what was causing that. We were using it to run a solar inverter output through to measure it, so that may be the problem overall - I think in some cases it was being asked to measure negative current... Issue with that was that every time it dropped it was turning the output of the panels off, so not helpful! I think we'll try it on a more conventional circuit.

    As for the above - I didn't desolder the whole module, I put dupont wires on with minimal solder to get connection. Was a bit hard but it worked ok!
  • ADVERTISEMENT
  • #20 20476333
    romanfarki
    Level 6  
    today i have flashed 2 more cb2s chips
    but not work on first time at all

    see picture :) [img-0] [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering

    Added after 13 [minutes]:

    Strange
    Sometimes write in 5 min sometimes 30 min..

    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering
  • #22 20476727
    romanfarki
    Level 6  
    I tried every one but only the middle work 921600
    backup work well in 1or two attempts
    but write - horror
    today I recorded about 10 cb2s to switch 16Amp
    but I spent 5 hours on it... well, I don't know, maybe it will be my flasher

    Thanks for help.
    I am ready
  • #23 20476735
    p.kaczmarek2
    Moderator Smart Home
    Well @romanfarki, as said in readme, maybe just try using hid_download_py?
    https://github.com/OpenBekenIOT/hid_download_py/
    Usage is on this video:


    Helpful post? Buy me a coffee.
  • #24 20598968
    rschaa
    Level 4  
    >>20288620

    many many thanks for your work

    could you change the title of this thread?

    from "TO-Q-SV1" to "TO-Q-SY1"

    its better to google :-)
  • #25 20599047
    p.kaczmarek2
    Moderator Smart Home
    So there was a typo? Well, thank you! I didn't notice that.

    By the way, here are OBK docs:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/README.md

    Please let me know if there is anything else I can do for you.
    Helpful post? Buy me a coffee.
  • #26 20670966
    przemsi_ele
    Level 11  
    I flash the CBU Wi-Fi TONGOU TO-Q-SY1-JWT without soldering and it worked. i only added 4 wires , CEN't use, in debian hid_download_py-master/uartprogram enter and turn on 3V3 and flies....
    As I downloaded the template in obk (http......./?app), the pins were set to rel and rel_n making the relay coil energized all the time and heated up a lot which gave me a thought, I changed to H bridge as below:

    "24": "BridgeFWD;1",
    "26": "BridgeREV;1"

    and now it is ok

    only this template name was missing some letter and maybe it was a template for another type
    my code: TO-Q-SY1-JWT 63
    and this template https://www.elektroda.com/rtvforum/download.php?id=1189399 has pins 24 and 26 for my case wrongly set are Rel and they are supposed to be bridge , because the relay controlled by H bridge
    with me the relay coil has 5V DC and here in the pictures above I see 12 VDC

    maybe they are the same but different device ? or maybe the description needs to be made up ?

    I analyzed the photos and I have a slightly different model, the board with the button I have soldered in a different way, above in the photo there are 3 solder fields on one side and 2 solder fields on the opposite side, and in my case 3 solder fields are in one place on the board and another 2 places in another place on the board :)
    buttered butter


    edits because the device is similar, pins are the same, only the design of the board is different
    [BK7231N - CBU] TONGOU TO-Q-SY1-JWT Din Rail Wifi Switch with power metering

    This model has a 12V coil , tuya was running fine, I uploaded openbk and now when switching the relay CBU restarts, the LED flashes and connects to the wifi.
    As I disconnect the relay the device continues to work without rebooting.
    Maybe I did something wrong
  • #27 20797944
    hapklaar
    Level 1  
    I have one of these devices and would like to flash OpenBK7231T on it. I wasn't able to find a flashing guide for the CBU module.

    Can anyone guide me to get this flashed without removing the module from the PCB if possible?

    I've flashed a lot of devices with Tasmota, so should be able to get this done with some guidance :)
  • #28 20797962
    p.kaczmarek2
    Moderator Smart Home
    @hapklaar it's just like with Tasmota - you can flash it without removing module as long as TX/RX is not used for some other purpose on the board.

    You can flash CBU just like CB3S, CB2S, it's BK7231N.

    You can check out these guides:



    Older method:




    Our new flasher:
    https://github.com/openshwprojects/BK7231GUIFlashTool

    Feel free to ask if you have any questions.
    Helpful post? Buy me a coffee.
  • #29 20862225
    Osrx
    Level 5  
    Hello!

    Seems I found a great problem with this firmware settings and how it works with bridge relay.
    In the first message in this thread was attached a diagram, how bridge Driver should be controlled:
    Diagram for controlling a bridge driver with 100 ms pulse timing.
    And there clearly showed that it controlled by impulses about 100ms.
    But in yours implementation bridge relay controlled by continuous power.
    This is a reason of ac-dc adapter and bridge driver itself is hardly overload and it's become VERY hot. This is extremely dangerous as for relay components so for environment!!! I show not the maximum temperature, it's continue to grow up.
    A thermometer showing 65.6°C next to an open casing with electronic components.

    Can you please update configuration for firmware to fix this issue? Thank you!

    PS: May be I'm doing something wrong?
  • #30 20862267
    p.kaczmarek2
    Moderator Smart Home
    Thank you reporting the issue. The bridge driver was created by Valek and I am not sure if he's active these days, @valeklubomir , are you online?
    If he's not, then we will have to fix the issue ourselves.

    So, are you saying that one of the relay coils is left on forever? This is strange, because judging from the code, it seems that both pins are set to 0 when time is out:
    Snippet of C code related to the operation of a bridge driver.
    Or maybe I have misunderstood you, I haven't analyzed the working principle of this bridge controller yet.
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around the TONGOU TO-Q-SY1-JWT DIN Rail WiFi switch, which utilizes the BK7231N chipset and incorporates a BL0942 chip for power metering. Users share experiences with firmware flashing, pin configuration, and relay operation. Key issues include the relay not switching correctly, overheating due to incorrect configurations, and the need for proper driver implementation. Solutions involve adjusting pin assignments to use BridgeFWD and BridgeREV instead of Rel and Rel_n, ensuring the bridge driver starts automatically, and calibrating power measurements. Users also discuss desoldering techniques and the challenges faced during the flashing process.
Summary generated by the language model.
ADVERTISEMENT