logo elektroda
logo elektroda
X
logo elektroda

Qiachip Smart Switch - BK7231N / CB2S - interior, programming

p.kaczmarek2 64296 288
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #211 20299690
    p.kaczmarek2
    Moderator Smart Home
    Yes it is planned, what exactly format of data do you need, the JSON? Which fields of JSON are you actively using? If just a few, I can add it for you relatively quick, but I need a detailed specs of what you need.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #212 20299866
    ionoleinic
    Level 10  
    For a simple switch i need only: topic = stat/[mqtt_device]/power payload = ON/OFF (not JSON)
    stat/gosund_sp111_1/POWER = ON
    get data for a smart plug with sensor : topic= stat/[mqtt_device]/STATUS8 (STATUS8 is from tasmota but you can put anything you want) and payload JSON format like this:
    stat/gosund_sp111_1/STATUS8 = {"StatusSNS":{"Time":"2022-11-23T21:12:28","ENERGY":{"TotalStartTime":"2022-10-13T16:13:07","Total":4.865,"Yesterday":0.076,"Today":0.077,"Power": 0,"ApparentPower":15,"ReactivePower":15,"Factor":0.01,"Voltage":231,"Current":0.065}}}

    Send req for sensor data of smart plug: topic=cmnd/[mqtt_device]/STATUS payload=8

    And, if you can, i need also connection data like MAC, IP, gateway, etc topic= stat/gosund_sp111_1/STATUS5 payload = JSON
    stat/gosund_sp111_1/STATUS5 = {"StatusNET":{"Hostname":"gosund-sp111","IPAddress":"192.168.0.100","Gateway":"192.168.0.1","Subnetmask":"255.255.255.0","DNSServer1":"192.168.0.1","DNSServer2":"0.0.0.0","Mac":"C4:4F:33:F7:C4:C7","Webserver":2,"HTTP_API":1,"WifiConfig":4,"WifiPower":17.0}}
    Send req for conncection data of smart plug: topic=cmnd/[mqtt_device]/STATUS payload=5

    Thank very much!
  • ADVERTISEMENT
  • #213 20302797
    Ipn00tic
    Level 8  
    Qiachip Smart Switch - BK7231N / CB2S - interior, programming Good afternoon friends

    I'm starting now in the world of the smart home, it's the first time I use these devices and I don't understand much about linux but I learn quickly and I have skills to use a soldering iron.

    I bought the first GIRIER branded 16A smart plug device that came with CB2S chip but I just want devices disconnected from the cloud.

    I read several of your topics and managed to write your firmware in GIRIER which is not listed, I wanted to know where I can share photos of the connections I made successfully and help increase compatibility with your firmware and also get help
  • #214 20302812
    p.kaczmarek2
    Moderator Smart Home
    Thanks @Ipn00tic , would you be also able to provide information where the plug was bought and how it looks like from the outside?
    If you can, you can post a separate topic here, but include more info: https://www.elektroda.com/rtvforum/forum507.html
    Helpful post? Buy me a coffee.
  • #215 20309854
    kajarit
    Level 6  
    kajarit wrote:
    But I couldn't find any info on these commands:
    - startDriver
    - linkTuyaMCUOutputToChannel
    - setChannelType


    Okay, I found info about the bottom two options, and tried several setting but no success, I always got 0 values (there should be a temperature value, a humidity and battery level also somewhere).

    eg:
    backlog startDriver tuyaMCU; startDriver tmSensor; setChannelType 1 ReadOnly; linkTuyaMCUOutputToChannel 1 2 1; setChannelType 2 ReadOnly; linkTuyaMCUOutputToChannel 2 2 2; setChannelType 3 ReadOnly; linkTuyaMCUOutputToChannel 3 2 3; setChannelType 4 ReadOnly; linkTuyaMCUOutputToChannel 4 2 4; setChannelType 5 ReadOnly; linkTuyaMCUOutputToChannel 5 2 5;


    Could you advise how to proceed?
  • #216 20310579
    p.kaczmarek2
    Moderator Smart Home
    @kajarit can you please provide more information, at least tell me, do you see anything in OBK logs, is OBK receiving any TuyaMCU packets? Or maybe check with UART to USB converter, are any TuyaMCU packets at all sent to OBK?

    We recently also had a user on Github and everything worked for him, he just reported that tmSensor is missing a "closing" packet, but apart from that, all data is parsed correctly..
    Helpful post? Buy me a coffee.
  • #217 20317170
    f616
    Level 5  
    Hi,

    I'm new in this forum and I came from Tasmota when I found out that this is the way to CB2S modules.
    I'm in a quest to re-flash the CB2S that came with my new AUBESS Power Monitor Switch.

    I've successfully flashed OpenBK7231N_QIO_1.15.125.bin using python/uartprogram.
    I've also successfully connect to the device AP, and entered the SSID/KEY pair for my WiFi. Here is where I'm having troubles.

    The device connects to one of my hotspots (my mobile hotspot), but it doesn't connect to my Unifi Wireless AP. I have no clue why. Could someone point me out a solution or a way to troubleshoot this?

    Thank you
  • #218 20317221
    p.kaczmarek2
    Moderator Smart Home
    Hello @f616 , can you provide more technical information about both WiFi networks, or at least about the problematic one? Does it broadcast SSID ,what kind of encryption is used, etc?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #219 20317924
    f616
    Level 5  
    p.kaczmarek2 wrote:
    Hello @f616 , can you provide more technical information about both WiFi networks, or at least about the problematic one? Does it broadcast SSID ,what kind of encryption is used, etc?


    I've tested several releases and the issue seems to be common on all:
    OpenBK7231N_QIO_1.15.125.bin
    OpenBK7231N_QIO_1.15.60.bin
    OpenBK7231N_QIO_1.12.103.bin
    OpenBK7231N_QIO_1.11.0.bin
    OpenBK7231N_QIO_1.0.0.bin

    About my WiFi setup, it's a cluster of two UniFi AP-AC-Pro managed by a Unifi Controller.
    - SSID is being broadcasted and have no special chars besides an underscore
    - WiFi Band 2.4GHz only
    - WPA2 (some special chars on the passw like _ and @)
    - DHCP enabled (192.168.100.0/24)
    - WiFi Channel width HT20 (which is the standard) currently on ch11 (and the other AP that is far away it's on ch6)
    - NoMAC Address Filtering

    No special setup as per my understand... I've have around 20 tasmotized devices connected to this network and never had issues.

    Edit:
    Bellow you can find the logs I got from the Unifi AP where c8:47:8c:01:23:45 is the MAC of the BK7231N:

    Sun Dec  4 13:34:12 2022 daemon.info hostapd[2220]: ath0: STA fc:ec:da:8d:29:70 DRIVER: Send AUTH addr=c8:47:8c:01:23:45 status_code=0
    Sun Dec  4 13:34:12 2022 kern.warn kernel: [2431717.610399] ath0: [c8:47:8c:01:23:45] recv auth frame with algorithm 0 seq 1
    Sun Dec  4 13:34:12 2022 daemon.info hostapd[2220]: ath0: STA c8:47:8c:01:23:45 IEEE 802.11: associated
    Sun Dec  4 13:34:12 2022 daemon.info hostapd[2220]: ath0: STA c8:47:8c:01:23:45 WPA: sending 1/4 msg of 4-Way Handshake
    Sun Dec  4 13:34:12 2022 kern.warn kernel: [2431717.616488] ieee80211_update_node_ecm_flags: node with aid 11 and mac c8:47:8c:01:23:45 has been tagged [ dvlan ]
    Sun Dec  4 13:34:12 2022 kern.warn kernel: [2431717.616548] ath0: [c8:47:8c:01:23:45] station associated at aid 11: short preamble, long slot time, QoS, HT20 cap 0x431
    Sun Dec  4 13:34:12 2022 user.info libubnt[3300]: wevent[3300]: wevent.ubnt_custom_event(): EVENT_STA_JOIN ath0: c8:47:8c:01:23:45 / 11
    Sun Dec  4 13:34:12 2022 kern.warn kernel: [2431717.898425] ieee80211_update_node_ecm_flags: node with aid 11 and mac c8:47:8c:01:23:45 has been tagged [ dvlan rate limited ]
    Sun Dec  4 13:34:13 2022 daemon.info hostapd[2220]: ath0: STA c8:47:8c:01:23:45 WPA: sending 1/4 msg of 4-Way Handshake
    Sun Dec  4 13:34:14 2022 daemon.info hostapd[2220]: ath0: STA c8:47:8c:01:23:45 WPA: sending 1/4 msg of 4-Way Handshake
    Sun Dec  4 13:34:15 2022 daemon.info hostapd[2220]: ath0: STA c8:47:8c:01:23:45 WPA: sending 1/4 msg of 4-Way Handshake
    Sun Dec  4 13:34:16 2022 user.info libubnt[3300]: wevent[3300]: wevent.ubnt_custom_event(): EVENT_STA_LEAVE ath0: c8:47:8c:01:23:45 / 11
    Sun Dec  4 13:34:21 2022 daemon.info hostapd[2220]: ath0: STA c8:47:8c:01:23:45 IEEE 802.11: deauthenticated due to local deauth request
    Sun Dec  4 13:34:27 2022 daemon.info stahtd: stahtd[2217]: [STA-TRACKER].stahtd_dump_event(): {"message_type":"STA_ASSOC_TRACKER","auth_delta":"0","mac":"c8:47:8c:01:23:45","wpa_auth_failures":"1","vap":"ath0","auth_ts":"2431717.643499","assoc_delta":"10000","event_type":"failure","assoc_status":"0","event_id":"1"}
    Sun Dec  4 13:34:35 2022 daemon.info stahtd: stahtd[2217]: [STA-TRACKER].stahtd_dump_event(): {"avg_rssi":"-84","dns_resp_seen":"yes","message_type":"STA_ASSOC_TRACKER","mac":"38:8b:59:48:d4:58","vap":"ath3","event_type":"fixup","assoc_status":"0","event_id":"10","arp_reply_gw_seen":"yes"}
    Sun Dec  4 13:34:58 2022 daemon.info stahtd: stahtd[2217]: [STA-TRACKER].stahtd_dump_event(): {"avg_rssi":"-67","dns_resp_seen":"yes","message_type":"STA_ASSOC_TRACKER","mac":"f0:ef:86:24:68:1d","vap":"ath3","event_type":"fixup","assoc_status":"0","event_id":"4","arp_reply_gw_seen":"yes"}
    Sun Dec  4 13:35:08 2022 daemon.info stahtd: stahtd[2217]: [STA-TRACKER].stahtd_dump_event(): {"avg_rssi":"-61","dns_resp_seen":"yes","message_type":"STA_ASSOC_TRACKER","mac":"9c:2e:a1:f4:d6:c9","vap":"ath3","event_type":"fixup","assoc_status":"0","event_id":"1","arp_reply_gw_seen":"yes"}


    Edit 2:
    Updated Unifi Controller from the 7.2.95 to 7.3.76 (last available version). The issue persist, the errors are slightly different but equivalent (I guess).

    
    Sun Dec  4 14:29:54 2022 kern.warn kernel: [2435059.873629] ath0: [c8:47:8c:01:23:45] recv auth frame with algorithm 0 seq 1
    Sun Dec  4 14:29:54 2022 daemon.info hostapd[2220]: ath0: STA fc:ec:da:8d:29:70 DRIVER: Send AUTH addr=c8:47:8c:01:23:45 status_code=0
    Sun Dec  4 14:30:09 2022 daemon.info stahtd: stahtd[2217]: [STA-TRACKER].stahtd_dump_event(): {"message_type":"STA_ASSOC_TRACKER","mac":"c8:47:8c:01:23:45","vap":"ath0","auth_ts":"2435059.906830","auth_failures":"1","event_type":"failure","assoc_status":"0","event_id":"1"}
    Sun Dec  4 14:30:19 2022 daemon.info hostapd[2220]: ath0: STA c8:47:8c:01:23:45 IEEE 802.11: disassociated
    Sun Dec  4 14:42:43 2022 daemon.info hostapd[2220]: ath0: STA fc:ec:da:8d:29:70 DRIVER: Send AUTH addr=c8:47:8c:01:23:45 status_code=0
    Sun Dec  4 14:42:43 2022 kern.warn kernel: [2435829.277311] ath0: [c8:47:8c:01:23:45] recv auth frame with algorithm 0 seq 1
    Sun Dec  4 14:42:58 2022 daemon.info stahtd: stahtd[2217]: [STA-TRACKER].stahtd_dump_event(): {"message_type":"STA_ASSOC_TRACKER","mac":"c8:47:8c:01:23:45","vap":"ath0","auth_ts":"2435829.310535","auth_failures":"1","event_type":"failure","assoc_status":"0","event_id":"1"}
    Sun Dec  4 14:43:06 2022 daemon.info hostapd[2220]: ath0: STA c8:47:8c:01:23:45 IEEE 802.11: disassociated
    
  • #220 20334235
    nemec23041990
    Level 4  
    Qiachip Smart Switch - BK7231N / CB2S - interior, programming Qiachip Smart Switch - BK7231N / CB2S - interior, programming приветствую. удалось прошить температурный датчик на CB3S, подскажите как извлечь информацию о температуре? Qiachip Smart Switch - BK7231N / CB2S - interior, programming Qiachip Smart Switch - BK7231N / CB2S - interior, programming Qiachip Smart Switch - BK7231N / CB2S - interior, programming Qiachip Smart Switch - BK7231N / CB2S - interior, programming
  • #221 20334252
    p.kaczmarek2
    Moderator Smart Home
    Hello @nemec23041990 , can you provide more information about your device? What kind of sensor? Is it a TuyaMCU one?

    This might be slightly related - TuyaMCU Motion Sensor configuration: https://www.elektroda.com/rtvforum/topic3937723.html


    EDIT: You need to find dpID for temperature now.

    dpID may be 1, or 2, or 3, idk. You need to check logs.
    Then:
    
    startDriver TuyaMCU
    startDriver tmSensor
    setChannelType 1 readonly
    // link dpid to channel 1
    linkTuyaMCUOutputToChannel 1 val 1
    


    Note that you should disconnect power wire from 3.3V pad of CB3S. Your device is a low-power battery powered device. TuyaMCU takes control of CB3S power is will turn it off most of the time.
    Helpful post? Buy me a coffee.
  • #222 20334263
    nemec23041990
    Level 4  
    chip UNICMICRO UM8005
    http://www.gztrchip.com/uploadfile/file/20210811/1628649277678726.pdf
    его можно прошить?
    датчик
    http://sensylink.com/a/products/lm2/CHT8305.html
    Qiachip Smart Switch - BK7231N / CB2S - interior, programming
    Quote:
    dpID может быть 1, 2 или 3, idk. Вам нужно проверить журналы.

    можно подробнее?
    как указать rx tx?
    возможно подключить сторонний датчик dht11?
  • #223 20334483
    dzidziaka1
    Level 11  
    Hello.
    I have a similar experience with two Aubees 20A.
    Six flashed with version 1.12.44 and then via OTA to 1.15.176.
    The MAC of the two problematic ones has changed to C8:47:8C:00:00:00 and they do not connect to the router. Its logs show attempts to connect but are disconnected. Over and over again. Router reset.
    What I did on one:
    Uploading 1.0.0, 1.10.4, 1.12.44, 1.15.176 without changes.
    I padded 1.10.4 with zeros up to 2Mb with no changes.
    What else can I try?
    What could be the reason that I achieved different results with the same flashing procedure? (maybe I did something wrong?)

    Regards
  • #224 20334533
    p.kaczmarek2
    Moderator Smart Home
    You padded with zeros, so you deleted the MAC partition - that`s logical.

    The router will always disconnect devices if you have two with the same MAC.

    According to the FAQ:
    Qiachip Smart Switch - BK7231N / CB2S - interior, programming
    Use the "Restore RF Config" tool in the OpenBeken application panel and you will get a new MAC address.
    Qiachip Smart Switch - BK7231N / CB2S - interior, programming
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #225 20334543
    dzidziaka1
    Level 11  
    I`m only testing one enabled device.
    I can`t access the panel because it doesn`t connect to the router. And that`s the problem :) .
    I`ll give him another router soon, maybe something will change.
    What is the most correct way to wipe the device and upload the firmware?
  • #226 20334576
    p.kaczmarek2
    Moderator Smart Home
    It does not connect to the router because there is already one with this MAC in the network. You have wiped two devices and both now have the same MAC.
    Turn off one, repair it, then reset the router, turn on the other and repair it too.

    Option 2: if by some miracle the problem still persists, perform 5 power on/off cycles, then the device temporarily returns to AP mode, in which there will be an "Exit safe mode" button (unless you have an too old version?) and activates the Web Application and allows you to run it and from there perform Restore RF Config.

    I haven`t heard of a situation where the device wouldn`t connect at all for a reason other than what I wrote at the beginning, if you seriously have such a problem, it must be something new...
    Helpful post? Buy me a coffee.
  • #227 20334646
    dzidziaka1
    Level 11  
    I only do this with this one on all the time.
    I flashed 1.15.176, connected in AP mode, pressed Exit Safe Mode, waited, pressed again, Exit Safe Mode disappeared. When I press Launch Web Application, a white page appears 192.168.4.1/app? and stands alone.
    Interestingly, in AP mode, when I search for the network, bushes appear as in the attached picture.
    BK7231N downed? Maybe it has an impact that I test with a direct power supply connected? (Well, the actors had no problem with it :) )

    Qiachip Smart Switch - BK7231N / CB2S - interior, programming
  • #228 20334753
    p.kaczmarek2
    Moderator Smart Home
    Web The application is downloaded from the Internet on an ongoing basis. Maybe in AP mode you don`t have a second internet connection (e.g. via cable) like me and it doesn`t load for you?

    Both the Web Application (WiFi connected to the OpenBeken AP, Ethernet cable to the router) and network scanning work for me.



    Does WiFi scanning not work on all your devices? Or maybe, for example, I don`t know, you click "Search" three times and that`s why there are bushes? This is the first time I see this, try to diagnose more and we will fix it.
    Helpful post? Buy me a coffee.
  • #229 20334822
    dzidziaka1
    Level 11  
    I`m not thinking about something today.
    You are right, how should the application be loaded when I am connected to the AP socket and I do not have any other Internet connection :)
    I only press once.
    There is some light. When I turn off Rel on P26, the socket connects to the router.
    Maybe when the 3.3 power supply is taken by the USB programmer, the relay wants to turn on and the voltage drops.
    I turned off the P26, plugged the socket into the 220, it connected, turned on the P26, restarted. Disconnection in the router logs :) .
    Maybe when the relay was turned on with power from 3.3, one of the elements on the board was damaged?
    It`s not a problem, I can try to check.
    I keep going.
  • #230 20334926
    p.kaczmarek2
    Moderator Smart Home
    Do problems occur even when you power the socket from your own 3.3V source (or 5V there, if you connect it before the LDO on the board)?
    Helpful post? Buy me a coffee.
  • #231 20334962
    dzidziaka1
    Level 11  
    I use 3.3 from the programmer connected to the USB hub.
    I just added a 2A power supply to this hub.
    It`s the same.
    I keep digging.
  • #232 20335041
    p.kaczmarek2
    Moderator Smart Home
    But I`ll ask anyway... are the capacitors OK on the board?
    How to fix a smart device that is chirping, squeaking and making strange sounds?
    Helpful post? Buy me a coffee.
  • #233 20335046
    dzidziaka1
    Level 11  
    The new sockets arrived yesterday :)
    I can desolder the capacitors and check them :)
  • #235 20336000
    dzidziaka1
    Level 11  
    Two broken sockets brought back to life.
    What I did:
    Dump all memory from a working socket.
    Uploading this dump to a non-working one.
    After that, the socket starts in AP mode in which I changed the MAC.
    Using the Restore RF Config option causes the socket to be re-bricked, which the application warns about.
    In this case, entering AP mode does not help. The socket is unstable, it is difficult to connect to it, I only connected via mobile phone (win 10 and linux on VM with three different wifi cards)
  • #236 20354093
    Lesnoi
    Level 6  
    Good afternoon. The MK601 device cannot find contacts to control the relay. Pin 26 is a button. 24 pins are still suitable for the board, but if you put a relay on it, the relay does not respond. Also sometimes the device reboots.
  • #237 20354156
    p.kaczmarek2
    Moderator Smart Home
    Hello @alexander21041995
    What kind of device do you have? MK601 looks like the one for toggle switch, so maybe instead of "Button" role you should "TglChannelOnToggle" role? I am not sure if I understand you...

    If your device reboots, can you try adding "PowerSave" command to short startup command? I am asking because those tiny relay modules sometimes have a very weak power supplies and running device in power saving mode wouldn't hurt. I already had similar problem and "powerSave" fixed that. Check and tell us if it still reboots.
    Helpful post? Buy me a coffee.
  • #238 20357196
    Lesnoi
    Level 6  
    Can you tell me where to enter the "PowerSave" command? It seems the board is heating up and after that it starts to reboot. Yes device MK601
  • #239 20357216
    p.kaczmarek2
    Moderator Smart Home
    PowerSave command needs to be executed after device reboot. The PowerSave is not remembered, so there are two options for you.
    Option 1. Enter in Options->Short Startup Command (then reboot):
    Qiachip Smart Switch - BK7231N / CB2S - interior, programming
    BTW - look at the uptime! My device runs for 33 days and still stable!
    Option 2: On Web Application, create autoexec.bat:
    Qiachip Smart Switch - BK7231N / CB2S - interior, programming
    Enter command, save, and reboot (or just run should also work):
    Qiachip Smart Switch - BK7231N / CB2S - interior, programming

    NOTE: Currently, PowerSave doesn't like keeping the HTTP page open in your browser! If you leave our HTTP page - that features autorefreshing - open in your web browser, then device will not sleep much

    We are still improving it. Things are relatively hard here because there are no docs for Beken chips. It's not like ESP, where you get thousands of examples in Google.
    Helpful post? Buy me a coffee.
  • #240 20357375
    spin55
    Level 17  
    Hello. In my case the configuration of MK601 SMART SWICHT is:
    P26 --> LEDs
    P6 --> Relay
    P7 --> Btn
    P10--> Btn_n (S2)
    regards

Topic summary

The discussion revolves around the Qiachip Smart Switch utilizing the BK7231N chip and the CB2S module, focusing on programming, firmware flashing, and integration with Home Assistant. Users share experiences with flashing the device using various tools like hid_download_py and uartprogram, troubleshooting issues such as connection problems, firmware compatibility, and device reboots. Key challenges include configuring WiFi settings, handling relay operations, and ensuring stable operation with different firmware versions. The community provides insights on soldering techniques, pin configurations, and the importance of power supply stability. Additionally, there are discussions about integrating DHT sensors and the need for improved firmware features.
Summary generated by the language model.
ADVERTISEMENT