Skip to content

Commit 4ea1417

Browse files
committed
Fixes for v3.1
1 parent 5e099c3 commit 4ea1417

File tree

11 files changed

+60
-84
lines changed

11 files changed

+60
-84
lines changed

.vscode/arduino.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"board": "esp8266com:esp8266:generic",
3-
"configuration": "xtal=160,vt=flash,exception=disabled,ResetMethod=nodemcu,CrystalFreq=26,FlashFreq=40,FlashMode=dio,eesz=1M128,led=2,ip=hb2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200",
3+
"configuration": "xtal=160,vt=flash,exception=disabled,ssl=all,ResetMethod=nodemcu,CrystalFreq=26,FlashFreq=40,FlashMode=dio,eesz=1M128,led=2,sdk=nonosdk_190703,ip=hb2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200",
44
"sketch": "ESPixelStick.ino",
55
"output": ".build"
66
}

Changelog.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11

22
# Changelog
33

4-
### 3.1-dev (on-going)
4+
### 3.1
55

6+
- Compiled against [2.6.3 Arduino Core](https://github.com/esp8266/Arduino/releases/tag/2.6.3)
7+
- ESPSFlashTool support for ESPixelStick v3.0 Hardware
8+
- Fixed DMX issues - [Issue #101](https://github.com/forkineye/ESPixelStick/issues/101)
69
- Added brightness support.
710
- Added calculated gamma support.
811
- Added grouping and zigzag for pixels.
912
- Added startup and idle effect options.
13+
- Added FPP Discovery support.
14+
- Added xLights ZCPP support.
15+
- Added DDP support.
1016
- Added Home Assistant MQTT Discovery support.
11-
- Better MQTT support (usage detailed in the README).
12-
- New effects for standalone or MQTT usage.
17+
- New effects for standalone and MQTT usage.
1318
- Changed GECE output from bit-banging to a UART based implementation.
14-
- Removed PWM support. A version supporting PWM is maintaned by [penfold42](https://github.com/penfold42/ESPixelBoard).
1519

1620
### 3.0
1721

EFUpdate.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@
2222
#include <lwip/def.h>
2323
#include "EFUpdate.h"
2424

25-
#ifndef U_SPIFFS
26-
/*
27-
* Arduino 8266 libraries removed U_SPIFFS on master, replacing it with U_FS to allow for other FS types -
28-
* See https://github.com/esp8266/Arduino/commit/a389a995fb12459819e33970ec80695f1eaecc58#diff-6c6d762c616bd0b92156f152d128ad51
29-
*
30-
* Substitute the value here, while not breaking things for people using older SDKs.
31-
*/
32-
#define U_SPIFFS U_FS
33-
#endif
34-
3525
void EFUpdate::begin() {
3626
_maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
3727
_state = State::HEADER;
@@ -75,8 +65,7 @@ bool EFUpdate::process(uint8_t *data, size_t len) {
7565
}
7666
} else if (_record.type == RecordType::SPIFFS_IMAGE) {
7767
// Begin spiffs update
78-
SPIFFS.end();
79-
if (!Update.begin(_record.size, U_SPIFFS)) {
68+
if (!Update.begin(_record.size, U_FS)) {
8069
_state = State::FAIL;
8170
_error = Update.getError();
8271
} else {

ESPixelStick.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#ifndef ESPIXELSTICK_H_
2121
#define ESPIXELSTICK_H_
2222

23-
const char VERSION[] = "3.1-dev";
23+
const char VERSION[] = "3.1";
2424
const char BUILD_DATE[] = __DATE__;
2525

2626
// Mode configuration moved to Mode.h to ease things with Travis

ESPixelStick.ino

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ void setup() {
181181
{
182182
LOG_PORT.println("Failed to read file system details");
183183
}
184-
184+
185185
// Load configuration from SPIFFS and set Hostname
186186
loadConfig();
187187
if (config.hostname)
@@ -279,9 +279,9 @@ void setup() {
279279
fppDiscovery.begin();
280280

281281
if (ddp.begin(ourLocalIP)) {
282-
LOG_PORT.println(F("- DDP Enabled"));
282+
LOG_PORT.println(F("- DDP Enabled"));
283283
} else {
284-
LOG_PORT.println(F("*** DDP INIT FAILED ****"));
284+
LOG_PORT.println(F("*** DDP INIT FAILED ****"));
285285
}
286286

287287
lastZCPPConfig = -1;
@@ -443,7 +443,7 @@ void onMqttDisconnect(AsyncMqttClientDisconnectReason reason) {
443443

444444
void onMqttMessage(char* topic, char* payload,
445445
AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total) {
446-
446+
447447
DynamicJsonDocument r(1024);
448448
DeserializationError error = deserializeJson(r, payload);
449449

@@ -1031,7 +1031,7 @@ void loadConfig() {
10311031
void serializeConfig(String &jsonString, bool pretty, bool creds) {
10321032
// Create buffer and root object
10331033
DynamicJsonDocument json(1024);
1034-
1034+
10351035
// Device
10361036
JsonObject device = json.createNestedObject("device");
10371037
device["id"] = config.id.c_str();
@@ -1115,7 +1115,7 @@ void serializeConfig(String &jsonString, bool pretty, bool creds) {
11151115
#endif
11161116

11171117
if (pretty)
1118-
serializeJsonPretty(json, jsonString);
1118+
serializeJsonPretty(json, jsonString);
11191119
else
11201120
serializeJson(json, jsonString);
11211121
}
@@ -1176,7 +1176,7 @@ void sendZCPPConfig(ZCPP_packet_t& packet) {
11761176
packet.QueryConfigurationResponse.PortConfig[0].port = 0;
11771177
#if defined(ESPS_MODE_SERIAL)
11781178
packet.QueryConfigurationResponse.PortConfig[0].port |= 0x80;
1179-
#endif
1179+
#endif
11801180
packet.QueryConfigurationResponse.PortConfig[0].string = 0;
11811181
packet.QueryConfigurationResponse.PortConfig[0].startChannel = ntohl((uint32_t)config.channel_start);
11821182
#if defined(ESPS_MODE_PIXEL)
@@ -1235,8 +1235,8 @@ void sendZCPPConfig(ZCPP_packet_t& packet) {
12351235
packet.QueryConfigurationResponse.PortConfig[0].gamma = 0;
12361236
#endif
12371237
}
1238-
1239-
zcpp.sendConfigResponse(&packet);
1238+
1239+
zcpp.sendConfigResponse(&packet);
12401240
}
12411241

12421242
/////////////////////////////////////////////////////////
@@ -1367,14 +1367,14 @@ void loop() {
13671367
memset(version, 0x00, sizeof(version));
13681368
for (uint8_t i = 0; i < min(strlen_P(VERSION), sizeof(version)-1); i++)
13691369
version[i] = pgm_read_byte(VERSION + i);
1370-
1370+
13711371
uint8_t mac[WL_MAC_ADDR_LENGTH];
13721372
zcpp.sendDiscoveryResponse(&zcppPacket, version, WiFi.macAddress(mac), config.id.c_str(), pixelPorts, serialPorts, 680 * 3, 512, 680 * 3, static_cast<uint32_t>(ourLocalIP), static_cast<uint32_t>(ourSubnetMask));
13731373
}
13741374
break;
13751375
case ZCPP_TYPE_CONFIG: // config
13761376
LOG_PORT.println("ZCPP Config received.");
1377-
if (htons(zcppPacket.Configuration.sequenceNumber) != lastZCPPConfig) {
1377+
if (htons(zcppPacket.Configuration.sequenceNumber) != lastZCPPConfig) {
13781378
// a new config to apply
13791379
LOG_PORT.print(" The config is new: ");
13801380
LOG_PORT.println(htons(zcppPacket.Configuration.sequenceNumber));
@@ -1388,7 +1388,7 @@ void loop() {
13881388
if (p->port == 0) {
13891389
switch(p->protocol) {
13901390
#if defined(ESPS_MODE_PIXEL)
1391-
case ZCPP_PROTOCOL_WS2811:
1391+
case ZCPP_PROTOCOL_WS2811:
13921392
config.pixel_type = PixelType::WS2811;
13931393
break;
13941394
case ZCPP_PROTOCOL_GECE:
@@ -1405,7 +1405,7 @@ void loop() {
14051405
default:
14061406
LOG_PORT.print("Attempt to configure invalid protocol ");
14071407
LOG_PORT.print(p->protocol);
1408-
break;
1408+
break;
14091409
}
14101410
LOG_PORT.print(" Protocol: ");
14111411
#if defined(ESPS_MODE_PIXEL)
@@ -1416,7 +1416,7 @@ void loop() {
14161416
config.channel_start = htonl(p->startChannel);
14171417
LOG_PORT.print(" Start Channel: ");
14181418
LOG_PORT.println(config.channel_start);
1419-
config.channel_count = htonl(p->channels);
1419+
config.channel_count = htonl(p->channels);
14201420
LOG_PORT.print(" Channel Count: ");
14211421
LOG_PORT.println(config.channel_count);
14221422
#if defined(ESPS_MODE_PIXEL)
@@ -1461,8 +1461,8 @@ void loop() {
14611461
LOG_PORT.print("Attempt to configure invalid port ");
14621462
LOG_PORT.print(p->port);
14631463
}
1464-
1465-
p += sizeof(zcppPacket.Configuration.PortConfig);
1464+
1465+
p += sizeof(zcppPacket.Configuration.PortConfig);
14661466
}
14671467

14681468
if (zcppPacket.Configuration.flags & ZCPP_CONFIG_FLAG_LAST) {
@@ -1531,7 +1531,7 @@ void loop() {
15311531
|| (config.ds == DataSource::MQTT) ) {
15321532
effects.run();
15331533
}
1534-
1534+
15351535
/* Streaming refresh */
15361536
#if defined(ESPS_MODE_PIXEL)
15371537
if (pixels.canRefresh())
@@ -1541,7 +1541,7 @@ void loop() {
15411541
serial.show();
15421542
#endif
15431543
}
1544-
1544+
15451545
// workaround crash - consume incoming bytes on serial port
15461546
if (LOG_PORT.available()) {
15471547
while (LOG_PORT.read() >= 0);

SerialDriver.cpp

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/******************************************************************
2-
*
2+
*
33
* Project: ESPixelStick - An ESP8266 and E1.31 based pixel (And Serial!) driver
44
* Orginal ESPixelStickproject by 2015 Shelby Merrick
55
*
@@ -8,16 +8,16 @@
88
* www.billporter.info
99
*
1010
* See Readme for other info and version history
11-
*
12-
*
11+
*
12+
*
1313
*This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
1414
This program is distributed in the hope that it will be useful,
1515
but WITHOUT ANY WARRANTY; without even the implied warranty of
1616
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1717
GNU General Public License for more details.
1818
<http://www.gnu.org/licenses/>
1919
*
20-
*This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
20+
*This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
2121
*To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or
2222
*send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
2323
******************************************************************/
@@ -119,23 +119,14 @@ int SerialDriver::begin(HardwareSerial *theSerial, SerialType type,
119119
return retval;
120120
}
121121

122-
/* move buffer creation to being, added header bytes on eneqeue / fill fifo */
123-
void SerialDriver::startPacket() {
124-
// Create a buffer and fill in header
125-
if (_type == SerialType::RENARD) {
126-
_serialdata = static_cast<uint8_t *>(malloc(_size + 2));
127-
_serialdata[0] = 0x7E;
128-
_serialdata[1] = 0x80;
129-
// Create buffer
130-
} else if (_type == SerialType::DMX512) {
131-
_serialdata = static_cast<uint8_t *>(malloc(_size));
132-
}
133-
}
134-
135122
const uint8_t* ICACHE_RAM_ATTR SerialDriver::fillFifo(const uint8_t *buff, const uint8_t *tail) {
136123
uint8_t avail = (UART_TX_FIFO_SIZE - getFifoLength());
137-
if (tail - buff > avail) tail = buff + avail;
138-
while (buff < tail) enqueue(*buff++);
124+
if (tail - buff > avail)
125+
tail = buff + avail;
126+
127+
while (buff < tail)
128+
enqueue(*buff++);
129+
139130
return buff;
140131
}
141132

@@ -168,8 +159,11 @@ void ICACHE_RAM_ATTR SerialDriver::serial_handle(void *param) {
168159
void SerialDriver::show() {
169160
if (!_serialdata) return;
170161

171-
uart_buffer = _serialdata;
172-
uart_buffer_tail = _serialdata + _size;
162+
/* Copy data to the idle buffer and swap it */
163+
memcpy(_asyncdata, _serialdata, _size);
164+
165+
uart_buffer = _asyncdata;
166+
uart_buffer_tail = _asyncdata + _size;
173167

174168
if (_type == SerialType::DMX512) {
175169
SET_PERI_REG_MASK(UART_CONF0(SEROUT_UART), UART_TXD_BRK);
@@ -182,9 +176,7 @@ void SerialDriver::show() {
182176

183177
startTime = micros();
184178

185-
/* Copy data to the idle buffer and swap it */
186-
memcpy(_asyncdata, _serialdata, _size);
187-
std::swap(_asyncdata, _serialdata);
179+
// std::swap(_asyncdata, _serialdata);
188180
}
189181

190182

SerialDriver.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/******************************************************************
2-
*
2+
*
33
* Project: ESPixelStick - An ESP8266 and E1.31 based pixel (And Serial!) driver
44
* Orginal ESPixelStickproject by 2015 Shelby Merrick
55
*
@@ -8,16 +8,16 @@
88
* www.billporter.info
99
*
1010
* See Readme for other info and version history
11-
*
12-
*
11+
*
12+
*
1313
*This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
1414
This program is distributed in the hope that it will be useful,
1515
but WITHOUT ANY WARRANTY; without even the implied warranty of
1616
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1717
GNU General Public License for more details.
1818
<http://www.gnu.org/licenses/>
1919
*
20-
*This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
20+
*This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
2121
*To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or
2222
*send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
2323
******************************************************************/
@@ -63,7 +63,6 @@ class SerialDriver {
6363
int begin(HardwareSerial *theSerial, SerialType type, uint16_t length);
6464
int begin(HardwareSerial *theSerial, SerialType type, uint16_t length,
6565
BaudRate baud);
66-
void startPacket();
6766
void show();
6867
uint8_t* getData();
6968

@@ -109,14 +108,14 @@ class SerialDriver {
109108
/* Serial interrupt handler */
110109
static void ICACHE_RAM_ATTR serial_handle(void *param);
111110

112-
/* Returns number of bytes waiting in the TX FIFO of SEROUT_UART */
111+
/* Returns number of bytes waiting in the TX FIFO of UART1 */
113112
static inline uint8_t getFifoLength() {
114-
return (ESP8266_REG(U0F+(0xF00*SEROUT_UART)) >> USTXC) & 0xff;
113+
return (U1S >> USTXC) & 0xff;
115114
}
116115

117-
/* Append a byte to the TX FIFO of SEROUT_UART */
116+
/* Append a byte to the TX FIFO of UART1 */
118117
static inline void enqueue(uint8_t byte) {
119-
ESP8266_REG(U0F+(0xF00*SEROUT_UART)) = byte;
118+
U1F = byte;
120119
}
121120
};
122121

dist/firmware/firmware.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
{
44
"name": "Pixel (WS2811 / GECE)",
55
"description": "Pixel Mode",
6-
"version": "3.0 (20171120)",
7-
"file": "pixel-3.0-1m_128k.bin"
6+
"version": "3.1 (20200110)",
7+
"file": "pixel-3.1-1m_128k.bin"
88
},
99
{
1010
"name": "Serial (DMX / Renard)",
1111
"description": "Serial Mode",
12-
"version": "3.0 (20171120)",
13-
"file": "serial-3.0-1m_128k.bin"
12+
"version": "3.1 (20200110)",
13+
"file": "serial-3.1-1m_128k.bin"
1414
}
1515
],
1616

html/index.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,6 @@
353353
</div>
354354
</div>
355355

356-
<!-- Display Layout -->
357-
<div class="t_layout">
358-
<legend class="esps-legend">Display Layout</legend>
359-
Placeholder for layout configuration to assist in effect rendering. Selectable type (string, matrix, tree, etc..) and size / orientation where applicable (20x30 matrix - horizontal or veritcal? where does feed start?). Should also be used to render view stream which is moved to the Diagnostics tab.
360-
</div>
361-
362356
</form>
363357
</fieldset>
364358
</div>

travis/firmware.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
"file": "serial-travis.bin"
1414
}
1515
],
16-
16+
1717
"devices": [
1818
{
1919
"name": "ESP01_1MB_128K",
2020
"esptool": {
21-
"reset": "none",
21+
"reset": "nodemcu",
2222
"baudrate": "115200",
2323
"spiffsloc": "0xDB000"
2424
},

0 commit comments

Comments
 (0)