logo elektroda
logo elektroda
X
logo elektroda

Using CH341A Programmer for BK7231N/CB3S Door/Window Sensor PB-69W VER 1.3: UART & OpenBK7231N_QIO

nihildiximus 6936 40
Best answers LABEL_AI_GENERATED

Why does my BK7231N/CB3S door sensor only wake from deep sleep when it was asleep with the reed open, and how do I make wake-up work in the closed state too?

Set the wake-up edge to match the sensor’s idle level before sleep: the working fix was `DSEdge 1` for the low-level wake-up case, and another user later confirmed that this solved the same problem for them [#20542881][#20826289] For the original reed-switch wiring, the working combination was `DoorSnsrWSleep_nPup` with a forced edge of `0`; for a direct GPIO-to-GND test setup, `DoorSnsrWSleep` with a forced edge of `1` was needed [#20542881] The issue was that the sensor must wake on the same state it will be in after deep sleep, otherwise opening/closing the reed does not generate the expected wake event [#20542881] If you need to set multiple startup commands, use Tasmota-style `backlog ...; ...;` syntax rather than separating commands with plain semicolons [#20543214]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • ADVERTISEMENT
  • #32 20546793
    Adi13089
    Level 11  
    Posts: 22
    Rate: 4
    I am using the OpenBK7231N_QIO_1.15.699.bin software and I do not have the Configure IP option in the WEB GUI
  • ADVERTISEMENT
  • #33 20546801
    nihildiximus
    Level 9  
    Posts: 32
    Help: 1
    Rate: 23
    You need a newer FW for this sensor. Go to "Launch web application" → "OTA" → "Select remote OTA file to download to PC", rip the latest 1.17.10.rbl and load it to your device (Drop OTA here). Then there will be an option with IP and other things needed for this sensor to work as it should.
  • ADVERTISEMENT
  • Clear all erased MAC address and RF partition

    #34 20546804
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14782
    Help: 659
    Rate: 12920
    You need to update the firmware. In addition, from the description of your problem, I'm beginning to suspect that you may have performed an operation in the flasher Clear all , i.e. you have removed the entire Flash memory, as a result of which the MAC address has changed to the default one, ending with 0x00 characters. Now if you have another same device, you will have two devices with the same MAC, which will result in problems connecting them.

    The normal OpenBeken upload operation does not clear the entire memory, only its beginning, and leaves the MAC sections unchanged.

    If your MAC address ends in 0x00, there are two solutions:
    1. via UART, in our flasher, do Restore RF partition: https://github.com/openshwprojects/BK7231GUIFlashTool
    2. In our Web Application, in the Flash Memory tab, press the Restore RF partition button

    The Restore RF Partition operation will assign a new random MAC address to your device and solve WiFi connection issues.

    Added after 1 [minutes]:

    Btw: we already have a lot of answers in the FAQ:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/faq.md
    Using CH341A Programmer for BK7231N/CB3S Door/Window Sensor PB-69W VER 1.3: UART & OpenBK7231N_QIO
    And here:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/README.md
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #35 20546834
    Adi13089
    Level 11  
    Posts: 22
    Rate: 4
    Unfortunately, I cannot enter the WebApp in SAFE MODE. Using CH341A Programmer for BK7231N/CB3S Door/Window Sensor PB-69W VER 1.3: UART & OpenBK7231N_QIO
  • Helpful post

    RF partition removal detected from zeroed MAC address

    #36 20546859
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14782
    Help: 659
    Rate: 12920
    You have indeed removed the RF partition, as evidenced by the device name ending in zeros. This name comes by default from the MAC, which also ends with zeros, which means that during flashing you had to overwrite the RF section or perform Clear All (the entire 2MB flash).

    There should be a big "Exit safe mode" button in the main menu, but the Web App downloads from the web, so it may not open for you. I have separate wifi and separate internet connected by cable, so it works for me. Try the Web App anyway.

    If it doesn't go, disconnect the device with the same MAC from the router (I guess it is, because this problem has already appeared on the forum), or fix the RF partition on that device, and then fix it on the other one, it was written in like previous post.

    As a last resort, you can also simply repair the RF partition via UART.

    Now I see it's finally there the restore RF partition option would be very useful in the firmware itself (not WebApp), but at the moment it is not there, we did not expect such problems with it. I think I will modify the firmware so that from the next versions, as soon as it detects a clean MAC, it will fix it itself ...
    Helpful post? Buy me a coffee.
  • #37 20546986
    Adi13089
    Level 11  
    Posts: 22
    Rate: 4
    Fixed IP: 192.168.2.44, 255.255.255.0, 8.8.8.8, 192.168.2.1
    2.4GHz WiFi network
    Unfortunately, there is still no IP and no access to the device, DHCP does not assign an address for this device, and somehow setting the IP to a fixed one also does not change anything Using CH341A Programmer for BK7231N/CB3S Door/Window Sensor PB-69W VER 1.3: UART & OpenBK7231N_QIO Using CH341A Programmer for BK7231N/CB3S Door/Window Sensor PB-69W VER 1.3: UART & OpenBK7231N_QIO
  • #38 20547103
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14782
    Help: 659
    Rate: 12920
    Do you have any other devices with OBK?
    Helpful post? Buy me a coffee.
  • #39 20547119
    Adi13089
    Level 11  
    Posts: 22
    Rate: 4
    Yes of course :)
    Techliner power strip :)
  • Requesting MAC address and board details

    #40 20547160
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14782
    Help: 659
    Rate: 12920
    And what does her MAC address look like?

    The situation becomes very mysterious. To sum up - you wiped 2MB flash, lost the RF partition, then restored it, and the device still won't connect to your WiFi?

    On which BK are your devices, on which is the strip, and on which door sensor?

    I have two dev boards with BK7231T and BK7231N, just to be sure, I will clean their flash at home and check if they connect ....
    Using CH341A Programmer for BK7231N/CB3S Door/Window Sensor PB-69W VER 1.3: UART & OpenBK7231N_QIO
    Helpful post? Buy me a coffee.
  • #41 20826289
    Jerome_H
    Level 1  
    Posts: 1

    Hello,

    To begin with, a huge thanks for all the work to release OBK. It's a genius idea.

    After 3 days of research, I solved my problem :)

    The issue was that wakeup did not work after a deepsleep in LOW level.
    I just fixed it by adding the rapid text command: DSEdge 1

    Thanks everybody.
    Have a nice day.

Topic summary

LABEL_AI_GENERATED
The discussion revolves around using the CH341A programmer to interface with the BK7231N/CB3S door/window sensor (PB-69W VER 1.3) and the OpenBK7231N_QIO firmware. Users report issues with the sensor not waking up from deep sleep when the reed switch is closed, despite various firmware updates and configurations. Solutions proposed include adjusting GPIO settings, using different firmware versions, and implementing specific commands like "DSEdge" to manage wake-up behavior. The conversation highlights the importance of correctly configuring pull-up and pull-down resistors and the need for firmware modifications to ensure proper functionality. Users also discuss the challenges of MQTT connectivity and the timing of state changes after waking from sleep.
AI summary based on the discussion. May contain errors.

FAQ LABEL_AI_GENERATED

TL;DR: Ten FAQ pomaga osobom flashującym PB-69W VER 1.3; klucz to „DSEdge 1” oraz firmware po 1.17.10, bo sensor potrafił spać 60 s i nie budzić się z jednego stanu kontaktronu. [#20826289]

Dlaczego to ważne: Zła krawędź wybudzania lub wyczyszczona partycja RF może zmienić czujnik drzwi w urządzenie, które nie raportuje włamań ani nie łączy się z WiFi.

Metoda / ustawienie Konkret z wątku Efekt
BK7231GUIFlashTool przez mono błąd serial.BytesToRead 4095, oczekiwano 4111 odczyt flash nie zapisuje wyniku
uartprogram + hid_download_py działało bez problemu pozwoliło wgrać OpenBK7231N_QIO
DHCP po deep sleep MQTT nawet po 19 s po dłuższym śnie wolniejsze raportowanie
Statyczny IP stan „open” po 6 s, „closed” po 9 s akceptowalne raportowanie w HA
DSEdge 0 lub 1 jako stała krawędź naprawia wybudzanie w nietypowych układach

Kluczowa obserwacja: PB-69W VER 1.3 wymaga dobrania stałej krawędzi wybudzania, a nie tylko roli GPIO. Dla jednego układu pomogło DSEdge 1, a dla oryginalnego połączenia testowano wariant DSEdge 0.

Quick Facts

  • Czujnik PB-69W VER 1.3 z modułem CB3S/BK7231N został najpierw podłączony przez CH341A, a chwilowe zwarcie CEN do GND pozwoliło odczytać i zapisać flash. [#20534749]
  • Konfiguracja pinów z działającego opisu: pin 5 jako Btn 1, pin 10 jako LED 0, pin 14 jako DoorSensorWSleep_nPup dla kontaktronu. [#20534749]
  • W pomiarach kontaktron miał 2,6 V względem GND po zamknięciu, 0 V po otwarciu, a po wejściu w sleep napięcie dochodziło do 3,3 V i utrzymywało się. [#20535562]
  • Po ustawieniu stałego IP raport w Home Assistant pojawiał się po około 6 s dla otwarcia i 9 s dla zamknięcia; bez tego po dłuższym śnie MQTT połączył się dopiero przy Time 19. [#20546258]
  • Jeżeli flasher wykona Clear all na całych 2 MB flash, urządzenie może stracić partycję RF i dostać domyślny MAC kończący się zerami. [#20546804]

How do I flash a BK7231N/CB3S PB-69W VER 1.3 door/window sensor with a CH341A programmer and OpenBK7231N_QIO firmware?

Flash wykonaj przez UART, po wcześniejszym wykonaniu kopii pamięci flash. 1. Podłącz CH341A do modułu CB3S/BK7231N i chwilowo zewrzyj CEN do GND. 2. Odczytaj oraz zapisz flash; w wątku uartprogram z hid_download_py działał poprawnie. 3. Wgraj OpenBK7231N_QIO_1.15.668.bin, a później zaktualizuj OTA do nowszego .rbl, np. 1.17.10. Nie używaj Clear all, bo kasuje sekcje RF. [#20534749]

Why does BK7231GUIFlashTool on Linux with mono fail with serial.BytesToRead errors when reading BK7231N flash, and why might uartprogram with hid_download_py work instead?

Błąd wynikał z nieudanego odczytu bufora UART w środowisku mono na Linuksie. Narzędzie pokazało serial.BytesToRead 4095, gdy oczekiwało 4111, i nie zapisało wyniku. Ten sam użytkownik odczytał układ bez problemu przez uartprogram z hid_download_py. W praktyce warto traktować ten zestaw jako obejście dla wadliwego odczytu przez mono. [#20534749]

What pin roles should be configured in OpenBeken for the PB-69W VER 1.3 sensor’s button, LED, and reed switch?

Ustaw pin 5 jako przycisk, pin 10 jako LED, a pin 14 jako kontaktron z wariantem bez pull-up. Konkretny opis podał: pin 5 GPIOP_26 PWM5 jako Btn 1, pin 10 GPIOP_9 PWM3 jako LED 0, oraz pin 14 GPIOP_7 PWM1 jako DoorSensorWSleep_nPup. Zwykły DoorSensWSleep nie działał w tej konfiguracji. [#20534749]

What is DSEdge in OpenBeken, and how does it fix door sensor wake-up problems after deep sleep?

DSEdge ustawia stałą krawędź GPIO używaną do wybudzania czujnika drzwi. „DSEdge” jest komendą OpenBeken, która wymusza krawędź wybudzania dla DoorSensor, zamiast wybierać ją automatycznie według stanu pinu przed sleep. W opisanym przypadku DSEdge 1 naprawił brak wybudzania po deep sleep w stanie LOW. [#20826289]

What is DSTime in OpenBeken, and how can it be used to change the time before a door sensor enters deep sleep?

DSTime zmienia czas oczekiwania przed wejściem czujnika drzwi w deep sleep. „DSTime” jest komendą OpenBeken, która ustawia zwłokę usypiania sterownika DoorSensor, zwykle krótszą niż domyślne 60 sekund po konfiguracji. W testach użyto DSTime 5, DSTime 15, DSTime 600 i DSTime 6000. Dla wielu komend w jednej linii użyj składni backlog. [#20546308]

Why does a BK7231N door sensor wake from deep sleep only when the reed switch slept in one state but not the other?

Czujnik budził się tylko z jednego stanu, bo firmware wybierał przeciwną krawędź wybudzania niż wymagała elektronika kontaktronu. Gdy kontaktron zasypiał otwarty, wybudzanie działało. Gdy zasypiał zwarty magnesem, urządzenie wymagało resetu zasilania. Pomiary pokazały 2,6 V po zamknięciu, 0 V po otwarciu oraz 3,3 V po sleep. Stałe DSEdge rozwiązało ten typ problemu. [#20535562]

How do DoorSnsrWSleep, DoorSnsrWSleep_nPup, and DoorSensorWSleep_nPup differ in OpenBeken?

Te role różnią się głównie obsługą wejścia i pull-up dla czujnika drzwi z deep sleep. DoorSnsrWSleep działał przy bezpośrednim połączeniu wolnego GPIO z GND. DoorSnsrWSleep_nPup sygnalizował stany 1 i 0 przy GPIO 8 i GND. W oryginalnym połączeniu PB-69W potrzebny był wariant DoorSensorWSleep_nPup oraz stała krawędź wybudzania. [#20542631]

What is the difference between using a pull-up, no-pull-up, and pull-down GPIO configuration for a reed switch on BK7231N?

Pull-up, no-pull-up i pull-down zmieniają stan spoczynkowy oraz krawędź widzianą przez BK7231N. „Pull-up” jest konfiguracją wejścia GPIO, która podciąga pin do 3,3 V, gdy zewnętrzny styk go nie wymusza. Wersja _pd miała testować podciąganie w dół, ale początkowo nie uruchamiała sterownika DoorSensor. Autor firmware dodał poprawkę w 1.15.675. [#20535432]

CH341A vs UART flashing tools — which method is more reliable for backing up and flashing a BK7231N CB3S module?

W tym wątku bardziej niezawodny okazał się UART przez uartprogram i hid_download_py. CH341A służył jako interfejs po podłączeniu, a chwilowe zwarcie CEN do GND umożliwiło odczyt flash. Problem pojawił się w BK7231GUIFlashTool przez mono, który zatrzymywał odczyt na serial.BytesToRead 4095. Dlatego najpierw zrób backup, a potem flashuj metodą, która stabilnie czyta układ. [#20534749]

How can I make a BK7231N OpenBeken door sensor report both quick open and close events to MQTT after waking from deep sleep?

Użyj nowszego firmware, który publikuje zapamiętany stan startowy i bieżący stan po połączeniu MQTT. Problem dotyczył typowego otwarcia i zamknięcia drzwi w 2–5 s, zanim WiFi zdążyło wrócić. Poprawka wymuszała publikację pierwszego stanu przez pierwsze 2 s, a potem wysyłała stan aktualny. Tester z buildem 1.17.10 potwierdził publikację obu stanów przy zmianie poniżej 1 s. [#20546308]

Why is WiFi or MQTT reconnection slow after deep sleep on OpenBeken, and how can static IP improve wake-to-report time?

Deep sleep wyłącza prawie cały CPU, więc urządzenie musi ponownie zestawić WiFi i MQTT. Po długim śnie MQTT potrafił połączyć się dopiero przy Time 19. Statyczny IP skrócił raportowanie w Home Assistant do około 6 s dla otwarcia i 9 s dla zamknięcia. Wątek wskazuje też poprawki logiki MQTT w nowszym firmware. [#20546258]

How do I set a fixed IP address in the OpenBeken web interface for a BK7231N device?

Stały IP ustawisz w menu Configure IP, znajdującym się pod Configure Wifi. Opcja pojawiła się dopiero w nowszym firmware, nie w OpenBK7231N_QIO_1.15.699.bin. Zalecana ścieżka aktualizacji to Launch web applicationOTA → pobranie nowszego pliku .rbl, np. 1.17.10, i wrzucenie go przez Drop OTA here. [#20546801]

What is the RF partition on BK7231N, and why can clearing the whole flash cause duplicate MAC address or WiFi connection problems?

Partycja RF przechowuje dane radiowe, w tym adres MAC używany przez WiFi. „Partycja RF” jest obszarem pamięci flash BK7231N, który przechowuje konfigurację radiową urządzenia, w tym unikalny adres MAC potrzebny do poprawnego łączenia z routerem. Operacja Clear all na 2 MB flash może zmienić MAC na domyślny kończący się 0x00, powodując konflikty. [#20546804]

How do I restore the RF partition or MAC address on an OpenBeken BK7231N device after using Clear All in a flasher?

Przywróć partycję RF przez flasher UART albo przez Web Application OpenBeken. W narzędziu UART wybierz Restore RF partition. Alternatywnie otwórz Web Application, przejdź do karty Flash Memory i użyj przycisku Restore RF partition. Ta operacja nadaje nowy losowy MAC i usuwa konflikty po wyczyszczeniu całych 2 MB flash. [#20546804]

What is OpenBK7231N_QIO firmware, and when should I use an RBL OTA update instead of flashing a BIN file?

OpenBK7231N_QIO to wariant firmware OpenBeken dla BK7231N używany przy początkowym flashowaniu plikiem .bin. „OpenBK7231N_QIO” jest obrazem firmware OpenBeken dla układów BK7231N, przygotowanym do startowego wgrywania i dalszej konfiguracji urządzeń Tuya. Po pierwszym uruchomieniu aktualizuj przez OTA plikiem .rbl, bo nowsze wersje dodały DSEdge, DSTime i Configure IP. [#20546801]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT