173 lines
5.7 KiB
Markdown
173 lines
5.7 KiB
Markdown
# 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
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Chan</th>
|
|
<th>Command</th>
|
|
<th>DMX Range</th>
|
|
<th>Value Range</th>
|
|
<th>Resolution</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>1</td>
|
|
<td>Intensity Coarse</td>
|
|
<td rowspan=2>0 - 65535</td>
|
|
<td rowspan=2>0 - 100%</td>
|
|
<td rowspan=2>15 bit<br/>2.4kHz PWM</td>
|
|
</tr>
|
|
<tr>
|
|
<td>2</td>
|
|
<td>Intensity Fine</td>
|
|
</tr>
|
|
<tr>
|
|
<td>3</td>
|
|
<td>Duration</td>
|
|
<td>0 - 255</td>
|
|
<td>0.02 - 0.5s</td>
|
|
<td>0.004s</td>
|
|
</tr>
|
|
<tr>
|
|
<td>4</td>
|
|
<td>Rate</td>
|
|
<td>0 - 255</td>
|
|
<td>0.5 - 25Hz</td>
|
|
<td>0.1Hz</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
### Hardware
|
|
```
|
|
/*
|
|
* This section to be configured by the Fixtures Dept.
|
|
*/
|
|
const int button = A0;
|
|
const int led = LED_BUILTIN;
|
|
```
|
|
These values need to match the hardware setup.
|
|
|
|
## Finishing
|
|
Use the upload button in Arduino to compile your changes and upload the software to your ESP32 device.
|
|
|
|
### Troubleshooting
|
|
| Problem | Try |
|
|
| :- | :- |
|
|
| Arduino shows compiler errors. | Make sure you have the correct board type selected in the Tools > Board menu. |
|
|
| Errors during upload. | Make sure that you have the correct port selected in the Tools > Port menu. |
|
|
|
|
## Credits
|
|
|
|
While not the first device of this class to be constructed, this version is credited to:
|
|
|
|
- Concept & electronics: Phil Abeyta
|
|
- System design & firmware: Kevin Matz
|
|
|
|
## Copying
|
|
This Software is released under the MIT License.
|
|
|
|
Copyright © 2020, Kevin Matz
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
SOFTWARE.
|