You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On OpenBeken v1.18.100 (tested on BK7231N), event handlers declared using addEventHandler ... do ... endon inside .bat scripts fail to execute properly. When the event fires, OBK throws cmd not found errors for valid scripting commands like delay and endon.
Environment
Firmware: OpenBK7231N_QIO_1.18.100.bin
Chipset: BK7231N
Script location: /scene1.bat and /autoexec.bat
Launch method: "Save, Reset SVM and run file as script thread"
Problem Description
Handlers using do ... endon blocks are accepted during script start (CMD_StartScript: started /scene1.bat), and even log the handler being added:
Info:EVENT:CMD_AddEventHandler: added OnChannelChange with cmd do
But when the trigger fires (e.g., OnChannelChange 10), OBK logs:
Error:CMD:cmd delay NOT found (args 200) Error:CMD:cmd endon NOT found (args )
This means the do block is being treated as a flattened runtime string, not parsed into a proper SVM block.
Example That Fails (When Placed in Script File and Run via SVM)
When saved in /autoexec.bat or /scene1.bat and executed via:
Filesystem -> "Save, Reset SVM and run file as script thread"
…this multi-line handler appears to load correctly, but fails at runtime:
Info:EVENT:EventHandlers_FireEvent: executing command do
Error:CMD:cmd delay NOT found (args 200)
Error:CMD:cmd endon NOT found (args )
This confirms the block was interpreted as a raw command string - not a parsed handler in the script VM.
Workaround That Works
Only a flattened backlog call executes successfully:
addEventHandler OnChannelChange 10 do backlog toggleChannel 1; toggleChannel 2 endon
Expected Behavior
When executed as a script thread (via startScript or Filesystem -> "Save, Reset SVM and run"), OBK should correctly interpret addEventHandler ... do ... endon as a script block and store the handler with parsed structure - not literal string evaluation.
Request
Please confirm whether this is a regression in 1.18.100 or intended behavior
If possible, expose whether SVM is being initialized successfully
Recommend adding a log line like SVM_HandlerParsed or similar for validation
This issue persisted after confirming:
UTF-8 (no BOM) encoding
Unix LF line endings
No trailing semicolons
Correct filename casing (autoexec.bat and scene1.bat both tested)
The text was updated successfully, but these errors were encountered:
Summary
On OpenBeken v1.18.100 (tested on BK7231N), event handlers declared using
addEventHandler ... do ... endon
inside.bat
scripts fail to execute properly. When the event fires, OBK throwscmd not found
errors for valid scripting commands likedelay
andendon
.Environment
OpenBK7231N_QIO_1.18.100.bin
/scene1.bat
and/autoexec.bat
Problem Description
Handlers using
do ... endon
blocks are accepted during script start (CMD_StartScript: started /scene1.bat
), and even log the handler being added:Info:EVENT:CMD_AddEventHandler: added OnChannelChange with cmd do
But when the trigger fires (e.g.,
OnChannelChange 10
), OBK logs:Error:CMD:cmd delay NOT found (args 200) Error:CMD:cmd endon NOT found (args )
This means the
do
block is being treated as a flattened runtime string, not parsed into a proper SVM block.Example That Fails (When Placed in Script File and Run via SVM)
/autoexec.bat
or/scene1.bat
and executed via:…this multi-line handler appears to load correctly, but fails at runtime:
Runtime Logs:
This confirms the block was interpreted as a raw command string - not a parsed handler in the script VM.
Workaround That Works
Expected Behavior
When executed as a script thread (via startScript or Filesystem -> "Save, Reset SVM and run"), OBK should correctly interpret
addEventHandler ... do ... endon
as a script block and store the handler with parsed structure - not literal string evaluation.Request
This issue persisted after confirming:
The text was updated successfully, but these errors were encountered: