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

prevent charging screen when cable is connected #10

Open jnweiger opened 5 years ago

jnweiger commented 5 years ago

All this looks like we are exploiting a firmware bug. A sequence of sudo ./led-badge-11x44.py -s8 -m4 ++++++ sudo ./led-badge-11x44.py -m9 fragment

shows quite reliably the text 'fragme' permanently while still connected to USB.

The number of characters given in the first command appear to determine the start position of the text in the next command. If only one character was given, we get 'fra:' at the right hand side, if two characters are given, we get 'frag'.

All this looks to me like we are exploiting a firmware bug.

jnweiger commented 5 years ago

If that can be reliable exploited, we should add an option -p (permanent) to trigger this behaviour :-) It would not work for scrolling or animation, but a static text can be shown this way.

A better implementation would be to shut down power on the USB port. But that does not seem to be always possible. My laptop accepts the commands in usb-power.sh but power does not go off.

jnweiger commented 5 years ago

If "-m4 ++++++" fails, you can also try "-m8 test" before the -m9 commands.

jnweiger commented 5 years ago

This is probably also needed for https://github.com/jnweiger/led-badge-44x11/issues/11

jnweiger commented 5 years ago

A clock:


./led-badge-12x48.py -s8 -m4 +++++
while true; do ./led-badge-12x48.py -s8 -m9 $(date +%H:%M); sleep 60; done
homeworkprod commented 3 years ago

Indeed this seems to be pretty stable.

Took me a while to get to this point, though. Sometimes executing the script seemed to have no effect. Part of the code suggests that updates only work once per second, so executing the script in too short intervals might have been the issue. So to support triggering this behavior via command line option we probably need to include a sleep for one second.

Apart from that: It works (for now), very cool! This makes it applicable for what I had in mind (i.e. a dynamically updated display permanently connected to a computer).

I wonder how you discovered this :)

acsr commented 3 years ago

If you interested in the mechanism the load detection works in the controller, take a look at this article featuring a teardown and hardware mod from USB to serial to connect to a RaspberryPi. Unfortunately this requires some quirky pretending of USB power off via the RPi. So this will not finally solve the USB issue with the charging screen, but may lead to a later solution.

Blog Post "Driving a scrolling LED badge from a Raspberry Pi | Dave Akerman" http://www.daveakerman.com/?p=1440

TheNitek commented 2 years ago

Anyone tried modding the hardware? I don't really need the battery, but I want the display to work properly while USB is connected.

acsr commented 1 year ago

I recently figured out, that the display has a nice behaviour when the battery is removed completely.

If you remove the battery and attach the programmed display to the USB (or a LiIon USB PowerPack) it shows the charging screen, but no message.

If you now press the lower button close to the micro USB, the display starts to display message 1 at once without showing "M1-8".

After pressing the button again, it starts with showing "M1-8" and starts over.

I never use multiple messages, so not tested using this setup. Reprogramming stops the loop, shows the lopp one time and then the loading screen permanent. Closing the button permanent toggles the LED intensity in a jerky way.

Adds nice applications with bigger batteries or permanent USB Power from a pure power cable.

aaltulea commented 1 year ago

Anyone tried modding the hardware? I don't really need the battery, but I want the display to work properly while USB is connected.

I cut the cables connecting the battery and now it draws power directly from the USB. However, the model I have does not have the programming screen acsr is talking about. It always shows the charging screen

acsr commented 7 months ago

Anyone tried modding the hardware? I don't really need the battery, but I want the display to work properly while USB is connected.

I cut the cables connecting the battery and now it draws power directly from the USB. However, the model I have does not have the programming screen acsr is talking about. It always shows the charging screen

I am sorry, my mistake – you are right: There is no actual programming screen. It is exactly the same charging screen, when just connected to any USB power source. I corrected that!

strongly-typed commented 5 months ago

I might have a different FW version. The marking on the PCB is B1144_221028 and 20240108.

-m9 is now a "laser" mode where the picture is created and dissolved with a "laser" from the side. It does not halt the display. After programming the message appears only once and then the charging screen (battery plus animated coffee cup) is displayed. You need to press at least a button for the message to appear.

I would love to use the display as a display which can be (frequently, e.g. once per minute) updated by Python.

Is there any alternative firmware or commands to avoid the M1-8 message and start the message directly after updating?

Side node: The messages are probably stored in Flash memory as they are kept even with battery disconnected.