jnweiger / led-name-badge-ls32

Upload tool for an led name tag with USB-HID interface
GNU General Public License v2.0
223 stars 81 forks source link

Text length/image size #12

Open syspart opened 5 years ago

syspart commented 5 years ago

Hello if i create a picture and send it as animation, what is the maximum size? If I look on your code, the image width could be 255*8 (width of a char). But there is a second byte, and it looks like the high byte of an integer. Or am I wrong? greetings syspart

jnweiger commented 5 years ago

That needs experimentation. :-) I see there is also https://github.com/jnweiger/led-name-badge-ls32/pull/15 from you. This should enable larger images or longer messages indeed.

Did you have the crashes, that motivated https://github.com/jnweiger/led-name-badge-ls32/pull/14 before or after applying #15 ?

syspart commented 5 years ago

With your code I got the overflow error, so I put my message into 5 parts whith 200 chars. But now I got the device error.

jnweiger commented 5 years ago

Merged #15 -- before the message limit was 255 characters, now it is 336 characters wehen using hidapi:

  File "/usr/local/lib/python3.6/dist-packages/pyhidapi/pyhidapi.py", line 641, in hid_write
    raise RuntimeError('hid_write() failed.')
RuntimeError: hid_write() failed.

Using usb.core, it happily uploads 520 characters (maybe more), but everything after character 507 is binary garbage. So we are overwriting something... \('!')/

jnweiger commented 5 years ago

20190719_100311(0)

Now we can start decoding the firmware :-)

syspart commented 5 years ago

Be carefull. My device stopped responding with 4 x 255 chars. You should test it with the sertronic badges. Maybe you got a newer firmware. My one is from 13.11.2018.

Am 19. Juli 2019 09:50:22 MESZ schrieb "Jürgen Weigert" notifications@github.com:

Merged #15 -- before the message limit was 255 characters, now it is 336 characters wehen using hidapi:

File "/usr/local/lib/python3.6/dist-packages/pyhidapi/pyhidapi.py",
line 641, in hid_write
   raise RuntimeError('hid_write() failed.')
RuntimeError: hid_write() failed.

using usb.core, it happily uploads 1300 chars (maybe more). Maybe with hidapi we should also use a loop?

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/jnweiger/led-name-badge-ls32/issues/12#issuecomment-513130892