SPI bridge for AWA protocol to control a LED strip from HyperHDR (version v17 and above).
Diagnostic data available at the serial port output (@115200 speed).
Rpi acts as a master, ESP8266/ESP32 is in slave mode.
LED strip / Device | ESP8266 | ESP32 |
---|---|---|
SK6812 cold white | yes | yes |
SK6812 neutral white | yes | yes |
WS281x | yes | yes |
SPI (APA102, SK9812, HD107...) | no | yes |
- SPI is much faster. HyperSPI works best at speed over 20Mb.
- SPI doesn't have any data integration check. But AWA protocol does have one.
- you don't need to have 2Mb capable serial port on your ESP board.
- I needed it and I was able to implemented it ;)
- There is a hardware limitation for the Rpi current design...even if you connect your grabber to the USB3.0 in the USB2.0 mode the adalight running driver causes quite a big USB transfer drop. So we can replace Adalight with a pure SPI data transfer as an alternative.
See what's happening for USB2.0 bus... my problematic Ezcap 320 @ 50 fps fell back to USB2.0 mode and did not like the CH340G serial port driver at all (real USB3.0 should not be affected, but not tested it):
That's how the grabbers works when other device is disconnected from the USB port.
Select esp8266 protocol for ESP proprietary SPI protocol, esp32 for ESP32 boards or 'standard' for other devices.
Make sure you set "Refresh time" to zero, "Baudrate" should be set to high but realistic value like 25 000 000
.
Enabling "White channel calibration" is optional, if you want to fine tune the white channel balance of your sk6812 RGBW LED strip.
ESP8266 SPI input: GPIO 14 for Clock (SCK), GPIO 12 for Data (MISO), GPIO 13 for Data (MOSI)
LED output: GPIO 2
Warning: HyperSPI set SPI_MODE0 on default due to a bug with a SPI bit shift link, you may need to change it to SPI_MODE3 for slower speeds
ESP32 SPI input: VSPI interface, GPIO 5 for SPI Chip Select, GPIO 18 for Clock (SCK), GPIO 19 for Data (MISO), GPIO 23 for Data (MOSI)
LED output (non-SPI): GPIO 2
LED output (SPI): GPIO 0 for Clock, GPIO 2 for Data
Compile the sketch using Arduino IDE. You need:
- https://github.com/espressif/arduino-esp32 (boards for ESP32)
- https://github.com/esp8266/Arduino/ (boards for ESP8266)
- Makuna/NeoPixelBus (install from Arduino IDE: manage libraries)
- ESP32DMASPI (install from Arduino IDE: manage libraries)
Options (first lines of the sketch):
For RGB strip like WS8212b comment it with a '//', leave it for RGBW SK6812:
#define THIS_IS_RGBW
For RGBW cold white LED strip version if above declaration is defined, delete it or comment it with '//' for RGBW neutral:
#define COLD_WHITE
Skip first led in the strip, that is used as level shifter:
bool skipFirstLed = true;
Don't change LED's count as it is dynamic.