logo elektroda
logo elektroda
X

OpenBeken addEventHandler buffer overrun issue—anyone able to replicate?

p.kaczmarek2 30 3
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 21716245
    p.kaczmarek2
    Moderator Smart Home
    @divadiow @insmod
    We got such report in issue #1828:
    Quote:
    in the summary, when there are more than 3 event handlers, the 2nd event handler for some reason will do the action of the last event handler instead of its own action.

    version: Built on Oct 6 2025 07:36:23 version 1.18.189
    Device Tuya IR blaster S18 chip CB3S
    Chip/model: BK7231N
    Device config?
    this is the commands in startup:
    "
    startDriver IR
    setFlag 1 1
    addEventHandler2 IR_NEC 0xC7EA 0x17 backlog IRSend NEC 0x0 0xA8; IRSend NEC 0x0 0xA8; IRSend NEC 0x0 0xA8

    addEventHandler2 IR_NEC 0xC7EA 0xF backlog IRSend NEC 0x0 0x8C; IRSend NEC 0x0 0x8C; IRSend NEC 0x0 0x8C;IRSend NEC 0x0 0x8C;IRSend NEC 0x0 0x8C

    addEventHandler2 IR_NEC 0xC7EA 0x10 backlog IRSend NEC 0x0 0x9C; IRSend NEC 0x0 0x9C; IRSend NEC 0x0 0x9C;IRSend NEC 0x0 0x9C
    "

    when the device boot this is what happened:
    "
    Info:MAIN:Started IR.
    Info:CMD:CMD_StartScript: started @startup at the beginning
    Info:MAIN:Drv IR is already loaded.
    Info:EVENT:CMD_AddEventHandler: added IR_NEC with cmd backlog IRSend NEC 0x0 0xA8; IRSend NEC 0x0 0xA8; IRSend NEC 0x0 0xA8
    Info:EVENT:CMD_AddEventHandler: added IR_NEC with cmd backlog IRSend NEC 0x0 0x9C; IRSend NEC 0x0 0x9C; IRSend NEC 0x0 0x9C;IRSend NEC 0x0 0x9C
    Info:EVENT:CMD_AddEventHandler: added IR_NEC with cmd backlog IRSend NEC 0x0 0x9C; IRSend NEC 0x0 0x9C; IRSend NEC 0x0 0x9C;IRSend NEC 0x0 0x9C
    "

    the 2nd event handler supposed send 0x8C when triggered, but instead it sent 0x9C (which is the action of the 3rd event handler). if there are 4 eventhandlers, the 2nd event handler will do the 4th event handler's action.

    in the summary, the 2nd event handler for some reason will do the action of the last event handler instead of its own action.

    Are you able to replicate? I've tried with self test, but no luck so far:
    Visual Studio environment with C source code and IRSend debug console output.
    Looks like a possible buffer issue (overrun or something)
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #2 21716270
    insmod
    Level 28  
    >>21716245
    Wasn't able to replicate on bk7231n
  • ADVERTISEMENT
  • #3 21716291
    p.kaczmarek2
    Moderator Smart Home
    He's referring to startup command specifically, did you try there?
    Helpful post? Buy me a coffee.
  • #4 21716294
    insmod
    Level 28  
    >>21716291
    Yes, even copied the whole command with startdriver and setflag.
ADVERTISEMENT