September 2019 Update

New! We're moving to the new forum!

ALL new Blog posts will be on the forum.

Please join us there.

This Blog will no longer be updated...

Tuesday, August 20, 2019

Dazed and Confused...

I'm stumped...  The new firmware is working extremely well, except for two things...

The module is configured to scan all attached sensors at specific intervals. When it's time, it fetches a lit of sensorId's from the database, and then loops through that liat and loads the configuration for each sensor.  

For some reason, the first sensor configuration is loaded ok, but the rest are not, the records are empty, or in some cases contain weird data that appears to be left over from a previous query, like field names...  I can't put my finger on the problem...  My quick solution at the time was to simple close the database after each use, which has the effect of clearing out the memory buffers used, so the query works now, however, the whole process is slowed down as it needs to keep connecting to the database every query.

The second issue just popped up last night. When a sensor fails the Sensor Test, three things happen:

  1. Send a warning to the Serial Output
  2. Send a notification to my phone using Blynk
  3. Write an entry to the debug log database table

For whatever reason, it will not write the database entry (while every other read and write is working fine, including many writes to the debug log table) and causes the ESP8266 to reboot.  If I remove the call to write the debug entry, it works just fine.

While I have a workaround for both issues, they must be a symptom of something being quite wrong. Whatever is causing this could be causing all sorts of unseen issues, and those can be the most dangerous bugs :)

So, I've tried all sorts of things, and if I can't get a handle on this soon, I guess I'll start over. That won't be so bad, I'll aim to get the sensor test code done first, and see if it still has the same problem, if not, it will be a simple matter of adding the rest of the code back in until it fails...

It looks like I have a game plan, it's certainly going to set me back timewise, but I'm sure I'll learn a lesson here somewhere. :)

No comments:

Post a Comment

Any comments deemed off topic or offensive will be removed