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

InfluxDB crashing device after a restart #318

Closed
xoseperez opened this issue Dec 9, 2017 · 7 comments
Closed

InfluxDB crashing device after a restart #318

xoseperez opened this issue Dec 9, 2017 · 7 comments

Comments

@xoseperez
Copy link
Owner

Originally reported by: Oscar Rovira (Bitbucket: OscarRoviraLopez, GitHub: Unknown)


Device: Sonoff POW

Version: >1.10.0

Steps

  1. Flash >1.10.0 with InfluxDB support enabled (not sure if it happens in < 1.10.0).
  2. Set-up InfluxDB connection
  3. Restart the device
  4. InfluxDB crashes start-up, restarts the device for 5 times, then device stops working completely
  5. I can't reset it to factory settings as it restarts before the 10sec.

Temporal fix
Erase eeprom and not enabling InfluxDB support.

Log
See in Pastebin.com

@xoseperez
Copy link
Owner Author

Original comment by Oscar Rovira (Bitbucket: OscarRoviraLopez, GitHub: Unknown):


I traced down the problem to:

#!arduino

if (!_idb_client.connect(getSetting("idbHost").c_str(), getSetting("idbPort", INFLUXDB_PORT).toInt())) {

Apparently the connect call is failing somewhere and throwing an exception. Should be a problem of ESPAsyncTCP.

@xoseperez
Copy link
Owner Author

Original comment by Oscar Rovira (Bitbucket: OscarRoviraLopez, GitHub: Unknown):


Decoded Stacktrace

@xoseperez
Copy link
Owner Author

I'm going to check it. The device stopping to work completely after 5 crashes is the system check feature, It basically disables non-critical features trying to reach a stable configuration. The device is such state only enables WiFi AP mode, OTA and telnet. So you can connect to it's AP, telnet to it and disable InfluxDB, for instance.

@xoseperez
Copy link
Owner Author

The problem is with the initial heartbeat message (freeheap and uptime sent to InfluxDB). It was called from the mqtt on connect callback. Bad idea. I moved it to the main loop.

I've also updated the InfluxDB module and UI configuration to allow the user to disable it with a switch or build an image with predefined connection values.

The changes are in the dev branch. Will be released with next version.

@xoseperez
Copy link
Owner Author

Original comment by Oscar Rovira (Bitbucket: OscarRoviraLopez, GitHub: Unknown):


Awesome! Already compiled and uploaded the code on dev branch and it works! Thanks a lot!

@xoseperez
Copy link
Owner Author

Released with 1.11.0

@xoseperez
Copy link
Owner Author

Removing milestone: 1.11.0 (automated comment)

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

No branches or pull requests

1 participant