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

Erica-Renee

Valuable Member
View Badges
Joined
Oct 4, 2017
Messages
1,596
Reaction score
3,290
Location
lost
Rating - 0%
0   0   0
Ok... Sorry for so many post. I need to subscribe (pay site ) so i can edit post..

Anyway I wiped the sd card . reinstalled pi reef pi version 1.5 and reset everything up. All is working
Things i have working so far.
8 Channel relay
ATO With Float switch (not the sensor)
Temp running a Heat and Cool Relay channels
And Lighting thru the adafruit servo board.. Right now I am running 2 12v fans .Will order stuff for lights soon.

I had to read some electrical refresher stuff i had forgotten most of this since school many many many many years ago. I do lots of home Electrical not much electronics....

Thank you Ron if anyone i can help or contribute let me know.. Most of this is out of or on the edge of my skillz ..
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Ok... Sorry for so many post. I need to subscribe (pay site ) so i can edit post..

Anyway I wiped the sd card . reinstalled pi reef pi version 1.5 and reset everything up. All is working
Things i have working so far.
8 Channel relay
ATO With Float switch (not the sensor)
Temp running a Heat and Cool Relay channels
And Lighting thru the adafruit servo board.. Right now I am running 2 12v fans .Will order stuff for lights soon.

I had to read some electrical refresher stuff i had forgotten most of this since school many many many many years ago. I do lots of home Electrical not much electronics....

Thank you Ron if anyone i can help or contribute let me know.. Most of this is out of or on the edge of my skillz ..
I think i know exactly what happened. 1.5 release brought raspberry Pi hardware based pwm support. Which means a jack (dimmable DC output) can either be RPi based or pca9685 based. Rpi allows only tow possible pin (0 & 1) while pca9685 allows 16 pins (0-15). This information is not present for 1.4 or older builds (that a jack is powered by rpi or pca9685), so, when you upgraded reef-pi assumed those pins are (declared in jack) rpi based and try to operate it that way and fail. This is definitely a bad coding style (I should have added the logic to default to pca9685 instead if driver information is absent). A possible solution can also be to delete the light/jack and recreate them (and specify pca9685 during creation).
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I think i know exactly what happened. 1.5 release brought raspberry Pi hardware based pwm support. Which means a jack (dimmable DC output) can either be RPi based or pca9685 based. Rpi allows only tow possible pin (0 & 1) while pca9685 allows 16 pins (0-15). This information is not present for 1.4 or older builds (that a jack is powered by rpi or pca9685), so, when you upgraded reef-pi assumed those pins are (declared in jack) rpi based and try to operate it that way and fail. This is definitely a bad coding style (I should have added the logic to default to pca9685 instead if driver information is absent). A possible solution can also be to delete the light/jack and recreate them (and specify pca9685 during creation).

And also my apologies for your inconvenience :-/ . I intend to make reef-pi safe and simple, and this is clearly not the case with such user experience
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I am running in to this problem when I try to delete a relay that I have hooked up to the ato. I am running 1.5 and here is what happens when I do these steps
1. Add relay to connections in configuration update
2. Add connection to relay in equipment. Update
3. Go to ato and enable with sensor pin on 23. Update
4. Click on control and select outlet. In this case outlet 4. Update
5. Check operation. Working back wards. Sensor out of water shuts off relay sensor in water turns relay off.
Want to delete this thing so I do these steps
1. Go to ato and click on pump and select -
2. Turn off control. Update
3. Go to equipment and delete outlet 4. So far so good
All is gone and looking good
Go to add it back doing every thing in the above first 5 steps
And this is what happens
5341D8D1-526B-4177-ADC9-5CDA4DBD2835.jpeg
I need some time to process and reproduce this. Let me run through the steps you mentioned tonight, and I'll get back to you.
 

Erica-Renee

Valuable Member
View Badges
Joined
Oct 4, 2017
Messages
1,596
Reaction score
3,290
Location
lost
Rating - 0%
0   0   0
And also my apologies for your inconvenience :-/ . I intend to make reef-pi safe and simple, and this is clearly not the case with such user experience

No apology needed.. Had this not happened right when i was setting up the se
And also my apologies for your inconvenience :-/ . I intend to make reef-pi safe and simple, and this is clearly not the case with such user experience

No apology needed or expected.. I know this is still in development software/ hardware and your not liable to nobody . Had i not been in the middle of setting up the Servo board , Just minutes after dusting off my Soldering iron and messing with electronics I do not fully understand ... Anyway ..

So far this is all working great. Sometime this week i am going to get connectors and project boxes to start building.. I also think i am going to do separate outlet/ relay boxes..

Do you know how far a db9 serial cable length can be and still run things.. I would like to put the brains in my network closet (the pi computer.) and equipment in basement and above the Reef tank in Living room ... maybe serial cable is not best solution .. Just still thinking ..

Thanks again
 

James Golden

Community Member
View Badges
Joined
Apr 8, 2018
Messages
44
Reaction score
55
Rating - 0%
0   0   0
And also my apologies for your inconvenience :-/ . I intend to make reef-pi safe and simple, and this is clearly not the case with such user experience
Ranjib. This is to me a wonderful system! It’s simple and makes you learn a lot about it. I have had so much fun building and learning about this system!
 

James Golden

Community Member
View Badges
Joined
Apr 8, 2018
Messages
44
Reaction score
55
Rating - 0%
0   0   0
Do you know how far a db9 serial cable length can be and still run things.. I would like to put the brains in my network closet (the pi computer.) and equipment in basement and above the Reef tank in Living room ... maybe serial cable is not best solution .. Just still thinking ..

Thanks again
I have everything under my tank at the moment. When I need to get in and reload or something like that, I just SSH into it. For now I have a bread pad attached to the Pi zero, and if I need to do anything, it all unplugs and I can make any mods
 

Erica-Renee

Valuable Member
View Badges
Joined
Oct 4, 2017
Messages
1,596
Reaction score
3,290
Location
lost
Rating - 0%
0   0   0
I have everything under my tank at the moment. When I need to get in and reload or something like that, I just SSH into it. For now I have a bread pad attached to the Pi zero, and if I need to do anything, it all unplugs and I can make any mods

I just think it would be kewl to add another device to the ever growing electronic closet.
What is in there . .
1. Router / Cable modem (separate units)
2. 10/100/10000 managed switch .(Connected though out the house cables are)
3. Synology Disk station (where we store everything and runs Local DNS Server)
4. I5 Windows 10 pc Media Server Running Kodi primary
6. Hdmi amp/ splitter with PIP .. This connects to 5 tvs in the house in each bedroom living room and sun room
7. Voip phone system . Uses google voice for free 4 lines of phone and two fax lines ( I work for myself )
8. Local tv antana amp/ servo Antana is in the attic and can be turned and adjusted with a remote .
9. Network Printer
10. Ohh Security camera connections .. (Synology also handles them for storage and uploads to my Cloud )

Yea i can ssh into it with no trouble.. I just do not want electronics close to my Tanks.... And the outlets in the closet are all on ARC Fault / gfci Some are are apc .. but the whole thing is connected to my Generator pannel .


wowee im a geek and did not know it
 

James Golden

Community Member
View Badges
Joined
Apr 8, 2018
Messages
44
Reaction score
55
Rating - 0%
0   0   0
I love building electronic devices! This is just one of the few projects that I have made. I have a navigation system I built for my motor cycle. Favorite one was the neighborhood ghost during Halloween! Ghost loaded with leds and hooked to a quadcopter that flys a programmed rout over the subdivision!
But I try to keep the home simple lol. I deal with enough “tech” at work. PDH, UDH, GPS NTP time server, about 40 pcs hooked to out units, so many managed switches we had to go to double letters to label them.
 

James Golden

Community Member
View Badges
Joined
Apr 8, 2018
Messages
44
Reaction score
55
Rating - 0%
0   0   0
Ok, was looking at the source files on the github and have a question for @Ranjib, if I edit the "sensor.go" where it says "if reading == 1 { // Water is above the level" to "if reading == 0 { // Water is above the level" would that invert the signal? And if so, Where can I find it on the PI? I have searched but cannot find it yet!
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Ok, was looking at the source files on the github and have a question for @Ranjib, if I edit the "sensor.go" where it says "if reading == 1 { // Water is above the level" to "if reading == 0 { // Water is above the level" would that invert the signal? And if so, Where can I find it on the PI? I have searched but cannot find it yet!
It will, but you have to recompile the binary. Its easier to just flip the outlet instead (i.e. use "reverse" in outlet declaration).
You can see the GPIO value like this (example if for gpio5)
Code:
pi@raspberrypi:~ $ cat /sys/class/gpio/gpio5/value
0
pi@raspberrypi:~ $
 

James Golden

Community Member
View Badges
Joined
Apr 8, 2018
Messages
44
Reaction score
55
Rating - 0%
0   0   0
Ok, did this
Code:
pi@raspberrypi:~ $ cat /sys/class/gpio/gpio23/value
1  //this is out of the water
pi@raspberrypi:~ $ cat /sys/class/gpio/gpio23/value
0 //this is in the water
pi@raspberrypi:~ $
and here is a screen shot. I have the relay not reversed and it will fill until it if full but you can see what is happening. below is a shot of the sensor in the water.
I have the relay in the non reversed setting because it would fill when the sensor was in the water and shut off when the sensor was out of the water.
Screen Shot 2018-04-21 at 10.12.10 AM.png

so the ato fill is showing that it is alway filling until it is below the sensor, then it shows the relay off. I want to keep this on NO open relay to protect the tank from filling is something happens to the Pi and it shuts off for some reason.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Ok, did this
Code:
pi@raspberrypi:~ $ cat /sys/class/gpio/gpio23/value
1  //this is out of the water
pi@raspberrypi:~ $ cat /sys/class/gpio/gpio23/value
0 //this is in the water
pi@raspberrypi:~ $
and here is a screen shot. I have the relay not reversed and it will fill until it if full but you can see what is happening. below is a shot of the sensor in the water.
I have the relay in the non reversed setting because it would fill when the sensor was in the water and shut off when the sensor was out of the water.
Screen Shot 2018-04-21 at 10.12.10 AM.png

so the ato fill is showing that it is alway filling until it is below the sensor, then it shows the relay off. I want to keep this on NO open relay to protect the tank from filling is something happens to the Pi and it shuts off for some reason.
Got it. I cant think of an easy way to do this. As part of multi ato support for 2.0, I have changed the ato designs to use inlet instead of declaring raw GPIO pin number. Inlets are same as outlets, and can be declared as 'reverse'. I think that will solve your problem. Its already in master and will be released by end of april or early may (at least two weeks before maker faire)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
@Ranjib what would happen if I used the inlet to reverse the input? Would that work?
I think 1.5 shipped with inlets,but its not integrated with ato yet. It was introduced to address things like this and multiple atos .
 

Erica-Renee

Valuable Member
View Badges
Joined
Oct 4, 2017
Messages
1,596
Reaction score
3,290
Location
lost
Rating - 0%
0   0   0
@James Golden depending on the relay board you have.. Most have a powered off and powered on power state.. I will have my pumps to stay powered on when pi is off Heaters and ATO PUMP Outlets in the normally off state when pi now powered.. this will keep them from working if the pi fails but not the house mains..
 

James Golden

Community Member
View Badges
Joined
Apr 8, 2018
Messages
44
Reaction score
55
Rating - 0%
0   0   0
@Erica-Renee , that what I am trying to do. I did just try something and I am giving it a try. I think it might work for now as a stop gap. I have been trying a few things. Have some transistors and a few 7404 ic chips and I am trying to make an inverter with it.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
@Erica-Renee , that what I am trying to do. I did just try something and I am giving it a try. I think it might work for now as a stop gap. I have been trying a few things. Have some transistors and a few 7404 ic chips and I am trying to make an inverter with it.
:) thats a good way to solve it.
 

Erica-Renee

Valuable Member
View Badges
Joined
Oct 4, 2017
Messages
1,596
Reaction score
3,290
Location
lost
Rating - 0%
0   0   0
OK .. I broke it again.
I unplugged everything to reorganize wiring . Pi was shut off. I had forgotten some of the Connectors gpio numbers so i started the pi , Started reef-pi and nothing was showing in any tab . I went to settings and every update button was in red. When i tried to click on one nothing would happen.
So I wiped the pi . reinstalled fresh ..
Complete new setup . Went into settings to change user name and Same thing..

here is the error log.
Apr 21 18:53:38 raspberrypi systemd[1]: reef-pi.service: Service hold-off time over, scheduling restart.
Apr 21 18:53:38 raspberrypi systemd[1]: Stopped raspberry pi based reef tank controller.
Apr 21 18:53:38 raspberrypi systemd[1]: Started raspberry pi based reef tank controller.
Apr 21 18:53:38 raspberrypi reef-pi[3160]: 2018/04/21 18:53:38 DB: reef-pi.db
Apr 21 18:53:38 raspberrypi reef-pi[3160]: 2018/04/21 18:53:38 ERROR: Failed to initialize pca9685 driver
Apr 21 18:53:38 raspberrypi reef-pi[3160]: 2018/04/21 18:53:38 ERROR: Failed to initialize controller. Error:remote I/O error
Apr 21 18:53:38 raspberrypi systemd[1]: reef-pi.service: Main process exited, code=exited, status=1/FAILURE
Apr 21 18:53:38 raspberrypi systemd[1]: reef-pi.service: Unit entered failed state.
Apr 21 18:53:38 raspberrypi systemd[1]: reef-pi.service: Failed with result 'exit-code'.

Now if i try to log in i get this from browser

This site cant be reached.
I am not sure what i am doing to break it.. But i assume installing everything again would do the same...


Please help...
 

Algae invading algae: Have you had unwanted algae in your good macroalgae?

  • I regularly have unwanted algae in my macroalgae.

    Votes: 44 35.2%
  • I occasionally have unwanted algae in my macroalgae.

    Votes: 27 21.6%
  • I rarely have unwanted algae in my macroalgae.

    Votes: 9 7.2%
  • I never have unwanted algae in my macroalgae.

    Votes: 10 8.0%
  • I don’t have macroalgae.

    Votes: 31 24.8%
  • Other.

    Votes: 4 3.2%
Back
Top