Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some work to get it stable #92

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Some work to get it stable #92

wants to merge 4 commits into from

Conversation

scamiv
Copy link

@scamiv scamiv commented Mar 24, 2018

Hi, I spent some time fixing the major annoyances.
In the WS2812 code i added a routine to halt the NMI while outputting the led data, this fixes the random flicker issue. ( from https://www.esp8266.com/viewtopic.php?f=9&t=3979&start=20 )

Webserver:
I added the TCP cleanup code from esp8266/Arduino#1923 this fixes the biggest Memleak and helps against crashes.
I modified the webserver to use ServeStatic this safes some heap and allows to send the files gzipped.
This makes the interface more snappy while lowering the load on the heap some more.
Added cache header.

The main loop now checks for low heap, if heap gets critical we do a reset.
Didn't have a hard freeze since.

Changed a lot of strings over to PROGMEM.

Theres now a pwmports[] array, it defines pins that will be accessible for PWM at universe 10.

Still need to do some cleanup before a merge.

Compile options:
CPU Frequency needs to be 160mhz, SDK 2.4.1 recommeded.
Set lwIP to "V2 Lower Memory"
Dont forget to upload SPIFFS (click on "ESP8266 Sketch Data Upload")

@scamiv scamiv changed the title Some work to get it stable (try2, sry screwed up my git) Some work to get it stable Mar 24, 2018
This was referenced Mar 25, 2018
@tohox
Copy link

tohox commented May 13, 2018

I believe this is a similar issue to what @Sine-Audio is experiencing in #66. I've compiled and ran your source on a Wemos D1 mini Pro with your recommended settings and it almost runs as expected. Webui and PWM outputs are working but as soon as I send something on the universe PORTA listens on the ESP crashes or restarts.

The only way to get it to run partially as it is now was to select the Wemos D1 R2 & mini board instead of the Wemos D1mini Pro board. I also had to select 4M (3M SPIFFS) instead of 16M (15M SPIFFS) in order for it to run.

@scamiv
Copy link
Author

scamiv commented May 13, 2018

Not sure what your issue could be, can you get a stack trace via serial and decode it? https://github.com/me-no-dev/EspExceptionDecoder
Did you select "Erase all flash Contents" on first flash?
Does the issue also occur when you set the port to pixel mode?

@Sine-Audio
Copy link

@scamiv Thank you for responding! Im not getting any exceptions, only when I set flash mode wrong (but thats normal). Right now it just says ld~ on the serial monitor and shortly after that a backwards questionmark. It does start a hotspot but only the default one without encryption or anything. Cant connect to webgui. I did erase the modules with esptool erase_flash. It must be something stupid that I am missing but I cant figure it out. Like I said, it does work with the original firmware compiled from Arduino, so maybe I am missing a setting in code?

@scamiv
Copy link
Author

scamiv commented May 13, 2018

Did you try setting the pwmports[] array in line 104 empty?

@tohox
Copy link

tohox commented May 14, 2018

@scamiv Thanks for your reply.

  • Installed exception decoder
  • Selected erase all flash contents and rebuilt + reflashed using Wemos D1 R2 & mini board definition.
  • Once complete, uploaded sketch data (still using 4M 3M SPIFFS as opposed to 16M 15M as it takes for ever and doesn't appear to work)
    After a restart Webui and PWM outputs on universe 10 are both working OK but when I send something on universe 0 (PORTA) the ESP crashes. If I send something to universe 4 (PORTB) there is no crash.

With the serial monitor set to 115200 it outputs this twice when the ESP restarts:

ets Jan 8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v614f7c32
~ld

I was expecting more information but anyway the current version of Exception Decoder appears to be broken or missing some tool chain elements.

Random notes of potential interest:

  • I get the same result if I define ESP_01.
  • As you suggested I also tried setting PORTA to pixel mode and although this does not crash the ESP I don't have the appropriate hardware to test if it is working correctly. Also when I configure PORTA for WS2812 I get a constant stream of gibberish on the serial monitor.
  • When the ESP initially turns on and I have DMX RGBW LEDs connected to PORTA with no ArtNet being sent I get random colors. As soon as I send ArtNet to it the colors change once before the ESP crashes.

@Sine-Audio
Copy link

I just emptied the pwm ports. I'm getting this with the exception decoder:

Decoding stack results
0x40214c88: spiffs_hal_read(unsigned int, unsigned int, unsigned char*) at /Users/Main/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/spiffs_hal.cpp line 45
0x40214d44: spiffs_hal_write(unsigned int, unsigned int, unsigned char*) at /Users/Main/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/spiffs_hal.cpp line 102
0x40213559: String::copy(char const*, unsigned int) at /Users/Main/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/WString.cpp line 170
0x402135a6: String::String(char const*) at /Users/Main/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/WString.cpp line 36
0x40213e58: operator new(unsigned int) at /Users/Main/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/abi.cpp line 30
0x4020d5fb: ESP8266WebServer::serveStatic(char const*, fs::FS&, char const*, char const*) at /Users/Main/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h line 68
0x40214b5f: SPIFFSImpl::begin() at /Users/Main/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/spiffs_api.h line 124
0x4020a70f: webStart() at /Users/Main/Downloads/ESP8266_ArtNetNode_v2-master/source/espArtnetNode_2.0.0_b5g/espArtnetNode_2.0.0_b5g.ino line 1036
0x40213f78: esp_yield() at /Users/Main/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/core_esp8266_main.cpp line 87
0x402013ee: delay at /Users/Main/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/core_esp8266_wiring.c line 54
0x4020aae4: setup() at /Users/Main/Downloads/ESP8266_ArtNetNode_v2-master/source/espArtnetNode_2.0.0_b5g/espArtnetNode_2.0.0_b5g.ino line 288
0x40213fbc: loop_wrapper() at /Users/Main/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/core_esp8266_main.cpp line 118

@scamiv
Copy link
Author

scamiv commented May 14, 2018

@tohox Strange issue, i actually never used the dmx output, i will try to replicate your problem on the weekend if i get some time. The gibberish/Flickering is cause you are using one of the rx ports for PORTA, try using another available pin to get rid of that.

@Sine-Audio That's useful, so its failing when setting up the webservier/spiffs.? Did you upload it?(click on "ESP8266 Sketch Data Upload") Requires: https://github.com/esp8266/arduino-esp8266fs-plugin

@Sine-Audio
Copy link

@scamiv Yes I did! It uploads both gz files with that plugin.. Its super weird, I tried it with different baud rates and same issue..

@tohox
Copy link

tohox commented May 14, 2018

@Sine-Audio I had problems getting this branch running initially and it was because I still had old versions of the espArtnetRDM and espDMX_RDM libraries in the Arduino directory. Copying the versions which came with @scamiv version solved that.

@Sine-Audio
Copy link

Sine-Audio commented May 14, 2018

@tohox Just tried that, no change in behaviour, still the same.
@scamiv This is my log part of the spiffs upload, nothing out of the ordinary I guess?
Just tried it with a Wemos D1 R2 board instead of NodeMCU, but its exactly the same. I tried a different machine with everything completely clean installed (Arduino 1.8.5, latest Arduino JSON library, libraries included with your version and SPIFFS plugin). Super weird!
[SPIFFS] data : /Users/Main/Downloads/ESP8266_Artnet/espArtnetNode_2.0.0_b5g/data [SPIFFS] size : 3052 [SPIFFS] page : 256 [SPIFFS] block : 8192 /index.htm.gz /style.css.gz [SPIFFS] upload : /var/folders/5n/zz8qxgrs5fz9fktwb4ht354h0000gn/T/arduino_build_946917/espArtnetNode_2.0.0_b5g.spiffs.bin [SPIFFS] address: 0x100000 [SPIFFS] reset : nodemcu [SPIFFS] port : /dev/cu.SLAB_USBtoUART [SPIFFS] speed : 115200

@tohox
Copy link

tohox commented Jun 25, 2018

Hi @scamiv

Any time to try the DMX output and replicate the issuesI've been seeing with the Wemos boards?

Thanks!

@mrv96
Copy link

mrv96 commented Feb 1, 2020

Hi, this fork doesn't work for me.
After flashing, sometimes ESP8266 led turn on, but it doesn't appear any WiFi AP available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants