Pickupman66 Reef-pi Build

pickupman66

5000 Club Member
View Badges
Joined
Aug 10, 2010
Messages
6,032
Reaction score
1,166
Location
Winchester, TN
Rating - 0%
0   0   0
I built this a while back and just added it into my tank thread, but I wanted to seperate that out for support and informational purposes. so here goes.

Goals:
  • completely replace DA Archon Controller
  • simple, clean and easy to do
  • learn how to solder
I think I have completed all of the above except fully remove the Archon. I still use its wavemaker functionality as it has not been fully implemented into reef-pi.

below is that post brought over.

The last two weeks have been interesting to say the least. One thursday evening, my Archon controller started to reboot. somehow it was not happy and I could not get it stable to connect to the buss and my wifi. I have NO CLUE what happened to it. after an hour of trying to get it back up, I gave up and swapped essential life controls over to a power strip and what outlets remained on and just left the head unit unplugged from the buss. The next am, I power cycled it yet again and still nothing.

After the issues the previous night, I decided i needed to start to migrate to another control system. to control what I currently have with my Archon, I would need 12-16 outlets plus some extra modules. we are talking serious $$$ for an Apex system (over $1000) or any other off the shelf controller. I had amassed my Archon up over 6 years or more so there was no initial sticker shock. Forking over that kind of dough would have left me and my reef in the doghouse.....

Fortunately I have been following the Reef-pi opensource controller thread and I have seen some similarities to the Archon in this setup (mainly the linux part). So, i made the decision and calculation that I could get into the reef-pi and get it started for about $150. Not bad. However it wont do all that my Archon can do at this point, but i can see the potential. Hopefully I can lend my beta team experiences with this as well.

Please go check out the Reef-pi here. https://www.reef2reef.com/threads/r...tank-controller-based-on-raspberry-pi.289256/

While it ended up at $165 or so plus some extraneous parts and pieces I already had, I am quite pleased considering a few things:
  1. I have never worked with a Raspberry Pi before
  2. I have never soldered in any way shape or form. ever. I have wanted to, and even got a nice soldering iron for christmas.
So below is what I purchased:
I had a case for it all to go in and some automotive wire laying around. We reefers like to re-purpose stuff so I did in several cases along the way here.

Due to a busy week ahead, I had to just order and let everything come in.

My first attempt at Soldering. Not too bad. a but heavy with the big wires but I was pleased. This is THE temperature circuit. I have 3 sensors connected to this portion.
IMG_20180830_222515.jpg


Here is the system after adding in the power supply and the Control for 8 outlets. The rainbow colors go from the top of the board and the GPIO pins down to the darlington where it then steps the signaling up to 12volts and delivers it to the DB9 connector.
IMG_20180831_214228.jpg


Here is the outside of my project box. Unfortunatley the plastic was too thick for the connectors so I had to grind it down with my angle grinder on the inside for them to thread in. but hey, it works well now.
IMG_20180901_212114.jpg
IMG_20180902_150241.jpg

Goodies inside the box
IMG_20180901_212143.jpg


IMG_20180902_150249.jpg

Here is a Frtizing schematic of what I have built here.
controller 8 channel power.JPG

to add 8 more channels I will add another breadboard and complete that circuitry probably next month
controller 16 channel power.JPG


RJ45 breakout I had purchased for my Archon. this allows me to signal along a standard cat5E cable from the control box to the side of my tank. Connected here is the ATO float switch (white and blue) and two (now 3) temperature probes. They use power from the system delivered over the Cat5e and signal back on the yellow. Cool thing about these types of probes is that they each have a different address yet signal across the same circuit. so I can monitor the tank, Sump and the room temp. ***To clarify, I did not us the Raspberry PI ethernet jack in this at all.
IMG_20180902_152443.jpg



SO, all that said now, I have control of 8 devices on my system. the reef-pi is controlling the heater and the auto top off.

Some of the graphing. good to see this data.
ato usage.JPG
temp graphs.JPG


I still have to implement PH monitoring and hopefully Salinity Monitoring along with PWM control for Jebao pumps. This is all still in development.
 

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Worth calling out here that this build had encountered a major hiccup induced by hung raspberry pi, leading to temperature drop in tank for days. Thankfully livestock was fine, we are looking at watchdog configuration (to auto reboot pi when it’s hung) and persisting usage data during sudden power down
 
OP
OP
pickupman66

pickupman66

5000 Club Member
View Badges
Joined
Aug 10, 2010
Messages
6,032
Reaction score
1,166
Location
Winchester, TN
Rating - 0%
0   0   0
Cross posting this from the Main reef-Pi thread.

MAJOR ISSUE today. as you know I had issues with my system alerting last week on the ATO. I have been traveling all week away from home and now that i am home, something was amis. my Clam did not look good. Plus one of the BTA walked around. I went to move a frag away from it and thought WOW, that water is COLD> I went to check Reef-pi and could not login. I put my cooking thermometer in the tank and it read 68°! HOLY MOLY! This is not good. I could not access reef-pi so I power cycled it. as soon as it came up, it started blowing up my phone with ATO alerts and also the LOW temperature alerts. I checked and I am about 4 gallons low. This means the system has not been working properly for at least 4 days. I dont know where to go to diagnose this. It appears to be operational at this moment as I can access and heater and ATO is working.

ALSO, since the reboot today, I have no historical graph data. all of that is missing.

Tank is at 70° but i am sure it got as low as 65° during the night.

I am on version 2.2 and I show no errors in the web GUI. All equipment was powered as my lights were on and all water movement pumps had power.

Full log file attached from just before the crash, thru the boot and up to active state after power cycle.

Logs skipped. Raspbian was not logging during the down time. evidence in that it was completely locked. all GPIO stayed in the state they were in at the hang.
upload_2019-2-9_22-8-35-png.972831
 

Attachments

  • reefpi crash point 2-10-19.txt
    64 KB · Views: 101

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
There are a handful of posts of pi getting hung during nightly cron jobs in the main raspberry pi forum. Do you have anything else running on the pi?
 
OP
OP
pickupman66

pickupman66

5000 Club Member
View Badges
Joined
Aug 10, 2010
Messages
6,032
Reaction score
1,166
Location
Winchester, TN
Rating - 0%
0   0   0
There are a handful of posts of pi getting hung during nightly cron jobs in the main raspberry pi forum. Do you have anything else running on the pi?
NO. Pi is strictly for the Reef. this would have been a 5:45PM local time job. IIRC, we were not home at the time.
 

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
As a first precautionary measure I’m advising to setup watchdog to auto reboot pi when something like this happen
https://www.switchdoc.com/2014/11/reliable-projects-using-internal-watchdog-timer-raspberry-pi/

Ideally we should be able to use adafruit triggers (with adafruit.io enabled setups) to alert in such situations as well. I.e. when reef-pi is not sending metrics adafruit will send us push or email notifications. But in reality this does not work (adafruit.io triggers) last time I checked
 
OP
OP
pickupman66

pickupman66

5000 Club Member
View Badges
Joined
Aug 10, 2010
Messages
6,032
Reaction score
1,166
Location
Winchester, TN
Rating - 0%
0   0   0
Ill get to work on the Watchdog. HOwever initially when i ran the first command:
sudo modprobe bcm2708_wdog
the system stated:
upload_2019-2-10_12-16-54.png


I am running updates now on the system so we will see what happens now after it gets done.
 

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Ill get to work on the Watchdog. HOwever initially when i ran the first command:
sudo modprobe bcm2708_wdog
the system stated:
upload_2019-2-10_12-16-54.png


I am running updates now on the system so we will see what happens now after it gets done.
you have to enable it from /boot/config.txt and reboot pi,
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,345
Reaction score
1,722
Location
Missouri
Rating - 0%
0   0   0
When you are able to update the OS post the results of uname -a and date. Here is what I am running currently with no issues, uptime is 28days....

Code:
bishop@tankpi:~ $ uname -a
Linux tankpi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux
bishop@tankpi:~ $ date
Sun 10 Feb 19:11:09 CST 2019

Here is a one liner for cli upgrade:
Code:
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

I believe you are running an older kernel (just verified from the other thread posting), when you do the update look to see if one of the packages is an update to the linux kernel, once you update you will have to reboot to load the latest kernel. Let me know if you have any questions.

:)
 
Last edited:

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,345
Reaction score
1,722
Location
Missouri
Rating - 0%
0   0   0
OK. what code do I need to add to that file?

That link that @Ranjib was a little bit out of date, the module is named different now, try this:

The latest information is that to get the watchdog started on the RPi, you need to do this (based on this posting https://www.raspberrypi.org/forums/viewtopic.php?t=147501&start=25#p1229897 Look for the post by paulv

In /boot/config.txt add/change: (sudo nano /boot/config.txt)
Code:
watchdog=on

In /etc/systemd/systemd.conf, change
Code:
#RuntimeWatchdogSec=
to:
RuntimeWatchdogSec=10s

reboot
 
Last edited:
OP
OP
pickupman66

pickupman66

5000 Club Member
View Badges
Joined
Aug 10, 2010
Messages
6,032
Reaction score
1,166
Location
Winchester, TN
Rating - 0%
0   0   0
The systemd.conf file was empty. i checked both in the Pi file xplorer app and verified each change.

thanks for the one liner. I am comfortable with a comand line but just dont know the language and coding.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,345
Reaction score
1,722
Location
Missouri
Rating - 0%
0   0   0
The systemd.conf file was empty. i checked both in the Pi file xplorer app and verified each change.

thanks for the one liner. I am comfortable with a comand line but just dont know the language and coding.

No problem, you do want to get to the newer kernel, the updates should load that and more which I hope will kill the lockup issue. :)

The empty file was probably due to needing the watchdog=on addition in the config.txt file, once that is done, it needs to be rebooted to enable it.
 
OP
OP
pickupman66

pickupman66

5000 Club Member
View Badges
Joined
Aug 10, 2010
Messages
6,032
Reaction score
1,166
Location
Winchester, TN
Rating - 0%
0   0   0
So I get this now.
do I follow its instructions on fixing the broken install?

upload_2019-2-10_21-8-47.png
 
Last edited:

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,345
Reaction score
1,722
Location
Missouri
Rating - 0%
0   0   0
So I get this now.
do I follow its instructions on fixing the broken install?

upload_2019-2-10_21-8-47.png

Well yeah thats no good, so lets do what they suggest:
Code:
sudo apt --fix-broken install

Then once that completes, run the one-liner again...
 

Stuck to your aquarium: Do you put reef-related stickers on or around your reef system?

  • I have reef-related stickers everywhere!

    Votes: 5 2.7%
  • I have some reef-related stickers on or around my reef system.

    Votes: 55 29.3%
  • I have some reef-related stickers, but not on my reef system.

    Votes: 39 20.7%
  • I don’t have reef-related stickers, but I am interested in getting some.

    Votes: 22 11.7%
  • I have no interest in reef-related stickers.

    Votes: 65 34.6%
  • Other.

    Votes: 2 1.1%
Back
Top