Controlling Wifi Enabled LED Strip from Python
After buying a RGB LED Strip controller like the one shown, I discovered that it has a WIFI interface broadcasting an access point ('LEDnet003324007'), I connected and used nmap to discover an open port - 5577. Since there wasnt any software included, a Google search turn up a number of experimental interfaces for this. But all of these were a little vague. So I wrote a simple python script for controlling the LED Strip via the interface.
When connected to the LEDnet003324007 access point, my machine was given an IP address of 10.10.123.4. Scanning this network using nmap I discovered the gateway address of the controller: 10.10.123.3, and its open port on 5577.
The colour is set by the third parameter and is a 3 byte hex value (eg. RRGGBB) which each byte being the intensity of that colour.
Script use examples:
python lednet.py 10.10.123.3 5577 FF0000 - switch ON RED only
python lednet.py 10.10.123.3 5577 00FF00 - GREEN only
python lednet.py 10.10.123.3 5577 0000FF - BLUE only
python lednet.py 10.10.123.3 5577 FF00FF - PURPLE (Red plus Blue)
python lednet.py 10.10.123.3 5577 000000 - ALL LEDS OFF
