-
Notifications
You must be signed in to change notification settings - Fork 289
Conversation
If LEDs>100, stalls ESP8266. So bunch of code cleanup and merge with existing variables used by other sections. Should be more efficient. As of now on Arduino ESP 2.4.1, WiFi.setSleepMode(WIFI_NONE_SLEEP); is required for MQTT function. ESP8266 is anyways connected to constant power supply, so power consumtion is not immidiate concern now. * HTTP OTA * Arduino OTA * Async MQTT * PubSubClient * HomeAssistant
Thanks again for your contribution. I will have a look at it soon and merge it into master. Just a bit busy at work at the moment. |
Take your time, no hurry. I did some major cleanup, could you test by running for a longer time (over 2 hrs)? For some reason all my ESP8266 drop WiFi connection, I am using a ASUS router RT-AC68U. Maybe move these over to a backup dlink router to figure out WiFi stability. WiFiManager (dev version) is quite unstable after 2.4.1 as well: esp8266/Arduino#4372 and same is true for PubSubClient. |
Modified * Better implementation of tickers (recommended) Added * Save State on SPIFFS (alternative to EEPROM) EEPROM has finite write cycles. * Added Custom MQTT QOS levels, as AMQTT can handle QOS level 0,1&2 in both publish and subscribe. Pubsub can only sunscribe in QOS 1&2, publish at QOS 1 only.
Hi @debsahu, I really like your changes, especially to save the state as JSON. This is something I tried a your ago, but it wouldn't work back then. If it works reliably, we could kick the EEPROM code completely. I was able to compile the code with only some little issues (had to update to ESP core 2.4.1 and a old version of the ESPTCP client made problems). I flashed it now to my testing lamp (24 LEDs) and it works like a charm. I will keep it running for some time, to test stability, but it looks good. Unfortunately I don't own really big strips. But before merging this to master I think I have to update the documentation, because setup is slightly more complex. Thank you again for this great contribution! Regards |
Just set the num_leds to 300 for testing, you dont have to drive 300 leds! Adafruit library uses a lot of memory for 300 leds, just wanted to make sure I am not the only one with the issues. When the leds are set to any value below 30 I have no issues. |
Yes, I already did that on a second ESP that has 60 LEDs connected effectively (but 300 set in the definitions.h). Works for some time now without problems. |
One issue I noticed: Could you reproduce this? |
You are right, I don't set them. I just read them, I thought mode will set them correctly. Also for some reason I totally forgot about "speed". I'll update in a few hours. |
* Added speed to SPIFFS save * Should set strip state after succesful read.
Update should set state correctly |
@toblum If you are on Arduino ESP8266 2.4.1, patch WiFiClient.cpp as per esp8266/Arduino#4516 PubSubClient will eventually lead to memory leak after long periods of time. Async MQTT is immune to this for now! |
Addresses #110
Updates should handle #110 as well |
Hello, |
Could you try my branch and report back? https://github.com/debsahu/McLighting There is lot going on during a mqtt callback. Now it's simplified and no strip calls are done |
Hi debsahu, |
Also, if you are on Arduino ESP8266 2.4.1, patch WiFiClient.cpp as per my link above for proper functioning of pubsubclient. Or else there will be memory leaks. |
Hm, i´m using the 2.4.1. |
* SetBrightness fix from REST API callback from Master * Added twinkleRandom to REST API (missing?) * MQTT callback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@debsahu I had it running with AMQTT for some hours now. It works flawlessly here so far. Great!
I used the Version from your repo.
I will extend the documentation soon and then we could merge it to master.
What do you think?
@toblum Go ahead, I have it running on my test system with 300 and 16 leds. Running fine so far. |
@The-Holgi this is off topic, but edit libraries/ESP8266WiFi/src/WiFiClient.cpp (In windows it is in C:\Users\<USERNAME>\AppData\local\Arduino15\packages\esp8266\hardware\esp8266) replace line 115
Or use latest git version. |
Hi, |
If LEDs>100, stalls ESP8266. So bunch of code cleanup and merge with
existing variables used by other sections. Should be more efficient. As
of now on Arduino ESP 2.4.1, WiFi.setSleepMode(WIFI_NONE_SLEEP); is
required for MQTT function. ESP8266 is anyways connected to constant
power supply, so power consumtion is not immidiate concern now.