JavaScript library for controlling DMX512 LED tubes via T-790K controller on Raspberry Pi.
-
LED Tube: DMX512 LED Tube Lights 24V, 360 Degree Lighting
- 24 pixels per meter
- DC24V power supply
- DMX512 protocol
-
Controller: T-790K 8 Ports Digital LED Controller
- Supports DMX512 and Art-Net protocols
- TCP/IP network communication
- 8 output ports
-
Power Supply: Mean Well LRS-350-24
- DC24V output
- 350W, 14.6A
See QUICK_START.md for fastest setup path.
See INTEGRATION_GUIDE.md for detailed step-by-step instructions.
- Install Node.js on your Raspberry Pi:
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs- Navigate to the project directory:
cd led-control- Install dependencies:
npm installBefore running the code, you need to configure the controller IP address:
- Connect the T-790K controller to your network
- Find the controller's IP address (check your router's DHCP client list or use the controller's LCD screen)
- Update the
hostparameter in your scripts to match the controller's IP address
Example:
const leds = new LEDController({
protocol: 'artnet',
host: '192.168.1.100', // Your controller's IP address
pixelsPerMeter: 24,
tubeLength: 1 // Length in meters
});const LEDController = require('./index');
const leds = new LEDController({
protocol: 'artnet',
host: '192.168.1.100',
pixelsPerMeter: 24,
tubeLength: 1
});
// Set all LEDs to red
leds.setAll(255, 0, 0);
leds.update();
// Set a single pixel
leds.setPixel(0, 0, 255, 0); // Pixel 0 to green
leds.update();
// Clear all LEDs
leds.clear();- Simple Test - Basic color tests:
npm test
# or
node examples/simple-test.js- Rainbow Effect - Smooth rainbow animation:
node examples/rainbow-effect.js- Chase Effect - Chasing light effect:
node examples/chase-effect.jsCreates a new LED controller instance.
Options:
protocol(string): 'artnet' or 'dmx' (default: 'artnet')host(string): Controller IP address (default: '192.168.1.100')universe(number): DMX universe number (default: 1)pixelsPerMeter(number): Number of pixels per meter (default: 24)tubeLength(number): Length of LED tube in meters (default: 1)
Set a single pixel color.
pixelIndex: Pixel index (0 to totalPixels-1)r,g,b: Red, green, blue values (0-255)
Set all pixels to the same color.
Clear all LEDs (set to black).
Update the LED strip with current buffer values.
Create a rainbow effect.
offset: Animation offset (0-255)
Create a chasing light effect.
position: Position of the chasewidth: Width of the chaser,g,b: Color values
Cleanup and close connections.
- Connect the LED tube to one of the controller's 8 output ports
- Connect the controller to your network via Ethernet
- Power on the controller and note its IP address
- Configure the controller for Art-Net or DMX512 mode (check controller manual)
- Set the DMX address if using DMX512 mode
-
LEDs not responding:
- Check controller IP address is correct
- Verify network connection
- Check controller is powered on
- Verify LED tube is connected to controller
-
Wrong colors:
- Check RGB channel order (may need to adjust in code)
- Verify DMX address settings
-
Connection issues:
- Ensure Raspberry Pi and controller are on the same network
- Check firewall settings
- Verify Art-Net/DMX512 protocol settings on controller
- The controller supports both Art-Net and DMX512 protocols
- Art-Net is recommended for network-based control
- Each pixel uses 3 DMX channels (RGB)
- Total channels = pixels × 3
- For a 1-meter tube with 24 pixels/meter: 24 × 3 = 72 channels
MIT