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

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
Ideally, Pi 3, zero w should never have wifi issue if they are not underpowered and properly configured. If this is a router issue then wifi antenna will not help, if this is a distance /reach related issue then may be a extender /access point will be better. If you provide your setup (pi's and home network) and issues you are facing, we'll be able to help better.

This is what I get that seems to be signal related to me


0152897a0ebb216d08d8745a493849b66669f32a16.jpg
 

MrWheelock

Valuable Member
View Badges
Joined
Jun 21, 2017
Messages
1,443
Reaction score
5,510
Location
St. Petersburg FL
Rating - 0%
0   0   0
- Salinty probe: Nope. Way back in the day (pre 1.0) , I wanted to get this done. But after building ATO and learning more about its impact vs opex/capex , I deprioritized this. After 3.0 if there's enough interest, we can get this done , since HAL works made it very easy to add support for new driver. All we have to do is there's folks who are willing to test it on the field and use it in the longer run. This is important, as I won't be running this probe.
- Currently theres no clean way to do two equipment controlled by a single sensor. You can do a hardware hack with a single GPIO output controlling two relay/outlets. Or a software hack where you define two atos in reef-pi both with the same probe but different equipment. This will change in 3.0, where we'll be able to attach multiple equipment to a single sensor.
- I have not read the details, but I think 4,5,6 are all possible with timers (period equipment control) or macros (serial execution of equipment or some key tasks [such as waiting]). In 3.0 this will become more powerful, as we'll be able to combine them (macros on timers)

Start a build thread and call out the expectations, I think they are feasible, but let others who have built or used reef-pi share their views. Those are more relevant as thats from a user perspective. Your skill and patience level will be great multiplier :0-)
thank you for considering reef-pi
So no if optical x then solenoid y?
 

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
If you are familiar with linux, then you can track down what are the exact things that are bogging down cpu/memory and nuke them selectively. I do this as my paid job :-/ which is why I am little bit aware of this process. For my personal use though, I'll always do the reverse and instead of reducing a full-blown desktop into a kiosk, I'll prefer to extend a barebone text based installation to support just my one chromium tab. Typically this means
- installing a lightweight window manager (lightdm etc)
- install chromium
- configure the systems to autostart chromium in incognito + kiosk (full screen) mode
- configure systemd boot target to launch just those bits, post network initialization
This is an awesome setup if you dont have any network connectivity, its completely offline yet functional controller. Much less security and reliability headaches . I ran several builds like this till i moved to google wifi + grafana/prometheus setup. Because may other things at home gets impacted when the wifi is bad, so i had to improve the control plane. And after doing that, the kiosk mode use case is going down. I think it will be reduced to only the layout/diorama use cases , thing where im hacking reef-pi to use with model rairoad /toys/terrariums etc. Mostly my son's assets :)


OK. A couple of those things you suggested there may as well be in a foreign language to me.

BUT

I did manage to follow this tutorial https://pimylifeup.com/raspberry-pi-kiosk/ and get Reef-Pi running in Kiosk mode. I am very happy. It is exactly what I wanted. A dedicated Reef-Pi interface from which I can control the whole tank. If anything, it seems a little more laggy to me, but it isn't anything I can't live with. I have configured the dashboard to display 12 metrics as a test. This Reef-Pi isn't running on a tank at present, I just have 3 x temp sensors and one level sensor running on the desk. So a few duplicate metrics, but you get the idea.
0149d38d451973bba785c47b9f662b5496eb431715.jpg
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
Does anyone know if there is an external WiFi antenna solution that works well on a Pi3 or 4? I'm having occasional signal issues and I must either add a WiFi extender somewhere in the house, or use improve the reception of the Pi.

Thanks
Is the pi in a metal enclosure? A metal enclosure would act like a faraday cage and cut wifi signal to and from the pi considerably.
As far as wifi on a pi zero, i am using one and my pi never has signal issues, so either you are too far from your router, have a source of interference, or your home/enclosure construction is cutting the signal.

Use a wifi signal app on a mobile and check the signal where your pi is located, maybe an extender or additional access point could help.
 

burningbaal

Active Member
View Badges
Joined
Aug 13, 2019
Messages
232
Reaction score
257
Location
Near Seattle
Rating - 0%
0   0   0
- The adafruit guides have individual links. We can consolidate those to reassemble the 2.x parts list again. I am currently focused on 3.0 release, and would prefer to do such work as part of 3.0 release (and hopefully this time we'll have more stable links, with static part details). I like the idea of source controlling the BOM. The website itself is under github.com/reef-pi/website, and a BOM is present there as well (not with as much details as I would love to). So we can start with improving from there.
- Would love to get any and all type of contribution, code, design improvements, docs, translations, build threads.. anything that help the project in any way.. we appreciate all of it :)
- Can you expand on the broken down bits aspect. Currently the design aims for extensibility and modularity. wich is you can build a single unit powered by pi zero and only with one module or a combination of many modules. In the code its pretty well segragated (reef-pi/controller/modules), there are horizontal libraries (drivers, telemetry, storage etc) that are seperate repos or standalone packages. The nano/pico/premium distinction is in the electronics/enclosure land ... not so much on the software side from design. It does bring in new performance challenges, but thats a different aspect. Most cases we know the safe limits, or we get to see when we are crossing it
- Bunch of the sensors you mention are already supported, some other will work without much changes (e.g. ezo based ec and orp probes) but not cleanly (modeled as ph), in 3.0 we have done some foundation work on driver side (Hardware Abstraction Layer) that will make the ground up support for new probes very easy. tplink smart plugs (kasa) are based on this. I hope to write many more as part of 4.0. Humidity is one of the main one.
- Selling ? Not really in that way. I dont think I can legally do that, neither I find it makes sense financially. And I am definitely pretty lazy when it comes to shipping etc.. But if you are in bay area, and willing to pick up manually, then I'm up for giving it away for a beer :) . I'll have to get rid of them some way, as I want to iterate and print newer models, I am learning a lot on that front recently.

Thanks for giving reef-pi a shot,
I found the adafruit guides, that's definitely helpful. One note is the bom on github.io page is a dead link, though I see the md file in the repo that is supposed to be that page.
Question (being new to pi-life and to go): Is the idea that you put several pi zeros together in some sort of network of modules or that you have a larger pi as a master and several modules under it? I was thinking I might pick up a big pi 4 and add the modules as I see fit, but seeing the lighting guide that includes a pi zero, I'm not sure if that's just the simplest way to make a reef-pi that's just lighting, or if it's representative of a pi-network approach.

I'll have to do some digging in the repo to get my head around the codebase, but I'm hoping to find two things in particular:
1. A place for new-hardware-code so I (or others) could drop in a new class (presumably implementing an interface) to easily add a new type of hardware, either to our own local build, or via a pull request.
2. A place for inidividuals to add our own scripting with access to whatever hardware is installed, via some sort of subscription/callback model so a given script can be triggered based on a sensor. I'm sure lots of users can learn some basic go or js, so they could do the same custom scripting neptune is known for, but with a sane framework:) Some examples: (a) 'pH of tank is below 7.8, turn off calcium reactor', (b) 'temperature of display is over 84F, turn off all lighting'. Similarly, scheduled things could happen 'at 2pm everyday, turn off ATO, open solenoid A to let water out of manifold to the drain until sensor B is dry, then turn on pump X (from new saltwater) until ATO sensor is wet, turn on ATO', boom...Auto water change.
 
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 found the adafruit guides, that's definitely helpful. One note is the bom on github.io page is a dead link, though I see the md file in the repo that is supposed to be that page.
Question (being new to pi-life and to go): Is the idea that you put several pi zeros together in some sort of network of modules or that you have a larger pi as a master and several modules under it? I was thinking I might pick up a big pi 4 and add the modules as I see fit, but seeing the lighting guide that includes a pi zero, I'm not sure if that's just the simplest way to make a reef-pi that's just lighting, or if it's representative of a pi-network approach.

I'll have to do some digging in the repo to get my head around the codebase, but I'm hoping to find two things in particular:
1. A place for new-hardware-code so I (or others) could drop in a new class (presumably implementing an interface) to easily add a new type of hardware, either to our own local build, or via a pull request.
2. A place for inidividuals to add our own scripting with access to whatever hardware is installed, via some sort of subscription/callback model so a given script can be triggered based on a sensor. I'm sure lots of users can learn some basic go or js, so they could do the same custom scripting neptune is known for, but with a sane framework:) Some examples: (a) 'pH of tank is below 7.8, turn off calcium reactor', (b) 'temperature of display is over 84F, turn off all lighting'. Similarly, scheduled things could happen 'at 2pm everyday, turn off ATO, open solenoid A to let water out of manifold to the drain until sensor B is dry, then turn on pump X (from new saltwater) until ATO sensor is wet, turn on ATO', boom...Auto water change.
I am assuming you have found this already, not super updated, but this is the 2.x list: https://github.com/reef-pi/website/blob/master/content/guides/bom.md

regarding how many pis and their workload distribution, My recommendation would be dont complicate the aspects that you are learning, and take on risk on aspects where your strengths are, and where it operationally makes sense. If you know nothing about electronics but comfortable with terminal etc, go with pi zero and get one module done (up and running) before investing anything. If you are not familiar with electronics as well as computers, go with pi 3 as it has enough CPU to run a full GUI, USB ports etc. If you are familiar with both electronics and computers, pi zero AIO setup, unless you have really elaborate setups (multiple probes, powerstrips etc).


All hardware drivers are located here: https://github.com/reef-pi/drivers , they all conform to a common Hardware Abstraction Layer (https://github.com/reef-pi/hal), core reef-pi is not aware of drivers and only operates on HAL layer. This make its relatively easy to write drivers (write enough code to confirm hal) and integrate it with core reef-pi

Macros (auto water change like features) are implemented via the UI. reef-pi does not provide any domain-specific language for extensibility. I believe most of the features that such DSL provides can be done straight over the UI. DSL adds programming/logic burden for the novices. In terms of extensibility, reef-pi is entirely API driven , and its trivial to consume the API and use cron and other scripts to do the custom things you want. Given we build the controller ourselves, we have access to whole linux/raspbian userland, hence this kinda approaches work for us. The ability to execute arbitrary script from the controller itself (hooks or callbacks as you mentioned) are deliberately excluded to due performance and UX concerns. People may learn JS/Go, but I dont think its a good assumption for our typical users. I want the core features to be as accessible, frugal and robust as possible, while it still offers insane amount of hacking capabilities for all DIY folks. I think later on (4 or 5) I would love to add an dynamic language interpreter (js or ruby), that will have a better, turing complete DSL, backed by the API, but compiled and executed by the same go runtime. There are projects that already does this (mruby, js compilers in go etc), but I want to wait till they become more mature, pi gets more stable and we sort out the LTS (long term support) APIs for reef-pi that we are confident enough for a 4-8 years lifespan.
 
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
So no if optical x then solenoid y?
yes, you should be able to do this. Optical sensor, floatswitches etc are all modeled as Inlet in reef-pi and you can use them to control any outlet (solenoid in your case).
 

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
Is the pi in a metal enclosure? A metal enclosure would act like a faraday cage and cut wifi signal to and from the pi considerably.
As far as wifi on a pi zero, i am using one and my pi never has signal issues, so either you are too far from your router, have a source of interference, or your home/enclosure construction is cutting the signal.

Use a wifi signal app on a mobile and check the signal where your pi is located, maybe an extender or additional access point could help.


It actually is in a metal enclosure, but the one side is open. And the open side is facing the direction of the router(s)


01d33b2464a3a4de39d225d541cdc9a7c426f6f796.jpg
 

pais

New Member
View Badges
Joined
Jun 27, 2019
Messages
15
Reaction score
12
Rating - 0%
0   0   0
Hi everybody, a suggest if you want to implement any other sensor (digital or analogic) is to use an arduino connected via i2c ro the rpi. I'm succesfully using this technique to achieve a reading of both analog ph-meter and an ec-meter. I perform also value-based actions on these sensors. I have seen ranjib talking about the new feature homeostatis, THANK YOU for the great work, now im waiting for that being implemented to reduce the arduino tasks.
 

Ryan115

Well-Known Member
View Badges
Joined
Dec 28, 2010
Messages
586
Reaction score
1,085
Location
Mississippi
Rating - 0%
0   0   0
It actually is in a metal enclosure, but the one side is open. And the open side is facing the direction of the router(s)


01d33b2464a3a4de39d225d541cdc9a7c426f6f796.jpg
If you have a direct connection (or if you are getting enough of a signal to remote in to the pi), run this code in terminal to get a report on your signal strength.
Code:
sudo iwlist wlan0 scan | egrep "Cell|ESSID|Signal|Rates"
 

Ernie E

New Member
View Badges
Joined
Aug 15, 2019
Messages
19
Reaction score
18
Rating - 0%
0   0   0
Totally following should you decide to post any examples of your setup and/or scripts used on the arduino to do the translation!! Which pH probe are you using?


Hi everybody, a suggest if you want to implement any other sensor (digital or analogic) is to use an arduino connected via i2c ro the rpi. I'm succesfully using this technique to achieve a reading of both analog ph-meter and an ec-meter. I perform also value-based actions on these sensors. I have seen ranjib talking about the new feature homeostatis, THANK YOU for the great work, now im waiting for that being implemented to reduce the arduino tasks.
 
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
Hi everybody, a suggest if you want to implement any other sensor (digital or analogic) is to use an arduino connected via i2c ro the rpi. I'm succesfully using this technique to achieve a reading of both analog ph-meter and an ec-meter. I perform also value-based actions on these sensors. I have seen ranjib talking about the new feature homeostatis, THANK YOU for the great work, now im waiting for that being implemented to reduce the arduino tasks.
in this route, where you are primarily using the arduino for analog input, how you do galvanic isolation? reef-pi currently has a HAL Analog driver interface that we can use to implement an arduino driver. We can totally do it if it makes sense (i.e. the results we get are good enough for our use case, and theres enough appetite for such use case)
 
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
Totally following should you decide to post any examples of your setup and/or scripts used on the arduino to do the translation!! Which pH probe are you using?
Without galvanic isolation, this will be highly unreliable, in our experience. My reading would fluctuate a lot when I tried read ph signal directly,
 

AbjectMaelstroM

Valuable Member
View Badges
Joined
Jul 21, 2019
Messages
1,530
Reaction score
1,811
Location
RVA
Rating - 100%
1   0   0
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

AbjectMaelstroM

Valuable Member
View Badges
Joined
Jul 21, 2019
Messages
1,530
Reaction score
1,811
Location
RVA
Rating - 100%
1   0   0
hm 5$ extra than ebay, not bad at all. I'll get it and test out. Thanks for the link. Its been long pending.

Can't wait to see the results. I was thinking about using those instead of gutting a slave doser unit. Looks like those are wire for +/- in one direction and +/- in reverse direction. Is there any reason to wire "reverse"? I don't imagine I'd ever need to draw water from the tank....
 
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
Can't wait to see the results. I was thinking about using those instead of gutting a slave doser unit. Looks like those are wire for +/- in one direction and +/- in reverse direction. Is there any reason to wire "reverse"? I don't imagine I'd ever need to draw water from the tank....
From my primitive understanding, we can use reef-pi as it is, with stepper motors. We have to connect pi or pca9685 pwm pin to a stepper drivers (such as drv8835) and that should be it.
Reversing the motor direction is very common. The titration systems definitely use those capabilities. From a manufacturing and electronics perspective, H-brige drivers (a type of circuit that allows easily switch the polarity of motors) are very common and omnipresent in most stepper/dc motor equipment. I guess from manufacturing point of view its hard to know if this feature will be used or not, but given the prevalence (and cheap) of this capability, its safer to just have it.
It will be awesome if @theatrus, @Bigtrout or @Michael Lane can validate my assumption, beforer i embark on testing this setup ;-)
 

rushbattle

Valuable Member
View Badges
Joined
Oct 19, 2016
Messages
1,347
Reaction score
1,647
Location
Equality
Rating - 0%
0   0   0
From my primitive understanding, we can use reef-pi as it is, with stepper motors. We have to connect pi or pca9685 pwm pin to a stepper drivers (such as drv8835) and that should be it.
Reversing the motor direction is very common. The titration systems definitely use those capabilities. From a manufacturing and electronics perspective, H-brige drivers (a type of circuit that allows easily switch the polarity of motors) are very common and omnipresent in most stepper/dc motor equipment. I guess from manufacturing point of view its hard to know if this feature will be used or not, but given the prevalence (and cheap) of this capability, its safer to just have it.
It will be awesome if @theatrus, @Bigtrout or @Michael Lane can validate my assumption, beforer i embark on testing this setup ;-)
I am afraid @theatrus is not engaged with reefing for a while now. Perhaps he’s busy, I hope for that and not health issues, or anything else.
 

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