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

AbjectMaelstroM

Valuable Member
View Badges
Joined
Jul 21, 2019
Messages
1,526
Reaction score
1,810
Location
RVA
Rating - 100%
1   0   0
@Ranjib looking good! Question about the TPLink/Kasa powerstrip; I know it tacks energy use via its own app...and I apologize if it's already been covered earlier (couldn't find via search), but can the reef-pi track power use on each socket?

Also, how is it connected to the Pi? Is there a write-up?
 
Last edited:
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
@Ranjib looking good! Question about the TPLink/Kasa powerstrip; I know it tacks energy use via its own app...and I apologize if it's already been covered earlier (couldn't find via search), but can the reef-pi track power use on each socket?

Also, how is it connected to the Pi? Is there a write-up?
Reef-pi does not have a notion of power monitoring for sockets yet, but then TP-Link driver exposes 6 outlets and 6 analog inputs, which can be used to monitor the power usage as ph probes :) , for the time being. Till I sort out what’s the best way to expose this.
Currently there’s no documentation yet, that will come in next couple of months once ui work is finished. I am using curl and api to create a TP-Link driver and then rest from the ui. Let me know if you want to test it out, happy to share the steps.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
Reef-pi does not have a notion of power monitoring for sockets yet, but then TP-Link driver exposes 6 outlets and 6 analog inputs, which can be used to monitor the power usage as ph probes :) , for the time being. Till I sort out what’s the best way to expose this.
Currently there’s no documentation yet, that will come in next couple of months once ui work is finished. I am using curl and api to create a TP-Link driver and then rest from the ui. Let me know if you want to test it out, happy to share the steps.
@Ranjib
The tp link is a great add on. I know wireless control of outlets isnt the first choice(im a fan of direct wired myself) but it does prevent novices from having to deal with safety of messing with mains voltages. And an added bonus is the tp link unit is UL listed!
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
@Ranjib
The tp link is a great add on. I know wireless control of outlets isnt the first choice(im a fan of direct wired myself) but it does prevent novices from having to deal with safety of messing with mains voltages. And an added bonus is the tp link unit is UL listed!
Yeah, this is my observations as well. It’s a different set of compromises compared to the adj wired power strip or relay based scratch build. Couple of other nice things about the TP-Link power strip is we can manually override the outlets by physical button on the plugs , led indicators , current monitoring, ability to offload the timers on the powerstrip itself etc(not that we are exploiting that feature currently )
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Yeah, this is my observations as well. It’s a different set of compromises compared to the adj wired power strip or relay based scratch build. Couple of other nice things about the TP-Link power strip is we can manually override the outlets by physical button on the plugs , led indicators , current monitoring, ability to offload the timers on the powerstrip itself etc(not that we are exploiting that feature currently )
There’s an amazon review post showing one of the hs110 unit burned out :-( . Funny that they are ul listed among all the options
 

b4tn

Valuable Member
View Badges
Joined
Jun 17, 2015
Messages
1,673
Reaction score
2,241
Location
Columbia MD
Rating - 0%
0   0   0
How do I associate reef-pi with the wifi interface on the command line? I used to run reefpi on a wired connection but dont have that option anymore. I used putty to get into the raspberry via the wired interface and IP and setup wifi in raspi-config. My router picks up the new IP and connection but when I try to SSH or connect to that IP it times out.
 

Zippyfear

Community Member
View Badges
Joined
Apr 30, 2019
Messages
86
Reaction score
152
Rating - 0%
0   0   0
Yeah, this is my observations as well. It’s a different set of compromises compared to the adj wired power strip or relay based scratch build. Couple of other nice things about the TP-Link power strip is we can manually override the outlets by physical button on the plugs , led indicators , current monitoring, ability to offload the timers on the powerstrip itself etc(not that we are exploiting that feature currently )

I have a wired relay strip for critical functions (Heating, cooling, pump, primary lights) , but the TP links are great for non-critical functions like alert skimmer, sump lights or dosing.. if it doesn't work.. not a major issue.. just saying.. My wired stuff.. love it, but I have a lot of wires around the tank.. it's getting pretty messy.
 

AbjectMaelstroM

Valuable Member
View Badges
Joined
Jul 21, 2019
Messages
1,526
Reaction score
1,810
Location
RVA
Rating - 100%
1   0   0
@Ranjib I just got one of @Michael Lane 's HATs (v2) and hooked it up to my Pi 3, however, when I went into config tab (3.0.0-pre-alpha-2 ) there doesn't seem to be a way to enable the PCA9685? When I tried to add a PCA9685 driver (PCA9685 from dropdown, channel 68, freq1500) I received an error, which I'm assuming is due to PCA9685 not being enabled.

Is this something that needs to be done manually?

config.JPG driver.JPG 20190731_085831 (1).jpg
 

Michael Lane

Well-Known Member
View Badges
Joined
Aug 11, 2018
Messages
677
Reaction score
1,123
Rating - 0%
0   0   0
@Ranjib I just got one of @Michael Lane 's HATs (v2) and hooked it up to my Pi 3, however, when I went into config tab (3.0.0-pre-alpha-2 ) there doesn't seem to be a way to enable the PCA9685? When I tried to add a PCA9685 driver (PCA9685 from dropdown, channel 68, freq1500) I received an error, which I'm assuming is due to PCA9685 not being enabled.

Is this something that needs to be done manually?

config.JPG driver.JPG 20190731_085831 (1).jpg
I don't see any of the pca9685 address pins soldered, so that means is it using the default address of 0x40. Instead of entering 68 as the address, please enter 64.
 

Coastal Aquatics

Community Member
View Badges
Joined
May 16, 2019
Messages
61
Reaction score
23
Rating - 0%
0   0   0
Welcome to the development thread of reef-pi, an open-source, affordable, modular DIY reef-tank controller based on Raspberry Pi.

aio.jpg

If you are trying to build a reef-pi controller, please check out the build guides linked below. You can use this thread to seek help and to stay updated with the latest development.

Screen Shot 2018-11-04 at 8.38.50 PM.png



reef-pi provides following functionalities:
  • Equipment control or automated power strip (including digital timers to switch on/off equipment at periodic intervals)
  • LED light control (24 hour cycle), diurnal cycle, fixed dimmig
  • Auto Top Off (based on photoelectric water level sensor or float switch)
  • Temperature monitoring and control (switch on/off heater & chiller)
  • pH monitoring
  • Dosing automation
  • Macro (feed mode etc)
  • And several other features like camera controls (periodic image capture and upload on google drive), telemetry (dashboard and alerting based on sensor values using adafruit.io), mobile friendly UI etc.
A beginner friendly list of reef-pi build guides are available on adafruit.io, if you are planning to build a reef-pi controller start with them.
  1. Setup and installation
  2. Power controller
  3. Temperature controller
  4. Auto Top Off
  5. Light controller
  6. pH monitor
Since reef-pi is modular and customizable, the cost of individual builds varies. In our experience reef-pi controller are almost always cheaper than the commercial alternatives and costs anywhere between 100 to 550 USD. An example bill of materials can be found here as amazon list. If you are building a reef-pi controller, I highly encorage you start a build thread and tag it with #reefpi to seek help with your build


--------------------------- Original thread start ---------------------
Hello friends,
I am starting a master thread for a DIY reef tank controller that is based on all opensource software and hardware. I had started with this project with following goals:
- Build an opensource software and hardware based reeftank controller that anyone can use and hack
- Keep the controller well tested against a set of standard equipment I use, while make it possible for other equipment to be used
- Maintain my own tank build threads and their evolution, backed by this controller.
- Learn electronics and reef keeping along the way (I am biologist by education & software engineer by occupation)

Following are the details of what I have developed & tested till now:
Controller software:
- The main controller software is called reef-pi. It is written in go, its fast and performant. It used embd for hardware communication. It also runs a little web server which provides the UI for the controller. UI is written in React , and can be accessed from anything that has web browser. As of now, the reef-pi supports following things:
- AC 110/220 V socket on/off (uses optocoupled relays underneath). This is used to remotely switch on/off return pump, LED bulb, heater etc.
- 0-20 Volt DC PWM. This is used to control things like dimmable LEDs, DC pumps. I use it to control my Kessil A80, A360. As well as a 5V DC pump (i use it as wave maker in one of my pico with SPS). PWM is done using PCA9685 breakout board from adafruit. This board supports 16 channels. I am using only 5 at max, as of now.
- Analog sensor support using MCP3008 analog to digital converter. This supports 8 channels. i.e. I can use up to 8 sensors/probes. As of now, I have only tested temperature sensor with it.
Other than the following basic hardware/equipment support, the controller software provides following additional features:
- Setting up daily/weekly/monthly scheduled jobs. Like turning on/off certain equipment. I use this feature to run my AC20 HOB filter nightly.
- Setting up dusk-to-dawn like lighting using PWM. The UI gives 12 vertical slider based 0-24 hours (each slider representing 2 hours gaps). I combine two of these two control the kessil LEDs.
- Authentication using Google OAuth. Since the whole controller runs on raspberry pi and provides an web frontend, security of one of my concern. To mitigate this, I have added google authentication support, which when configured will allow only certain users to log in (email specified in the configuration value).

This is the summary of the core controller software and what features it has as of now. I am constantly writing/improving things around it. As of now, I have two reef tank powered by this. I 'll have seperate threads on the individual builds that will include the housing and ancillary hardware in nano-reef.com, as my tank build threads are there, but I'll share all the controller specific common bits here, including UI screen shots, and tank pics :)

20161115_081550.jpg
This is awesome thanks!
 

janos

Active Member
View Badges
Joined
Jun 4, 2017
Messages
267
Reaction score
259
Location
Toronto,Canada
Rating - 0%
0   0   0
Just to repair my first Q: i2cdetect is working now BUT i got 3 addresses 0x40 ,0x70 ,and 5x45, how to figure out what is what?Thank you for your time and help.
 

Michael Lane

Well-Known Member
View Badges
Joined
Aug 11, 2018
Messages
677
Reaction score
1,123
Rating - 0%
0   0   0
Just to repair my first Q: i2cdetect is working now BUT i got 3 addresses 0x40 ,0x70 ,and 5x45, how to figure out what is what?Thank you for your time and help.

0x40 - pca9685 PWM chip normal address
0x70 - pca9685 PWM chip "All Call" address
0x45 - probably pH board with both jumpers connected [post edited for correction]

Addresses are usually specified in data sheets, but it's often easier to figure out by disconnecting components when working with modules.
 
Last edited:

janos

Active Member
View Badges
Joined
Jun 4, 2017
Messages
267
Reaction score
259
Location
Toronto,Canada
Rating - 0%
0   0   0
Thank you Michael i do not have 0x75 ,but on the PH board both jumper is on.What i have
0x40
0x70
and not sure 0x45 but the 45 is in the 5th line.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Testing out the new tplink drivers. Here is the chart for current draw from the heater that I used during new saltwater mix.

The resident current draw is 0.0169A, without any device attached to the outlet,
Screen Shot 2019-08-03 at 12.39.00 AM.png


when on the heater is drawing 0.111A .
Screen Shot 2019-08-03 at 12.33.25 AM.png


If I zoom in on the data, I can see some variation,
Screen Shot 2019-08-03 at 12.32.51 AM.png


At this point, I don't know how to interpret the data other than computing raw wattage and cross-check if that matches with the heater rating. I have a kill a watt, and I plan to do some cross-check with that as well. Being an analog input (exposed as ph probe) I should be able to apply one or two-point calibration if needed.
 

janos

Active Member
View Badges
Joined
Jun 4, 2017
Messages
267
Reaction score
259
Location
Toronto,Canada
Rating - 0%
0   0   0
Hi to all,why do i got unauthorized when i try to calibrate with curl? Thank you and this is the log:
03/08/2019, 18:48:40UIERROR{"error":"json: cannot unmarshal object into Go value of type []hal.Measurement"} | HTTP 400

Screenshot from 2019-08-03 18-45-56.png Screenshot from 2019-08-03 18-10-59.png
 

Mastering the art of locking and unlocking water pathways: What type of valves do you have on your aquarium plumbing?

  • Ball valves.

    Votes: 71 53.0%
  • Gate valves.

    Votes: 68 50.7%
  • Check valves.

    Votes: 34 25.4%
  • None.

    Votes: 30 22.4%
  • Other.

    Votes: 9 6.7%

New Posts

Back
Top