Skip to content

Commit

Permalink
Merge pull request #1 from debsahu/develop
Browse files Browse the repository at this point in the history
1.2.1
  • Loading branch information
debsahu authored Nov 8, 2019
2 parents 5a805c6 + 99c1fc3 commit 6aad892
Show file tree
Hide file tree
Showing 8 changed files with 594 additions and 125 deletions.
487 changes: 389 additions & 98 deletions Arduino/E131_PixelPusher/E131_PixelPusher.ino

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions Arduino/E131_PixelPusher/version.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define SKETCH_VERSION "1.1.2"
#define SKETCH_VERSION "1.2.1"

/*
* Dec 13, 2018 v1.0.0
Expand All @@ -21,6 +21,15 @@
* - Added ESP32 support (check platformio.ini for compiling details)
* - APA102/DotStar relavent lines
*
* Jab 8, 2019 v1.1.2 (commented by default so version remains same)
* Jan 8, 2019 v1.1.2 (commented by default so version remains same)
* - Added Arduino IDE compatibility mode, DNS server is not Async for ArduinoIDE
*
* Jan 21, 2019 v1.2.0
* - Add web interface
* - user can choose starting universe, unicast/umulticast, total number of universe
*
* Jan 31, 2019 v1.2.1
* - Fix ESP32 specific issues
* - Use Adafruit's Dotstar SPI method using hardware support
* - MDNS.setinstance is causing significant FPS drop, commented for now
*/
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
# E131_PixelPusher

[![Build Status](https://travis-ci.com/debsahu/E131_PixelPusher.svg?branch=master)](https://travis-ci.com/debsahu/E131_PixelPusher) [![License: MIT](https://img.shields.io/github/license/debsahu/E131_PixelPusher.svg)](https://opensource.org/licenses/MIT) [![version](https://img.shields.io/github/release/debsahu/E131_PixelPusher.svg)](https://github.com/debsahu/E131_PixelPusher/releases/tag/1.1.2) [![LastCommit](https://img.shields.io/github/last-commit/debsahu/E131_PixelPusher.svg?style=social)](https://github.com/debsahu/E131_PixelPusher/commits/master)
[![Build Status](https://travis-ci.com/debsahu/E131_PixelPusher.svg?branch=master)](https://travis-ci.com/debsahu/E131_PixelPusher) [![License: MIT](https://img.shields.io/github/license/debsahu/E131_PixelPusher.svg)](https://opensource.org/licenses/MIT) [![version](https://img.shields.io/github/release/debsahu/E131_PixelPusher.svg)](https://github.com/debsahu/E131_PixelPusher/releases/tag/1.2.0) [![LastCommit](https://img.shields.io/github/last-commit/debsahu/E131_PixelPusher.svg?style=social)](https://github.com/debsahu/E131_PixelPusher/commits/master)

Minimalistic Async code around Async E131 for ESP8266/ESP32

- Completely Async
- Web-interface to set starting universe, unicast/umulticast, total number of universes
- WiFiManager Captive Portal to get WiFi credentials (Compile with `-DUSE_EADNS` for ESP8266)
- Subscribes to E131 multicast
- Connect RX/GPIO3 to DIN of NeoPixel strip, and any PIN (<GPIO32) specified for ESP32
- Upload included [firmware.bin](https://github.com/debsahu/E131_PixelPusher/releases/latest) at http://<IP_ADDRESS>/update for ESP8266, compile your own for ESP32
- Included relavent lines for APA102/Dotstar LED strip
- Included relavent lines for APA102/Dotstar LED strip: Comment `//#define USE_NEOPIXELS xxx` and uncomment `#define USE_DOTSTAR`
- ESP8266 Hardware SPI: Uses GPIO14(SCK) for CLOCK and GPIO13(MOSI) for DATA
- ESP32 Hardware SPI: Uses GPIO18(SCK) for CLOCK and GPIO23(MOSI) for DATA

[![E131_PixelPusher](https://img.youtube.com/vi/lZ09GlO2_8s/0.jpg)](https://www.youtube.com/watch?v=lZ09GlO2_8s)

## Libraries Needed

[platformio.ini](https://github.com/debsahu/E131_PixelPusher/blob/master/platformio.ini) is included, use [PlatformIO](https://platformio.org/platformio-ide) and it will take care of installing the following libraries.

| Library | Link |
|---------------------------|------------------------------------------------------------|
|ESPAsyncE131 |https://github.com/forkineye/ESPAsyncE131 |
|ESPAsyncUDP |https://github.com/me-no-dev/ESPAsyncUDP |
|ESPAsyncTCP |https://github.com/me-no-dev/ESPAsyncTCP |
|NeoPixelBus |https://github.com/Makuna/NeoPixelBus |
|ESPAsyncWiFiManager |https://github.com/alanswx/ESPAsyncWiFiManager |
|ESPAsyncDNSServer |https://github.com/devyte/ESPAsyncDNSServer |
|ESP Async WebServer |https://github.com/me-no-dev/ESPAsyncWebServer |
| Library | Link | Platform |
|---------------------------|------------------------------------------------------------|-------------|
|ESPAsyncE131 |https://github.com/forkineye/ESPAsyncE131 |ESP8266/32 |
|ESPAsyncUDP |https://github.com/me-no-dev/ESPAsyncUDP |ESP8266 |
|ESPAsyncTCP |https://github.com/me-no-dev/ESPAsyncTCP |ESP8266 |
|NeoPixelBus |https://github.com/Makuna/NeoPixelBus |ESP8266/32 |
|ESPAsyncWiFiManager |https://github.com/alanswx/ESPAsyncWiFiManager |ESP8266/32 |
|ESPAsyncDNSServer |https://github.com/devyte/ESPAsyncDNSServer |ESP8266 |
|ESP Async WebServer |https://github.com/me-no-dev/ESPAsyncWebServer |ESP8266/32 |
|AsyncTCP |https://github.com/me-no-dev/AsyncTCP |ESP32 |
|Adafruit's Dot Star |https://github.com/debsahu/Adafruit_DotStar |ESP8266/32 |

## Pushing E1.31 UDP Data

Expand Down
6 changes: 6 additions & 0 deletions data/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ct":256,
"mode": "unicast",
"su":1,
"uct":7
}
150 changes: 150 additions & 0 deletions data/index.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<meta name='viewport' content='width=device-width' />
<script>
function LoadBody() {
//var url = '/data/data.json';
var url = '/data';
fetch(url, {
method: 'GET'
}).then(function(e) {
if(e.ok){
return e.json();
}
throw new Error('Network response was not ok.');
}).then(function (e) {
console.log('Success:', JSON.stringify(e));
document.getElementById("pixelct").innerHTML = 170 * (e.uct - e.su + 1);
document.getElementById("mode").value = e.mode;
document.getElementById("su").value = e.su;
document.getElementById("uct").value = e.uct;
}).catch(function(e) {
console.error('Error:', e)
});
}
function validateVal() {
var suval = document.getElementById("su").value;
var uctval = document.getElementById("uct").value;
var maxUniverse = 170 * 7;
if(document.frmmr.mode.value == "unicast") maxUniverse = 170 * 12;
if( suval > uctval || (uctval - suval + 1) <= 0 || 170 * (uctval - suval + 1) > maxUniverse) {
if(suval > uctval) alert("Starting universe cant be higher than ending universe!");
if(uctval - suval + 1 <= 0) alert("Number of Pixels cant be negative/zero!");
if(170 * (uctval - suval + 1) > maxUniverse) alert("Cant access that many universes!");
return false;
} else {
return true;
}
}
function calcPixels() {
document.getElementById("pixelct").innerHTML = 170 * (document.getElementById("uct").value - document.getElementById("su").value + 1);
}
function checkUnicast() {
if(document.frmmr.mode.value == "unicast") {
document.getElementById("su").max = "12";
document.getElementById("uct").max = "12";
} else {
document.getElementById("su").max = "7";
document.getElementById("uct").max = "7";
}
}
</script>
<style>
body {
width: 100%;
height: 100%;
margin: auto;
text-align: center;
background-color: #c6b3d4;
font-family: sans-serif;
color: white;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}

#wrapper {
width: 250px;
height: 270px;
border: 2px solid #8531C6;
border-radius: 8px;
margin: auto;
margin-top: 25px;
background-color: #580797;
}

.subbt {
text-align: center;
margin: 20px;
background-color: #008CBA;
border: none;
color: white;
padding: 10px 30px;
text-decoration: none;
display: inline-block;
font-size: 20px;
border-radius: 8px;
}

.title {
line-height: 24px;
display: block;
padding: 2px 0;
color: white;
}

.form {
width: 100%;
padding: 10px;
margin: 8px 0;
box-sizing: border-box;
}

a {
color: white;
text-decoration: none;
}

.github{
margin-top: 10px;
}

.github a {
color: #EF5989;
text-decoration: none;
font-weight: bold;
font-size: 16px;
}
</style>
</head>

<body onload="LoadBody()">
<div id="wrapper">
<h4 class="title">E1.31 Pixel Pusher</h4>
<form name="frmmr" class="form" method='POST' action='/updateparams' onsubmit="return validateVal()">
Pixels: <span id="pixelct"></span>
<br>
Mode:
<select id="mode" name="mode" onblur="checkUnicast()">
<option value="unicast">UNICAST</option>
<option value="multicast" selected>MULTICAST</option>
</select>
<br>
Start Universe: <input id="su" name="su" type="number" placeholder="Starting universe" max="12" min="1" onkeyup="this.value=this.value.replace(/[^\d]/,'')" onblur="calcPixels()" onclick="calcPixels()"/>
<br>
End Universe : <input id="uct" name="uct" type="number" placeholder="Ending universe" max="12" min="1" onkeyup="this.value=this.value.replace(/[^\d]/,'')" onblur="calcPixels()" onclick="calcPixels()"/>
<br>
<input class="subbt" type="submit" value="Update">
</form>
</div>
<br><a href='/update'>Update Firmware?</a>
<br>
<div class="github"><a href='https://github.com/debsahu/E131_PixelPusher'>E131_PixelPusher by @debsahu</a></div>
<script>
</script>
</body>

</html>
1 change: 1 addition & 0 deletions data/index.min.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="viewport" content="width=device-width"><script>function LoadBody(){var e="/data";fetch(e,{method:"GET"}).then(function(e){if(e.ok)return e.json();throw new Error("Network response was not ok.")}).then(function(e){console.log("Success:",JSON.stringify(e)),document.getElementById("pixelct").innerHTML=170*(e.uct-e.su+1),document.getElementById("mode").value=e.mode,document.getElementById("su").value=e.su,document.getElementById("uct").value=e.uct}).catch(function(e){console.error("Error:",e)})}function validateVal(){var e=document.getElementById("su").value,t=document.getElementById("uct").value,n=1190;return"unicast"==document.frmmr.mode.value&&(n=2040),!(e>t||t-e+1<=0||170*(t-e+1)>n)||(e>t&&alert("Starting universe cant be higher than ending universe!"),t-e+1<=0&&alert("Number of Pixels cant be negative/zero!"),170*(t-e+1)>n&&alert("Cant access that many universes!"),!1)}function calcPixels(){document.getElementById("pixelct").innerHTML=170*(document.getElementById("uct").value-document.getElementById("su").value+1)}function checkUnicast(){"unicast"==document.frmmr.mode.value?(document.getElementById("su").max="12",document.getElementById("uct").max="12"):(document.getElementById("su").max="7",document.getElementById("uct").max="7")}</script><style>.subbt,body{text-align:center;color:#fff}.subbt,.title,a,body{color:#fff}.github a,.subbt,a{text-decoration:none}body{width:100%;height:100%;margin:auto;background-color:#c6b3d4;font-family:sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#wrapper{width:250px;height:270px;border:2px solid #8531C6;border-radius:8px;margin:25px auto auto;background-color:#580797}.subbt{margin:20px;background-color:#008CBA;border:none;padding:10px 30px;display:inline-block;font-size:20px;border-radius:8px}.title{line-height:24px;display:block;padding:2px 0}.form{width:100%;padding:10px;margin:8px 0;box-sizing:border-box}.github{margin-top:10px}.github a{color:#EF5989;font-weight:700;font-size:16px}</style></head><body onload="LoadBody()"><div id="wrapper"><h4 class="title">E1.31 Pixel Pusher</h4><form name="frmmr" class="form" method="POST" action="/updateparams" onsubmit="return validateVal()">Pixels: <span id="pixelct"></span><br>Mode:<select id="mode" name="mode" onblur="checkUnicast()"><option value="unicast">UNICAST</option><option value="multicast" selected>MULTICAST</option></select><br>Start Universe: <input id="su" name="su" type="number" placeholder="Starting universe" max="12" min="1" onkeyup="this.value=this.value.replace(/[^\d]/,&#34;&#34;)" onblur="calcPixels()" onclick="calcPixels()"><br>End Universe : <input id="uct" name="uct" type="number" placeholder="Ending universe" max="12" min="1" onkeyup="this.value=this.value.replace(/[^\d]/,&#34;&#34;)" onblur="calcPixels()" onclick="calcPixels()"><br><input class="subbt" type="submit" value="Update"></form></div><br><a href="/update">Update Firmware?</a><br><div class="github"><a href="https://github.com/debsahu/E131_PixelPusher">E131_PixelPusher by @debsahu</a></div><script></script></body></html>
Binary file added data/index.min.htm.gz
Binary file not shown.
35 changes: 21 additions & 14 deletions platformio.ini
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
[platformio]
src_dir = ./Arduino/E131_PixelPusher/
;env_default = nodemcuv2
;env_default = esp32dev
;default_envs = nodemcuv2
;default_envs = esp32dev

[common]
framework = arduino
build_flags =
-w
monitor_speed = 115200
; upload_speed = 921600
upload_speed_fast = 921600
upload_speed = 115200
lib_deps =
ESPAsyncE131=https://github.com/forkineye/ESPAsyncE131
NeoPixelBus
[email protected]
; NeoPixelBus=https://github.com/Makuna/NeoPixelBus/archive/Esp32RMTExperimental.zip
ESP Async WebServer
ESPAsyncWiFiManager
https://github.com/debsahu/Adafruit_DotStar

[common:esp8266]
platform = [email protected]
arduino_core_2_3_0 = [email protected]
arduino_core_2_4_0 = [email protected]
arduino_core_2_4_1 = [email protected]
arduino_core_2_4_2 = [email protected]
arduino_core_2_5_2 = [email protected]
arduino_core_stage = https://github.com/platformio/platform-espressif8266.git#feature/stage
platform = ${common:esp8266.arduino_core_2_5_2}
board_build.flash_mode = dout
upload_resetmethod = nodemcu
build_flags =
Expand All @@ -31,9 +39,9 @@ lib_deps =
ESPAsyncDNSServer

[common:esp32]
platform = [email protected]
platform = [email protected]
;platform = https://github.com/platformio/platform-espressif32.git#feature/stage
build_flags =
-D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
-D ARDUINO_ARCH_ESP32
lib_ignore =
ESPAsyncUDP
Expand All @@ -46,8 +54,7 @@ lib_deps =
[env:nodemcuv2]
board = nodemcuv2
framework = ${common.framework}
; platform = ${common:esp8266.platform}
platform = https://github.com/platformio/platform-espressif8266.git#feature/stage
platform = ${common:esp8266.platform}
build_flags =
${common.build_flags}
${common:esp8266.build_flags}
Expand All @@ -59,16 +66,15 @@ board_build.flash_mode = ${common:esp8266.board_build.flash_mode}
lib_deps =
${common.lib_deps}
${common:esp8266.lib_deps}
;targets = upload, monitor ;uncomment for upload and serial monitor
;targets = erase, upload, monitor ;uncomment for upload and serial monitor

# see: http://docs.platformio.org/en/latest/platforms/espressif32.html
[env:esp32dev]
board = esp32dev
board = lolin_d32
framework = ${common.framework}
platform = ${common:esp32.platform}
;platform = https://github.com/platformio/platform-espressif32.git#feature/stage
monitor_speed = ${common.monitor_speed}
upload_speed = ${common.upload_speed}
upload_speed = ${common.upload_speed_fast}
build_flags =
${common.build_flags}
${common:esp32.build_flags}
Expand All @@ -77,4 +83,5 @@ lib_ignore =
lib_deps =
${common.lib_deps}
${common:esp32.lib_deps}
;targets = upload, monitor ;uncomment for upload and serial monitor
; WiFiManager=https://github.com/tzapu/WiFiManager/archive/development.zip
;targets = erase, upload, monitor ;uncomment for upload and serial monitor

0 comments on commit 6aad892

Please sign in to comment.