UltimateHackingKeyboard / firmware

Ultimate Hacking Keyboard firmware
Other
418 stars 65 forks source link

setLedTxt command seems broken since firmware 10.3.0 #708

Closed mhantsch closed 11 months ago

mhantsch commented 12 months ago

Agent 3.1.0 Firmware 10.3.0

Error at $onInit 1/16/19: Unrecognized command: '
> 16 | setLedTxt 300 ':::'
>    |                   ^
Error at $onKeymapChange CMX 1/17/32: Unrecognized command: "
> 17 | ifKeymap CMX setLedTxt 200 "::C"

Seems like the setLedTxt command is now broken (since fw 10.3.0). Neither single nor double quotes allow me to set the text.

kareltucek commented 12 months ago

Indeed! Thanks for report!

markrickert commented 11 months ago

I just experienced this as well moving from firmware 10.1.0 to 10.3.0. My custom startup macro stopped working. I'm guessing that in my case it's because +. -, *, & / are now mathematical operators, but i guess there's more to it. Glad to see a fix in the pipeline for the next firmware release!

setLedTxt 150
setLedTxt 150 !!-
setLedTxt 150 !--
setLedTxt 150 ---
setLedTxt 150 --
setLedTxt 150 -

setLedTxt 150 /
setLedTxt 150 |
setLedTxt 150 \
setLedTxt 150 -
setLedTxt 150 O

setLedTxt 150 O-
setLedTxt 150 O/
setLedTxt 150 O|
setLedTxt 150 O\
setLedTxt 150 O-
setLedTxt 150 O/
setLedTxt 150 OM

setLedTxt 150 OM-
setLedTxt 150 OM/
setLedTxt 150 OM|
setLedTxt 150 OM\
setLedTxt 150 OM-
setLedTxt 150 OM/
setLedTxt 1000 OMG
mhantsch commented 11 months ago

I'm guessing that in my case it's because +. -, *, & / are now mathematical operators, but i guess there's more to it.

Yes, there are two unrelated things at play here:

  1. You will need to put the string in quotes. Either double-quotes (") or single-quotes (') will work. Double-quotes will give you string interpolation, but with your strings it won't make a difference whether you use single or double.

  2. A bug in 10.3.0 makes any setLedTxt command produce an ERR.

Personally, I have reverted to firmware 10.2.0 for now until the bug is fixed. The new Agent at least shows me error and warning messages directly in Agent, and 10.2.0 already contains a lot of useful improvements.

mhantsch commented 11 months ago

Btw, it seems we all like to play with the segment display 😄

I have a lot of macros similar to this:

setLedTxt 800 "[-]"
setLedTxt 200 "[\]"
setLedTxt 200 "[|]"
setLedTxt 200 "[/]"
setLedTxt 200 "[-]"
setLedTxt 200 "[\]"
setLedTxt 200 "[|]"
setLedTxt 200 "[/]"
setLedTxt 200 "[-]"
setLedTxt 200 "[*]"
setLedTxt 200 "|_|"
mondalaci commented 11 months ago

Reopening then, as this still seems to be a bug.

kareltucek commented 11 months ago

I believe all is fixed on master, just not released. Could you maybe release a patch firmware?

mondalaci commented 11 months ago

On master, I get:

Error at $onInit 1/1/14: Text argument expected.
> 1 | setLedTxt 150
>   |              ^
Error at $onInit 1/4/18: Could not parse
> 4 | setLedTxt 150 ---
>   |                  ^
Error at $onInit 1/4/1: Unexpected variable type: 3
> 4 | setLedTxt 150 ---
Error at $onInit 1/5/17: Could not parse
> 5 | setLedTxt 150 --
>   |                 ^
Error at $onInit 1/5/1: Unexpected variable type: 3
> 5 | setLedTxt 150 --
Error at $onInit 1/6/16: Could not parse
> 6 | setLedTxt 150 -
>   |                ^
Error at $onInit 1/6/1: Unexpected variable type: 3
> 6 | setLedTxt 150 -
Error at $onInit 1/11/16: Could not parse
> 11 | setLedTxt 150 -
>    |                ^
Error at $onInit 1/11/1: Unexpected variable type: 3
> 11 | setLedTxt 150 -
kareltucek commented 11 months ago

Yes, because this is an incomplete numeric expression. Neither a string, nor a number.

I agree that the error could be improved, but that's pretty much it...

mondalaci commented 11 months ago

Just released the new 10.3.1 firmware version. setLedTxt works well with quoted arguments, indeed.

These animations are quite amusing; I think I'll feature them in a future blog post.

markrickert commented 11 months ago

@mondalaci Thank yo so much! I'll test when i get home on saturday. Also, the source of my macro script is this repo where i originally found it and modified it to "OMG", haha https://github.com/hxv/uhk-macros/blob/master/lcd.md