# WiFlash Uses a GPIO to control a lighting console over OSC, whilst also controlling an LED strobe light with DMX data received over sACN. This software is designed for the ESP32, but will probably be usable on other Espressif platforms, ![example](assets/wiflash_schem.png) ## Requirements * [Arduino IDE](https://www.arduino.cc/en/software) > Refer to the [Getting Started](https://www.arduino.cc/en/Guide/) page for Installation instructions. * [Arduino core for ESP32](https://github.com/espressif/arduino-esp32) > - Start Arduino and open Preferences window. - Enter `https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json` into *Additional Board Manager URLs* field. You can add multiple URLs, separating them with commas. - Open Boards Manager from Tools > Board menu and install *esp32* platform (and don't forget to select your ESP32 board from Tools > Board menu after installation). * [ArduinoOSC](https://github.com/hideakitai/ArduinoOSC) - OSC subscriber / publisher for Arduino > Install from the Arduino library manager. * [WiFlash for ESP32](https://git.company235.com/kevin/wiflash) > - Unzip the downloaded file. - Open `wiflash_esp32.ino` in Arduino. - Select your ESP32 board from the Tools > Board menu. ## Configuring ### WiFi ``` // ----------------------------------- // Configure the WiFi network // ----------------------------------- const char ssid[] = "WiFi NETWORK"; const char pwd[] = "PASSWORD"; ``` Change these lines to enter your own SSID and WEP/WPA2 password. ### IPv4 ``` // ----------------------------------- // Configure the IPv4 network // ----------------------------------- const IPAddress ip(127, 0, 0, 1); const IPAddress gateway(0, 0, 0, 0); const IPAddress subnet(255, 255, 255, 255); ``` Enter your own IP configuration. **Note the commas** between bytes in the address. ### OSC ``` // ----------------------------------- // Configure OSC // ----------------------------------- const String host = "2.0.0.1"; const uint16_t port = 7001; ``` Set the value of `host` to be the IP address of the OSC server. Here, **the IP address bytes are separated by a period**. ``` const String pressed_addr = "/hog/playback/go/0"; const String pressed_value = "99.1"; const String released_addr = "/hog/playback/go/0"; const String released_value = "99.2"; ``` Change these lines to suit your setup. These examples will send `GOTO LIST 99 CUE 1` when the button is pressed, and `GOTO LIST 99 CUE 2` when the button is released. Check the [Hog 4 OSC mappings](https://www.highend.com/pub/support/controllers/documents/HTML/en/sect-osc_mappings.htm) manual page for additional inspiration. ### E1.31 sACN ``` // ----------------------------------- // Configure E1.31 sACN // ----------------------------------- Strobe strobe(E131_MULTICAST, 1, 001); ``` Set these 3 arguments to configure sACN. 1. Change this to `E131_MULTICAST` to receive multicast sACN, or `E131_UNICAST` to receive unicast sACN. 1. This is the sACN universe to respond to. 1. Set the DMX start address for the strobe light. ###### Hog4 fixture profile: [Import from XML](728%20Fixtures%20Wiflash%20rev%200.xml) #### DMX Mapping
Chan | Command | DMX Range | Value Range | Resolution |
---|---|---|---|---|
1 | Intensity Coarse | 0 - 65535 | 0 - 100% | 15 bit 2.4kHz PWM |
2 | Intensity Fine | |||
3 | Duration | 0 - 255 | 0.02 - 0.5s | 0.004s |
4 | Rate | 0 - 255 | 0.5 - 25Hz | 0.1Hz |