logo elektroda
logo elektroda
X

[Solved] OpenBeken flashing error on WB2S switch module: serial.BytesToRead 0 during write

mtsbndt 39 2
ADVERTISEMENT
  • #1 21732182
    mtsbndt
    Level 2  
    Hi,

    I recently bought one of these "Wifi+RF switch modules", hoping it would be hackable with OpenBeken.
    https://de.aliexpress.com/item/1005003973194673.html

    WiFi+RF433 light switch module by Wenzhi with ports and connection labels 

    I opened it and found a WB2S board inside, which seems to be well supported by OpenBeken. So I soldered a few wires to VBAT, GND, RX1 and TX1 and was able to connect to the device with a USB TTL adapter. As a power supply I'm using a USB DC-DC converter. Using the BK7231GUIFlashTool v148 (running on Fedora 42 with Mono), I was able to backup the existing firmware, and erasing the flash memory (starting at 0x11000) also worked fine. But as soon as I try to write the OpenBK7231T firmware image, I get an error. The logs say:
    
    All selected sectors erased!
    Going to do erase, start 1970176, sec count 1!
    Erasing sector 1970176... ok! 
    All selected sectors erased!
    failed with serial.BytesToRead 0 (expected 15)
    The beginning of buffer in UART contains  data.
    Writing sector 0x11000... Writing sector 69632 failed!
    Writing file data to chip failed.
    

    Has anybody seen this error before and knows what it's about?

    Added after 42 [minutes]:

    OK, apparently the problem is the serial port speed! Interestingly it wouldn't work with 115,200 Baud, but the error goes away when I set it 230,400 Baud. I thought lower speeds would be more reliable than higher ones, but apparently not in this case. The CRC check was also successful, so I'm going to assume it worked.
  • ADVERTISEMENT
  • #2 21732226
    mtsbndt
    Level 2  
    Set the serial port baud rate to 230400 instead of 115200.
  • #3 21732239
    p.kaczmarek2
    Moderator Smart Home
    Yes, that actually happens from time to time. I also saw situations where higher baud was a bit more stable. It's rare, but still possible. Glad to see you have it solved!
    Helpful post? Buy me a coffee.
ADVERTISEMENT