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

Just looked at one of the last commits of Ranjibs code that was just committed. Of course I don't understand it, but noticed he includes tooltips. Very cool.
This made me wonder if we needed a glossary of terms. Things like cron, commit, pull, etc., are common in software work but not in everyday life. I would be happy to begin this if anyone thinks it might be useful.

Ranjib, what do you think? This would not be more work for you, except to review it and load it on github. Maybe we can even define the components..okay, not a real glossary, but something that explains terms and components most people are not familiar with.
We need glossary, FAQ and API document.
 
Just looked at one of the last commits of Ranjibs code that was just committed. Of course I don't understand it, but noticed he includes tooltips. Very cool.
This made me wonder if we needed a glossary of terms. Things like cron, commit, pull, etc., are common in software work but not in everyday life. I would be happy to begin this if anyone thinks it might be useful.

Ranjib, what do you think? This would not be more work for you, except to review it and load it on github. Maybe we can even define the components..okay, not a real glossary, but something that explains terms and components most people are not familiar with.
Not too much. I would appreciate any help around documentation :-)
Let me know what you need from me? I can add a place holder page that you can use as example, I have a few words in mind for the gloassary .. reef-pi's website is README tells about how to add anything in the website: https://github.com/reef-pi/website

right now this information is scattered across guides. Like the cron/timer details can be found here: https://reef-pi.github.io/general-guides/timer/
similarly, various electronics parts is somewhat mentioned here: https://reef-pi.github.io/general-guides/electronics/

I would love to get all of your feedback on how to best organize the documents.. as you know first hand the challenges in assembly.
 
Okay, I can start on the glossary. I will also start gathering info for the FAQ when I get started. Did you want to post these on reef-pi (GitHub.io) with the General and Build guides?

If anyone has questions or terms they want to add please note them in the thread.
 
Okay, I can start on the glossary. I will also start gathering info for the FAQ when I get started. Did you want to post these on reef-pi (GitHub.io) with the General and Build guides?

If anyone has questions or terms they want to add please note them in the thread.
Yes. You have to send pull requests against the website repo, I run `hugo` to generate the actual website pages and check them in https://github.com/reef-pi/reef-pi.github.io repo. They are live on http://reef-pi.com after that,
 
Thanks. I was just reading that. Since I have never done it before I will let you know when I issue a pull request and you can help with with any corrections to my methodology. Have a great day everyone. Later
 
Okay, I can start on the glossary. I will also start gathering info for the FAQ when I get started. Did you want to post these on reef-pi (GitHub.io) with the General and Build guides?

If anyone has questions or terms they want to add please note them in the thread.

I would suggest a wiki. I just found this project yesterday, and the hardest part of the whole installation process was actually finding the .deb files that are referenced in the install guide. The .deb files are located on a different github project page than reef-pi and I had to enlist google's help in finding them.

Also, I'm attempting to install on a Raspberry Pi B+. Both the RPi-0 and the RPi-3 .deb files fail to launch on my B+, so I decided to compile from scratch. Every project I've attempted to compile on my own has had two files in the source folder - INSTALL and README. Those are supposed to include instructions on compiling the package yourself - Those did not exist in this package.

I might be the minority in this though - but what do you guys think about splitting the resources? I have dedicated debian servers in my network, and I would prefer running the cpu-intensive stuff on it, but use the RPi for network-atttached gpio pins.
 
I'm following the development instructions located at https://reef-pi.github.io/general-guides/development/

I gave up trying to install Go from the latest binaries from the golang website. Instead, I had success installing from the debian repo.
Code:
sudo apt-get install golang-go

I also installed npm and NodeJS from the debian repo. The repo's binary was at /usr/bin/nodejs. I had to manually symlink this to /usr/bin/node to make the default $path work
Code:
sudo ln -s /usr/bin/nodejs /usr/bin/node

but I ended up with 404 "file not found" errors when attempting to build the reef-pi dependancies. I solved these by updating NodeJS and npm from the NodeJS website.
Code:
sudo npm install npm@latest -g

After that, I was able to install all the go libraries with 'make go-get', and compile the reef-pi UI or reactjs dependencies with 'npm install'.

Edit -
After building reef-pi by running 'make' and './node_modules/.bin/webpack -d', I'm supposed to be able to edit the config and run reef-pi with './bin/reef-pi.yml'. However ./bin does not exist in the build directory. Another file in the build directory, './build/reef-pi.service', references the main executable at '/usr/bin/reef-pi', however, that file doesn't exist, nor does any executable file named 'reef-pi' in the development folder.

I'm pretty much stuck here.
 
Last edited:
I would suggest a wiki. I just found this project yesterday, and the hardest part of the whole installation process was actually finding the .deb files that are referenced in the install guide. The .deb files are located on a different github project page than reef-pi and I had to enlist google's help in finding them.

Also, I'm attempting to install on a Raspberry Pi B+. Both the RPi-0 and the RPi-3 .deb files fail to launch on my B+, so I decided to compile from scratch. Every project I've attempted to compile on my own has had two files in the source folder - INSTALL and README. Those are supposed to include instructions on compiling the package yourself - Those did not exist in this package.

I might be the minority in this though - but what do you guys think about splitting the resources? I have dedicated debian servers in my network, and I would prefer running the cpu-intensive stuff on it, but use the RPi for network-atttached gpio pins.
reef-pi should have those two files, it just that they are only required for those who want to build it from scratch. We are currently focusing on a general install guide which assumes pi 3 or zero. Do you think having two copies, one for the website and one in the controller repo itself will help? reef-pi has muliple components (backend controller, UI elements, website, documents) which will be segregated to different repositories, hence a repository specific install file is something I thought less priority over an end to end setup/install guide.

B+ should work fine, as you have learned. I had tested it couple of times as well. But for sake of simplicity I would stick to Pi3/pi-zero based builds. This makes all documentation straight forward. I want to focus on end to end stability on a single platform. Pi3 being newer and having on-board wifi was the preferred one.

I have discussed about having a client server model, where a reef-pi controller can control multiple smaller controller, architecturally this is not hard to achieve, the recent code changes has made it easy as well. If we want we can run the reef-pi htttp server someplace else, and let it control the GPIO/pwm or other hardware over http (or some different protocol) based api. But currently, reef-pi is not cpu intensive at all. And keeping the UI/physical controller together makes it simple setup. But this is something I want to revisit post X-mas/1.0 releas. Current focus is to get the basic functionality very well tested while making it easy to install/configure (i.e intuitive UI and documentation)
 
I'm following the development instructions located at https://reef-pi.github.io/general-guides/development/

I gave up trying to install Go from the latest binaries from the golang website. Instead, I had success installing from the debian repo.
Code:
sudo apt-get install golang-go

I also installed npm and NodeJS from the debian repo. The repo's binary was at /usr/bin/nodejs. I had to manually symlink this to /usr/bin/node to make the default $path work
Code:
sudo ln -s /usr/bin/nodejs /usr/bin/node

but I ended up with 404 "file not found" errors when attempting to build the reef-pi dependancies. I solved these by updating NodeJS and npm from the NodeJS website.
Code:
sudo npm install npm@latest -g

After that, I was able to install all the go libraries with 'make go-get', and compile the reef-pi UI or reactjs dependencies with 'npm install'.
Im glad it worked out for you.
 
After giving it some thought, the GPIO/pwm hardware control is the most CPU intensive. The only benefit I can think of is if people need to control more than one "pool" - let's call it a tank - and be able to view and control via a single IP.

I'm honestly trying to make do with the hardware I have - a single Raspberry Pi B+, and I'm having troubles just doing that.

EDIT -
In regards to my post above, It seems the source code in the git repo has been changed since the compilation instructions were written.
The git repo needs to be cloned into $GOPATH/src/github.com/reef-pi/reef-pi , NOT $GOPATH/src/github.com/ranjib/reef-pi
 
Last edited:
After giving it some thought, the GPIO/pwm hardware control is the most CPU intensive. The only benefit I can think of is if people need to control more than one "pool" - let's call it a tank - and be able to view and control via a single IP.

I'm honestly trying to make do with the hardware I have - a single Raspberry Pi B+, and I'm having troubles just doing that.
Let us know where you are stuck at, and we can lend a hand. B+ should be ok, i think pi-zero debian will work as it is for B+ (since both of them are ARM6) . I used to see issues with wifi drop out. Dont run web browser or and desktop environment on the Pi, with only 512 MB ram, that makes thing very slow.
GPIO should not be the most cpu intensive work, since its offloaded to hardware, only minimal I/O is done at kernel/CPU level while writing things in sysfs. Same goes with PWM, reef-pi uses PCA9685 board, so all calculation is offloaded to those IC. Raspberry Pi's cpu is mostly used for running various threads (ATO, lighting cycle) and the http server that provides the API. If you plan to hook up display, then that will be the single biggest cpu consumer.
 
Let us know where you are stuck at, and we can lend a hand. B+ should be ok, i think pi-zero debian will work as it is for B+ (since both of them are ARM6) . I used to see issues with wifi drop out. Dont run web browser or and desktop environment on the Pi, with only 512 MB ram, that makes thing very slow.

Like all my other servers, I'm running a bare install, no GUI. Only SSH and reef-pi's webserver will be running.
I wasn't able to get reef-pi running using either precompiled pi3 or pizero builds, but I was able to compile from git myself.

At the moment, reef-pi runs, and says "listening on localhost:8080". I've modified the test configuration to listen on 0.0.0.0:8080, however the builtin webserver is still only listing on localhost.

I've already modified the "address", and both "interface" options to reflect the ethernet ports listed using ifconfig.
My current config:
Code:
---
database: "reef-pi.db"
address: 0.0.0.0:8080
system:
  enable: true
  interface: enxb827ebf47fe0
  display: false
  dev_mode: true
  name: controller
equipments:
  enable: true
  dev_mode: true
  outlets:
    AC1:
      pin: 12
    AC2:
      pin: 13
lighting:
  enable: true
  dev_mode: true
  jacks:
    SingleChannel:
      pins:
        - 24
    DoubleChannel:
      pins:
        - 21
        - 23
camera:
  enable: true
timers:
  enable: true
ato:
  enable: false
  dev_mode: true
  sensor: 12
  check_interval: 5
  control: true
  pump: 16
temperature:
  enable: true
  min: 77
  max: 79
  check_interval: 60
  heater: 14
  cooler: 17
adafruitio:
  enable: false
  token: xxx
  user: xxx
  feed: temperature
enable_gpio: true
enable_pwm: true
database: "reef-pi.db"
api:
enable_auth: false
auth:
  id: 35adsjfaksjfdhks5eun435b.apps.googleusercontent.com
  secret: adqwieuqiwue
  callback_url: http://localhost:8088/auth/callback/google
  domain: example.com
  users:
    - foobar
  gomni_auth_secret: sadfhsadfkh238asdf
image_directory: /var/lib/reef-pi/images
interface: enxb827ebf47fe0
display: false
 
Right there with you. Really important to get the build guides fleshed out. When i start loading my pi, I will take step by step notes and then submit them on github. Do you remember the steps you went through
 
Right there with you. Really important to get the build guides fleshed out. When i start loading my pi, I will take step by step notes and then submit them on github. Do you remember the steps you went through

I pretty much documented any issue I ran into on the thread. I can't even believe how many posts ago that was now.

Once you have your pi, I feel you will find it very easy to get up and running.

Just ask questions when needed. Ranjib walked me through any issue I couldn't figure out on my own.[emoji3]
 
I pretty much documented any issue I ran into on the thread. I can't even believe how many posts ago that was now.

Once you have your pi, I feel you will find it very easy to get up and running.

Just ask questions when needed. Ranjib walked me through any issue I couldn't figure out on my own.[emoji3]

I have my pi but don't have my ttl to usb cable...stuck like chuck until I get that... I may be wrong but my feeling is that we can make the install guides good enough that Ranjib won't have answer too many questions...so far Mr robot used a pi b and I think someone used a pi zero...maybe brad... if we can get all that info in the install guides it will help others and free up Ranjib to code....just my opinion though
 
Like all my other servers, I'm running a bare install, no GUI. Only SSH and reef-pi's webserver will be running.
I wasn't able to get reef-pi running using either precompiled pi3 or pizero builds, but I was able to compile from git myself.

At the moment, reef-pi runs, and says "listening on localhost:8080". I've modified the test configuration to listen on 0.0.0.0:8080, however the builtin webserver is still only listing on localhost.

I've already modified the "address", and both "interface" options to reflect the ethernet ports listed using ifconfig.
My current config:
Code:
---
database: "reef-pi.db"
address: 0.0.0.0:8080
system:
  enable: true
  interface: enxb827ebf47fe0
  display: false
  dev_mode: true
  name: controller
equipments:
  enable: true
  dev_mode: true
  outlets:
    AC1:
      pin: 12
    AC2:
      pin: 13
lighting:
  enable: true
  dev_mode: true
  jacks:
    SingleChannel:
      pins:
        - 24
    DoubleChannel:
      pins:
        - 21
        - 23
camera:
  enable: true
timers:
  enable: true
ato:
  enable: false
  dev_mode: true
  sensor: 12
  check_interval: 5
  control: true
  pump: 16
temperature:
  enable: true
  min: 77
  max: 79
  check_interval: 60
  heater: 14
  cooler: 17
adafruitio:
  enable: false
  token: xxx
  user: xxx
  feed: temperature
enable_gpio: true
enable_pwm: true
database: "reef-pi.db"
api:
enable_auth: false
auth:
  id: 35adsjfaksjfdhks5eun435b.apps.googleusercontent.com
  secret: adqwieuqiwue
  callback_url: http://localhost:8088/auth/callback/google
  domain: example.com
  users:
    - foobar
  gomni_auth_secret: sadfhsadfkh238asdf
image_directory: /var/lib/reef-pi/images
interface: enxb827ebf47fe0
display: false
did you restart reef-pi service? Can you share the log `journalctl -u reef-pi.service`
 
@Cary, this is where I get overwhelmed![emoji15]
You wont be , ... sooner, this whole configuration bits gonna get whole lotta easier. All of it will be configurable via ui (so no more, service restart using command line and no more file editing), also most of the configuration values will have sane default (like this one has almost unusable value)
 
did you restart reef-pi service? Can you share the log `journalctl -u reef-pi.service`

Yes, after every change to the config, the reef-pi service was restarted.

Code:
pi@raspberrypi:/etc/reef-pi $ journalctl -u reef-pi.service
-- Logs begin at Wed 2017-08-23 19:26:19 UTC, end at Wed 2017-08-23 23:39:44 UTC. --
Aug 23 23:36:55 raspberrypi systemd[1]: Started raspberry pi based reef tank controller.
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 DB: reef-pi.db
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 Initializing DB for temperature bucket
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 Successfully started subsystem: temperature
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 Starting temperature controller
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 Successfully started subsystem: lightings
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 Initializing DB for timers bucket
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 Starting lighting cycle
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 Successfully started subsystem: timers
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 Successfully started subsystem: camera
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 Initializing DB for system bucket
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 Successfully started subsystem: system
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 Equipment sub-system: Running in dev mode, skipping gpio initializatio
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 Successfully started subsystem: equipments
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 Image directory:
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 Starting http server at: localhost:8080
Aug 23 23:36:56 raspberrypi reef-pi[15865]: 2017/08/23 23:36:56 reef-pi is up and running
 

IF YOU HAD TO TAKE A REEFING EXAM, WOULD YOU PASS?

  • 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