Merge pull request #910 from Aircoookie/merge-dmx-proxy
Merge dmx proxy
This commit is contained in:
commit
579f355852
@ -8,11 +8,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX
|
||||||
#include "src/dependencies/dmx/ESPDMX.h"
|
|
||||||
DMXESPSerial dmx;
|
|
||||||
|
|
||||||
void handleDMX()
|
void handleDMX()
|
||||||
{
|
{
|
||||||
|
// don't act, when in DMX Proxy mode
|
||||||
|
if (e131ProxyUniverse != 0) return;
|
||||||
|
|
||||||
// TODO: calculate brightness manually if no shutter channel is set
|
// TODO: calculate brightness manually if no shutter channel is set
|
||||||
|
|
||||||
uint8_t brightness = strip.getBrightness();
|
uint8_t brightness = strip.getBrightness();
|
||||||
|
@ -25,6 +25,15 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, bool isArtnet){
|
|||||||
seq = p->sequence_number;
|
seq = p->sequence_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WLED_ENABLE_DMX
|
||||||
|
// does not act on out-of-order packets yet
|
||||||
|
if (e131ProxyUniverse > 0 && uni == e131ProxyUniverse) {
|
||||||
|
for (uint16_t i = 1; i <= dmxChannels; i++)
|
||||||
|
dmx.write(i, e131_data[i]);
|
||||||
|
dmx.update();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// only listen for universes we're handling & allocated memory
|
// only listen for universes we're handling & allocated memory
|
||||||
if (uni >= (e131Universe + E131_MAX_UNIVERSE_COUNT)) return;
|
if (uni >= (e131Universe + E131_MAX_UNIVERSE_COUNT)) return;
|
||||||
|
|
||||||
|
@ -212,6 +212,8 @@ function S(){GCH(15);GetV();mMap();}function H(){window.open("https://github.com
|
|||||||
<button type="button" onclick="B()">Back</button><button type="submit">Save</button><hr>
|
<button type="button" onclick="B()">Back</button><button type="submit">Save</button><hr>
|
||||||
<h2>Imma firin ma lazer (if it has DMX support)</h2><!-- TODO: Change to something less-meme-related //-->
|
<h2>Imma firin ma lazer (if it has DMX support)</h2><!-- TODO: Change to something less-meme-related //-->
|
||||||
|
|
||||||
|
Proxy Universe <input name=PU type=number min=0 max=63999 required> from E1.31 to DMX (0=disabled)<br>
|
||||||
|
<i>This will disable the LED data output to DMX configurable below</i><br><br>
|
||||||
<i>Number of fixtures is taken from LED config page</i><br>
|
<i>Number of fixtures is taken from LED config page</i><br>
|
||||||
|
|
||||||
Channels per fixture (15 max): <input type="number" min="1" max="15" name="CN" maxlength="2" onchange="mMap();"><br />
|
Channels per fixture (15 max): <input type="number" min="1" max="15" name="CN" maxlength="2" onchange="mMap();"><br />
|
||||||
|
@ -297,7 +297,10 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
|
|||||||
#ifdef WLED_ENABLE_DMX // include only if DMX is enabled
|
#ifdef WLED_ENABLE_DMX // include only if DMX is enabled
|
||||||
if (subPage == 7)
|
if (subPage == 7)
|
||||||
{
|
{
|
||||||
int t = request->arg("CN").toInt();
|
int t = request->arg("PU").toInt();
|
||||||
|
if (t >= 0 && t <= 63999) e131ProxyUniverse = t;
|
||||||
|
|
||||||
|
t = request->arg("CN").toInt();
|
||||||
if (t>0 && t<16) {
|
if (t>0 && t<16) {
|
||||||
DMXChannels = t;
|
DMXChannels = t;
|
||||||
}
|
}
|
||||||
|
@ -76,6 +76,10 @@
|
|||||||
#include "src/dependencies/blynk/BlynkSimpleEsp.h"
|
#include "src/dependencies/blynk/BlynkSimpleEsp.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef WLED_ENABLE_DMX
|
||||||
|
#include "src/dependencies/dmx/ESPDMX.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "src/dependencies/e131/ESPAsyncE131.h"
|
#include "src/dependencies/e131/ESPAsyncE131.h"
|
||||||
#include "src/dependencies/async-mqtt-client/AsyncMqttClient.h"
|
#include "src/dependencies/async-mqtt-client/AsyncMqttClient.h"
|
||||||
#include "src/dependencies/json/AsyncJson-v6.h"
|
#include "src/dependencies/json/AsyncJson-v6.h"
|
||||||
@ -227,6 +231,10 @@ WLED_GLOBAL bool receiveDirect _INIT(true); // receive UDP
|
|||||||
WLED_GLOBAL bool arlsDisableGammaCorrection _INIT(true); // activate if gamma correction is handled by the source
|
WLED_GLOBAL bool arlsDisableGammaCorrection _INIT(true); // activate if gamma correction is handled by the source
|
||||||
WLED_GLOBAL bool arlsForceMaxBri _INIT(false); // enable to force max brightness if source has very dark colors that would be black
|
WLED_GLOBAL bool arlsForceMaxBri _INIT(false); // enable to force max brightness if source has very dark colors that would be black
|
||||||
|
|
||||||
|
#ifdef WLED_ENABLE_DMX
|
||||||
|
WLED_GLOBAL DMXESPSerial dmx;
|
||||||
|
WLED_GLOBAL uint16_t e131ProxyUniverse _INIT(0); // output this E1.31 (sACN) / ArtNet universe via MAX485 (0 = disabled)
|
||||||
|
#endif
|
||||||
WLED_GLOBAL uint16_t e131Universe _INIT(1); // settings for E1.31 (sACN) protocol (only DMX_MODE_MULTIPLE_* can span over consequtive universes)
|
WLED_GLOBAL uint16_t e131Universe _INIT(1); // settings for E1.31 (sACN) protocol (only DMX_MODE_MULTIPLE_* can span over consequtive universes)
|
||||||
WLED_GLOBAL uint16_t e131Port _INIT(5568); // DMX in port. E1.31 default is 5568, Art-Net is 6454
|
WLED_GLOBAL uint16_t e131Port _INIT(5568); // DMX in port. E1.31 default is 5568, Art-Net is 6454
|
||||||
WLED_GLOBAL byte DMXMode _INIT(DMX_MODE_MULTIPLE_RGB); // DMX mode (s.a.)
|
WLED_GLOBAL byte DMXMode _INIT(DMX_MODE_MULTIPLE_RGB); // DMX mode (s.a.)
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//eeprom Version code, enables default settings instead of 0 init on update
|
//eeprom Version code, enables default settings instead of 0 init on update
|
||||||
#define EEPVER 19
|
#define EEPVER 20
|
||||||
//0 -> old version, default
|
//0 -> old version, default
|
||||||
//1 -> 0.4p 1711272 and up
|
//1 -> 0.4p 1711272 and up
|
||||||
//2 -> 0.4p 1711302 and up
|
//2 -> 0.4p 1711302 and up
|
||||||
@ -28,6 +28,7 @@
|
|||||||
//17-> 0.9.1-dmx
|
//17-> 0.9.1-dmx
|
||||||
//18-> 0.9.1-e131
|
//18-> 0.9.1-e131
|
||||||
//19-> 0.9.1n
|
//19-> 0.9.1n
|
||||||
|
//20-> 0.9.1p
|
||||||
|
|
||||||
void commit()
|
void commit()
|
||||||
{
|
{
|
||||||
@ -211,6 +212,11 @@ void saveSettingsToEEPROM()
|
|||||||
EEPROM.write(2181, macroNl);
|
EEPROM.write(2181, macroNl);
|
||||||
EEPROM.write(2182, macroDoublePress);
|
EEPROM.write(2182, macroDoublePress);
|
||||||
|
|
||||||
|
#ifdef WLED_ENABLE_DMX
|
||||||
|
EEPROM.write(2185, e131ProxyUniverse & 0xFF);
|
||||||
|
EEPROM.write(2186, (e131ProxyUniverse >> 8) & 0xFF);
|
||||||
|
#endif
|
||||||
|
|
||||||
EEPROM.write(2187, e131Port & 0xFF);
|
EEPROM.write(2187, e131Port & 0xFF);
|
||||||
EEPROM.write(2188, (e131Port >> 8) & 0xFF);
|
EEPROM.write(2188, (e131Port >> 8) & 0xFF);
|
||||||
|
|
||||||
@ -524,6 +530,13 @@ void loadSettingsFromEEPROM(bool first)
|
|||||||
e131Port = EEPROM.read(2187) + ((EEPROM.read(2188) << 8) & 0xFF00);
|
e131Port = EEPROM.read(2187) + ((EEPROM.read(2188) << 8) & 0xFF00);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WLED_ENABLE_DMX
|
||||||
|
if (lastEEPROMversion > 19)
|
||||||
|
{
|
||||||
|
e131ProxyUniverse = EEPROM.read(2185) + ((EEPROM.read(2186) << 8) & 0xFF00);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
receiveDirect = !EEPROM.read(2200);
|
receiveDirect = !EEPROM.read(2200);
|
||||||
notifyMacro = EEPROM.read(2201);
|
notifyMacro = EEPROM.read(2201);
|
||||||
|
|
||||||
|
@ -456,6 +456,8 @@ void getSettingsJS(byte subPage, char* dest)
|
|||||||
#ifdef WLED_ENABLE_DMX // include only if DMX is enabled
|
#ifdef WLED_ENABLE_DMX // include only if DMX is enabled
|
||||||
if (subPage == 7)
|
if (subPage == 7)
|
||||||
{
|
{
|
||||||
|
sappend('v',"PU",e131ProxyUniverse);
|
||||||
|
|
||||||
sappend('v',"CN",DMXChannels);
|
sappend('v',"CN",DMXChannels);
|
||||||
sappend('v',"CG",DMXGap);
|
sappend('v',"CG",DMXGap);
|
||||||
sappend('v',"CS",DMXStart);
|
sappend('v',"CS",DMXStart);
|
||||||
|
Loading…
Reference in New Issue
Block a user