todbot / blink1-tool

Command-line tools and C library for blink(1) USB RGB LED
https://blink1.thingm.com/
Other
84 stars 15 forks source link

CLI pattern read and write inconsistencies with old blink1 devices #20

Open cvdwl opened 5 years ago

cvdwl commented 5 years ago

I'm noting a number of inconsistencies when writing patterns to an (admittedly ancient) blink1:

  1. Patterns, e.g. a color, time, index triplet - #ffffff,9.00, 0, are taken in order presented, without regard to specified index.
  2. No matter how many triplets are presented, only 12 are inserted, although 32 are reported.
  3. If more than 12 triplets are pushed, the first triplet is skipped and the last is used as line 0.
  4. Time values reported inconsistently: If I write 1.00 (s) it will be written as 1000 (ms?), but in readpattern will show 500, which is what will be played
  5. Color values reported inconsistently: if I write, e.g. #ff5f00,1.98, 4, I will see writing line 4: ff,5f,00 : 1980 : 4, readpattern will yield #ff1c00,0.99,4,. I don't have a good sense as to how accurate this color is.

I recognize that my hardware may be too ancient to deal with, and I'm comfortable with the workarounds I've found, but thought I'd mention these.

~> blink1-tool --list
blink(1) list: 
id:0 - serialnum:1A00259F  fw version:100
~> blink1-tool -v --writepattern '{0,#999999,9.99,0,#ff0000,0.02,1,#ff0000,1.98,2,#999900,0.02,3,#999900,1.98,4,#00ff00,0.02,5,#00ff00,1.98,6,#009999,0.02,7,,#009999,1.98,8,#0000ff,0.02,9,#0000ff,1.98,10,#990099,0.02,11,#990099,1.98,12}'
deviceId[0] = 0
cached list:
0: serial: '1A00259F' '0002:0004:00'
openById: 0
write pattern: {0,#999999,9.99,0,#ff0000,0.02,1,#ff0000,1.98,2,#999900,0.02,3,#999900,1.98,4,#00ff00,0.02,5,#00ff00,1.98,6,#009999,0.02,7,,#009999,1.98,8,#0000ff,0.02,9,#0000ff,1.98,10,#990099,0.02,11,#990099,1.98,12}
s:'#999999'
s:'#ff0000'
s:'#ff0000'
s:'#999900'
s:'#999900'
s:'#00ff00'
s:'#00ff00'
s:'#009999'
s:'#009999'
s:'#0000ff'
s:'#0000ff'
s:'#990099'
s:'#990099'
writing line 0: 99,99,99 : 9990 : 0
writing line 1: ff,00,00 : 20 : 1
writing line 2: ff,00,00 : 1980 : 2
writing line 3: 99,99,00 : 20 : 3
writing line 4: 99,99,00 : 1980 : 4
writing line 5: 00,ff,00 : 20 : 5
writing line 6: 00,ff,00 : 1980 : 6
writing line 7: 00,99,99 : 20 : 7
writing line 8: 00,99,99 : 1980 : 8
writing line 9: 00,00,ff : 20 : 9
writing line 10: 00,00,ff : 1980 : 10
writing line 11: 99,00,99 : 20 : 11
writing line 12: 99,00,99 : 1980 : 12
~> blink1-tool -v -v --readpattern | sed 'sP,#P,\n#Pg'
deviceId[0] = 0
cached list:
0: serial: '1A00259F' '0002:0004:00'
openById: 0
read pattern:
{0,
#510051,0.99,0,
#ff0000,0.01,1,
#ff0000,0.99,2,
#515100,0.01,3,
#515100,0.99,4,
#00ff00,0.01,5,
#00ff00,0.99,6,
#005151,0.01,7,
#005151,0.99,8,
#0000ff,0.01,9,
#0000ff,0.99,10,
#510051,0.01,11,
#510051,0.99,12,
#510051,0.99,13,
#510051,0.99,14,
#510051,0.99,15,
#510051,0.99,16,
#510051,0.99,17,
#510051,0.99,18,
#510051,0.99,19,
#510051,0.99,20,
#510051,0.99,21,
#510051,0.99,22,
#510051,0.99,23,
#510051,0.99,24,
#510051,0.99,25,
#510051,0.99,26,
#510051,0.99,27,
#510051,0.99,28,
#510051,0.99,29,
#510051,0.99,30,
#510051,0.99,31}
~>