Going to next level of Aquarium Automation...who's with me?

ok now I don’t even know what to do. It is saying that -m is an unknown option???..

Duh… somewhere along the line we started talking about mosquitto_sub, but you need to use mosquitto_pub to publish those results.

You can use mosquitto_sub to subscribe to the topic and watch for messages from the command line.

and there it is working… now next part… how do I get mosquitto to automatically send this data at a certain interval, say every minute?

You could use a scheduler like crontab to do that or you could write a script to do that.

A script might look like this:

#!/bin/bash
until [ "$?" != "0" ];
do
#individual temp probe and mqtt commands here 
        mosquitto_pub_command_1
        mosquitto_pub_command_2
# Sleep in seconds
        sleep 55
done

To get this script to execute at run time, edit the file /etc/rc.local on your system and add a call to that file with a " &" on the end of your call to this script of yours. For instance, if you named this script “mqtt_publisher.sh” and it was in your pi user directory, you would add the following line to your /etc/rc.local file

/home/pi/mqtt_publisher.sh &

BTW, don’t forget to use “sudo” when editing the /etc/rc.local file and also make sure to do a “chmod 755 /home/pi/mqtt_publisher.sh” as well (and test it) before adding that to your /etc/rc.local file, or you might break your bootup. (you can also test your /etc/rc.local file before reboot as well. That would be a good idea to do so, most likely.)

Running a script to just loop may not execute exactly at every 60 seconds. Each MQTT_PUB command will take about 1-3 seconds to execute depending on your CPU and you may want to adjust the sleep cycles for less than 60 seconds if you want the cycle to start less than 60 seconds from when it finished running for every temp probe you have. You can get it pretty close on average to about every 60 seconds, and in most cases, that’s good enough for most people.

But if you want exactly every 60 seconds, best to use crontab to schedule that down to the second accuracy level.

I use a script for my setups, btw.

OK. Trying that now. Every 60 seconds isn’t critical, just an interval I chose that seemed reasonable. I’ll probably back it down a few seconds to try and get it close.

And… did you get it working??? :smiley:

Yes. It looks like its working. I ran out of time to get it running upon start up though.

Now I guess I need to get them calibrated.

How many do you have? I got 10 and just did a single point calibration of all 10 at 25C … only 2 were off by more than half a degree, so I took an average of the other 8 and went with that.

One day I’ll get my hands on a NIST calibrated thermo and calibrate all again to that.

I’ve got 5. 4 are actually working.

Actually it looks like the probes don’t need much calibration. They were all within .5* of each other.

Interestingly I have one probe in my sump and another in my display tank along with similar probes from my reef angel. They are reading the opposite of what I would expect. Since the heater is in the sump I would expect that to be a bit warmer than the display tank (I’m running LEDs not metal halides). However the new probes show the opposite. The display tank is sitting a degree or two warmer. Nothing to be concerned about just an interesting observation. I may possibly be able to turn my heater down just a bit to save on energy.

What… like this? :slight_smile:

49
Keep in mind, my runs to at least 3 of my tanks are 7+ meters away - plenty of surface area for heat loss. The Anemone tank is 14 meters away from my sump (pipe length) - and still they always measure warmer than my sump.

The reasons for this are partly due to the dissipated heat loss of the pumps inside your display tanks.

Another reason may possibily related to where in the Sump you placed the Temp probe. For myself, I have the temp probe not where the heaters are, but just before the water gets to the heaters - in the same compartment of the sump where water returns from all my display tanks.

I wouldn’t recommend putting the temp probes in the same water compartment of your sump that contains your heaters.

Yeah those are pretty consistent.


Not too bad. I’m not trying to keep them all the same as they are separate tanks and tanks without coral in them I try and keep a bit cooler.

1 Like

Congrats!!!

If you want to feel really good about yourself and what you’ve done, go price out an Apex controller with that many temp probes. :wink:

I know how much my reef angel cost and it was a bargain compared to the apex (which truly is a great product, just pricey).

Unfortunately I’m noticing some anomalies in my temperature trends. My display tank temp dropped to 73* last night. This seemed to be an issue with me placing it right behind my gyre pump motor and I think interference was causing that as I moved the probe and the temp has come back up to 80.

The sump temp and quarantine temp however just jump back and forth between 76.78 and 76.89. The quarantine temp is doing something very similar and it is not reading the proper temp because I had the heater off for a while and the temp was closer to 74 not 77. I checked my connection on the breadboard and unlplugged/replugged the probes but they’re still giving me those readings. What could be causing this?

Can you upload some graphs so we can see? Are you sure you’re not just seeing actual minor fluctuations in the actual temps?

More powerful DC and esp AC pumps will emit a magnetic field around them, and this can cause some interference. Best to park further away from power heads and stream pumps.

Additionally, the quality of wire used to run the 1-wire connections may actually be susceptible to interference. I had this problem using non-twisted pairs and/or un-shielded telephone wires on longer runs.

I also found that having a monitor via the HDMI port can cause some issues here for both 1-wire and simple GPIO based float valves / button circuits. I tried everything to fix this issue, including several attempts at filter circuits - best / only solution to that problem was to remove the HDMI monitor. (Was a luxury connection anyways).

I’ve heard there can be some variances if you’re Pi is not properly powered. If your RED LED on your Pi isn’t staying illuminated, is flashing or just doesn’t light … that could be your problem.

Also, regarding the DS18B20 itself… you did use the Water proof produced version of these or did you make your own Water proof versions using Shrinkwrap? FWIW, I have one of the later I tried to see how it works, and found it works less reliably than the pre-made waterproof versions.

But I did add some marine grade waterproofing shrink wrap to all my pre-made water proof probes anyways. Although they claim the metal in the tip is Stainless Steel, I didn’t take any risks.

Hi!

Thanks for the temp mqtt thing, I’ve borrowed it:slight_smile:

Here is how I did 0-10V output (for Kessil and Tunze stream), converted a Jebao doser for use with HASS, etc:

http://www.ultimatereef.net/threads/firing-up-the-hated-dlx-enabled-reefer-250.803674/

I’ve initially went with DACs and opamp, but converted to RC filter & opamp, way easier and neater IMO. It’s cheaper, has less contacts to solder, and is fast and still wide enough with the arduino.

1 Like

Sure here are the graphs. The only one I am confident is working correctly is the curing tub. It follows exactly what I programmed it to do.

The pi is properly powered red LED stays on and it is running headless. These were the sensors I bought: https://www.amazon.com/gp/product/B00KUNKR3M/ref=oh_aui_detailpage_o03_s01?ie=UTF8&psc=1

org_812org_812org_812org_812

Also Sumi I will definitely be checking out your thread soon!

What is your target temp for the sump and quarantine temps?

My sump target is 77.3. That is what my reef angel is set to keep it at and according to the reef angel its does just that, only occasionally do I see 77.5 or 77.1. The other temp probe on my reef angel shows my display tank usually at 77.1. Hence the anomaly with these new probes.

The QT temp I am trying to keep at 75.