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

Wednesday, May 29, 2019

GBW saves my bacon!

This morning while I was working away at the computer, my wife walked by the grow room, and yelled down the hall that something was making a racket in there...

The noise was coming from my 4x4 tent, so it had to be the inline fan...  I unzipped the tent, expecting to hear the noise from the top of the tent, but no, it was coming from lower down...  The only other thing in there was the light, could it make a squealing noise? I didn't think so, but if it could, then it sounded like it would explode... I rushed and unplugged the light, but the noise persisted... so I unplugged the fan, and still, the noise persisted...  That's when I noticed the little black oscillating fan clamped to the pole about a foot off the ground...  Yep, it was the cheap circulating fan...   gave it a smack, and it's fine...

Fast forward to tonight, ten minutes ago...  My phone had been shut off and charging since dinner time, and as soon as I turned it on, it went nuts with all these notifications from the system telling me the temp was climbing in the flower tent...

WTH? How could that happen, the lights went out 3 hours ago, so even if the fan wasn't working, it shouldn't get hotter...  I looked down at the duct I am using as an air intake for the tent, and can see faint light coming though... What? The lights were supposed to go out 3 hours ago?

When I plugged the fan and light back in this morning, I plugged the fan into the timer, and the light into the extension cord.  The FAN shut off 3 hours ago, the 400W light, or should I call it heater, was going full blast...

It would have REALLY sucked to wake up tomorrow morning, look in the tent, and find all the plants baked and dead....

WHEW!!

Whatever gets you though the night...

I've always been somewhat of an audiophile...  When I was in my twenties, I volunteered at a local recording studio to learn as much as I could about the art of recording music. I was working with some local bands, just basement stuff, but did a couple demo tapes for battle of the bands, nothing major, never pursued it.

Anyhow, I've always loved music, but can't play an instrument for the life of me, so best I could do was listen...  My favorite band of all time is The Who. I like a lot of rock music, but never listened to Metallica until recently. I saw "Through The Never" in 3d (using my smartphone and a virtual reality 3d viewer) and have been in love with the soundtrack every since...  I can listen to it 3 or 4 times a night while I'm coding away (I tend to stay up all night coding) with the ear buds in, sound cranked to 100%, VLC at 125%, rocking on...

https://www.youtube.com/watch?v=SNJzCVn7doU



Tuesday, May 28, 2019

Wifi and MySql Login info - wrapping it up

I've implemented the Config Library on the Wemos Mega 2560's.

When the 8266 boots, it's exactly the same as the ESP-01, it will wait 15 seconds for you to hit 'C' in the Serial Monitor.

The 2560 boots, it will wait 10 seconds for you to press 'C'.

In both cases, if you do not hit 'C', everything boots up as usual...

If you do hit C, then the 2560 sends a 'C' to the 8266 to put it into Config mode. The 2560 then goes into a loop, reading from Serial3 and writing that to Serial, for me to see, and if I type, it reads my input on Serial, and sends it to the 8266 on Serial3.

This is in an endless loop, so when you hit 'Q' to exit the configuration, and the 8266 reboots, you must manually reboot the board again, since the 2560 is trapped in its endless loop. In terminal, just disconnect and reconnect, and DTR will reset the whole board.

I have it working on the Wemos Mega that I'm using for my development board as Sensor Module 3. 

As part of this code change, I'm replacing all my calls to sprintf( with the safer snprintf( allowing me to specify the maximum size of the buffer to fill, thus preventing really strange behaviour when you accidentally overwrite memory used for other things :eek:

Sunday, May 26, 2019

WiFi and MySql login info - Implementation

I decided to go with the simplest method I could come up with...

This is how I am implementing configuration on a standalone ESP-01 module.

When the module boots, every time it boots, it will wait 10 seconds during which you may enter a c or C via the Serial monitor. If you do not, then it continues to boot as it always did.

If you hit c (or C) to enter configuration mode, you will see this:



If there are no credentials set, then it will automatically go to this screen...

I added the database instance name to the configuration since it is currently hardcoded into all my sql statements.  That's gonna be a lot of work fixing that!

So now I have the menu displaying, I haven't actually written any code yet to parse input, save data, read data, etc...  Lots to do, but at least I know how I'm going to do it now...

WiFi and MySql login info - Revised Plan

If you read my last post, you know that currently, the Wifi and MySql credentials are hardcoded in the software. I want to make it so they can be reconfigured without installing new software, and also, configurable at first startup, when no WiFi will be available, because there are no credentials...

In my last post, I was thinking a button to put the device into config mode, and it would create an Access Point allowing you to join that network on your smartphone, and using a web browser, set the credentials as required.

That's a lot of work, not only setting up the software to do this, but also getting a useable button on the ESP-01 is not straightforward.

So, new idea...

One of my other hobbies is R/C stuff, and I was working on an OSD (On Screen Display) module for an FPV (First Person View) R/C car. I needed a way to easily configure it, and ended up using the Serial output, AND input.  Basically output a menu to the serial port, and get the input from the serial port.

This solution requires having the device plugged into a computer to access the Serial port, but requires NO hardware changes (button) and VERY LITTLE in the way of software changes...

As for where to store the configuration, I think EEPROM will be easiest. Another option might be SPIFFS, but again, more work...

Saturday, May 25, 2019

WiFi and MySql login info

Right now, the login credentials for both the WiFi Network, and the MySql Database are hard coded in the software which is uploaded to each module. This works for me, but it does mean having to recompile and reinstall the software on every module if something changes.

For some time, I've been thinking about this, and the solution seemed to be, if you cannot connect to WiFi, then create your own network, and allow your smartphone to join its network and configure the module with the proper credentials...

I've kept putting it off fo a couple reasons, first, it's not critical, I can easily recompile and reinstall whenever I like, and second, and more importantly, if the router is rebooting, you don't want all your modules switching to AP mode and waiting forever, meanwhile, you're fast asleep for the night....

So now, I think I might have a solution...

If you've already configured a module, and it cannot connect, chances are, it's a network issue, the module does not need to be reconfigured...

If the module is new, and you just plugged it in for the first time, they why not have a button to press and hold while booting, and if it is pressed, then go into Soft Access Point mode, create a network with a default username/password and a web interface to do the configuration.

I think that's a brilliant solution...   I'll have to check to see how I'll do this on the ESP8266 but I think there is a GPIO pin on the ESP-01 board I can use...

If I want to, I think the Wemos Mega 2560 exposes a bunch of pins directly from the built-in ESP8266 as well.

This will be a significant change, so I'll break it into smaller tasks...

I think I'll start with adding a button to all my existing modules. This will be fairly simple, all I need it a pushbutton, a resistor, some wire, and a connector for each module. A bit of solder, and I'm all set. I may mount the pushbutton on a tiny piece of perfboard so it can be mounted (with two sided tape) somewhere on or near the module.


Next, I'll update the code to check for the button at startup, and then to run the AP mode, serving up the config pages... This will be the harder part, and I'm not really sure how long it will take, perhaps I can create some shared code for all the modules.


Tuesday, May 21, 2019

OTA Software updates

All of my ESP8266's get updated OTA, or over the air, via WiFi and http.  I decided, since all this info was available, to create a page on the web server which will always link to the proper IP address, even if I use dynamic IP.


Monday, May 20, 2019

the misting of the clones...

I had an idea tonight, haven't figured out exactly how yet, but this should give you an idea of what I'm thinking...


That's the spritzer I use for my clones...   I've got some nice strong servos left from my R/C days...

I just have to figure out how to mount it. I supposed some sort of frame that holds both the servo and the bottle.

The dome over my clones is a an opaque storage bin from the dollar store, and has a hole cut in one end that used to have a computer fan in it, so I can mount it there.


You can see the fan in this picture. When I use it with the DWC cloner, I use the fan, and don't need to mist the clones because the water keeps the humidity nice and high. When I use the jiffy pellets, I constantly need to mist them, especially since I've been using the heated seedling mat.



Of course, there's probably an easier way to do this, like use an electric pump and pump through a nozzle, maybe something from the hydro shop? Not sure, I'll check before I go much further with this, but in the end, I'd like to automate the misting of the clones...

Sunday, May 19, 2019

Automatic Watering System - clogged pump


This is my aeration pump from the Auto Water reservoir after about 2 weeks...



So badly clogged it was barely pumping water, and no air bubbles...

I'm using liquid nutes, but I guess they still settle as a solid.

Not sure if this is because I am only auto watering one plant, and it only needs water maybe once a week at this point. That leaves plenty of time for this to happen...

If it was looking after 8 plants, as designed, the water would be replaced every week, probably topped up every couple days...

I had hoped adding the circulating pump would have prevented this.

Perhaps I need a way to add nutrients to a single dose of water at the time of watering?  Sounds tricky...  Something else to think of...

In the mean time, less water in the res, add a couple more plants to the auto watering schedule, maybe in the flower tent, they need watering much more often...

Another thought, I have observed the water level dropping in the res due to evaporation, this will increase the nutrient concentration... I think a Lid for the bucket is in order to prevent this evaporation...


Friday, May 17, 2019

Soil Moisture Sensor Corrosion

Sensor #35 is one of the new stainless steel Soil Moisture Sensors, the ones I call DIY-3 Soil Moisture Sensors.

Sensor #35 was built on Oct 2, 2018, and first went into service on Mar 9, 2019 until two days ago.

This particular sensor has had 3,195 power cycles, for a total powered time of 1,954,623 milliSeconds, or 32 minutes and 34 seconds spending the entire time in one pot.

You can see the corrosion on the left probe.


A closer view...



The data shows it had no effect on the sensors performance in that short time.




I will continue to monitor the condition of sensors as they are removed from pots to determine at what point it begins to affect the readings.  It will be simple enough to automatically determine the point just before failure, and prompt me to replace the sensor (or at least the probes)

This leads to a design change for any future sensors...

Right now I plug the ends of the terminal block, where the steel rods are connected, with hot glue to ensure it is waterproof.  Future versions will have heat shrink applied first, then hot glue, then more heat shrink. This will keep the hot glue out of the screws and threads, allowing me to replace individual probes.





Thursday, May 16, 2019

My first recall notice!

The dual level soil moisture sensors have been removed from the system, sort of...  They are still in the pots, and still hooked up to the Sensor Modules, but they are not being used to determine whether to water the plants. I've put regular sensors back in, and they will be used.

The reason I'm not using them now, they don't seem to work. The top sensor read under 5% or 6% while the bottom read upward of 70%. That may be fine, but over two weeks, those readings did not change in any reasonable way. In two weeks, I should see a drop in moisture, but all I saw were random fluctuations.



A normal sensor output looks like this




I'm not sure why the dual level sensor would be any different than the single level one, it's made the same way from the same materials. The difference is the dual uses a single probe to read, and two probes to power it, meaning when it tests the top level, it applies 5v to the short probe, near the surface, and reads the center probe, which actually extends to the bottom of the pot. That 5v should take the path of least resistance, which is going to be the shortest route to ground, right across the 1/2 inch or so gap. Then when it reads the bottom sensor, it applies power to the long probe (which is shielded from touching soil until it is past the end of the top probe, so that again, it should read the moisture at the lower level. Since it only powers one side at a time, it should be no different than using two sensors with one shoved deep into the dirt, and the other at the surface...

I can see for sure that it is seeing two distinct sensors, the readings are vastly different, and although somewhat random, they are consistent...

It's also possible there's a bug in my software on the Arduino Pro/Mini's that are used as I2C slave modules.

As soon as I get some time, I'll come back to these and see why they failed... I do have faith that I will eventually get them working properly without having to do a major redesign.


Tuesday, May 14, 2019

Doubting Dual Moisture Sensor design...

While the design seems perfect, the implementation is not as I would expect...

Read about the sensor design here


I have a DIY Soil Moisture Sensor in a plant, and it currently reads a raw value of 429.

I plugged one of the two new DIY Dual Soil Moisture Sensors into the same pot, and it reads the top level as 36 and the bottom level as 656

The top level should be the same roughly as the single sensor...

I noticed this same behaviour on the first Dual Level sensor I put online about a week ago...

I will monitor them over the next bit, but I don't think they are working properly... I'll have to think on this one...

Monday, May 13, 2019

A new way of looking at things...

I've been a long time user of threaded message forums, and find them to be perfect for their ability to let you easily pick up anywhere you left off, and read items in the order they were written.

Their weakness however, unless you create many threads, it can be hard to find specific information, such as, how did you do this? It can be spread out over many posts, each on a different topic.

This last point is one of the strengths of a blog like this site, I can create pages dedicated to each aspect of the project, plus I can continue my ongoing rambling posts where you can read them, or not, but all the real information will still be at your fingertips.

The transition will take some time I'm sure as I learn a little more about this site.  If you have any comment, or suggestions about the site, please let me know.

Thanks

Saturday, May 11, 2019

May 11, 2019

The stainless steel soil moisture sensors sure are consistent...  I'm seeing this across all the sensors in the flower tent...


You can easily see when the plant was watered, and slowly the soil dries out...


Unfortunately, more common in the Veg area is something like this:


No sharp increase to show when it was watered, and no slow decline as the soil dries out. It's very choppy, and it's as if the soil is not drying out...



Another from veg...