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
Some development updates,
we got chinese and portugese translations merged this week, which means Chinese/Portugese users will be able to use reef-pi ui in their native language :-) . All the contributions came from github community .. i dont know if the authors are here in r2r, if you are, thank you so much . Internationalization and localization is something i hold dear. In 3.0 we are doing some ground work for internationalization, hopefully in 4.0 we'll do some work on localization.

I continued to make small progress on the other 3.0 feature matrix. Since and random pwm profiles are now merges in master, for those of you who are following, these features will be used for wavemaker or lights... pretty anything thats connected via a jack or variable voltage output. Next i'll focus on combining random + dirunal profile, i believe this something commercal manufacturers are calling as reef crest. After that I may work on the last pwm profile which is composite. With composite multiple profiles can be combined, things like nutrient export and other modes can be recreated with this.
Here is a screenshot of the random profile output (graph generated via google spreadsheet)
Screen Shot 2019-07-13 at 10.41.03 AM.png
 

AquaRaider44

#Reef4Life
View Badges
Joined
Apr 19, 2019
Messages
526
Reaction score
820
Location
Brevard County
Rating - 0%
0   0   0
Some development updates,
we got chinese and portugese translations merged this week, which means Chinese/Portugese users will be able to use reef-pi ui in their native language :) . All the contributions came from github community .. i dont know if the authors are here in r2r, if you are, thank you so much . Internationalization and localization is something i hold dear. In 3.0 we are doing some ground work for internationalization, hopefully in 4.0 we'll do some work on localization.

I continued to make small progress on the other 3.0 feature matrix. Since and random pwm profiles are now merges in master, for those of you who are following, these features will be used for wavemaker or lights... pretty anything thats connected via a jack or variable voltage output. Next i'll focus on combining random + dirunal profile, i believe this something commercal manufacturers are calling as reef crest. After that I may work on the last pwm profile which is composite. With composite multiple profiles can be combined, things like nutrient export and other modes can be recreated with this.
Here is a screenshot of the random profile output (graph generated via google spreadsheet)
Screen Shot 2019-07-13 at 10.41.03 AM.png
That's pretty sweet but I'm still looking for the lunar PWM profile! I think this will be a game changer to come on when the moon is upon the day and time and be as bright as the moon should be in %!
 
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
That's pretty sweet but I'm still looking for the lunar PWM profile! I think this will be a game changer to come on when the moon is upon the day and time and be as bright as the moon should be in %!
How it is different from diurnal or sine or any other pwm profile? Do you have any reference to the intensity profile (graph) that I can refer?
 

AquaRaider44

#Reef4Life
View Badges
Joined
Apr 19, 2019
Messages
526
Reaction score
820
Location
Brevard County
Rating - 0%
0   0   0
How it is different from diurnal or sine or any other pwm profile? Do you have any reference to the intensity profile (graph) that I can refer?
It is the same as the sine. The only difference is that it needs to pull from the moon data for time of moon rose and moon set for my zip code/area and the % full for the intensity. Something like this needs to be used to calculate it https://grafana.com/plugins/fetzerch-sunandmoon-datasource or just full from some website like https://www.mooncalc.org/#/49.495,11.073,3/2019.07.13/16:58/1/3 which has an API.
 

brandon clow

Active Member
View Badges
Joined
Oct 22, 2017
Messages
121
Reaction score
151
Rating - 0%
0   0   0
Some development updates,
we got chinese and portugese translations merged this week, which means Chinese/Portugese users will be able to use reef-pi ui in their native language :-) . All the contributions came from github community .. i dont know if the authors are here in r2r, if you are, thank you so much . Internationalization and localization is something i hold dear. In 3.0 we are doing some ground work for internationalization, hopefully in 4.0 we'll do some work on localization.

I continued to make small progress on the other 3.0 feature matrix. Since and random pwm profiles are now merges in master, for those of you who are following, these features will be used for wavemaker or lights... pretty anything thats connected via a jack or variable voltage output. Next i'll focus on combining random + dirunal profile, i believe this something commercal manufacturers are calling as reef crest. After that I may work on the last pwm profile which is composite. With composite multiple profiles can be combined, things like nutrient export and other modes can be recreated with this.
Here is a screenshot of the random profile output (graph generated via google spreadsheet)
Screen Shot 2019-07-13 at 10.41.03 AM.png
I seen this commit today and it made my day. Keep up the great work!
 
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
It is the same as the sine. The only difference is that it needs to pull from the moon data for time of moon rose and moon set for my zip code/area and the % full for the intensity. Something like this needs to be used to calculate it https://grafana.com/plugins/fetzerch-sunandmoon-datasource or just full from some website like https://www.mooncalc.org/#/49.495,11.073,3/2019.07.13/16:58/1/3 which has an API.

Im reluctant on relying on 3rd party/external system for the data part. Also im curious if adding arbitrary lat/long makes sense, since most corals that we keep are tropical. I do want to have some gps aware things, and I think biotopes might be a good candidate to run such experiments, but even in those cases the data should not vary a lot and probably we'll always have a robust locally configurable/dynamic profile with no external dependencies. Im still looking for graphs that I can use for building this profile. The website you shared provide moon's relative location compared to earth (astronomical data), not observed moonlight intensity/spectrum. I need the later,
 
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
It is the same as the sine. The only difference is that it needs to pull from the moon data for time of moon rose and moon set for my zip code/area and the % full for the intensity. Something like this needs to be used to calculate it https://grafana.com/plugins/fetzerch-sunandmoon-datasource or just full from some website like https://www.mooncalc.org/#/49.495,11.073,3/2019.07.13/16:58/1/3 which has an API.

Im reluctant on relying on 3rd party/external system for the data part. Also im curious if adding arbitrary lat/long makes sense, since most corals that we keep are tropical. I do want to have some gps aware things, and I think biotopes might be a good candidate to run such experiments, but even in those cases the data should not vary a lot and probably we'll always have a robust locally configurable/dynamic profile with no external dependencies. Im still looking for graphs that I can use for building this profile. The website you shared provide moon's relative location compared to earth (astronomical data), not observed moonlight intensity/spectrum. I need the later,
 

Ryan115

Well-Known Member
View Badges
Joined
Dec 28, 2010
Messages
586
Reaction score
1,085
Location
Mississippi
Rating - 0%
0   0   0
It is the same as the sine. The only difference is that it needs to pull from the moon data for time of moon rose and moon set for my zip code/area and the % full for the intensity. Something like this needs to be used to calculate it https://grafana.com/plugins/fetzerch-sunandmoon-datasource or just full from some website like https://www.mooncalc.org/#/49.495,11.073,3/2019.07.13/16:58/1/3 which has an API.
Would it be sufficient to have the sine set where it increments forward by about an hour each day? That would give it close to a monthly cycle (realistically could get closer to true cycle if needed).
Additionally be able to set min/max and where in the cycle to start that day (only needed to "sync" to current moon phase.)
 

AquaRaider44

#Reef4Life
View Badges
Joined
Apr 19, 2019
Messages
526
Reaction score
820
Location
Brevard County
Rating - 0%
0   0   0
Would it be sufficient to have the sine set where it increments forward by about an hour each day? That would give it close to a monthly cycle (realistically could get closer to true cycle if needed).
Additionally be able to set min/max and where in the cycle to start that day (only needed to "sync" to current moon phase.)
I guess if you could make a custom pwm profile for 29.5 days you could just start it when you want and it would ramp up and down and repeat at the end of the 29.5 days. This would be the basic lunar cycle.
 
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
Yes.
I went through couple of articles, and I think i understand the details a bit more now. We need sine curves daily, but the amplitude of that sine curve will vary from 0 (new moon) to a max value(full moon), and that intensity increase is not linear, its actual mirrored exponential form. This is all about the intensity variation, theres a duration variation as well, but i think we can park that for next phase since the solar simulation itself is not really mimicing the yearly/monthly patterns. I'll make sure we have a lunar profile which basically runs a mirrored exponential monthly intensity multiplier against a daily sine curve. Actually, we have something called a composite profile which i can use to build something like this, it allows fully or partially combining multiple profiles

https://ask.metafilter.com/226118/What-part-of-the-earth-gets-the-most-moonlight
https://jeb.biologists.org/content/214/5/770
 

AquaRaider44

#Reef4Life
View Badges
Joined
Apr 19, 2019
Messages
526
Reaction score
820
Location
Brevard County
Rating - 0%
0   0   0
This would just be a huge 708.734 hour sine cycle where the brightness of the lights just increases over the whole time. It should be super simple to implement @Ranjib then you could just define the setting as start date which would be the last new moon for the user to input.

1f8929efcd49f5b91c3c9f2dc25958d7.png
 

AquaRaider44

#Reef4Life
View Badges
Joined
Apr 19, 2019
Messages
526
Reaction score
820
Location
Brevard County
Rating - 0%
0   0   0
Yes.
I went through couple of articles, and I think i understand the details a bit more now. We need sine curves daily, but the amplitude of that sine curve will vary from 0 (new moon) to a max value(full moon), and that intensity increase is not linear, its actual mirrored exponential form. This is all about the intensity variation, theres a duration variation as well, but i think we can park that for next phase since the solar simulation itself is not really mimicing the yearly/monthly patterns. I'll make sure we have a lunar profile which basically runs a mirrored exponential monthly intensity multiplier against a daily sine curve. Actually, we have something called a composite profile which i can use to build something like this, it allows fully or partially combining multiple profiles

https://ask.metafilter.com/226118/What-part-of-the-earth-gets-the-most-moonlight
https://jeb.biologists.org/content/214/5/770
I completely agree. Thank you!
 
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
@Ranjib would a profile like the one I described above be possible with just generic settings? Such as


graph-1-illumination-vs-hours-for-the-lunar-cycle.png

https://plot.ly/~cowas78/114.embed
This is a gaussian curve, we dont have this, we have sine curve, which is very similar except the smooth start/end plateue. Diurnal cycle has similar plateues.
But more importantly, this is not a daily cycle graph this is the graph of peak intensity (midnight ??) across a month. I think i know what we are looking here. Gimme some time and I'll get back with some updates
 
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
I completely agree. Thank you!
No thank you, this is a great suggestion, we need this type of discussions. I learned a lot just by reading through those papers..
 

AquaRaider44

#Reef4Life
View Badges
Joined
Apr 19, 2019
Messages
526
Reaction score
820
Location
Brevard County
Rating - 0%
0   0   0
This is a gaussian curve, we dont have this, we have sine curve, which is very similar except the smooth start/end plateue. Diurnal cycle has similar plateues.
But more importantly, this is not a daily cycle graph this is the graph of peak intensity (midnight ??) across a month. I think i know what we are looking here. Gimme some time and I'll get back with some updates
Yes this would be the peak intensity at the time when the moon would be right above the tank / high point. It would still need to be adjusted for the time of day when the moon rises and sets with this number being the peak %.
 

MichaelA18454

Community Member
View Badges
Joined
Jun 22, 2019
Messages
50
Reaction score
37
Rating - 0%
0   0   0
Check if reef-pi is running (sudo systemctl status reef-pi.service), as mentioned here: https://reef-pi.github.io/guides/troubleshooting/

Directly after I am disconnected from a "REBOOT" i see:

pi@reeftank:~ $ sudo systemctl status reef-pi.service
? reef-pi.service - raspberry pi based reef tank controller
Loaded: loaded (/lib/systemd/system/reef-pi.service; enabled; vendor preset:
Active: activating (auto-restart) (Result: exit-code) since Sun 2019-07-14 18
Process: 9823 ExecStart=/usr/bin/reef-pi daemon -config /etc/reef-pi/config.ym
Main PID: 9823 (code=exited, status=1/FAILURE)
lines 1-5/5 (END)

After I reset "Service" I see:

pi@reeftank:~ $ sudo systemctl status reef-pi.service
? reef-pi.service - raspberry pi based reef tank controller
Loaded: loaded (/lib/systemd/system/reef-pi.service; enabled; vendor preset:
Active: active (running) since Sun 2019-07-14 18:44:49 AEST; 2min 15s ago
Main PID: 9917 (reef-pi)
Memory: 2.0M
CGroup: /system.slice/reef-pi.service
+-9917 /usr/bin/reef-pi daemon -config /etc/reef-pi/config.yml

Jul 14 18:44:50 reeftank reef-pi[9917]: 2019/07/14 18:44:50 Successfully started
Jul 14 18:44:50 reeftank reef-pi[9917]: 2019/07/14 18:44:50 Initializing DB for
Jul 14 18:44:50 reeftank reef-pi[9917]: 2019/07/14 18:44:50 Successfully started
Jul 14 18:44:50 reeftank reef-pi[9917]: 2019/07/14 18:44:50 reef-pi is up and ru
Jul 14 18:44:50 reeftank reef-pi[9917]: 2019/07/14 18:44:50 ERROR: health checke
Jul 14 18:44:50 reeftank reef-pi[9917]: 2019/07/14 18:44:50 Starting health chec
Jul 14 18:44:50 reeftank reef-pi[9917]: 2019/07/14 18:44:50 ERROR: Failed to loa
Jul 14 18:44:50 reeftank reef-pi[9917]: 2019/07/14 18:44:50 Starting http server
Jul 14 18:45:50 reeftank reef-pi[9917]: 2019/07/14 18:45:50 health check: Used m
Jul 14 18:46:50 reeftank reef-pi[9917]: 2019/07/14 18:46:50 health check: Used m
lines 1-18/18 (END)
 

MichaelA18454

Community Member
View Badges
Joined
Jun 22, 2019
Messages
50
Reaction score
37
Rating - 0%
0   0   0
I started at reformat SDcard again and did a complete fresh install.
Without setting up any modules and ONLY selecting the 3 items in the "Configuration" folder Dose-LightingpPCS8685 and pressing "REBOOT"
Here are the log files before and after pressing "REBOOT"

pi@reeftank:~ $ sudo systemctl status reef-pi.service

? reef-pi.service - raspberry pi based reef tank controller
Loaded: loaded (/lib/systemd/system/reef-pi.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-07-15 12:31:38 AEST; 2min 58s ago
Main PID: 268 (reef-pi)
Memory: 9.3M
CGroup: /system.slice/reef-pi.service
+-268 /usr/bin/reef-pi daemon -config /etc/reef-pi/config.yml

Jul 15 12:31:39 reeftank reef-pi[268]: 2019/07/15 12:31:39 INFO: equipment subsystem: Finished syncing all equipment
Jul 15 12:31:39 reeftank reef-pi[268]: 2019/07/15 12:31:39 Successfully started subsystem: equipment
Jul 15 12:31:40 reeftank reef-pi[268]: 2019/07/15 12:31:40 Successfully started subsystem: timers
Jul 15 12:31:40 reeftank reef-pi[268]: 2019/07/15 12:31:40 Successfully started subsystem: ato
Jul 15 12:31:40 reeftank reef-pi[268]: 2019/07/15 12:31:40 Successfully started subsystem: temperature
Jul 15 12:31:40 reeftank reef-pi[268]: 2019/07/15 12:31:40 Successfully started subsystem: macro
Jul 15 12:31:40 reeftank reef-pi[268]: 2019/07/15 12:31:40 reef-pi is up and running
Jul 15 12:31:40 reeftank reef-pi[268]: 2019/07/15 12:31:40 Starting http server at: 0.0.0.0:80
Jul 15 12:31:40 reeftank reef-pi[268]: 2019/07/15 12:31:40 ERROR: health checker. Failed to load usage. Error: Item 'health_stats' does not exist in bucket '
Jul 15 12:31:40 reeftank reef-pi[268]: 2019/07/15 12:31:40 Starting health checker

*****************************************************************
Error Log file after pressing "REBOOT"

pi@reeftank:~ $ sudo journalctl -fu reef-pi.service
-- Logs begin at Mon 2019-07-15 12:39:55 AEST. --
Jul 15 12:41:28 reeftank systemd[1]: Started raspberry pi based reef tank controller.
Jul 15 12:41:29 reeftank reef-pi[292]: 2019/07/15 12:41:29 Setting pca9685 frquency: 1500
Jul 15 12:41:29 reeftank reef-pi[292]: 2019/07/15 12:41:29 ERROR: Failed to initialize pca9685 driver with mock i2c bus. Error: remote I/O error
Jul 15 12:41:29 reeftank reef-pi[292]: 2019/07/15 12:41:29 ERROR: Failed to initialize controller. Error:remote I/O error
Jul 15 12:41:29 reeftank systemd[1]: reef-pi.service: Main process exited, code=exited, status=1/FAILURE
Jul 15 12:41:29 reeftank systemd[1]: reef-pi.service: Failed with result 'exit-code'.
Jul 15 12:44:19 reeftank systemd[1]: reef-pi.service: Service RestartSec=1min 30s expired, scheduling restart.
Jul 15 12:44:19 reeftank systemd[1]: reef-pi.service: Scheduled restart job, restart counter is at 1.
Jul 15 12:44:19 reeftank systemd[1]: Stopped raspberry pi based reef tank controller.
Jul 15 12:44:19 reeftank systemd[1]: Started raspberry pi based reef tank controller.
Jul 15 12:44:19 reeftank reef-pi[599]: 2019/07/15 12:44:19 Setting pca9685 frquency: 1500
Jul 15 12:44:19 reeftank reef-pi[599]: 2019/07/15 12:44:19 ERROR: Failed to initialize pca9685 driver with mock i2c bus. Error: remote I/O error
Jul 15 12:44:19 reeftank reef-pi[599]: 2019/07/15 12:44:19 ERROR: Failed to initialize controller. Error:remote I/O error
Jul 15 12:44:19 reeftank systemd[1]: reef-pi.service: Main process exited, code=exited, status=1/FAILURE
Jul 15 12:44:19 reeftank systemd[1]: reef-pi.service: Failed with result 'exit-code'.
 

MichaelA18454

Community Member
View Badges
Joined
Jun 22, 2019
Messages
50
Reaction score
37
Rating - 0%
0   0   0
I believe so in 2 places
The config.txt file:
Edit config.txt to include the following lines...

dtparam=i2c_arm=on
dtoverlay=w1-gpio
dtoverlay=pwm-2chan

and in sudo raspi-config
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get i2c-tools

sudo systemctl start ssh.service
sudo systemctl enable ssh.service

sudo systemctl start systemd-timesyncd.service
sudo systemctl enable systemd-timesyncd.service
sudo dpkg-reconfigure tzdata
 

TOP 10 Trending Threads

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

  • 100% live rock + bagged sand

    Votes: 38 26.6%
  • 100% dry rock + 100% live sand

    Votes: 48 33.6%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 32 22.4%
  • 75% live rock, 25% live sand

    Votes: 15 10.5%
  • 25% live rock, 75% live sand

    Votes: 10 7.0%
Back
Top