Dear All,
This is my first post here, so let me thank you for having me. I hope we can help each-other in the long run.
That said, I have this little ESP-12E NodeMCU unit which I ordered from china. Exact model here:
I'm using a BME280 unit with it to start putting together a small home weather station. It's kind of a work-in-progress. The unit is here:
On my very first attempt, everything was going smoothly, no real issues.
Here's the - working version - of the code. Please do excuse the mess - as I said it's a work in progress, contains lots of stuff that will only be useful later or is used for another purpose, like polling it remotely, etc...
Too long to quote, see attached please.
This code does the following things currently:
- Connects onto a wifi network
- Exposes the OTA interface and mDNS for remote flashing
- Spins up a simple webserver to export the sensor data attached to it (currently only this single sensor) in simple JSON
- Upon web request, polls the events and generates JSON reply with the BME data
- About once a day it restarts for housekeeping
- Implements some rudimentary web commands without any kind of security at all FOR NOW, like rebooting (I am fully aware this is wrong - this is a work in progress I'm sorry)
- Monitors wifi connectivity and if lost, attempts to reestablish
So... it works well as you can see it.
But as soon as I try to implement (call) the part in the BME library that would poll me the current altitude, the unit locks into a reboot cycle and won't start (rst cause:2, boot mode:(3,6)...............) until I plug in a USB physically and remove the added code.
This is basically which causes it to get instant brain death on boot. I even give you two versions, both produce the same mayhem, but I think it just boils down to the use of the readAltitude anyway... once that gets involved, it's game over.
Version 1:
#define SEALEVELPRESSURE_HPA (1013.25)
...
somevariable=bme.readAltitude(SEALEVELPRESSURE_HPA));
Version 2...n:
float SEALEVELPRESSURE_HPA = 1013.25;
...
...
somevariable=bme.readAltitude(SEALEVELPRESSURE_HPA));
Or essentially any variation I tried on the above...
So... what am I doing wrong?
Any clue would be appreciated... Thanks so much
meteo.ino (6.74 KB)