Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.

Brightness change causes reboot #224

Closed
tnkaiser opened this issue Aug 27, 2018 · 15 comments
Closed

Brightness change causes reboot #224

tnkaiser opened this issue Aug 27, 2018 · 15 comments
Assignees

Comments

@tnkaiser
Copy link

If this has been discussed previously, please point me in the direction.

//#define USE_NEOANIMATIONFX // Uses NeoAnimationFX, PIN is ignored & set to RX/GPIO3 or UART method: D4/GPIO2, see: https://github.com/debsahu/NeoAnimationFX
#define USE_WS2812FX // Uses WS2812FX, see: https://github.com/kitesurfer1404/WS2812FX

// Neopixel
#define PIN D1 // PIN (14 / D5) where neopixel / WS2811 strip is attached
#define NUMLEDS 300 // Number of leds in the strip
#define BUILTIN_LED 2 // ESP-12F has the built in LED on GPIO2, see esp8266/Arduino#2192
#define BUTTON 4 // Input pin (4 / D2) for switching the LED strip on / off, connect this PIN to ground to trigger button.

const char HOSTNAME[] = "McLighting01"; // Friedly hostname

#define HTTP_OTA // If defined, enable ESP8266HTTPUpdateServer OTA code.
//#define ENABLE_OTA // If defined, enable Arduino OTA code.
#define ENABLE_AMQTT // If defined, enable Async MQTT code, see: https://github.com/marvinroger/async-mqtt-client
//#define ENABLE_MQTT // If defined, enable MQTT client code, see: https://github.com/toblum/McLighting/wiki/MQTT-API
#define ENABLE_HOMEASSISTANT // If defined, enable Homeassistant integration, ENABLE_MQTT must be active
#define ENABLE_BUTTON // If defined, enable button handling code, see: https://github.com/toblum/McLighting/wiki/Button-control
#define MQTT_HOME_ASSISTANT_SUPPORT // If defined, use AMQTT and select Tools -> IwIP Variant -> Higher Bandwidth
//#define ENABLE_LEGACY_ANIMATIONS


MQTT: Recieved [home/McLighting01_ha/state/in]: {"state": "ON", "brightness": 132}

Exception (28):
epc1=0x40227e7e epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: sys
sp: 3fffea70 end: 3fffffb0 offset: 01a0

stack>>>
3fffec10: 3fff4592 00000000 00000020 00000000
3fffec20: 3fff4595 3fffecd0 3fffeca0 4020b458
3fffec30: 00000004 00000084 3ffe9a48 3fff4595
3fffec40: 3fff55c0 00000008 3fff458c 40228124
3fffec50: 00000000 3fffecd0 00000008 00000026
3fffec60: 3fff1c28 00000008 3fffec80 3fff45ae
3fffec70: 00000000 3ffe8308 3fffeca0 4020b181
3fffec80: 7b203a5d 61747322 3a226574 3fff45ae
3fffec90: 3fff1c28 3fff4592 3ffe95a8 3fff45ae ........
................................................................................
fffff30: 3fff1338 000000b4 40222d54 3fffefb0
3fffff40: 3fffdad0 00000009 00000000 40201593
3fffff50: 00000000 3fff0f7c 3fff1068 4021a7ec
3fffff60: 1b02089e 00000000 3fff135c 40214625
3fffff70: 40224fb8 00000000 00001388 3fff1d00
3fffff80: 3fffdad0 00000000 3fff0f7c 4021a81d
3fffff90: 3fffdad0 00000000 3fff1cfa 4020f761
3fffffa0: 00000000 00000000 00000001 3fff1d00
<<<stack<<<

ets Jan 8 2013,rst cause:2, boot mode:(1,6)

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

wdt reset

@toblum
Copy link
Owner

toblum commented Aug 29, 2018

HI @tnkaiser,

I think this wasn't reported before. Does this happen also when you set the brightness via web UI? Oder directly via REST call? Or only via MQTT call from homeassist?

Regards
Tobias

@tnkaiser
Copy link
Author

AMQTT ---> reboot (via the popup slider when the light is turned on)
Direct MQTT --->reboot (via third party MQTT client), but only sporadically (sometimes, when the JSON string is sent WITHOUT anything else... i.e. {"brightness":25} it works, other times it hangs
WebUI --->works, no reboot
websockets --->seems to work, no reboot.

@toblum
Copy link
Owner

toblum commented Aug 30, 2018

OK, then this seems to be related to MQTT. Strange that it happens fot both MQTT and AMQTT.
What kind of board do you use?
And what is returned when you call http://YOUR_IP/esp_status

Regards
Tobias

@MNatzke
Copy link

MNatzke commented Sep 25, 2018

Hi all,

As you are waiting for an answer for about a month and I am having the same issue this is what I can provide for an analysis:
{"HOSTNAME":"BadWaschtisch","version":"2.1.4","heap":23504,"sketch_size":449056,"free_sketch_space":2695168,"flash_chip_size":4194304,"flash_chip_real_size":4194304,"flash_chip_speed":40000000,"sdk_version":"2.2.1(cfd48f3)","core_version":"2_4_2","cpu_freq":80,"chip_id":1458208,"animation_lib":"WS2812FX","pin":4,"number_leds":100,"button_mode":"ON","amqtt":"ON","home_assistant":"ON","legacy_animations":"ON","esp8266_http_updateserver":"ON","arduino_ota":"ON","state_save":"SPIFFS"}

Maybe on thing more:
If I set the brightness via "normal" MQTT Interface.

BadWaschtisch/in
%100

There is no reboot. It looks like it is always if you are using the Topics for "Home Assistant".

Best
Michael

@toblum
Copy link
Owner

toblum commented Sep 27, 2018

@MNatzke Thank you for your investigations.

@debsahu I couldn't reproduce this. Do you have an idea why this seems to only happen with the homeassistant topics?

@toblum toblum closed this as completed Sep 27, 2018
@toblum toblum reopened this Sep 27, 2018
@MNatzke
Copy link

MNatzke commented Sep 28, 2018

Hi Tobias,

feel free to contact me if you need further investigations/tests with my system.

Without a deeper look into the source code I can identify some differences between MQTT for Home Assistant and the "normal" MQTT.
The payload of the homeassistant topic has a different format as the payload for the MQTT API (which is the format of the Websocket API). There might be an issue with the parser of the homeassistant payload.
And the content of the payload is different. Setting the brightness via MQTT API does send the value for the brightness only but via the homeassistant topic there will be sent an "ON" Statement as well.

What else can i provide..
I was experimenting with the RGBW Version of McLightning on the same NodeMCU. Maybe there are some "leftovers" of that in the EEPROM? I can offer to use a brand new NodeMCU with the latest McLightning version (none RGBW) and/or changing the PIN for the LED/Button (hope that's not the issue because I just ordered new PCBs for my installations ;-) )

Regards
Michael

@MrPaulAR
Copy link

MrPaulAR commented Sep 28, 2018

I'll add that I just installed this on a D1 Mini and I'm having the same issue with the AMQTT library. Even sending a message with only the brightness causes core dump.

{
"brightness":25
}

Below is my esp_status if it's useful.

{"HOSTNAME":"McLighting01","version":"2.1.4","heap":26224,"sketch_size":444400,"free_sketch_space":2699264,"flash_chip_size":4194304,"flash_chip_real_size":4194304,"flash_chip_speed":40000000,"sdk_version":"2.2.1(cfd48f3)","core_version":"2_4_2","cpu_freq":80,"chip_id":1458415,"animation_lib":"WS2812FX","pin":2,"number_leds":50,"button_mode":"ON","amqtt":"ON","home_assistant":"ON","legacy_animations":"ON","esp8266_http_updateserver":"ON","arduino_ota":"ON","state_save":"SPIFFS"}

@debsahu
Copy link
Collaborator

debsahu commented Sep 29, 2018

Don't have any idea why there is a issue with JSON parsing. I'll investigate!

@mkova186
Copy link

mkova186 commented Oct 1, 2018

Shame issue with AMQTT and HA

{"HOSTNAME":"McLighting01","version":"2.1.4","heap":26432,"sketch_size":438064,"free_sketch_space":2707456,"flash_chip_size":4194304,"flash_chip_real_size":4194304,"flash_chip_speed":40000000,"sdk_version":"2.2.1(cfd48f3)","core_version":"2_4_2","cpu_freq":80,"chip_id":1458376,"animation_lib":"WS2812FX","pin":14,"number_leds":136,"button_mode":"ON","amqtt":"ON","home_assistant":"ON","legacy_animations":"ON","esp8266_http_updateserver":"ON","state_save":"SPIFFS"}

@debsahu
Copy link
Collaborator

debsahu commented Oct 2, 2018

@MNatzke @MrPaulAR @mkova186 could you anyone try the develop version and update arduinojson to latest(6.4.0-beta) as well?

@debsahu debsahu self-assigned this Oct 2, 2018
@MNatzke
Copy link

MNatzke commented Oct 2, 2018

I am on a trip with my family starting tomorrow. If I could not manage to test it tonight i'll test it in a week.
Will give you a feedback asap.

btw.: I already had Arduinojson installed in 6.4.0-beta

@mkova186
Copy link

mkova186 commented Oct 2, 2018

same here, already had Arduinojson installed in 6.4.0-beta

@mkova186
Copy link

mkova186 commented Oct 2, 2018

just downgrade the Arduinojson to 6.1.0-beta and no issue, all working as it should. Tnx

@BananaPukeh
Copy link

Same here, downgraded to 6.1.0-beta and it's all working fine. Thanks for figuring out

@MNatzke
Copy link

MNatzke commented Oct 2, 2018

Just tested the development version with 6.4.0-beta and YES everything is working very well.
arduionojson 6.4.0-beta wit the master branch causes a crash once i try to change the brightness.

Thank you!

@debsahu debsahu closed this as completed in 6d8269f Oct 2, 2018
debsahu added a commit that referenced this issue Oct 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants