Coder Social home page Coder Social logo

reef-pi / reef-pi Goto Github PK

View Code? Open in Web Editor NEW
383.0 48.0 133.0 96.48 MB

An opensource reef tank controller based on Raspberry Pi

Home Page: http://reef-pi.com

License: Other

Makefile 0.24% Go 35.16% HTML 0.02% JavaScript 64.11% Ruby 0.01% Shell 0.05% Dockerfile 0.10% SCSS 0.31%
raspberry-pi golang go reef-tank reef aquarium reef-pi adafruit

reef-pi's Introduction

reef-pi

An open source reef tank controller based on Raspberry Pi

GitHub release Build Status(backend) Build Status(frontend) Build Status(smoke) Build Status(package)

Coverage Status Go Report Card License GoDoc

Introduction

reef-pi is an opensource reef tank controller based on Raspberry Pi. This is the software repository for reef-pi. If you are trying to build a physical controller to automate your reef tank, use reef-pi website. If you are new to reef keeping and want to know about the hobby use one of the online forums such as reef2reef or nano-reef(for smaller reef tanks).

reef-pi is an award winning, modular, do it yourself (DIY) project that aims to provide a hackable, affordable reef tank automation platform using easy to learn electronics. Apart from Raspberry Pi, reef-pi uses a handful of additional electronics boards from adafruit, a open hardware, community-focused electronics company. reef-pi is under active development. Follow reef2reef thread if you want to stay up to date with reef-pi development. Use the build guides on reef-pi website if you just want to build a reef tank controller based on reef-pi. We use slack for developer communication. Click here to join reef-pi slack channel.

Features

  • Web browser based user interface
  • On-demand & timer based control of equipment
  • Sunrise to sunset LED lighting automation
  • Temperature monitoring and control
  • pH monitoring
  • Dosing pump (peristaltic pumps) control
  • Auto Top off
  • Email alerts, charts, and dashboard capabilities. Adafruit.io based telemetry for monitoring.
  • On-demand or automatic tank photo capture with google drive upload using pi camera

Maintainers

Development

To ensure a good development process please follow the Code Of Conduct and the Pull Request Template. To setup your development environment please read this document.

Internationalization

If you want to edit or provide translations to the project, please follow the guide for internationalization.

Currently available languages (but not completed):

  • English
  • French
  • Italian
  • German
  • Hindi
  • Persian
  • Spanish

Acknowledgments

reef-pi would not be possible without these awesome things:

  • Raspberry Pi Foundation
  • Adafruit.com for all peripheral boards, tutorials.
  • go, the programming language that powers reef-pi non-ui parts.
  • react, a javascript framework used by reef-pi user interface.
  • github, the social coding platform that provide reef-pi code, website and release package hosting.
  • embd, go based IoT library used by reef-pi.
  • reef2reef, worlds largets reef tank user forum where reef-pi's original discussion thread is hosted.
  • travis ci for continuous integration service

reef-pi's People

Contributors

bdeakins avatar bijookha avatar chendx79 avatar danggrianto avatar dependabot-preview[bot] avatar dependabot[bot] avatar gokooma avatar hectorespert avatar jimmyker avatar loksiklubos avatar nick-falco avatar prsws avatar ranjib avatar ranthalion avatar revoohc avatar richievos avatar robsworld78 avatar schwabix-1311 avatar stvnmbr1 avatar theatrus avatar trackerit1 avatar viper5000 avatar wraul avatar zekth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reef-pi's Issues

Improvements to dashboard lighting widget

In attempting to further understand the lighting algorithm used in Reef-Pi I found that the current widget does not provide any information not already in the lighting settings. My suggestion is to add the following features.

  1. It would be nice if one graph showed all channels instead of individual graphs per channel. This would save space and allow a better visual of the light mix
  2. The ability to set the graph display color to match the light color (color drop down per channel maybe?)
  3. It would be nice if the lighting graph showed a rolling 24 hours by the minute of the actual output. I am not sure if Reef-Pi logs this now but it would be great to see if there was a temporary change in the past perhaps.

These are just suggestions from a grateful user of Reef-Pi

Add another light option "Diurnal Cycle"

In addition to the slider value or auto mode, I suggest a third option of diurnal cycle. This would use a function to calculate the light amount along a curve. This has the advantage of being a smoother, more natural lighting cycle as well as being simple to setup as you would only specify the max and min value for that channel, the time of day to start the ramp up and the time of day to end the ramp down. I am attaching a suggested UI for what I think this would look like.

Operationally the max value would set the upper limit for that channel. In my case, my lights are far more powerful than needed so this would be in the 50% range. The min value could be used to keep a light on. For instance if you wanted a "moon" light.

I have done this in an arduino application that I ran my last aquarium with. Reef-pi has a nicer UI and more capability than the program I wrote so I switched earlier this year. I am including an excel file that I used to dial in an accurate representation of the solar cycle for reference.

Here is an explanation of what the function does:
We want to calculate the value from 0-1 to represent the percent of light at this time in minutes and we will call this value PercentLight.
PercentLight is calculated as a function of the negative cosine of the daylight hours, defined by the user, divided by 2 pi to get the step.
The value in the cosine function is cubed to get a steeper rise and a flat top. The function is as follows:
Calculate the steps... This gives the number of steps in a full cycle of radians for day hours.
All times are in minutes elapsed since midnight
(Current time - Start time)* 2*pi / (End time - Start Time)

Then cube the cosine of that value. This produces a shape with a second peak (First plot in the excel file graph). Use a min or ceiling function to eliminate this peak (second plot in the excel file graph). Finally multiply this value by the Max Lights value - Min Lights Value and then add the Min lights value. PercentLight * (Max - Min) + Min
=(1-COS((minutes-startMinutes)2PI/(End Minutes-startMinutes))^3) * (Max - Min) + Min
Let me know if this makes sense or if you would like clarification.

diurnal light ui
sun simulation.xlsx

Installation Docs

Write README style documentation for reefer on raspberry pi

Details

Cover following things:

  • Download binary
  • Configuring systemd service
  • Raspberry pi i2c, spi, screen etc configuration

Macro functionality

Macro or feed mode or group actions is a common requirement for day to day reef keeping chores whereby users have to switch on or off multiple equipments and disable timer jobs etc during water change or feeding fish / corals.

Users should be able to group a set of equipments,timers and specify actions against them (on/off for equipments, start/stop for timers ). Once specified users can trigger the macro to execute all those actions against target equipment/ timers . Macros should also provide a reverse feature where by all actions are reverted.

Users should also be able to trigger macros using timers.

Dev Environment not working

Trying to help in software development while learning go and react but when i tried to do:
DEV_MODE=1 ./bin/reef-pi
I still got this error

2018/05/29 13:51:26 DB: reef-pi.db
2018/05/29 13:51:26 ERROR: Failed to initialize i2c. Error: open /dev/i2c-1: no such file or directory
2018/05/29 13:51:26 ERROR: Failed to initialize controller. Error:open /dev/i2c-1: no such file or directory

Timers not working in R2 beta 7

I have been unable to get a timer to trigger in the latest beta release 2.0.0-beta 7. I reverted to an earlier release 1.0 and was able to trigger a timer and was able to see the output in the system journal.

I am running on a pi 3 mobel B.

Happy to provide assistance diagnosing this issue.

Dont call dashboard api when its disabled

2.0.0-beta tries to load dashboard configuration (under configuration tab) even when the capability is disabled. This throws user visible error.

move dashboard config under main dashboard ui as well

Adafruit.io AIO Key Not Saving

Upon entering my Adafruit.io username I receive the following message instantly "Please set a valid adafruit.io key" and after hitting "update" the key does not save.

When reloading the page after saving the AIO key the textbox is null.

running 2.0.0-beta-6

Send alert when temperature sensor is not detected

Often time ds18b20 sensors are not detected in linux , either due to circuit issue or sensor going bad or sometime for no obvious reasons. reef-pi should send alert (if configured) and stop temperature controller when this happens

Docs for LED blink example

Create a README style documentation for LED blink example using reefer dashboard.

Details

User should be able to run two LED (red & green) for 5 seconds alternatively using reefer running on raspberry pi

Add pH sensor support

Users should be able to hook up Atlas scientific pH kit (probe + ezo circuit + voltage isolator), and use reef-pi to calibrate the probe as well as monitor tank pH. Allow sending an alert when ph goes beyond a range, or trigger an action against an equipment.

Support providing an offset to the temperature probe

Cheap Dallas 1wire sensors (or knockoffs) from China, while they claim 0.5C precision, aren't usually all that accurate.

There should be a spot in the UI on the temperature sensor to enter an offset for it.

[bug] problem with raspberry V2

Rasp V2
uname -a: Linux raspberrypi 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l GNU/Linux
VERSION="8 (jessie)"
Hardware : BCM2835

i2cdetect -y 1:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --

reef-pi -version: 0.0.4

ERROR: Failed to sync equipment:Return Error:embd: your host ": ARMv7 Processor rev 5 (v7l)" is not supported at this moment. request support at https://github.com/kidoman/embd/issues

Potential Power Loss Corruption Issue

I am running into an issue of when I lose power or unplug the pi zero w with reef-pi running (currently only an 8 channel relay and a temperature sensor is hooked up), once I regain power I am unable to SSH into my pi or view the reef-pi web service. also the relays go through a huge amount of clicking.... its using DHCP and when I try to ping it I get "Request timed out" and "Destination host unreachable" with 50% packet loss.

I was in the middle of making a how-to video for the temperature sensor and had to stop because the pi is now unusable. I will need to format the card. I can wait and send you the image/boot drive if you think it will help.

Enhance input validation across all elements

  • Implement or improve input validation across all modules and component under them
  • Aim for both server side and client side validations
  • These enhancements should also protect reef-pi from possible misconfigurations or inconsistent state, from which user might not be able to recover easily (like wrong dashboard config causing entire UI to crash etc)

Implement dosing system

Users should be able to declare multiple dosing pumps.
Each pump will be controlled by a jack
Each pump can be calibrated [run for a fixed amount of time, say 5 seconds] from reef-pi ui
Each pump can be turn on/off at specific time of the day
Each pump can have a pwm value to control it speed (dosing volume)
reef-pi should provide chart or some sort of visualization for the entire dosing regiment

Add ability to select graph colors for lighting widget.

It would be helpful to have the ability to set the graph display color to match the light color in a graph.
For example: There are multiple color channels controlled by jack 1. In the settings for that jack there would be a color drop down box for each channel. This would allow a more complete visualization of the current lighting program.

Thank you for your consideration.

Allow setting pwm frequency

  • Allow setting pwm frequency across pca9685 and raspberry pi pwm drivers
  • Some LED drivers (meanwell noteworthy) allows different levels of dimming (10% to 1%) depending on the control signal's pwm frequency. Verify and document any such scenarios with configurable pwm frequency from users

[feat] Implement peristaltic pump controller

Peristaltic pumps are used for Auto Top Off and dosers. Basic support for peristaltic pump should include

  • Turning on and off, on demand and periodically
  • Controlling the speed (via PWM probably)

Change Tab with Sidebar

The tab is not responsive, in the mobile view it will become stacked. I propose to move it to sidebar and for the mobile view it will be hidden in the hamburger menu. I will attach the prototype later.

Customizable dashboard

Users should be able to customize their dashboards. This is a predicate for supporting multiple ATO and temperature sensors. Few things the customization workflow needs to support

  • Chart grid layout [current default is 2x3]
  • Width & height of individual charts [current default is 500 X 300 px]
  • Which charts to add [from healthchart, ato charts, temperature sensor charts, ph sensor charts etc]

When connecting a second Temp. Sensor, the reef pi does not recognize it.

When connecting a second Temp. Sensor, the reef pi does not recognize it.

The first sensor was connected to pin 4 in a cool area and and worked just fine.

I wanted to test a second, so I added it on the pinout in addition to the one on pin 4. the second was connected to pin 26 next to my computers heat sync fan so I could see a temperature change.

I did not see it show up, so I removed the sensor on pin 4 from reef-pi (still connected to the physical pin) to try out the one on 26. I then rebooted the pi from the UI. There were no changes in temperature readings.
To be sure I moved the pin 4 sensor by the heater for a minute or to (please see attached) and sure enough, it went up.

I believe that this is not desired behavior.

I did a reboot between switching. I am wondering if there is some strange caching going on where it won't change the pin its reading from if its still connected ?

Does this make sense?
image

image

these are readings from pin 4 sensor still, even though I removed it from reef-pi and rebooted...
image

Adafruit.io telemery tab will not save AIO key

Issue: No telemetry or feeds created on adafruit.io
When attempting to setup telemetry I found that the AIO key is not saved. I am testing this by typing in the AIO key, then I click update, then go to another tab and then back to telemetry. Then I see the username and prefix are saved but not the AIO key. I have this running on a "production" Raspberry Pi 3B+, a test Raspberry Pi 3B+ and a test Raspberry Pi Zero W. All of these exhibit the same issue. I believe this is the root cause for it failing to update the or even create the feeds at adafruit.io.

Change all mention of equipments in codebase

equipments is not a correct English word and have been a constant source of annoyance in different threads. since the same word is used by 1.0 API (/api/equipments), lets use 2.0 as an opportunity to get rid of all usage of equipments in reef-pi in lieu of equipment.

Support multiple ATO system

Provide support for multiple water level sensor. Each sensor can be assigned a human-readable name. Users should be able to customize their monitoring frequency, alert, equipment action, and polarity of the sensor (some sensors send opposite signals than others).

Load test for reef-pi

Develop a comprehensive load test suite for reef-pi to test its concurrent CRUD operations and also to estimate reef-pi capabilities when run on pi zero or pi 3. Some measurements around current draw will be useful as well (and associated circuit)

Maintenance alerts

Is it possible to have alerts either scheduled (every day, 2 days, week, month, etc...) or for a specific day, for maintenance purposes. I think it would be most useful to have these user defined, and to set up interval and method of alert.
Method could either be message section in reef-pi, or text/email message (not at 00:00 of day of reminder)
A few examples:
-Reminder to clean skimmer every week.
-Reminder to clean pump every month.
-Reminder to change RO membrane a year from today.
-Reminder to mix water for next water change.

Provide a way to do light acclimation

Light acclimation is a critical requirement for introducing any new corals. reef-pi should allow users to configure individual light schedule (auto mode) to acclimate over a fixed number of days. When specified , reef-pi will slowly ramp up individual intensity values for any given hour over the course of specified days , incrementally

reef-pi should periodically save stats to disk

Currently reef-pi only saves stats on disk when its shutting down. In case of accidental shutdown this can lead to loss of week long stats across ato,ph, temperature sub-system. reef-pi should periodically save stats to disk as a safeguard (probably every night)

Allow users to see errors in reef-pi

reef-pi should allow users to see latest errors (say 100 last errors) occurred in the system. reef-pi should not crash in most error conditions, but warn users if critical errors are occurring. This is equivalent to engine light check features, except users should be able to see a list of errors in addition to an overall warning/critical status.

Temperature graph oddities and improvements

image

image

Not sure if it is what data type you are using (float might cause issues) or if there is some odd rounding happening but I'm seeing some strange things on the temperature graph. see attached pictures.

Also if we are graphing from a list maybe we can do some better scaling and use more of the screen real-estate for visualizing the graph

Provide weeklong cpu/memory usage

Currently reef-pi stores only past three hours cpu and memory usage. It will be easier to diagnose long running trends if it stores a week worth of cpu/memory usage

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.