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

OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
This may not sound that exciting to most (especially my Spousal Equivalent), but I have a KP303 on my desk with one outlet being repeatedly turned on and off by an ESP32. Turning on / off a single outlet Kaza device is not trivial, adding the 2 extra outlets on a strip increases the complexity. Having to identify the target relay with only knowing the ip address of the power strip is a task. (Im sure @Ranjib can relate) I was able to (with some help from Stack Overflow) make a function to encrypt the json string to send to the Kaza device..

I just need to integrate a temp sensor and the logic to monitor it and use what I have built here on my desk now to turn the thing on and off when the temps are outside the set parameter.

My test board is this Adafruit ESP32-S2 TFT Feather (https://www.adafruit.com/product/5300). I plan to use the TFT on it to display the current temp and status of the heater. Thinking just display the temp nice and large with 2 decimal places and color the background either green for not heating or red for heating. And since the ds18b20 is supported by ardiuno, should be a robust little temp controller.

1647339224993.png
This is awesome. Can it run a tiny web server ? It will be cool if we can have some simple api and reef-pi can integrate with it :-) . I always wanted to have an network based driver implementation (may be just reuse tasmota’s spec) in reef-pi that can be used to integrate with custom , diy esp32 based purpose made devices. Could be sensors or outputs ,,, this is a good excuse .
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Hive mind,
I have cut 5.2 release of reef-pi yesterday.

This release brings an experimental stepper based doser support using drv8825 ICs. I have tested it with a 42 step doser from Amazon ( goso) . The wiring details are explaIned here:
I’m calling this an experimental driver as I expect the ui might change a bit, I may move it under connector/driver later on .
ph controller now has enabled/disabled toggle button from collapsed ui similar to ato or temperature controllers.
Users with MQTT integration can now specify a prefix value that will be used as parent topic for publishing all messages.


other than this, the main focus was on fixing outstanding bugs. Community member Markus Kuhn contributed bulk of the ui validation related fixes and i18n improvements across temperature, ph, lighting, driver components.
Ato reset button not working bug was fixed.

Capability changes under settings ui was not reflected correctly with backend state. Fixed.

Timer when used with revert back feature, would raise duration parsing error . Fixed

Journal entries were not sorted. I fixed this. But have some bad news here, this is a breaking change. Due to the poor was I designed it in the beginning the time information was not modeled correctly. It will be considerably hard to decipher correct time, that we need to sort the entries using the existing type. To make this manageable in time, I have updated the type. This will save the sorting issue for all new entries, but existing entries will render as invalid (Reset toast jan 01, 01 ). I request users to recreate the journal. I’m sorry for this, I’ll be mindful of this. In fact this is what made me call out stepper driver as experimental. I think going forward it will be wise to augment the newly developed component that we are still hammering through user feedbacks and has not gone through couple of minor release cycle at least , will be called out experimental . This also means we can be double strict about not altering non experimental api in minor releases,


Release builds are available in usual location : https://github.com/reef-pi/reef-pi/releases/tag/5.2
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
Hive mind,
I have cut 5.2 release of reef-pi yesterday.

This release brings an experimental stepper based doser support using drv8825 ICs. I have tested it with a 42 step doser from Amazon ( goso) . The wiring details are explaIned here:
I’m calling this an experimental driver as I expect the ui might change a bit, I may move it under connector/driver later on .
ph controller now has enabled/disabled toggle button from collapsed ui similar to ato or temperature controllers.
Users with MQTT integration can now specify a prefix value that will be used as parent topic for publishing all messages.


other than this, the main focus was on fixing outstanding bugs. Community member Markus Kuhn contributed bulk of the ui validation related fixes and i18n improvements across temperature, ph, lighting, driver components.
Ato reset button not working bug was fixed.

Capability changes under settings ui was not reflected correctly with backend state. Fixed.

Timer when used with revert back feature, would raise duration parsing error . Fixed

Journal entries were not sorted. I fixed this. But have some bad news here, this is a breaking change. Due to the poor was I designed it in the beginning the time information was not modeled correctly. It will be considerably hard to decipher correct time, that we need to sort the entries using the existing type. To make this manageable in time, I have updated the type. This will save the sorting issue for all new entries, but existing entries will render as invalid (Reset toast jan 01, 01 ). I request users to recreate the journal. I’m sorry for this, I’ll be mindful of this. In fact this is what made me call out stepper driver as experimental. I think going forward it will be wise to augment the newly developed component that we are still hammering through user feedbacks and has not gone through couple of minor release cycle at least , will be called out experimental . This also means we can be double strict about not altering non experimental api in minor releases,


Release builds are available in usual location : https://github.com/reef-pi/reef-pi/releases/tag/5.2

Options for steppers look great, will try that out later today or tomorrow, but you are right, the 5 pin selection might look better hidden away under connectors or somewhere around there

I am not sure there's a perfect solution to be had here, but I assume the microstepping selector controls the A, B, C outputs? Leaving A, B, C disconnected and hardwiring those pins instead and selecting the correct microstepping for calculation purposes is no problem, i see no immediately obvious reasons to want to switch microstepping after initial tweaking for a doser or titrator, but making those generic and independent from the microstepping selection would allow to use pretty much any stepper driver. Would make setup less intuitive and open for errors though, needing to look up tables, or need another selector for the type of chip. Different chips have different tables, here is an example for TMC2209

1647432223250.png
 

DWKDiver

Community Member
View Badges
Joined
May 18, 2021
Messages
44
Reaction score
41
Location
Georgia
Rating - 0%
0   0   0
I’ll have to go through the ui and reproduce it. It will be big help if you can test if it’s present in 5.2 , and file a bug if it’s present. I suspect a few other ui bugs … I want to address these as first priority
Checked out 5.2.

Still has message: invalid value. Use values between xx.yy and xx.zz.

The valid value it wants is 2 x histeresis is if that helps.

Now on to se the changes in 5.2.
 

DWKDiver

Community Member
View Badges
Joined
May 18, 2021
Messages
44
Reaction score
41
Location
Georgia
Rating - 0%
0   0   0
Checked out 5.2.

Still has message: invalid value. Use values between xx.yy and xx.zz.

The valid value it wants is 2 x histeresis is if that helps.

Now on to se the changes in 5.2.
Checked out journal. Did get error. So deleted and rebuilt. Now works and get a graph???

My ATOs will not reset. Created test ato item with and will wait till data accumulates to test. It currently gets same error message. Item undefined does not exist in bucket ato.

I have rebooted and restarted reef pi already.
 

DWKDiver

Community Member
View Badges
Joined
May 18, 2021
Messages
44
Reaction score
41
Location
Georgia
Rating - 0%
0   0   0
OK I did further trials for ato resets. I had to delete the first ato for resest to work. However, it now works for all the ato resets. One down.

Tried the same with the temp keyboard pop up, still no go... value error.
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0
This is awesome. Can it run a tiny web server ? It will be cool if we can have some simple api and reef-pi can integrate with it :) . I always wanted to have an network based driver implementation (may be just reuse tasmota’s spec) in reef-pi that can be used to integrate with custom , diy esp32 based purpose made devices. Could be sensors or outputs ,,, this is a good excuse .
yes, it can run a webserver.

I have a couple ESP32's running air quality sensors that output metrics for Prometheus.

I also have one that's connected to a flow sensor that is inline between my RO/DI and my ATO reservoir. I use it to alert me when the reservoir is overflowing onto my living room floor.. That also emits prometheus metrics. Very simple to setup.

I started work on the ESP32 that will interface with Kasa last night to read temps, ran into a snag, but hopefully will have that worked out by this weekend. Once I get past that, I'll have the temp control worked out.

1647468584404.png

1647468624823.png
 
Last edited:

Martin Lowry

Community Member
View Badges
Joined
Sep 19, 2017
Messages
60
Reaction score
65
Location
Dover, NH
Rating - 0%
0   0   0
Probably my lack of knowledge, but, is it possible to normalize the power monitoring data collected from the Kasa HS300 power strip? I just set it up today as a test to monitor my 300Watt AWC bucket heater. it's displaying 2612 in the RPI Dashboard and 2.6Kw in Grafana.

Reef-Pi v5.1
Pi 3
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Probably my lack of knowledge, but, is it possible to normalize the power monitoring data collected from the Kasa HS300 power strip? I just set it up today as a test to monitor my 300Watt AWC bucket heater. it's displaying 2612 in the RPI Dashboard and 2.6Kw in Grafana.

Reef-Pi v5.1
Pi 3
To be perfectly honest, I don't really use the graphs on the reef-pi UI for anything. I stick with the grafana. Way more configurable.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Probably my lack of knowledge, but, is it possible to normalize the power monitoring data collected from the Kasa HS300 power strip? I just set it up today as a test to monitor my 300Watt AWC bucket heater. it's displaying 2612 in the RPI Dashboard and 2.6Kw in Grafana.

Reef-Pi v5.1
Pi 3
It’s milliamp, you just have to choose the right unit I think, in grafana
 
Last edited:
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
To be perfectly honest, I don't really use the graphs on the reef-pi UI for anything. I stick with the grafana. Way more configurable.
That’s because you have multi node setup and your home is a tiny data center :-)

I get this dilemma all the time . But Last two years I realized the importance of stand alone reef-pi with built in dashboard. It makes a huge difference for the folks who does not run similar setup .

This is very similar issue like the start up unit file configuration (waiting on network ) . Reef-pi allows a wide variety of setup , being a opensource extensible system. The default setup that comes with the software must stay core to its original value of enabling frugal, diy , reef focused controller. In that paradigm making reef-pi critically dependent on grfana will be undesirable. It does create significant work on our side to maintain those ui code, but I think it’s worth it. I have started using (and improving ) the built in dashboards In recent times. I understand it will never be like grafana, but we should be able to provide a smaller , less features yet relevant and effective built in dashboard .

grafana is the very best dashboard /telemetry tool I can think of right now. It’s used in large tech companies across the world. It’s a beast :-) . I have used it with hundreds and thousands of servers for years now . Big fan of it.

I think for setups where there are many tanks , like public aquariums, coral farms, fish stores , reef-pi , grafana combo will shine.
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0
That’s because you have multi node setup and your home is a tiny data center :)

I get this dilemma all the time . But Last two years I realized the importance of stand alone reef-pi with built in dashboard. It makes a huge difference for the folks who does not run similar setup .

This is very similar issue like the start up unit file configuration (waiting on network ) . Reef-pi allows a wide variety of setup , being a opensource extensible system. The default setup that comes with the software must stay core to its original value of enabling frugal, diy , reef focused controller. In that paradigm making reef-pi critically dependent on grfana will be undesirable. It does create significant work on our side to maintain those ui code, but I think it’s worth it. I have started using (and improving ) the built in dashboards In recent times. I understand it will never be like grafana, but we should be able to provide a smaller , less features yet relevant and effective built in dashboard .

grafana is the very best dashboard /telemetry tool I can think of right now. It’s used in large tech companies across the world. It’s a beast :) . I have used it with hundreds and thousands of servers for years now . Big fan of it.

I think for setups where there are many tanks , like public aquariums, coral farms, fish stores , reef-pi , grafana combo will shine.


I agree, not everyone has the time, energy or patience to deal with the level of nonsense guys like us are dealing with.

I would love to jump in and help out, but as the code base has very little in the way of comments, I'm not exactly sure what's going on with a lot of it. I don't like mucking about in things I don't understand. (completely untrue)
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
I wanted to try out the stepper implementation but it wouldn't let me save the configuration.

Created outlets on GPIO 7 and 8 for STEP and DIR. It threw errors if i wanted to save without A, B, C assigned, but that was a simple fix, i created dummy outlets on GPIOs 23,24,25 and just didn't connect anything. Then, with every field filled out, it throws validation error null

Is there a problem with my pin selection? Or something else? Schedule was the default selection, hour minute, second as 0, the rest starred

1647515930326.png


Also, having 1/64 stepping as an option, at least for calculation purposes might be nice, but not hugely important, haven't tried out how fast the pi can even keep up
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
Thought it was pin7/8 being blocked by SPI somehow, but GPIO 16 and 20 instead show the same problem. Tried 0,1,100 for Delay (what is that supposed to be btw, time in milliseconds between step pulses?), different Microsteppings,different vol/rotation and dosing volumes, to no avail, always "The settings cannot be saved due to validation errors. Please correct the errors and try again.null"

No idea what is null and how i can fix it
 

brandon clow

Active Member
View Badges
Joined
Oct 22, 2017
Messages
121
Reaction score
151
Rating - 0%
0   0   0
Thought it was pin7/8 being blocked by SPI somehow, but GPIO 16 and 20 instead show the same problem. Tried 0,1,100 for Delay (what is that supposed to be btw, time in milliseconds between step pulses?), different Microsteppings,different vol/rotation and dosing volumes, to no avail, always "The settings cannot be saved due to validation errors. Please correct the errors and try again.null"

No idea what is null and how i can fix it
I couldn't get past this error message also. I was going to see the API would reject it also when I have some time
this weekend.
 

DWKDiver

Community Member
View Badges
Joined
May 18, 2021
Messages
44
Reaction score
41
Location
Georgia
Rating - 0%
0   0   0
For for thought...

Steppers for dosing seems like it is screaming for i2c stepper driver boards. Many dosers and NO RPI pins required. I used 5v L293 i2c boards with BYJ cheap steppers for project and it was a piece of cake. It would require a driver for each specific i2c stepper board though assuming i2c commands where different between boards. You would just get the peristaltic head and attach the stepper.
 

Martin Lowry

Community Member
View Badges
Joined
Sep 19, 2017
Messages
60
Reaction score
65
Location
Dover, NH
Rating - 0%
0   0   0
To be perfectly honest, I don't really use the graphs on the reef-pi UI for anything. I stick with the grafana. Way more configurable.
Thanks @GaryE , Can you normalize the Y-Axes in Grafana so it accurately represents the actual Wattage? I've looked for a way to do it but have not found a way so far. I tried setting it to Miliwatts, didn't work. Set it back to Watts and it's looking better...
 
Last edited:

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
For for thought...

Steppers for dosing seems like it is screaming for i2c stepper driver boards. Many dosers and NO RPI pins required. I used 5v L293 i2c boards with BYJ cheap steppers for project and it was a piece of cake. It would require a driver for each specific i2c stepper board though assuming i2c commands where different between boards. You would just get the peristaltic head and attach the stepper.
Maybe there are good ones with i2c capabilties, the trinamic ones sadly only have uart which isn't much help when looking at multiple steppers at the same time, but i really wouldn't recommend using L293 as stepper "drivers". At least not if you are going to be in the same room. That's worse than a4988 and those are already loud.

I don't know what the best way forward is, maybe it is an arduino based pin extender/ arduino based doser controlled by the pi, some other kind of expansion, or maybe we just have to cram in as much to the pins we have as we can, with the current way of doing things all we really need is 1 pin per pump to run a doser, 2 if we want to run a pump in both directions, the rest can be hardwired

edit: come to think of it, there are some with SPI, but that wouldn't really save on pins either due to the need for chip select
 
Last edited:

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Thanks @GaryE , Can you normalize the Y-Axes in Grafana so it accurately represents the actual Wattage? I've looked for a way to do it but have not found a way so far. I tried setting it to Miliwatts, didn't work. Set it back to Watts and it's looking better...
I was having a similar issue with my flow meter, it was showing incorrectly. It was 100 times higher than it should have been.

So, simple math fixed it.. (by the way, I was stationed at Pease AFB in the late 1980's)
1647564959040.png
 

TOP 10 Trending Threads

WHAT AMOUNT OF LIVE ROCK AND SAND SHOULD BE PRIORITIZED FOR OPTIMAL BIODIVERSITY/FILTRATION?

  • 100% live rock + bagged sand

    Votes: 37 27.2%
  • 100% dry rock + 100% live sand

    Votes: 46 33.8%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 30 22.1%
  • 75% live rock, 25% live sand

    Votes: 13 9.6%
  • 25% live rock, 75% live sand

    Votes: 10 7.4%
Back
Top