If you install the minimal version of Rocky Linux you may find out that your networking is not working. You will see things like “name or service not found” when running the ping command. You may run ifconfig and see that the machine isn’t pulling a dhcp address.
The issue appears to be with NetworkManager. I will admit that I am new to it. I typically have configured networking using the raw network configuration files. The good news is that there is a tool called “nmtui” that is installed to make configuring NetworkManager easier.
Select Edit a connection, then your interface name and “edit”. Once you do that you should see something similar to the following.
Make sure “Automatically connect” is enabled. Then exit out of the program and reboot the machine. It should start working.
When I originally thought about this project, I was thinking of having the Raspberry Pi interface with another micro-controller which would take the actual measurements. The majority of the sensors are essentially designed to generate pulses. The frequency of these pulses corresponds to a certain value. For example, the rain gauge operates using a reed switch with a 100 Ohm resistor in series with it. When a hundredth of an inch of water passes through it, it momentarily closed the reed switch. Depending on how you hook it up, it can be either active low or active high. I prefer working with active high signals, so that is the design I went with.
However, after thinking about it for awhile I decided to use the GPIOs on the Raspberry PI and to use the interrupt library. In hind sight, that may not have been the best idea. I originally connected the rain gauge to the first GPIO pin (board pin 3). Unfortunately, the only place where it is documented that board pin 3 has pull up resistor on the Raspberry Pi board itself is in the code for the library. So when I first did my integration, it was throwing all kinds of errors and warnings. So, I ended up switching it to board pin 8. The schematic below is the updated schematic I am currently using.
The code is relatively simple. Rather than having locks, I use a counter. Due to the GIL in Python, the counter is essentially atomic (not that it matters much for this implementation anyway). Every hour, I calculate what the difference is in the current count from the previous hour’s count. I multiply by 0.01″ because every rising edge should be a hundredth of an inch and write it to the database.
import RPi.GPIO as GPIO
GPIO.setup(8, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
c = 0
o = 0
c = c + 1
print("Rain Gauge Trigger %i" % (c,))
GPIO.add_event_detect(8, GPIO.RISING, callback=my_callback)
t = c #read c once in case it changes
r = (c-o)*0.01
o = t
# now do the database update
conn = psycopg2.connect("dbname=weather user=grafana password=[PASSWORD] host=[HOST]")
cur = conn.cursor()
cur.execute("INSERT INTO rain (time, amount) VALUES ('now', %s)", (r, ))
I run the program using screen so that I can disconnect from the Raspberry Pi. At some point, I plan on using systemd to run it as a daemon which is restartable and will run at boot. From, there I use Grafana to generate a nice display.
Unfortunately, one of the problems I do have is that there are a lot of “phantom” interrupts as in there are interrupts when it is not raining. I get a few of these an hour. I believe it has something to do with the logic level thresholds, so I am going to play with the pull down resistor to see if I can get them to go away.
One of the issues I do have with bluegrass is its long germination time. I do have some spots I would like to fill in rather quickly. I have sections of my yard that are some variety of fine fescue and those spots seem to do very well most of the year. After doing a bunch of research, I determined that I would like to test Grand Slam perennial rye grass, Radar fine fescue and 4th Millenium tall fescue. I planted those indoor plots on May 11th, 2020.
It’s been almost two weeks since I originally planted these. At this point, both the Grand Slam and 4th Millenium would be ready for their first cut. The Grand Slam is doing the best as expected (because it is a rye grass) and it is the majority of the grass is over 4″ tall. The 4th Millenium is just behind with most of the grass being around 3.5″ tall. The Radar fine fescue is about 2″ tall.
There are areas of my lawn that don’t seem to grow much of anything. I have planted grass seed for the past several years and nothing happens. I want some ground cover until I try to plant grass again in the Fall of 2020, so I decided to try white dutch clover.
I put down seed in some of the rough areas on May 6th. It is now the 16th of May and it seems like it is starting to germinate in about 30% of the area I put it down in. I followed up the rough areas with another round of seed today and I also overseeded it in the side yard and parts of the front yard. The front yard is where I have spent the majority of my time over the past few years trying to get it back to life. Unfortunately it is being invaded right now by Black Medic. I have used chemicals in the past and it was extremely difficult to get it to go away. The only thing I found that worked was to get the grass healthy enough to choke it out. I’m hoping that the clover will quickly germinate and try to push it out this time. I don’t have any particular problem having clover in my yard as long as it is providing some benefit.
On May 13th which is about 2 weeks after I planted the indoor test plot, the Blue Note variety of blue grass has started to germinate. This means I am still waiting on the Midnight variety to germinate. The Fahrenheit 90 seems like it is doing the best followed by the SPF 30.
I did end up bringing in the outdoor test plot a few days ago because of a cold snap. I took all of the varieties back outside with the exception of the SPF 30. The varieties outdoors still show no signs of germinating. However, the SPF 30 germinated within a few days of being indoors.
A week and two days later, several of the varieties started to show some seedlings on the inside plots. The variety that seems like it is doing the best is Fahrenheit 90. The other two varieties that are showing some seedlings are SPF 30 and Skye.
There are still no signs of seedlings on the outdoor test plot. I think it has to do with the fact that it is much colder outside than it is indoors which during normal years is not true at this time of year.
I got my first weather station almost two decades ago. It was a very basic weather station by Davis and only supported rain, temperature and wind speed. After that one finally kicked the bucket, I ended up with a similar Peet Brothers weather station and for a brief period of time I used it for reporting weather over APRS.
Now that I am getting back into gardening again and starting to care about my lawn more, I would like to be able to have a better idea of what is going on. I’d like to be able to monitor the weather in the garden and be able to analyze it over the years.
So, I decided that I am going to build my own weather station out of a Raspberry Pi 4. The Raspberry Pi will interface with a rain guage, temperature sensor and hygrometer. I’m not worried about wind speed because my house is surrounded by many very tall trees, so I will never be able to get an accurate measurement.
On the software side, I wanted to be able to record the data for as long as possible and to have a convenient way to display and manipulate the data. To do this, I plan on using Postgresql and Grafana hosted on an AWS t3a.nano instance.
I looked into using Prometheus, but it was not as flexible or easy to use as I would like. Part of the problem is that my house is behind a NAT gateway and I have no plans on opening any ports or bothering with any VPNs. Out of the box, Prometheus only records data for 15 days. That can be changed using a modern version, but I’m always worried about a configuration file getting overwritten during an update and losing data.
If you are trying to run WordPress on AWS and are getting messages about loopback connection failed or cURL error 28: connection timed out then that means that WordPress can’t do a loopback to itself. On AWS, the problem is most likely due to the public/private IP address. The solution to this problem is that you need to put your domain name into your /etc/hosts file with your domain name set to 127.0.0.1. What is going on is WordPress is doing a DNS query to find your servers public DNS address. Then it is trying to connect to it by sending it out the gateway router and it is getting messed up. By setting your domain name in /etc/hosts, it tells it just to connect to itself and the loopback request goes through.
Right now my yard is kind of a mess. I believe the previous home owners always cut the lawn short and always bagged the clippings. As a result, there aren’t a whole lot of nutrients and there are a lot of different weeds that have taken over the yard.
I have tried overseeding and fertilizing over the past several years and the yard is looking a lot better. The lawn is looking a lot better, but it still needs a lot of work. The predominant grass type is turf type tall fescue which seems to do OK in my zone which is 7B. However, I would like a grass that is capable of repairing itself and filling in the bald spots.
The summers here can get absolutely brutal and they start quickly. We can go from a day where it is in the 40’s to a day when it almost hits 90. In July and August, we typically have a little bit of a drought where we can go one or two weeks of 90 degree weather without any rain.
I have spent a lot of time looking at different grass seeds and decided to go ahead and try bluegrass. There are some hybrid varieties that seem to do well in Texas and I figured they might do well here in my yard. So I ended up ordering small amounts of Fahrenheit 90, SPF 30, Blue Note, Midnight and Skye.
I am doing two different test plots. One is inside and one is outside. The game plan is whichever one seems to do the best (with a bias towards the one that does best outside), I will be planting in the fall.
I set up the indoor test plot on 4/30/2020 and the outdoor test plot on 5/2/2020. I am keeping the soil moist and misting it several times a day.