LedPictureFrame is the controller code for the DIY project Led Picture Frame using an esp12/esp12e and any 8x8 or 16x16 RGB Matrix NeoPixel Module.
Required libraries:
- Adafruit GFX (https://github.com/adafruit/Adafruit-GFX-Library)
- Adafruit NeoPixel (https://github.com/adafruit/Adafruit_NeoPixel)
- Adafruit NeoMatrix (https://github.com/adafruit/Adafruit_NeoMatrix)
- ESP-WifiSettings (https://github.com/Juerd/ESP-WiFiSettings)
All libraries are available from the Library Manager in the Arduino IDE. I recommend installing them that way.
Panels: The sketch is designed to work with RGB flexible matrix panels based on individual addressable WS2812B LEDs. They are pretty cheap and easy to obtain - just do a search for e.g. "rgb led matrix 16x16" or "rgb led matrix 8x8". It is also possible to create your own panel using strips of WS2812B LEDs arranged in a zigzag pattern.
Wiring: Locate the IN connector on the panel and hook up GND and VCC to the appropriate pins on the ESP as well as the data line to D3. Both 3.3v and 5v works for the panel, however if you plan to chaing multiple panels together for 32x32 or 64x64 you need to supply extra power through the dedicated connectors.
Getting started / setup: 0) Define the display size
- Use Arduino IDE to compile and upload the sketch to your esp8266.
- The sketch will start looking for a network and when it doesn't find one it will start an AP with a configuration portal using a SSID like "frame-xxxxxx", where xxxxx is the MAC-address of the esp.
- Select the "frame-xxx" WiFi and wait for the configuration portal to appear
- Select your wifi and type in the credentials. If you wish to name the Led Picture Frame you can do that now
- Restart the esp
Use: After the initial set up, on power up the panel will show a red-blue-green sequence in the upper right pixel followed by a blue bar indicating connection to a known WiFi.
The panel is now ready to receive UDP-commands on port 8888. Even though the sketch will work with raw UDP-commands I recommend downloading Led Picture Frame from AppStore or write your own interface.
Supported commands:
cmd0 (returns information on panel resolution) cmd1 (clear panel) cmd2XX (adjust brightness, where XX are a value between 0-255 expressed in HEX) posLXXYYCCCCCC (sets pixel at XX x YY to the color CCCCCC. If L=0 the color is expressed as 16-bit rgb565 value and if L=1 color is 24-bit rgb value) LMIXXXXX (recieve and parse a LMI - Lossless Matrix Image). If the image is larger then the panel it will be cropped.
Examples using netcat:
Clear panel: echo cmd1 | nc -u frame_office.local 8888
Set (1,7) to red ( rgb(255,0,0) expressed FF00000): echo pos10107FF0000 | nc -u frame_office.local 8888