logo elektroda
logo elektroda
X
logo elektroda

[BK7231N+BL0942] DIY Smart Mini Switch - WBP-1G - configuration, pinout, program

piratee 10743 37
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20493074
    piratee
    Level 13  
    [BK7231N+BL0942] DIY Smart Mini Switch - WBP-1G - configuration, pinout, program Hello forum.
    On Ali I bought a DIY Smart Mini Switch with energy measurement. I initially drew the pins for programming. Has anyone ever used such a device. (In Smart Live seen as WBP-1G. [BK7231N+BL0942] DIY Smart Mini Switch - WBP-1G - configuration, pinout, program

    Regards
  • ADVERTISEMENT
  • #2 20493204
    p.kaczmarek2
    Moderator Smart Home
    Indeed, it seems that the pads are marked correctly. Can you also attach a 2MB dump from this device and its IO configuration later?
    [BK7231N+BL0942] DIY Smart Mini Switch - WBP-1G - configuration, pinout, program
    Helpful post? Buy me a coffee.
  • #5 20495529
    piratee
    Level 13  
    Hello
    This is how I read under windows:
    python uartprogram switch_measurement1.bin -d com1 -r
    I'm syntactically bad?
  • #6 20495547
    p.kaczmarek2
    Moderator Smart Home
    Since Windows, maybe it's better to use a new solution?
    https://github.com/openshwprojects/BK7231GUIFlashTool
    Have you checked if our new program works for you?

    Your syntax is incomplete, the 2MB length is missing. In bkWriter:
    [BK7231N+BL0942] DIY Smart Mini Switch - WBP-1G - configuration, pinout, program
    In uartprogram/hid_download_py:
    
    -l 0x200000
    
    Helpful post? Buy me a coffee.
  • #8 20495725
    p.kaczmarek2
    Moderator Smart Home
    Thank you. By the way, you didn't write anything unless this is version N BK7231. In such a situation, the command for uartprogram would also require unprotect and offset 0x0, as in the video with the LED lamp:
    https://www.youtube.com/watch?v=2e1SUQNMrgY
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #9 20495935
    piratee
    Level 13  
    Yes this is the bk7231n version
    I will read it again when I have time. But it is read by the program to which the link was given. I didn't see those options there.
    Regards
  • #10 20495963
    p.kaczmarek2
    Moderator Smart Home
    No, we didn't understand each other. The reading from my Flasher from the GUI is correct. He does all the settings himself, he is user-friendly.
    I just wrote that in the case of uartprogram you would misread.

    In addition, we obtained the pin configuration from this firmware, here it is:
    - Relay - P7
    - Button - P23
    - ToggleChannelOnToggle - P6
    - WiFiLED - P26
    In addition, I have the impression that I see BL0942 there (also in the picture, it has 10 legs). It is normally on the UART1 port, i.e. on P10 and P11.
    Does this configuration work for you?

    Due to the fact that the configuration of this device is almost complete, I separate these posts into a separate section.
    Helpful post? Buy me a coffee.
  • #11 20495992
    piratee
    Level 13  
    Oh and I learned something again, is it already uploading your software or something else needs to be done.
    (yes there is BL0942) [BK7231N+BL0942] DIY Smart Mini Switch - WBP-1G - configuration, pinout, program
    Regards
  • ADVERTISEMENT
  • #12 20496001
    p.kaczmarek2
    Moderator Smart Home
    I think we have everything we need. Ew. as a rule, you could give a picture of the housing from the outside, so that I would have something to display on our list:
    https://openbekeniot.github.io/webapp/devicesList.html
    Did you know it's already calibrating via Web Application? There are fields for this, there is a ready form, you don't have to do it with commands anymore.
    Helpful post? Buy me a coffee.
  • #13 20496013
    piratee
    Level 13  
    Somewhere recently on the HA group they wrote whether there is an option to transfer IP using MQTT.
    This is actually sometimes needed information.
    I will send a photo when I reprogram and desolder the wires.
    Regards
  • #14 20496024
    p.kaczmarek2
    Moderator Smart Home
    It seems to me that at this moment our IP is published at the start. You can also read it in our readme.
    https://github.com/openshwprojects/OpenBK7231T_App
    [BK7231N+BL0942] DIY Smart Mini Switch - WBP-1G - configuration, pinout, program
    Recently, we have slimmed down the readme and separated documentation for JSONs and automatically generated MDs, which can be found here:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/README.md
    (yes, also readme in the name, but it's a different readme)

    In general, if you have any questions, I recommend looking at the readme and the documentation, there are things described there, there is even a FAQ:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/faq.md
    Helpful post? Buy me a coffee.
  • #15 20496386
    piratee
    Level 13  
    I have bad luck.
    Despite the lack of a short circuit, the mini switch shorted me.
    I will not check other settings.
    I will probably order a second one that cannot be soldered because the paths at bk7231n have evaporated
    Photo of the mini switch [BK7231N+BL0942] DIY Smart Mini Switch - WBP-1G - configuration, pinout, program
  • #16 20496545
    p.kaczmarek2
    Moderator Smart Home
    What exactly happened? Could you give pictures? How bad is it?
    Helpful post? Buy me a coffee.
  • #17 20496570
    piratee
    Level 13  
    I uploaded the latest openbeken software. I connected to my phone via wifi. I entered my network and rebooted. I did not want to log in to the network several times and restarted the software twice. Nothing helped no openbeken web server and no device connected to the router. Everything was powered from the usb converter. If it didn't work, I turned off the 3.3V from the converter and connected 230V and uploaded the soft again. And sparks flew. It burned the mini switch and the converter.
    Ps
    I ordered a second one :)

    [BK7231N+BL0942] DIY Smart Mini Switch - WBP-1G - configuration, pinout, program
  • #18 20504131
    p.kaczmarek2
    Moderator Smart Home
    It's deadly dangerous! The computer could also be damaged. Please do not connect the programmed devices to the network! These circuits have no galvanic separation! Even the flasher manual says this:
    https://github.com/openshwprojects/BK7231GUIFlashTool

    Instead of connecting to the network, it's better to connect TXD2 to read the boot log from the device on baud 115200. This means that the device will not be able to stand up, but I'm talking about the future.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #19 20504139
    piratee
    Level 13  
    I know it's dangerous - because high voltage.
    I am constantly aware of the fact that sometimes I happen to be at voltages higher than 230V.
    But yes - next time I will not connect simultaneously from two power supplies.
    Regards
    Ps.
    The second module is already flying from ali.
  • #20 20504147
    p.kaczmarek2
    Moderator Smart Home
    With the new module, also do a 2MB dump, put it here, and I will try to help you run it step by step and possibly diagnose the problem if something is wrong. How much did you pay for a new one?
    Helpful post? Buy me a coffee.
  • #22 20521756
    p.kaczmarek2
    Moderator Smart Home
    Hello again, based on the attached 2MB firmware dump, I am able to suggest the following configuration:
    - BL0942 on UART1 (standard)
    - WiFi LED on P8
    - Relay on P26
    - Pairing button on P23
    - TglChannelOnToggle on P24 (external switch)
    For verification.

    By the way, our user @Digga from USA is looking for something with BL0942. Give a link to where you bought it, or maybe even send him a PM.
    Helpful post? Buy me a coffee.
  • #23 20521865
    piratee
    Level 13  
    As usual shopping on Ali
    PLN 9.14 55% OFF | AUBESS Tuya Smart Circuit Breaker 16A WiFi Smart Switch Support 2-Way Power Control Monitor Energy Saving Light Switch Module 110V 240V
    https://a.aliexpress.com/_EjIMLoT
  • #24 20521878
    p.kaczmarek2
    Moderator Smart Home
    The link you gave is a product for PLN 9 and shipping for PLN 30. In total, PLN 40 is quite a lot. I think something's wrong.

    If I click on another sub-offer from the linked offer, I get PLN 22 with free shipping.

    But I will not order, I already have some of my gadgets and recently I've only been uploading the firmware at the request of readers for what they send me.
    Helpful post? Buy me a coffee.
  • #25 20521909
    piratee
    Level 13  
    I bought for PLN 22.60 when there was a promotion.
    (I posted a link from my purchases)
    What is the shortcut - pairing button on P23
    It's also cool, without soldering, I connected to 3.3V, GND, RX, TX and programmed it without soldering the entire board.

    Added after 14 [minutes]:

    So I quickly checked:
    - switching on the relay with contacts S1-S2 works
    - switching on the relay with the Btn button (pairing) works
    - the WiFi diode works at the start of the Switch
    - switching on the relay from the application works
    I'll check the energy meter tomorrow.
    (I uploaded the latest version 1.15.643)


    Ps.
    Is it difficult to earn extra money in the application?

    Regards
  • #26 20521992
    Digga
    Level 9  
    Thanks for the link! I'm actually from Germany, your neighbor :)
  • #27 20522035
    p.kaczmarek2
    Moderator Smart Home
    It's still very cheap. Weren't there any more payments?

    Pairing button in original firmware. You can just set the Button role.

    Added after 17 [seconds]:

    Do you need the ability to set up two networks on OBK? one spare?
    Helpful post? Buy me a coffee.
  • #28 20522075
    piratee
    Level 13  
    The buttons are ok.
    The voltage measurement is already working, tomorrow I will check the power and energy.

    Yes, sometimes I need two networks.
    Because I take the device to the plot or to work and then I could set it without resetting.

    Will the power and cos parameters be published by MQTT with BL0942 (so far I have not scrolled anywhere in the logs)

    Apparent Power 0.0VA
    Reactive Power 0.0 var
    Power Factor nan
    Ps.
    Is P23 (ADC3) the same as ADC by. description to the plate soldered vertically?
  • #29 20522089
    p.kaczmarek2
    Moderator Smart Home
    Nad nowymi parametrami pomiarów pracuje @Digga , ale na ten moment chyba nie są one gotowe.

    ADC to jest to samo co ADC3 (P23). Poniżej masz pinout CB2S:
    [BK7231N+BL0942] DIY Smart Mini Switch - WBP-1G - configuration, pinout, program
    Pin number Symbol I/O type Function
    1 3V3 P Power supply 3V3
    2 P6 I/O Support hardware PWM and correspond to P6 of the IC
    3 GND P Power supply reference ground
    4 P7 I/O Support hardware PWM and correspond to P7 of the IC
    5 RX1 I/O UART_RX1, which is used for receiving user data and corresponds to P10 of the IC. Do not pull it up. By default, the MCU serial port should be in low-level or high-impedance state.
    6 P8 I/O Support hardware PWM and correspond to P8 of the IC
    7 TX1 I/O UART_TX1, which is used for transmitting user data and corresponds to P11 of the IC. Do not pull it up. By default, the MCU serial port should be in low-level or high-impedance state.
    8 ADC I/O ADC, which corresponds to P23 of the IC
    9 P24 I/O Support hardware PWM and correspond to P24 of the IC
    10 CEN I/O Reset pin
    11 P26 I/O Support hardware PWM and correspond to P26 of the IC
    Test point RX2 I/O UART_RX2, which corresponds to P1 of the IC. This pin is not allowed to use.
    Test point TX2 I/O UART_TX2, which is used for outputting logs and corresponds to P0 of the IC
    Test point CSN I/O Mode selection pin. If it is connected to the ground before being powered on, enter the firmware test mode. If it is not connected or connected to VCC before being powered on, enter the firmware application mode. It corresponds to P21 of the IC.
    Helpful post? Buy me a coffee.
  • #30 20522111
    piratee
    Level 13  
    That's what I guessed with this P23, to spite me, I have a socket with BL0942 that I would like to have @Digga
    Regards

Topic summary

The discussion revolves around the DIY Smart Mini Switch identified as WBP-1G, which features energy measurement capabilities. Users share insights on programming the device, including pin configurations and firmware reading techniques. The BK7231N chip is confirmed to be in use, with suggestions for using specific software tools like BK7231GUIFlashTool and uartprogram for firmware management. Users discuss the pinout for the BL0942 energy measurement chip, troubleshooting issues related to device connections, and the importance of proper voltage handling to avoid damage. The conversation also touches on MQTT integration for IP transfer and the functionality of the energy meter. A new version of the switch with a different design is introduced, and users share their experiences with the device's performance and configuration.
Summary generated by the language model.
ADVERTISEMENT