Aqua Controller via Raspberry PI

Ace25

Active Member
View Badges
Joined
Apr 30, 2012
Messages
339
Reaction score
11
Location
California
Rating - 0%
0   0   0
I'm not trying to dissuade you at all with moving forward with the Pi project, only trying to be realistic and point out potential issues you make come across along the way. It sounds like a fun project to me and if I wasn't over my head with other projects it would be one I would do as well.

If I were to do this type of project, knowing the issues that can occur with using an OS based controller, I would use it on a test tank with nothing living for at least 6 months to ensure there are no bugs that would cause things like an ATO to not function as expected, or heater, or any other critical piece to an aquarium. I have yet to find an OS that doesn't have occasional issues that require at least a reboot every so often. Unix, Linux, BSD, Windows, etc. If my movie freezes up 1/2 way through and I have to reboot the Pi (which takes a minute and hope no critical OS files were corrupted when it locked up), no big deal, but if it freezes up when the ATO kicks on and no one is around to fix it, it starts to become a big deal very quickly.

Going the Raspberry Pi route adds so much more complexity to doing simple tasks that to me it brings reliability into question. Can reliability issues be solved? More than likely, but the amount of time and programming to do so is beyond most people. For me, Arduino coding was easier to learn than BASIC since I knew some programming (not C++). It only took me a couple hours to pick it up. On the other hand, learning C++, that's not going to happen in a weekend for most people. Point being, it is not above most people to be able to figure out Arduino programming to update/troubleshoot a controller, but it is beyond most people to learn C++ to do the same.

For you zemuss, since you do know C++, that doesn't seem to be the case, so a Pi controller may be more up your ally and a lot more fun for you. I really do wish you all the success with the Pi project. I would love to see one working. :bigsmile:
 

zemuss

Valuable Member
View Badges
Joined
Jun 1, 2010
Messages
1,254
Reaction score
137
Location
Florida
Rating - 0%
0   0   0
I understand what your saying and until we go down the road we don't know how far the rabbit hole will become. (ISSUE wise) I am going to research more over time and take things slow because rushing it will cause problems.
 

discoreefer

Community Member
View Badges
Joined
Aug 31, 2014
Messages
37
Reaction score
0
Location
USA
Rating - 0%
0   0   0
I would love to work on something like this as a group. I do quite a bit of automation programming for my job. Mostly I work in Python, which is also what the default library is written in for accessing the pi's gpio pins, etc... I've built several projects with the pi, it's great for some things, but not for others. (analog/pwm functions)

Here are some of my thoughts on a project like this.

1. First thing we should get a consensus on is a list of requirements, what do we want this device to be able to do. (Light timer, wave maker, LED controller, top-off, ph probe, etc...) Once there is a consensus we can figure out our hardware requirements. Likely we'll need to incorporate other breakout boards, or use an arduino for reading analog sensors and communicate with the py via serial. communications.

2. The second thought is that in my experience running a web server on the pi isn't a great idea. The first issue is that the pi is not that powerful, so when you try to run a webserver and database to store info it's going to really bog it down. Typically what I do for those projects is to have an online server that hosts a rest api that the pi just feeds info into. That way there's a place online I can get realtime information from, but don't have to run my own webserver on the pi. The second issue with running a web server on your pi is opens up attack vectors on your home network. I prefer not to have open inbound ports open into my home network if I don't need too.

3. I see several mentions of C++, that's not really the language of choice for Pi projects, most tutorials and available libraries are written in Python. Python is an excellent language for people to learn on.
 

redfishbluefish

Stay Positive, Stay Productive
View Badges
Joined
Mar 22, 2012
Messages
11,710
Reaction score
25,751
Location
Sayreville, NJ
Rating - 0%
0   0   0
Future son in law is here again. Please realize this isn't me speaking....I'm simply the dumb messenger. He just mentioned that the other negative with Pi is that if there is a power failure, someone needs to physically turn the Pi back on when power is restored. So you might want to put some thought into that....maybe a constant battery backup.
 

discoreefer

Community Member
View Badges
Joined
Aug 31, 2014
Messages
37
Reaction score
0
Location
USA
Rating - 0%
0   0   0
Future son in law is here again. Please realize this isn't me speaking....I'm simply the dumb messenger. He just mentioned that the other negative with Pi is that if there is a power failure, someone needs to physically turn the Pi back on when power is restored. So you might want to put some thought into that....maybe a constant battery backup.


As soon as power was restored to the pi it would boot automatically, there is no power button. It is important to make sure the boot partition is read/only though so that it doesn't get corrupted when the power gets cut.
 

Ace25

Active Member
View Badges
Joined
Apr 30, 2012
Messages
339
Reaction score
11
Location
California
Rating - 0%
0   0   0
It is important to make sure the boot partition is read/only though so that it doesn't get corrupted when the power gets cut.
The boot partition is just a tiny part of the boot process. There are a million and one ways for an OS to crash/corrupt itself outside of the boot partition. Ie. Network driver file gets corrupted = no network, chipset driver corrupted = no interfaces. While the boot partition is important, making it read only doesn't really solve many issues (boot partitions can still be corrupted in read only mode via bad sectors on boot media which is probably the most common problem to face with boot partitions crashing). Making a boot partition read only tends to cause more problems than it solves.

"The major downside of mounting /boot read-only, setting immutable bits, or anything similar is that you will need to undo those settings every time you update your kernel or boot loader. This is much more likely to trip you up than it is to offer meaningful security."
 

discoreefer

Community Member
View Badges
Joined
Aug 31, 2014
Messages
37
Reaction score
0
Location
USA
Rating - 0%
0   0   0
Ace25, sd card corruption is a common issue on raspberry pi's. More so with certain cards than with others. Once common method to lesson the chances of corruption is to have a read only boot partition on the sd card and then the rest of the partitions on a usb stick/drive. I get that cards can still be corrupted, however not having files open for writing on an sd card when the power goes away will lesson the chances of that happening.

In regards to the bit you copied and pasted from google, making the boot partition isn't done for security reasons but rather to lesson the chance of sd card corruption.

Have you done many projects with the raspberry pi's before?
 

Ace25

Active Member
View Badges
Joined
Apr 30, 2012
Messages
339
Reaction score
11
Location
California
Rating - 0%
0   0   0
@Ace25,

Have you done many projects with the raspberry pi's before?

Just have one in my living room running Ubuntu as a Media center. That is the limit with my Pi experience since I couldn't figure out what else to do with it when they first came out that was useful for me at home. I have 25 years of OS/Server/Network experience. That is my day job at my local college for the past decade and before that for the USAF.

I agree with you that making the boot loader on a SD card, that is read only, and having the remaining OS on a flash drive is much more ideal than having the OS on the SD card alone, and that will greatly add to the stability (because the act of accessing the SD card, even in other areas/partitions could still corrupt the read only boot partition and more than likely will within a year or two from my experience).
 
Last edited:

discoreefer

Community Member
View Badges
Joined
Aug 31, 2014
Messages
37
Reaction score
0
Location
USA
Rating - 0%
0   0   0
Right, on. It's really a great platform to build on, other than the sd card corruptions they've all been pretty stable hardware wise. I'm excited to get one of the new ones with the new processor and more memory. I've got a project I was working on previously using the openCV library, but it was just too slow to really handle it.
 

zemuss

Valuable Member
View Badges
Joined
Jun 1, 2010
Messages
1,254
Reaction score
137
Location
Florida
Rating - 0%
0   0   0
Augh i really need to contribute more on this. I am sorry but life just got way too busy the last few weeks. I certainly need to put more thought into this.
 

zemuss

Valuable Member
View Badges
Joined
Jun 1, 2010
Messages
1,254
Reaction score
137
Location
Florida
Rating - 0%
0   0   0
discoreefer,

How easy is Python? Would u be willing to help out here?
 

discoreefer

Community Member
View Badges
Joined
Aug 31, 2014
Messages
37
Reaction score
0
Location
USA
Rating - 0%
0   0   0
zemuss, python is very easy to learn. If you're completely new to programming I'd probably recommend the codecademy website. Pretty good primer there.

Learn to code | Codecademy


If you're already familiar with general object oriented programming concepts, I'd just jump right into the tutorials on the raspberry pi website. Specifically the tutorials that get you started with the use of the io pins. If you don't already have an interface to the raspberry pi's io pins I'd suggest adafruits t-cobbler pi. Then you can plug into a solderless breadboard to start prototyping.

Raspberry Pi Documentation

I'm really close to getting my tank setup. Got a skimmer and return pump last week. Just need to plumb it up and do a leak test. Hoping in the next few weeks I'll have saltwater in it. Then I can get started on a controller.
 

zemuss

Valuable Member
View Badges
Joined
Jun 1, 2010
Messages
1,254
Reaction score
137
Location
Florida
Rating - 0%
0   0   0
Great! More contribution the better here..

I am going to focus on the PI and Netduino solutions.

Maybe a Arduino Solution later.
 

KoleTang

Valuable Member
View Badges
Joined
Jun 27, 2011
Messages
2,346
Reaction score
81
Location
Woodbury, MN
Rating - 0%
0   0   0
I am thinking that arduino is the way to go here. There are several reef controller codes already written for it. In fact ReefAngel is arduino based and you can download their code off their site. I would assume this means their parts will be compatible as well which is a plus.

Also found this: Open Reefs
 

discoreefer

Community Member
View Badges
Joined
Aug 31, 2014
Messages
37
Reaction score
0
Location
USA
Rating - 0%
0   0   0
Arduino is great for reading analog sensors, but doesn't have any built network capability with out add on boards. Another issue with the arduino the limited space for your programs. Once you add networking ability that sucks up half your space. I'm going to be using both the arduino and raspberry pi for my controller.

Also in regards to changing settings on the controller, would be much easier to access the pi via a web browser on your phone through flask/python, etc... instead of manually editing files and re-uploading them to the arduino.
 
Last edited:

KoleTang

Valuable Member
View Badges
Joined
Jun 27, 2011
Messages
2,346
Reaction score
81
Location
Woodbury, MN
Rating - 0%
0   0   0
Arduino I great for reading analog sensors, but doesn't have any network capability with out add on boards. Another issue with the arduino the limited space for your programs. Once you add networking ability that sucks up half your space. I'm going to be using both the arduino and raspberry pi for my controller.

I'll probably follow suit. It would be cool to use the Pi for a web server for remote access along with the networking functionality. Are there any apps that allow remote access that you know of?
 

zemuss

Valuable Member
View Badges
Joined
Jun 1, 2010
Messages
1,254
Reaction score
137
Location
Florida
Rating - 0%
0   0   0
Does anyone know if the Arduino can power more than 6 channels for LED drivers? This was a limit before an those with bigger tanks might have an issue with that. I am not saying that you can't hook up whites on one channel but the PWM limitation is there with the Arduino but the PI can handle more as the PWM is software driven. If I understand this correctly this means get an extension board for PWM and you can control a lot of PWM channels.

One the other hand why would you need more than a 6 channel PWM for LED drivers?

Thoughts?
 

discoreefer

Community Member
View Badges
Joined
Aug 31, 2014
Messages
37
Reaction score
0
Location
USA
Rating - 0%
0   0   0
I'll probably follow suit. It would be cool to use the Pi for a web server for remote access along with the networking functionality. Are there any apps that allow remote access that you know of?

I'm planning on using flask as it's pretty light weight and I prefer python. There are lots of option you could use though depending on what your comfortable with. Basically you're going to be creating a webserver that you connect to. One issue with allowing access to your pi from the outside internet is that you're going to need to run your webserver as root so that it has access to the gpio pins. This opens some security issues.

My plan was to have flask setup on the pi just to edit settings/change parameters, etc... and it would only be available on my local network (or vpn) but not to the outside world. As my pi collects data, that will be uploaded to a web app on my website where I can monitor the data, send alerts, etc...
 

discoreefer

Community Member
View Badges
Joined
Aug 31, 2014
Messages
37
Reaction score
0
Location
USA
Rating - 0%
0   0   0
Does anyone know if the Arduino can power more than 6 channels for LED drivers? This was a limit before an those with bigger tanks might have an issue with that. I am not saying that you can't hook up whites on one channel but the PWM limitation is there with the Arduino but the PI can handle more as the PWM is software driven. If I understand this correctly this means get an extension board for PWM and you can control a lot of PWM channels.

One the other hand why would you need more than a 6 channel PWM for LED drivers?

Thoughts?

Can use a shift register to get more pwm outputs on your arduino. I used this same method for controlling the LED's on my remote control truck. Was pretty straight forward. I'm not real familiar these LED light setups or the controllers for them. So that will be a learning process for me once I get mine.

ShiftPWM: the easiest software PWM library for Arduino | ElcoJacobs.com
 

Bubbles, bubbles, and more bubbles: Do you keep bubble-like corals in your reef?

  • I currently have bubble-like corals in my reef.

    Votes: 47 41.6%
  • I don’t currently have bubble-like corals in my reef, but I have in the past.

    Votes: 12 10.6%
  • I don’t currently have bubble-like corals in my reef, but I plan to in the future.

    Votes: 32 28.3%
  • I don’t currently have bubble-like corals in my reef and have no plans to in the future.

    Votes: 20 17.7%
  • Other.

    Votes: 2 1.8%
Back
Top