Lophophora's spare bathroom

Half-baked guide to automation

I see a lot of nice turn-key automation setups, along with some really slick custom automation setups.

I have neither. I do however have an embedded PC, some I2C sensors, and the will to make due with what I have.

Reading a sensor can be achieved using the linux sysfs tree without any special software

#!/bin/bash
function readsensor {    
    local loghost="10.10.10.10"
    local logport="420"
    local facility="local0.info"
    
    ## I2C addresses for BMP280 is either 0x76 or 0x77
    for x in 76, 77; do
        local device="/sys/class/i2c-adapter/i2c-2/2-00${x}/iio:device1"
        local sensor=$(cat "${device}/name")
        ## If you're going to get fancy with sed, make notes about what it is you wrote
        local temp=$(cat "${device}/in_temp_input" | sed -e 's/\(..\)\(..\).*/\1.\2/' -)
        local address=$x
        logger -n "${loghost}" -P "${logport}" -p "${facility}" -t "$sensor-$address" "$temp"
    done
}
readsensor
#EOF

Automating sensor readings is as simple as adding such a bash script to your crontab.

* * * * * /usr/local/bin/logtemp.sh > /dev/null

But where does this data go, and how is it stored, a fancy resource intensive SQL database? Absolutely not.

Let the system logger deal with it. I just use the built in syslog software, which is already running in the background of 99% of linux distros. Log rotation, compression, and backup are all handled by the logger already. No forgotten SQL credentials, no intricate backup procedures, no worries.

In my case I just make a custom rsyslog configuration to handle local and UDP logging.

# /etc/rsyslog.d/10-temperature.conf
input(type="imudp" port="420" ruleset="templogData")
ruleset(name="templogData") {
  action(type="omfile" dynaFile="templogTemplate" template="templogFormat")
  action(type="omfile" file="/dev/tty2" template="ttylogFormat")
  stop
}

Logging is not limited to local devices either. With UDP logging I can send data from a battery powered ESP-01 with a BMP280 over network for months on a single charge. For robustness I donā€™t even bother sending timestamps with environmental data, I use the recieve time on the logging machine as the timestamp. This also cuts reliance on local or external NTP services.

What to do with all this data? Hereā€™s some remote log data:

2021-04-04T06:30:26.972864-04:00 logger BMP280 26.22 68074.22
2021-04-04T06:30:31.972951-04:00 logger BMP280 26.22 68074.22

How about the highest value? The lowest?

cat remotelogs/esp_183da3.local.domain-BMP280.log-20210405 | cut -d' ' -f4 | sort -u | head -n1
26.22
cat remotelogs/esp_183da3.local.domain-BMP280.log-20210405 | cut -d' ' -f4 | sort -u | tail -n1
23.73

Certainly you can use your imagination in this department. Data can be parsed in nearly limitless ways and periodic cronjobs can be used for analysis and email alerts.

Graphing can also be automated with tools like gnuplot, either to a fixed dashboard display or by periodically pumping out SVG or PNG graphs for display on a web page.

Please note, when it comes to graphing I will never be satisfied. This type of flexibility opens a pandoraā€™s box of possibilities and can consume a lot of valuable time. Do you really need gradients and transparent historical data behind your plot line? I wish I could share some gnuplot scripts with you here, but it feels like an unfinished masterpiece

Couldnā€™t you just use MQTT for your IOT setup? Sure, if you want to install, maintain, and secure a bunch of extra network services. There are also 3rd party IOT MQTT services one can use if you have absolutely no regard for sending private data out on the internet, and are 100% confident that you will never suffer network connectivity issues. I realize this is a major technology implemented in industrial automation systems, chat programs, and more but the protocol and tools just seem so longwinded to me. Half the time you have to roll your own publisher or subscriber daemons anyways, itā€™s just another middleman.

11 Likes

nice and simple man! I gotta rely on guys like you to write that code, then I just edit to suit my situationā€¦

But at least I understand everything you said :slight_smile: lol and that makes me dangerousā€¦ Like I said on another thread, I am always learning something new here for sure!

8 Likes

What have I done?

Things have been progressing well, at least until I repotted into fabric pots. I used the exact same batch of soil to fill the new pots as I had used to fill the last pots. Shortly after transplanting two of the plants started to yellow to more of a lime greenish colour, then they got a bit darker but with yellowing leaf edges.

My first instinct was to try everything, which I had to fight the urge to act upon. My next instinct was to not pick at things, so as not to make anything worse. I spent a few minutes adjusting the brightness and whitebalancing on my camera to grab a true colour representation close up photo. Thatā€™s how it looks to me in person at any rate.



After a bit of reading, the most common suggestion given to others was ā€œcheck your pHā€. Why not? Iā€™m already in my lavatory- err, laboratory. I grabbed a soil test kit, dug deep for a bit of root dirt, and ran a couple pH tests. Perhaps the test solution was spoiled, or maybe I did it wrong many times in succession. At any rate the results were inconclusive.


Not to be discouraged I moved on to the next round of testing. Water comes out of my tap at about 7 as far as I can discern. After watering I checked the runoff which I measured to be 6-6.5.


I gave the plants a nice epsom salt foliar spray at lights out a few days ago and again last night. Looking this morning the plants are looking better than a few days ago, but Iā€™m still a bit confused. Maybe the plants were just stressed. Maybe Iā€™m just stressed? Itā€™s really the two Skywalker Kush x JLO that look the most angry, perhaps it takes a mighty gardener to tame such beasts.

My lights are at 18", environmental readings at 24Ā°C/55% RH (surprisingly consistent this time of year).

The soil mix is made of sea compost, earthworm castings, peat moss, and perlite, amended with Gaia Green 4-4-4, kelp meal, and dolomitic lime. The same mix is doing great for my vegetables and house plants, but that doesnā€™t elevate it above criticism.

I donā€™t enjoy posting pictures of unhappy plants. Itā€™s like getting pantsed in gym class, only to have the school photographer rush in and take a bunch of colour photos to be posted on every locker.

Fingers crossed the plants will mend without my intervention, but Iā€™m open to suggestion.

11 Likes

The little auto that wasnā€™t (Part 2) - Thatā€™s a man, baby!

Thatā€™s a funny looking female. Despite all of my questions and uncertainty, all of my concerns have been allayed. What was once a pressing matter is now resolved.

8 Likes

Lmaoo, youā€™re gonna be making more seeds already??! :joy:

5 Likes

Iā€™m afraid Lola here is getting the chop. Already lied to me about being an auto, and now about being feminized. Next thing I know my wallet will be missing along with my car.

16 Likes

Hey bro, how are the plants doing now?

Hope all is well with you my friend :slightly_smiling_face:

4 Likes

I sense a great disturbance

While basking in the serenity of my garden something caught me off guard. Now where have I seen these before?

Looks like the Skywalker Kush x JLO are out of the running much to my disappointment but Iā€™m sure the jedi will returnā€¦

Moving along

With Mrs. Doubtfire and his friend out of the garden itā€™s time to move forward. Two new contenders have appeared.

From left to right (and in chronological order):

  • Dragon Milk x Tangie, courtesy of @catapult. This selection sounds exquisite, I truly appreciate it. Thank you.
  • Peyote Cookies x Shaman, courtesy of @Oldtimerunderground. Your thoughtfulness and outdoor growing prowess is a shining example to us all. Thank you.

Hereā€™s hoping I can see these girls through to flower. Thereā€™s a first time for everything.

9 Likes

I havenā€™t seen anyone get a female yet. I know the Lowryder2 I used produces about 60% males in a lot of his offspring. He was a manly man.

5 Likes

This sounds like a challenge. Iā€™ve got some goals now.

Never tell me the odds.

5 Likes

Nice, Iā€™m about to be using my not spare bathroom as a temporary veg room. at least now I have a reason to clean it :sweat_smile:

3 Likes

You know these things do grow in dirt :wink:

5 Likes

Yeah, but Iā€™m a but of a slob :sweat_smile:

3 Likes

Iā€™m really glad I was able to find those beans, canā€™t think of anyone that cross is more suited for than you. You will always be held in high esteem my friend, and I look forward to seeing more of your grows. Sending the most positive vibes from the universe your way bro, can you feel it?
ezgif.com-gif-maker

7 Likes

The beginning of the end

ā€œI thought there was a shower downstairs?ā€

8 Likes

Turn it up and rip the knob off

I told my family ā€œIf you need to shower itā€™s going to rain on Sunday. Iā€™m in charge around here, and there will be no further questions.ā€ My orders were obeyed immediately, and my authority absolute.

What actually happened is I visited all of the local hardware stores before ordering the part I needed online, then I repaired the fixture. Once completed I said aloud ā€œFoolish me, I should have repaired the downstairs fixures tooā€¦ā€

All of this knob turning got my wheels turning, and while in motion I finally got around to installing a PWM LED dimmer. My original design employed an arduino nano clone which to my dismay did not survive the design phase. Not interested in further setbacks I just threw an esp8266 in there and called it a day. I still have software improvements to implement but for now I can dim the lights via knob or network.

Improvements didnā€™t stop with plumbing and electrical. The Swackhammer found itā€™s way into the 10 gallon fabric potato pot in which I had planned to grow potatoes- but then I got high and planted corn. At any rate this pot is right at home in my spare bathroom, where it will see the Swackhammer through to the end.

With the change in seasons rapidly approaching I have taken a cue and set the lights to 12/12. Hopefully all subsequent pictures will be nothing but the chronic.

In light of the recent changes in lighting and threats to the sanctity of my bathroom, I whisked my seedlings away in the night to an undisclosed secret location.

The Dragon Milk x Tangie and Peyote Cookies x Shaman, which recently graduated to one gallon containers, are coming along nicely. Not much else to report while they cuddle up with my cacti.

18 Likes

@lophophora.ca I just read your last update again and laughed just as hard the 2nd time bro :joy: Great stuff man. Plants are all looking phenomenal.

6 Likes

@lophophora.ca entertains us while updating. :joy:

:green_heart: :seedling:

8 Likes

Retrospecticus

There are lots of ā€œbig namesā€ in the weed scene, Cheech and Chong, Jorge Cervantes, even Mike Tyson has his own weed brand. Snoop Dogg has never come to my house to help me grow weed, Marc Emery never helped me move a sofa last weekend, Cypress Hill didnā€™t advise me to check my pH. Scrolling up this thread to see the names of my weed mentors liking these posts, Iā€™m flattered beyond what I can describe with words.

You are the real weed heroes.

Has it been a month already?

Itā€™s time to take a look at my harvest from July. After a few days of hanging the bud graduated to a sealed jar.

The cure jar has been pretty steady at 63%RH- until I decided to jam my hand in the jar to rearrange the contents for a picture and reset the clock in the process. It was tough enough jamming the thermohygrometer in the jar in the first place, from now on itā€™s midnight.

A lower bud from one of the colas didnā€™t look or smell like much until I broke it up in a grinder. The aroma was akin to coffee and chocolate ran through a cheesegrater, very pleasant. Savoury like a turkey dinner. The smoke was not phenomenal, it didnā€™t cause temporary illiteracy or loss of bladder control, but the smoke was smooth as it was mellow.

I am at peace in flavour country.

I appreciate all the kind words and wish I could share a lot more. Compared to cacti these plants move like lightning but they still take their time.

12 Likes

You can tell a macho, he has a funky walk

:musical_note: Macho, macho man, I gotta be a macho man :musical_note:

Maybe those are just swollen calyxes, like she has some junk in the trunk?

15 Likes