reef-pi :: An opensource reef tank controller based on Raspberry Pi.

njtiger aquariums

Well-Known Member
View Badges
Joined
Oct 9, 2015
Messages
513
Reaction score
521
Location
NV
Rating - 0%
0   0   0
Your thread was a good read :) it's coming along well. And I definitely understand where you are coming from with doing the software yourself.

The last coding I did was over 10 years ago in high school and I've only used HTML, basic and a bit of python so Im sure I could teach myself again with a bit of effort. If I go with pre made software it will be something like the one in this thread which is open source, so I can teach myself the language used and have a good understanding of the system. Wiring anything electrical (especially 240V) is 100% new to me and a bit daunting so that will be a new experience.

Initially I want temp monitoring (I live somewhere too hot for a heater so I don't care about control, I just need to know if my chiller bites the dust :p), 16 controllable outlets which I can assign some tasks to and dimming for my 3 Mars aqua lights (at some stage it will be 4). And I would like it all to be controlled / displayed on a tablet.

In the future I would like to add a solenoid on my RODI with a bunch of float switches to do automatic filling of my top off reservoir and general ATO functions. Then further down the line pH, salinity and ORP monitoring would be awesome but not required.

I also use aquarimate to monitor my parameters and remind me about tasks but I like how you included it in your software so I may consider something similar once I am happy with the majority of the controller.

I can tell you that electrical was new to me. People would be loling at me if they watch me work on the wiring. I did some reading, wire, reading, looking at the wires, read. I spent like a week with the whole unit wired up but never plugged in. When I did decided to be brave and test the outlet I used a cheap plug in led and had the whole system plug into a surge that I was ready to pull out of the wall in case of any issues. With that said my outlets been running for 2+ years and *knock on wood* no issues yet. Now the equipment that draws the most is my heater and I only been running that for about 3 months now; granted the system doesn't control the heater just yet.

Python is easy to learn or at least for me it is. I never knew python until I started this project and I been picking it up quickly.

The temp was the easiest to do. The DS18B20 is cheap (I got a bag of 5 for like $9). I use this site to help with code for the temp code -
https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/parts but I don't use all of their parts. I have my code check the temp every min and then log the temp every hour on the hour into a mysql database.

I'm still debating where I want to go next with controls. I need to work on the current system and clean up many stuff but I been thinking of either controlling my RW4s power heads (even started looking into that) or controlling my Kessil 360 (but I have the Kessil controller so no rush here) or handling a ATO.

I'm not one to share my code freely but I don't mind helping pointing someone in the right direction. Its not that I want to sell my code but it something I'm not willing to share or at least not share at this time. Now if I use any open source code or public code within my code I do share that freely as well.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Thanks. I might pick your brian on how you did the controls from the Kessil 360 but I'm no where ready for something like that. I have a ton of cleanup to do on my current system.
Happy to help, anytime
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Hello friends,
I just cut a new release of reef-pi. Which address couple of bugs (Raspberry Pi 2 detection issue , as mentioned by @ClaudioA ), updated documentation (Job specification), some lighting cycle related bug fixes , and ...

Raspberry Pi zero build :) .,
Yeah I am stoked to announce that reef-pi can run just fine on raspberry pi zero, the 10$ wifi enabled computer :) . This should make it possible to do a under 5o$ controller, with even smaller form factor.

https://github.com/ranjib/reef-pi/releases/tag/0.0.5

happy reefing,
 

Aaron Smith

Active Member
View Badges
Joined
Apr 9, 2017
Messages
250
Reaction score
273
Location
Oregon
Rating - 0%
0   0   0
Hello friends,
I just cut a new release of reef-pi. Which address couple of bugs (Raspberry Pi 2 detection issue , as mentioned by @ClaudioA ), updated documentation (Job specification), some lighting cycle related bug fixes , and ...

Raspberry Pi zero build :) .,
Yeah I am stoked to announce that reef-pi can run just fine on raspberry pi zero, the 10$ wifi enabled computer :) . This should make it possible to do a under 5o$ controller, with even smaller form factor.

https://github.com/ranjib/reef-pi/releases/tag/0.0.5

happy reefing,

For update to 0.0.5,

Do I need to remove the library like the update to 0.0.4? Also need to re-setup the config file?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
For update to 0.0.5,

Do I need to remove the library like the update to 0.0.4? Also need to re-setup the config file?
Just remove it using 'apt-get remove reef-pi ' and install using 'dpkg -i reef-pi....deb' . This should work. Remember to install the pi3 package,
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
My 24hour lighting cycle
IMG_1131.JPG
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
The lighting cycle setup is geared for kessil, thats only two channel pwm (one for intensity and one for color ), I am pretty sure this wont suffice for anything else. I am wondering what the best UI for this should be. Initial thoughts are around config file specifying channels (name & pin).. and then UI can show one set of sliders (12 vertical sliders, each at 2 hour gap, like the image I posted before),
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I am still doing something wrong on the remote access though. I can't see to figure it out. LOL!
Can you share the output of `ifconfig -a`, and `cat /etc/reef-pi/config.yml` ?
 

Aaron Smith

Active Member
View Badges
Joined
Apr 9, 2017
Messages
250
Reaction score
273
Location
Oregon
Rating - 0%
0   0   0
The lighting cycle setup is geared for kessil, thats only two channel pwm (one for intensity and one for color ), I am pretty sure this wont suffice for anything else. I am wondering what the best UI for this should be. Initial thoughts are around config file specifying channels (name & pin).. and then UI can show one set of sliders (12 vertical sliders, each at 2 hour gap, like the image I posted before),


For this I would only need to be able to control PWM 0 (blue) and PWM 1 (white) separately on the 2 hour blocks as you have it. I was thinking it should work as is?

I am currently controlling 1 driver (blue) with PWM 0 and 1 driver (white) with PWM 1
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
For this I would only need to be able to control PWM 0 (blue) and PWM 1 (white) separately on the 2 hour blocks as you have it. I was thinking it should work as is?

I am currently controlling 1 driver (blue) with PWM 0 and 1 driver (white) with PWM 1
Yeah , for your case it will work as it is,
 

MaccaPopEye

Well-Known Member
View Badges
Joined
Jan 5, 2016
Messages
697
Reaction score
1,234
Rating - 0%
0   0   0
The lighting cycle setup is geared for kessil, thats only two channel pwm (one for intensity and one for color ), I am pretty sure this wont suffice for anything else. I am wondering what the best UI for this should be. Initial thoughts are around config file specifying channels (name & pin).. and then UI can show one set of sliders (12 vertical sliders, each at 2 hour gap, like the image I posted before),
Maybe the ability to add tabs for each light such as "light 1", "light 2", "light 3" etc. Each tab/screen can have 2 sets of sliders. For kessil users that can be 1 for intensity and 1 for colour and for other users (Black boxes and DIY lights etc.) it can be 1 for blues and 1 for whites. I also think sliders at 1hr intervals would be better, could have more of a steady ramp up/down. You wouldn't need a full 24 sliders but maybe 14-16 (6am to 8pm for example)?

I didn't get a chance to pull one of my mars aqua lights down last night but I'm free tonight so I will get some pics of the insides and post them up to see what I would need to dim them.
 

ClaudioA

New Member
View Badges
Joined
Jun 7, 2017
Messages
16
Reaction score
13
Rating - 0%
0   0   0
Hello friends,
I just cut a new release of reef-pi. Which address couple of bugs (Raspberry Pi 2 detection issue , as mentioned by @ClaudioA ), updated documentation (Job specification), some lighting cycle related bug fixes , and ...

Raspberry Pi zero build :) .,
Yeah I am stoked to announce that reef-pi can run just fine on raspberry pi zero, the 10$ wifi enabled computer :) . This should make it possible to do a under 5o$ controller, with even smaller form factor.

https://github.com/ranjib/reef-pi/releases/tag/0.0.5

happy reefing,

@Ranjib, I update with the new version (apt-get remove...dpkg -i..) but this is the new output:
Code:
systemctl status reef-pi.service
● reef-pi.service - raspberry pi based reef tank controller
  Loaded: loaded (/lib/systemd/system/reef-pi.service; enabled)
  Active: failed (Result: exit-code) since lun 2017-06-12 13:35:19 CEST; 1s ago
  Process: 24295 ExecStart=/usr/bin/reef-pi -config /etc/reef-pi/config.yml (code=exited, status=200/CHDIR)
Main PID: 24295 (code=exited, status=200/CHDIR)

giu 12 13:35:19 raspberrypi systemd[1]: Started raspberry pi based reef tank controller.
giu 12 13:35:19 raspberrypi systemd[1]: reef-pi.service: main process exited, code=exited, status=200/CHDIR
giu 12 13:35:19 raspberrypi systemd[1]: Unit reef-pi.service entered failed state.

root@raspberrypi:/home/pi/reefpi# reef-pi -version
0.0.5

And this is the config.yml
Code:
---
controller:
  adafruitio:
  enabled: false
  token: xxx
  user: xxx
  feed: temperature
  enable_gpio: true
  enable_pwm: true
  enable_adc: false
  enable_temperature_sensor: false
  database: "reef-pi.db"
  outlets:
  AC1:
  pin: 5
  AC2:
  pin: 6
  AC3:
  pin: 13
  AC4:
  pin: 19
  PWM0:
  pin: 0
  type: pwm
  PWM1:
  pin: 1
  type: pwm
  equipments:
  Return: AC1
  Filter: AC2
  Heater: AC3
  AirPump: AC4
  Light Intensity: PWM0
  Light Color: PWM1
  lighting:
  enabled: false
  intensity_channel: 0
  spectrum_channel: 1
api:
  address: "0.0.0.0:8080"
  enable_auth: false
  auth:
  id: 35adsjfaksjfdhks5eun435b.apps.googleusercontent.com
  secret: adqwieuqiwue
  callback_url: http://localhost:8088/auth/callback/google
  domain: example.com
  users:
  - foobar
  gomni_auth_secret: sadfhsadfkh238asdf
  image_directory: /var/lib/reef-pi/images
  interface: eth0
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
@Ranjib, I update with the new version (apt-get remove...dpkg -i..) but this is the new output:
Code:
systemctl status reef-pi.service
● reef-pi.service - raspberry pi based reef tank controller
  Loaded: loaded (/lib/systemd/system/reef-pi.service; enabled)
  Active: failed (Result: exit-code) since lun 2017-06-12 13:35:19 CEST; 1s ago
  Process: 24295 ExecStart=/usr/bin/reef-pi -config /etc/reef-pi/config.yml (code=exited, status=200/CHDIR)
Main PID: 24295 (code=exited, status=200/CHDIR)

giu 12 13:35:19 raspberrypi systemd[1]: Started raspberry pi based reef tank controller.
giu 12 13:35:19 raspberrypi systemd[1]: reef-pi.service: main process exited, code=exited, status=200/CHDIR
giu 12 13:35:19 raspberrypi systemd[1]: Unit reef-pi.service entered failed state.

root@raspberrypi:/home/pi/reefpi# reef-pi -version
0.0.5

And this is the config.yml
Code:
---
controller:
  adafruitio:
  enabled: false
  token: xxx
  user: xxx
  feed: temperature
  enable_gpio: true
  enable_pwm: true
  enable_adc: false
  enable_temperature_sensor: false
  database: "reef-pi.db"
  outlets:
  AC1:
  pin: 5
  AC2:
  pin: 6
  AC3:
  pin: 13
  AC4:
  pin: 19
  PWM0:
  pin: 0
  type: pwm
  PWM1:
  pin: 1
  type: pwm
  equipments:
  Return: AC1
  Filter: AC2
  Heater: AC3
  AirPump: AC4
  Light Intensity: PWM0
  Light Color: PWM1
  lighting:
  enabled: false
  intensity_channel: 0
  spectrum_channel: 1
api:
  address: "0.0.0.0:8080"
  enable_auth: false
  auth:
  id: 35adsjfaksjfdhks5eun435b.apps.googleusercontent.com
  secret: adqwieuqiwue
  callback_url: http://localhost:8088/auth/callback/google
  domain: example.com
  users:
  - foobar
  gomni_auth_secret: sadfhsadfkh238asdf
  image_directory: /var/lib/reef-pi/images
  interface: eth0
Can you check if the directory /var/lib/reef-pi exists ? If not create it.
This is strange, because that directory should be created by dpkg automatically. This is pi 2 right? Can you also share the output of following:
'''
cat /lib/systemd/system/reef-pi.service
ls -alh /var/lib/reef-pi
'''
 

MaccaPopEye

Well-Known Member
View Badges
Joined
Jan 5, 2016
Messages
697
Reaction score
1,234
Rating - 0%
0   0   0
So it got one of my lights down and opened it up. Unfortunately the drivers don't have anything on them (I checked underneath them too, still no info)
PhotoGrid_1497283782754_zpsadukusja.png


Here is the potentiometer (one photo as it was and one with the zip tie moved to the side). Any idea what parts I would need to be able to dim 8 of these channels (4 white and 4 blue)?
PhotoGrid_1497283807806_zpssuxjh7ub.png
 

ClaudioA

New Member
View Badges
Joined
Jun 7, 2017
Messages
16
Reaction score
13
Rating - 0%
0   0   0
Can you check if the directory /var/lib/reef-pi exists ? If not create it.
This is strange, because that directory should be created by dpkg automatically. This is pi 2 right? Can you also share the output of following:
'''
cat /lib/systemd/system/reef-pi.service
ls -alh /var/lib/reef-pi
'''

I reinstall and start! I test it. Thanks @Ranjib
 
Last edited:

Aaron Smith

Active Member
View Badges
Joined
Apr 9, 2017
Messages
250
Reaction score
273
Location
Oregon
Rating - 0%
0   0   0
So it got one of my lights down and opened it up. Unfortunately the drivers don't have anything on them (I checked underneath them too, still no info)
PhotoGrid_1497283782754_zpsadukusja.png


Here is the potentiometer (one photo as it was and one with the zip tie moved to the side). Any idea what parts I would need to be able to dim 8 of these channels (4 white and 4 blue)?
PhotoGrid_1497283807806_zpssuxjh7ub.png

Did you de-solder the v+ and v+dim?
 

MaccaPopEye

Well-Known Member
View Badges
Joined
Jan 5, 2016
Messages
697
Reaction score
1,234
Rating - 0%
0   0   0
Did you de-solder the v+ and v+dim?
Nope I didn't change anything. That's just how it was. I should have gotten a pic of the top too before I put it all away haha. I thought I saw 4 white wires going into the top.

Looking back at the pics it looks like the 4 wires from the driver go into the row of 4 dots of solder above the empty ones.
 

HAVE YOU EVER KEPT A RARE/UNCOMMON FISH, CORAL, OR INVERT? SHOW IT OFF IN THE THREAD!

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%
Back
Top