• Stars
    star
    229
  • Rank 174,666 (Top 4 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 5 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Upload tool for an led name tag with USB-HID interface

Led-Badge-44x11

Upload tool for an led name tag with USB-HID interface

LED Mini Board

Hardware

The types supported by this project have an array of

  • 44 x 11 LEDs or
  • 48 x 12 LEDs.

The manufacturer is probably https://lesun-led.en.alibaba.com/

In both configurations, the badge identifies itself on the USB as

idVendor=0416, idProduct=5020
Mfr=1, Product=2, SerialNumber=0
LSicroelectronics LS32 Custm HID

Warning

There are many different versions of LED Badges on the market. This one uses an USB-HID interface, while others use USB-Serial (see references below).

Command Line Installation and Usage

User access to badge on all Linuxes

The following will install a udev rule allowing anybody read/write access to the badge via USB.

sudo cp 99-led-badge-44x11.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger

Required dependencies on Debian/Ubuntu Systems

sudo pip install pyhidapi
sudo pip install pillow
sudo apt-get install libhidapi-hidraw0
sudo ln -s /usr/lib/x86_64-linux-gnu/libhidapi-hidraw.so.0  /usr/local/lib/

or sudo apt install python3-usb python3-pil

Required dependencies on Fedora Systems

sudo dnf install hidapi python3-hidapi python3-pillow python3-pyusb

Required dependencies on Mac Systems

sudo easy_install pip
pip install pyhidapi
pip install pillow
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
brew install hidapi

or Try with pip3 install pyhidapi

Required dependencies on Windows 10

Download win/inf-wizard.exe to your desktop. Right click 'Run as Administrator'
   -> Click 0x0416 0x5020 LS32 Custm HID
   -> Next -> Next -> Documents LS32_Sustm_HID.inf -> Save (we don't need that file)
   -> Install Now... -> Driver Install Complete -> OK

Download python from python.org
  [x] install Launcher for all Users
  [x] Add Python 3.7 to PATH
   -> Click the 'Install Now ...' text message.

Run cmd.exe as Administrator, enter:
  pip install pyusb
  pip install pillow

Required dependencies on Windows 7

Download win/win32-bin-1.2.6.0.zip to your desktop. Extract.
Find the inf-wizard.exe in the bin folder. Right click 'Run as Administrator'
Then continue as with windows 10 above.

Examples:

Sudo may or may not be needed for accessing the USB device, depending on your system.

sudo python3 ./led-badge-11x44.py "Hello World!"

loads the text 'Hello World!' as the first message, and scrolls it from right to left (default scroll mode=0) and speed 4 (default). After an upload the device shows the first message once and returns to the charging screen if still connected to USB. Either pull the plug or press the small button next to the USB connector.

sudo python3 ./led-badge-11x44.py -m 6 -s 8 "Hello" "World!"

loads the text 'Hello' as message one and 'World!' as message two. Compare the difference in quoting to the previous example. Up to 8 messages can be uploaded. This example uses mode 6, which drops the words with a nice little animation vertically into the display area. Speed is set to maximum here, for smoothness.

Per default you will only see 'Hello'. To see all messages, press the small button next to the USB connector multiple times, until you briefly see 'M1-8'. Now the display loops through all uploaded messages.

sudo python3 ./led-badge-11x44.py -m 5 :gfx/fablabnbg_logo_44x11.png:

loads a fullscreen still image. Avoid whitespace between colons and name. If you receive a message ImportError: cannot import name '_imaging', then try to update the corresponding package: sudo pip install -U Pillow

sudo python3 ./led-badge-11x44.py "I:HEART2:my:gfx/fablab_logo_16x11.png:fablab:1:"

uses one builtin and one loaded image. The heart is builtin, and the fablab-logo is loaded from file. The fablab logo is used twice, once before the word 'fablab' and again behind through the reference ':1:' (which references the first loaded image).

LED Mini Board

sudo python3 ./led-badge-11x44.py -s7 -m0,1 :bicycle: :bicycle_r:

shows a bicycle crossing the display in left-to-right and right-to-left (as a second message). If you select the 'M1-8' mode, the bike permanently runs back and forth the display. You may add a short message to one or both, to make it appear the bike is pulling the text around.

LED Mini Board

sudo python3 ./led-badge-11-x44.py -b0,1 -s1 -m5 "  :heart2:    :HEART2:" "  :HEART2:"

shows a simple animation of a slowly beating heart on the first message, and a blinking heart on the second message.

python3 ./led-badge-11x44.py --list-names

prints the list of builtin icon names, including :happy: :happy2: โค๏ธ :HEART: :heart2: :HEART2: :fablab: :bicycle: :bicycle_r: :owncloud: ::

python3 ./led-badge-11x44.py --help

prints some condensed help:

usage: led-badge-11x44.py [-h] [-t TYPE] [-s SPEED] [-m MODE] [-b BLINK]
			  [-a ANTS] [-p FILE] [-l]
                          MESSAGE [MESSAGE ...]

Upload messages or graphics to a 44x11 led badge via USB HID.
Version 0.6 from https://github.com/jnweiger/led-badge-44x11
 -- see there for more examples and for updates.

positional arguments:
  MESSAGE               Up to 8 message texts with embedded builtin icons or
                        loaded images within colons(:) -- See -l for a list of
                        builtins

optional arguments:
  -h, --help            show this help message and exit
  -t TYPE, --type TYPE
			Type of display: supported values are 12x48 or
			(default) 11x44. Rename the program to led-badge-12x48,
			to switch the default.
  -s SPEED, --speed SPEED
                        Scroll speed (Range 1..8). Up to 8 comma-seperated
                        values
  -m MODE, --mode MODE  Up to 8 mode values: Scroll-left(0) -right(1) -up(2)
                        -down(3); still-centered(4); animation(5); drop-
                        down(6); curtain(7); laser(8); See '--mode-help' for
                        more details.
  -b BLINK, --blink BLINK
                        1: blinking, 0: normal. Up to 8 comma-seperated values
  -a ANTS, --ants ANTS  1: animated border, 0: normal. Up to 8 comma-seperated
                        values
  -l, --list-names      list named icons to be embedded in messages and exit

Example combining image and text:
 sudo ./led-badge-11x44.py "I:HEART2:you"

Related References (for USB-Serial devices)

More Repositories

1

pdfcompare

compare two PDF files, write a resulting PDF with highlighted changes
Python
52
star
2

inkscape-gears-dev

Enhanced version of the well known gears extension, allows spokes, center cross, metric module, best evolute shape ...
Python
52
star
3

ruida-laser

About the protocol between RDWorks, usb-stick, ethernet, and laser.
R
50
star
4

showspeed

print I/O activity of process, files, or network.
Perl
35
star
5

led-hologram-propeller

Driver for a POV display device with 224 LEDs, also called Led fan, 3D-Holographic display and other fancy names in marketing
Python
30
star
6

graphtecprint

Driver for graphtec silhouette plotters/cutters
Python
26
star
7

inkscape-thunderlaser

Simple inkscape extension to control a lasercutter with rudia board. Download at
Python
16
star
8

ws2812_sprites

Sample code for driving a programmable LED strip, featuring smoothly animated sprites.
C
10
star
9

inkscape-round-corners

An inkscape 1.0 extension to apply a radius to sharp corners of a path.
Python
10
star
10

Schickard

Lasercut construction of the first calculating machine after Wilhelm Schickard 1623
Python
8
star
11

landscape-sysinfo-mini

a trivial re-implementation of the sysinfo printout shown on debian at boot time. No twisted, no reactor, just /proc & utmp inspired by ubuntu 14.10 /etc/update-motd.d/50-landscape-sysinfo Requires: python-utmp for counting users.
Python
7
star
12

inkscape-clean-path

An inkscape extension to work around typical path issues
Python
6
star
13

inkscape-svg2fcsketch

Convert from inkscape SVG to FreeCAD sketch in fcstd file format
Python
6
star
14

OCFFS

A friendly FUSE filesystem for ownCloud clients
Python
5
star
15

inkscape-flat-projection

Apply a 3D rotation matrix to 2D objects, then apply an axiometric projection back into 2D
Python
4
star
16

Ketten-Rollator

3D-Designs to equip a rollator with caterpillar chains to use in rough terrain
OpenSCAD
3
star
17

inkscape-exponential-distort

Apply an logarithmic/exponential scale distortion to X- and/or Y-coordinates of a path object.
Python
3
star
18

mirobo-drive

Control a Xiaomi Mi robot with a USB gamepad controller
Python
3
star
19

inkscape-input-stl

Input extension for inkscape to read stl files sliced into layers. Requires slic3r
Python
3
star
20

osc-plugin-install

find and install a package from OBS, managing REPO-urls for you
Python
3
star
21

dvswitch

branch of git://anonscm.debian.org/dvswitch/dvswitch.git
C++
3
star
22

spiral-arm

An articulated arm made of plywood inspired by a John Edmark design
C++
2
star
23

testipy

TestiPy is a technology independent GUI-testing framework, inspired by SikuliX
C
2
star
24

perl-File-Unpack

A strong archive file unpacker, based on mimetypes
Perl
2
star
25

lunatum

A collection of tools for machine reading of graphical user interfaces
Python
1
star
26

inkscape-import-rd

Input filter for reading RD files, as generated by e.g. rdworks to drive RUIDA laser controllers.
Python
1
star
27

juggletorch

LED illumination for juggling clubs (without getting yourself burned)
Perl
1
star
28

stringsx

A simplified strings tool, similar to the well known strings tool. But we support all encodings simultaneously
C
1
star
29

hapla-drive

A harmonic planetary drive
1
star