Technologists That Build Their Own Systems

  • Thread starter Mepis
  • Start date
  • Tagged users None
M

Mepis

45
18
I apologize in advanced if this isn't the best section for this post. I didn't see a better fit.

Anyway, I'm a Desktop Analyst by trade. It's my job to create and solve technology issues. It's also my hobby. I recently got into growing, originally out of necessity for cost (medicinal reasons for my wife), and it turned into a full on hobby. As with all my other hobbies, I go off the deep end. I don't know how to take it slow.

At any rate, I started tracking my progress with a spreadsheet. I have a Raspberry Pi laying around, though, that's only being used as an appliance to wake my media server and NAS on demand. I wanted to automate data collection and other activities with it. Until I have some extra money (it's tight right now) to buy the extra sensors and servos, I started building the software for it.

Part of that software is the user inputed data collection agents. I've tried Grow Buddy but didn't like it at all. It's a nice app and the developers were really kind to distribute it for free, but it's an app designed for their grow operation and not mine. I work differently then they do.

At any rate, my goal is to have this software running on a web server on the RPI and use the RPI for all the automated tasks (temperature monitoring, humidity monitoring, watering, etc...). I hosted the software on Github for the moment under the MIT license. If it goes anywhere, I intend to do a complete instruction set so others can use the software / hardware if they want and replicate the device as easily as possible.

Long explanation aside, I'd like to get input from other growers on what data they collect about their grows, how they log it, and what their general process is. I like to collaborate, and honestly, others may have a much better idea or process flow than I do.

If anyone is genuinely interested in seeing the web based software thus far, or as it's made, I don't mind spinning up a VM on Amazon EC2 to host it. I'm not going to go nuts as it's not production software, and I don't want to give out my web address for my local web server (I don't think my ISP would appreciate a bunch of outside traffic hammering my house). I'd love others input.
 
jumpincactus

jumpincactus

Premium Member
Supporter
11,609
438
Welcome to the Farm. Good to see peeps getting innovative with tech in relation to our hobby.

I'm ole skool and tho I love tech I typically keep a simple grow log on a Excel spreadsheet I built.

It tracks feed dates and times, Ph of source water prior to feeding, final PPM or EC of feed water and finally any foliar application feeding applied during grow cycle. I track germination dates, veg times and when flipped to flower dates. Along with feed strengths of each of the nutrients used for each feeding.

I have a EVS 2 controller that measures C02, Rh, max and minimum day and night temps etc. So my setup is very basic but gets the job done.
 
jumpincactus

jumpincactus

Premium Member
Supporter
11,609
438
Well you may be right there. :) But my way aint much better compared to some of the shit I see guyz doin. The important part is you take the time and care to even keep a log!!! Respect
 
M

Mepis

45
18
Geezum...

Thanks guys/gals!

I'm still learning the PH / nutrient thing. I'm shifting from my first plants to my second now. The first few I didn't bother logging anything. I don't have a green thumb, so I used that grow to get my feet wet and prototype the processes for me. It's worked so far. I've torn down and rebuilt my grow area 3 or 4 times now. Scheduling that around lighting schedules is a PITA BTW. I think I'm pretty happy with my setup. Though, I need to buy a tent now and replace my home-built flowering chamber with that. Thankfully, that's the only tent I need. I'm growing in the basement along with other plants. Basically the entire rest of the basement stays on a 'spring' lighting schedule while the tent stays in a 'flowering' lighting schedule. Makes life easy for me.

I still have to setup racks for the nutrient mixes and whatnot, and run some plumbing, and hang some more lighting. At least I have the tables and general layout down though, so I'm happy.

Stuff will get added to the software as I get a better idea of the process and how it works. It looks like I have plenty of stuff to consider now. That picture really helps a lot. I was debating how to setup a database for nutrient feedings and watering schedules. I was contemplating making it plain text but that's makes it more difficult to sort/catagorize/metric later on. That gives me a really good idea of where to start with that. Until I get a better example and learn more, honestly, I might just 'borrow' that from you for now.
 
DemonTrich

DemonTrich

6,394
313
I just keep log books for each room. Just basic water, feed, training things. My temps and rh are pretty consistant. I also have a Callender as a back up in case I forget to write it in my log book. I have books going back 4 yrs. Thinking I might burn them.
 
stonestacker

stonestacker

4,271
263
I'm very basic. I just keep notes in a composition notebook. Of strains, ppm's, amount of feed in and runoff, temp, and humidity highs and lows out of necessity. I suffer from crs (can't remember shit). To be honest it's an unorganised mess that's hard to go back to look shit up.
Ken's log is more sophisticated than what I do lol.
Something like this could be a big help. I'm not all that tech savvy. But working on it, and willing to learn.

Welcome to the farm.
Most of my success is due to this place. It's a wealth of knowledge for this old fart lol.

Thank you for your contribution.
 
M

Mepis

45
18
In case anyone is interested, here is the link of what I've got so far:

I spun up a VM on Amazon EC2 so I can show it to some people without hammering my local home server.

I started building the daily journal around @kendog's picture from above. I ran into a snag though. I'm thinking through how to set up various nutrients. I like the way he/she logs the data in their journal, but I may not always use that. I'd like to be able to make it changeable. I trying to figure out how to make it a little more future proof software wise (to be able to add/change things down the road).
This will be going on my RPI down the road. That's why the home page is empty. That's going to be a dashboard of information, like current temp and humidity, maybe a live video feed of my grow, etc...

It's getting there. If anyone has an interest in using this down the line, I can make a VM with instructions to people can install it on their own PC. I don't want to get into adding a user system. That's an added cost I can;t afford to give people for free right now. But I really don't mind doing whatever I can to make it as easy as possible to help anyone set this up for themselves. I've got plenty of ideas to to make that really simple. I've learned so much from this community, and others, that if I can give back in some way, I'll be more than happy too.

If anyone has any suggestions for me, I'd love to hear it. This is very much a work in progress at the moment.

The nav bar on the page also won't be visible on mobile phones at the moment, only on tablets and laptops. I've been to lazy to add that yet. It's on the to-do list.
 
Last edited by a moderator:
M

Mepis

45
18
I also forgot to mention. That website link I posted is fully usable at the moment. Anyone can make changes and add things, including changing the settings. The problem is, if anyone changes the settings, it won't work. It's configured for where it's installed right now. If someone changes those settings by mistake, and I don't catch it, the settings to make it work are below. They are case sensitive.

Database User Name: dbUser
Database Password: password
Database Host: localhost
Database Name: gardenTracker
 
M

Mepis

45
18
I reported my own post above and asked someone to remove the link I posted. Another community pointed out it may not be a wise idea to post a link to any website that collects any information. Though I only want to show people what I've made in case they might find it useful themselves, I agree with that sentiment. I'd rather have the link removed. Maybe in the future after the website is more fully developed, I can figure out a safe way to post screenshots and an anonymous Git repo and instructions on how to use it, or something.
 
Ignignokt

Ignignokt

350
93
Howdy,

I designed a monitoring solution that was primarily for controlling the CO2 level based on sensor input. I run a shell script on a RasPi that reads the level and controls a solid state relay for the CO2 valve. It also keeps track of time so I'm not wasting CO2 in the dark.

The CO2 sensor is a NDIR type - most seem to be made by the same company in China (Winsen). I had started by using an AMPRO CO2 meter with a USB port to develop the code while my order from China was in transit. That device reported CO2 ppm, humidity, temperature and dew point. This was enough to start.

After working with the sensor itself - I found the best way to integrate it was to use an Arduino based controller. New Arduinos, like the Zero, have enough program space to implement most all functionality without ever needing a RasPi. I'm finishing the design on the arduino version - it will have wifi and use MQTT to upload the data to IOT style cloud services.

The board I'm using is:

https://www.adafruit.com/products/3061

The CO2 sensor:

http://sandboxelectronics.com/?p=1126

When I'm finished, I'll post the code and such on github later this year. As you can see - the basic controller and CO2 sensor come to about $100.00US.

At the moment - I'm thinking canopy temperature sensing may be interesting. There is a device from TI that can sense temperature without touching and has I2C bus connection:
https://www.adafruit.com/products/2023
 
M

Mepis

45
18
That's really awesome! I'm hoping to do that at some point. Less so on the CO2 and more with the other sensors, like temp and humidity.

For the moment I started building my own grow journal software. I was originally hosting it on my Pi but moved it to a public instance on EC2. I built in a user system. I pivoted a little because I wasn't thrilled with the grow journal software currently out there. It just didn't fit my work flow.

Since I posted this originally I pivoted my goals. I wanted to make software that anyone could host and use on their own. After a discussion on Reddit, though, I decided to build something and just host it for anyone with a user system. This way, anyone can just sign up and use it. I'm putting a lot of thought into user security and what information I actually need to collect (as in as little as possible).

After I get to 1.0, I hope to make an API and a roll a RPI image with documentation for standard parts that people can use to build a hardware sensor device that will automatically take measurements and upload them to their account. This a stretch goal kind of thing. Hopefully I'll get there come Nov-Jan.

I hosted what I have on GitHub. I'm putting everything under the MIT license. That way those that are tech savvy can host their own version. Those that aren't or just don't want do the upkeep can sign up.

I have a catch 22 on this though. I don't mind posting the GitHub link, but that means I can't talk about me growing anything at all for safety reasons. I live in a state where it's not very legal yet (but getting there). It's easy to figure out who I am from my GitHub info. If people will use the website, I don't mind posting it.

Anyway, I'm stepping away from the PC for five minute. To many things are going on in the house at once. To many distractions at the moment.
 
Ignignokt

Ignignokt

350
93
I appreciate your ambition - however I think there is a fundamental issue to your proposed market. I, for one, have no intention of sending my grow data off site. I implement my own system to:

1. Avoid the Revolv syndrome - vendor abandonment. Google bought them, shut down the servers and guess what? No access to the data. They refunded the cost of the appliance - but value lies in data generated.

2. Ability to enhance, reprogram, modify and otherwise hack to my hearts content.

3. Absolute control of the data and who gets access.

I have no illusions about trying to take my designs and market them. Like you, I want to pay it forward somehow through open source releases of my hardware and software designs. I benefit from the group subject matter expertise on growing techniques, nutrients, diseases and pests and hopefully others can benefit from my technical subject matter expertise in electronics and software. I have specific technical goals to achieve to obtain state of the art indoor grow room efficiency - to allow the ultimate goal of off-grid power use.

To be compelling - your app needs to somehow eliminate work, not just find a way to electronically record what others write on bound paper. Like voice input to record logs. That would be swell.

Good luck with your project!

Iggy
 
M

Mepis

45
18
I appreciate your ambition - however I think there is a fundamental issue to your proposed market. I, for one, have no intention of sending my grow data off site. I implement my own system to:

1. Avoid the Revolv syndrome - vendor abandonment. Google bought them, shut down the servers and guess what? No access to the data. They refunded the cost of the appliance - but value lies in data generated.

2. Ability to enhance, reprogram, modify and otherwise hack to my hearts content.

3. Absolute control of the data and who gets access.
I very much feel the same way. I originally wasn't going to share it at all. Then I figured it would be nice to give me, and I would just post the repo and let people have a go at it. Then I realized that most people won't even attempt to tackle trying to setup their own web server and DDNS address. Then I figured I'd figure out a way to package it in a nice VM people could just download or very detailed instructions to setup. Then I had that conversation on Reddit with other people...

I still keep my own personal information on my own web server. It takes very little effort to maintain my own web server and an EC2 instance for other people to use. So, I just went that route. People that are capable of installing a web server or willing to learn can do so and clone the repo and have the same feature set that's on the site. Those that can't can just simply use the site.

I understand the Revolv thing. That's the reason I use Google services sparingly and clone the data stored there in other places. Since Reader shut down, I've been very hesitant of using cloud services or something I can't control (I'm running nix on my laptop for heaven's sake!). That's why, at some point, I'm going to put in a way to export data to a CSV file.

I'm taking anonymity and data gathering seriously (as in I'm taking zero analytics on the website and asking for only the information I see needed - I have no idea who is using what and how because of that). Even when I make a way to upload pictures to the journal, the jpg naming scheme will be some kind of hash of the user name and other information so the data is semi separated from the accounts.

I can't stress enough though, that if someone doesn't want to trust the website, they can clone the repo and set a copy of this themselves.

... I have specific technical goals to achieve to obtain state of the art indoor grow room efficiency - to allow the ultimate goal of off-grid power use.
Sounds like we have the same goals.

To be compelling - your app needs to somehow eliminate work, not just find a way to electronically record what others write on bound paper. Like voice input to record logs. That would be swell.

Those kinds of things will come in time. I'm lazy so I like to make things as streamlined and automated as possible. At the moment I'm trying to get to 1.0 first and have a basic usable thing with normal, expected features. It'll get there.

Good luck with your project!
Thanks! You too! I look forward to seeing your stuff at some point.
 
Ignignokt

Ignignokt

350
93
Here is a design that uses a handheld AMPRO CO2 meter for sensing - data is a simple serial stream over USB to a Raspberry Pi 2 or 3:



You need an external power supply for the meter - batteries will not last long.

I use GPIO25 to control a solid state relay for now. A good alternate (safer!) is:

http://www.digital-loggers.com/iot.html (Warning = all their webpages seem to have autoplay video. Someone please take away their video camera. )

The shell script that runs on the pi is below. You need to 'sudo' to run this script (must be root). You also get running logs of every sample taken (about every 10 seconds) in a file /var/www/html/CtlrLog`date -I`.txt - the log rolls over to a new file at midnight every night. I use it to view the raw data in a browser.



Code:
#!/bin/bash
#set -x
#
#
# read CO2 level Temp and Humidity
#
# Control CO2 valve based on measured value from sensor
#
# Rev 0.5 - basic funcions
#     0.6 - format for redirection to a file
#     0.7 - first go at garbage detection - multiple starts sometimes required without
#           some check that input is not sane.
#           Daily manual start-stop but otherwise autonomous.
#           Logging confirms regulation design.
#           First version for regular usage.
#     0.8 - experiments with format for display and logging. Introduce DEBUG variable.
#     0.9 - Time aware for enable valve open. Time in 24hr fmt.
#           Currently lighting is asynchronous with the ctlr.
#     0.91  Adding temp, humidity and dewpoint to ouput
#
#
#   Need to add -
# - process other var TEMP and Humidity
# - Check for lights ON
# - process for average - lower update rate.
#
#   Display does not always use LF. Logging always uses LF.
#
# Initial watermarks - logged when set
#  Rationale for values:
#
# to get an accurate low watermark for a run - use an artificially high value.
# high mark is easy since ambient is 400.
#
#  Note low mark value will be low (~280) at start.
#
LOWPOINT=2000
HIGHPOINT=400
#
# Setpoints for control
#
#  This is the control band range.
#
LOWSET=1200
HIGHSET=1500

#
# Set initial Valve state
#
#  Since there is no current method to be sure of valve state
#  The design is to always initialize as closed.
#
VALVE=closed
RUNSTATE=online

#
# Set the start and stop times for CO2 enhancement
#
# Start after 8am. Stop (offline) after 7pm
#
TIMESTART=8
#
# Stop at 7pm
#
TIMEEND=19


# Set initial Light state NOT YET IMPLEMENTED
#  This is detectable. Before any OPEN action, check for  Lights OFF.
#
LIGHTS=on

# Setup port for serial stream
stty -F /dev/ttyUSB0 raw 9600 cs8 clocal

#
#
#  Set GPIO pin mode for GPIO25
#
#  This is where we assert control of the valve state.
#  Initialize as OFF (valve closed)
#
gpio mode 25 output
gpio write 25 0

#
#  Capture state to logfile
#

gpio readall >> /var/www/html/CtlrLog`date -I`.txt

#
# initialize variable to some reasonable value
#

level=400
#
# Kick out a few line feeds

echo
echo "-------------------"
echo
echo

#
# Read the serial stream
#
# This is the begin of the endless while-loop.
#

cat /dev/ttyUSB0 | while IFS=":" read -r  val1 val2 val3 val4 val5;

do

#
# Discard the header line
#
  if [ $val1 == '$CO2' ];
     then
     continue
  fi

#
# Try to discard garbage
#

  if [[ $val1 != *ppm ]];
     then
     continue
  fi

# extract the CO2 level in ppm
#
  declare -i sample=`echo $val1 | sed -e 's/C//' -e 's/ppm//'`;
#
# extract the temperature in degrees F
#
  temp=`echo $val2 | sed -e 's/T//' -e 's/F//'`;
#
# extract the humidity in percent
#
  humidity=`echo $val3 | sed -e 's/H//' -e 's/%//'`;
#
# extract the dewpoint
#
  dew=`echo $val4 | sed -e 's/d//' -e 's/F//'`;

#
#
#
#  This section runs with every sample loop.
#

#
# If the level has not changed - print nothing
#
     if [ "$level" -ne "$sample" ];
        then
        level=$sample;
        else
        continue
     fi

#
# Print the level when it updates
# rev 0.8 updates to print this on the same line NO LF.
#
# To standard out - this is the only output from the script.
# no LF.  Could be used with a LCD ( not implemented ).
#
     echo -ne "    Current Level: $level ppm  Status: $RUNSTATE  Temp= $temp F  Humidity= $humidity % Dewpoint= $dew F       \r"

#
# System log basic heartbeat.
#
     echo "Current Level: $level ppm  Status:$RUNSTATE  Temp= $temp F  Humidity= $humidity % Dewpoint= $dew F `date`    " >> /var/www/html/CtlrLog`date -I`.txt

#
# Set and LOG watermark levels for min-max
#
     if [ $level -lt $LOWPOINT ];
        then
        LOWPOINT=$level
        echo "`date` Low mark Set ## $level ppm" >> /var/www/html/CtlrLog`date -I`.txt
        echo " Temp= $temp F  Humidity= $humidity %  DewPoint= $dew F" >> /var/www/html/CtlrLog`date -I`.txt

     fi
     if [ $level -gt $HIGHPOINT ];
        then
        HIGHPOINT=$level
        echo "`date` High mark Set ## $level ppm" >> /var/www/html/CtlrLog`date -I`.txt
        echo " Temp= $temp F  Humidity= $humidity %  DewPoint= $dew F" >> /var/www/html/CtlrLog`date -I`.txt

     fi
#
# ACTION : OPEN VALVE
# Test for low setpoint - if less than - open the valve IF the lights are ON.
# 
# added check for hours of operation.
#
# -- future dev - add light duration and wait for 30 min after dawn for valve open.
#
     if [ $level -lt $LOWSET ];
        then
#
# TODO:  Add when light detection is present
#       <
#         Need logic to set based on GPIO read.
#       <
     if [ $LIGHTS = 'off' ];
        then
        continue
     fi
#
# Check valve STATE - if it is already open, skip VALVE OPEN action.
#
        if [ $VALVE = 'open' ];
           then
           continue
        fi
#
# Check the time. hours treated as a simple integer with a known range.
# first check if past shutoff time
# then check if before turn on time
#

        if [ `date +%H` -gt $TIMEEND ];
           then
           gpio write 25 0  # Time to close for the night
           VALVE=closed
           RUNSTATE=offline
           continue
        fi
        if [ `date +%H` -lt $TIMESTART ];
           then
           gpio write 25 0  # Time to close for the night
           VALVE=closed
           RUNSTATE=offline
           continue
        fi
#
# turn valve on
#
     RUNSTATE=online
         gpio write 25 1
         VALVE=open;
         gpio readall  >> /var/www/html/CtlrLog`date -I`.txt
#
# print date and action - open valve
#
         echo "`date`  - VALVE OPEN ACTION "
         echo " Temp= $temp F  Humidity= $humidity %  DewPoint= $dew F"
         echo " High Watermark = $HIGHPOINT Low Watermark = $LOWPOINT"
         echo "`date`  - VALVE OPEN ACTION " >> /var/www/html/CtlrLog`date -I`.txt
         echo " Temp= $temp F  Humidity= $humidity %  DewPoint= $dew F" >> /var/www/html/CtlrLog`date -I`.txt
         echo " High Watermark = $HIGHPOINT Low Watermark = $LOWPOINT" >> /var/www/html/CtlrLog`date -I`.txt
     fi

#
# ACTION : CLOSE VALVE
# Test for high setpoint - if greater than - close the valve.
#
     if [ $level -gt $HIGHSET ];
         then
#
# Check valve STATE
#
       if [ $VALVE = 'closed' ];
          then
          continue
       fi
#
# Close the valve
#
        gpio write 25 0
#
# Report and log
#
        echo "`date` - VALVE CLOSE ACTION"
        echo " Temp= $temp F  Humidity= $humidity %  DewPoint= $dew F"
        echo " High Watermark = $HIGHPOINT Low Watermark = $LOWPOINT"
        VALVE=closed;
        echo "`date` - VALVE CLOSE ACTION" >> /var/www/html/CtlrLog`date -I`.txt
        echo " Temp= $temp F  Humidity= $humidity %  DewPoint= $dew F" >> /var/www/html/CtlrLog`date -I`.txt
        echo " High Watermark = $HIGHPOINT Low Watermark = $LOWPOINT" >> /var/www/html/CtlrLog`date -I`.txt
        gpio readall >> /var/www/html/CtlrLog`date -I`.txt
     fi
done
 
Ignignokt

Ignignokt

350
93
Ah shit. Forgot -

This is fully functional code I have run for months at a time - reliability is important since having the CO2 valve running open loop (not controlled) in a sealed or mostly sealed environment would generate toxic CO2 levels for plants and humans. The meter can be set to alert with a beep at higher concentrations - I have mine set for 2000 ppm.

Note - If your Raspi becomes somehow sentient, drains your bank account and rapes your dog because of this code - It's all on you. I will provide no support, fixes or updates. This is released under MIT license, mostly because GPL3 goes on and on (TL;DR) but I'd really like folks to contribute. I hope someone else finds this useful.

MIT License

Copyright (c) [2016] [Hegemone Technical Services]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
 
Top Bottom