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...

Thursday, August 8, 2019

Bug swatting time!


If you read my previous post, you see that I was pretty excited that I solved the issue of detecting the presence of a sensor on a port. It appears my celebration may have come too early.

I completely rewrote the way the main code on the 2560 requests and receives the sensor configuration from the 8266, as well as enabled the internal pull-up resistors on all the analog pins.

I'm a night owl, so I tend to do most of my work at night, and during the day, I slow down a bit.  Today I noticed some weird readings, and the system doing weird things...

For instance, when it encountered a photo-resistor used to ensure the lights in the flower tent asre either on or off at the appropriate times, every sensor after that was a photo-resistor...

In another instance, the descriptions were correct, but the sensor id was the same for all the readings....

So, tonight will be spent debugging the new code, see where I screwed up, and fix it hopefully, no pressure... :)

Update: Aug 9, 2019  1:30am

I see a definite change in values read from the soil moisture sensors at the exact time I moved the new code onto the live modules, It looks like the raw values increase by approximately 100.

The first thing I'll do is modify the code so the pull-up resistors are only activated during the sensor test, the rest of the time they will not be active. This will still allow the reliable sensor detection, while maintaining the consistency of the sensor readings.

I considered simply letting it use the new values, but then I would have to re-calibrate all the sensors. Other than that, working with the new values would be fine, after all, it's all just relative to the calibrated levels.

That's my plan, update the code and try again...

Update: 5:50am

I'm having a heck of a time trying to create a library.  I want to move a bunch of code into a library so I can share it between the 2560 and 8266 firmware, stuff common to both.  I've written a few libraries, so I "think" I know what I'm doing...  I'm trying to create it so that I can call methods or use variables without having to preface them with a class name/instance.

Update: 6:22am

I don't usually do this, but I'm giving up.  I'm really starting to doubt it can even be done, plus I have reservations about how variables will be shared.

I'll put the code back the way it was...  then rethink this....

No comments:

Post a Comment

Any comments deemed off topic or offensive will be removed