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

chipmunkofdoom2

Always Making Something
View Badges
Joined
Jun 6, 2017
Messages
2,417
Reaction score
4,505
Location
Baltimore, MD
Rating - 0%
0   0   0
You can but I am not sure on life expectancy. The PH and ORP probes are not super expensive, but all salinity probes seem to be outrageous.

I paired my pH chip with a generic Bulk Reef Supply probe. The whole package cost $144 USD. You could save a little cash by not getting the $46 USB adapter, but you'll need some sort of BNC connector still. Not terribly expensive, but not chump change either.

Cheaper ph probes will have low life span (6 months ) and not for continuous monitoring.
Last time I checked I found a 35$ probe that's OSHWA as well as for continuous use and have around 2 year lifespan. Whenever I start working on the ph stuff, I am likely to use that one

That sounds like a great buy, could you post a link to that probe?
 

denierlexiese

Active Member
View Badges
Joined
Jul 7, 2017
Messages
106
Reaction score
68
Rating - 0%
0   0   0
@Ranjib Purchased the temp probe, and 4.7k resistor. I downloaded your code into visual studio and eclipse. Eclipse my main java driver at work, and visual studio has color code for go. Do you recommend a preferred editor for go?

I tried to build the code yesterday with "Make build." What command is your daily execute command to build the updates while debugging ? It looks like I might also be having go version conflicts. Here's the version of go I downloaded from https://github.com/tgogos/rpi_golang .

~/reefPI/reef-pi $ go version
go version go1.4.3 linux/arm

What version of go do you use?

https://github.com/tgogos/rpi_golang

Thanks!!!
 
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
@Ranjib Purchased the temp probe, and 4.7k resistor. I downloaded your code into visual studio and eclipse. Eclipse my main java driver at work, and visual studio has color code for go. Do you recommend a preferred editor for go?

I tried to build the code yesterday with "Make build." What command is your daily execute command to build the updates while debugging ? It looks like I might also be having go version conflicts. Here's the version of go I downloaded from https://github.com/tgogos/rpi_golang .

~/reefPI/reef-pi $ go version
go version go1.4.3 linux/arm

What version of go do you use?

https://github.com/tgogos/rpi_golang

Thanks!!!
Awesome.
I use vi for go/C/python/ruby, and IntelliJ for java. Used to be an eclipse user for java earlier. As long as you are comfortable with the IDE, you should be fine, in fact I'd recommend sticking with the IDE/editor of your choice.
I use go 1.8.1. I'll recommend using the same.

I'd recommend looking at the travis (which reef pi uses for continuous integration) configuration for learning about the commands/steps to build reef-pi. In short, its
```
make go-get # to download all dependency
make test #to run tests
make bin # to build binary (same arch as the machine its being invoked on). make pi will make ARM7 binary (pi3), make pi-zero will make pi zero (ARM6) bianry
make deb # will make debian package that packs the binary + javascript/html (for the ui)
```

What are you using as your development machine? I use my macbook for developing reef-pi, so I dont need go installed on the pi itself. Download whatever latest version of go is available for rpi if you are using it as your development machine. Eclipse might be bit heavy/slow on pi.
 

denierlexiese

Active Member
View Badges
Joined
Jul 7, 2017
Messages
106
Reaction score
68
Rating - 0%
0   0   0
I can use linux mint to build it. It's my daily driver at home. I understand go is supposedly platform independent, I just figured building it on the closest architecture to what I would be running it on would be a good idea.

So on your mac book, you typically make it into a deb, and then install the deb? I suspect you can run the executable / web server off your mac book without any issues; it just doesn't see any sensors plugged in, but spins up correctly?
 
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 can use linux mint to build it. It's my daily driver at home. I understand go is supposedly platform independent, I just figured building it on the closest architecture to what I would be running it on would be a good idea.

So on your mac book, you typically make it into a deb, and then install the deb? I suspect you can run the executable / web server off your mac book without any issues; it just doesn't see any sensors plugged in, but spins up correctly?
Yup. Cross compiling in go is very straight forward, just set the environment variable GOARCH=arm and it go build will make arm binaries (check travis configuration for example).
All webserver and driver logic can be tested on mac, reef pi has a configuration setting named dev_mode ,when enabled, will use stubbed drivers
```
controller:
dev_mode: true
```
And you should be able to almost everything except the GPIO/PWM driver, you can still use the UI and execute logic that uses them
 
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 noticed my pico tanks water level in bank chamber drops significantly, making the temp probe exposed to air :-( .
Gives me more reason to work on the ATO I guess. I received the drfrobot probe yesterday, gonna work on integrating it this weekend.
Meanwhile the temperature controller code is almost done (controls heater/fan when temperature is out of range), but I didnt get enough time to work on the housing. Wood working requires my physical presence at home :-/ .

Temperature sensor is working as expected
Screen Shot 2017-07-14 at 10.31.17 AM.png
 

denierlexiese

Active Member
View Badges
Joined
Jul 7, 2017
Messages
106
Reaction score
68
Rating - 0%
0   0   0
I got the DS18B20 temperature probe working with an introductory python script, writing to my mysql database. It appears to be accurate within .5 of a degree of my neptune temp probe. Mounted it with the breadboard and raspberry pi to my wall next to my fish tank with wires exposed. Frustrated the temperature probe cord is only about 3ft. I wish it was more like 6 to 8 ft. Do yo have any good solutions for lengthening a cord?
 
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
That's awesome.
I usd stereo right angle plug to pigtail cable extension like this: https://www.adafruit.com/product/1700 , to extend the probe chords. It solves both the length and the jack issue. Remember to solder the joints and have a heat shrink wrapping around it , for more permenant and stable installation
 

denierlexiese

Active Member
View Badges
Joined
Jul 7, 2017
Messages
106
Reaction score
68
Rating - 0%
0   0   0
That's awesome.
I usd stereo right angle plug to pigtail cable extension like this: https://www.adafruit.com/product/1700 , to extend the probe chords. It solves both the length and the jack issue. Remember to solder the joints and have a heat shrink wrapping around it , for more permenant and stable installation

@Ranjib Perfect!!! What do yo mean it solved the jack issue? What did you use the jack for? Doesn't the 3 wires go into your breadboard?
 
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
@Ranjib Perfect!!! What do yo mean it solved the jack issue? What did you use the jack for? Doesn't the 3 wires go into your breadboard?

Once my electronics prototyping is done, I move it inside a housing or fixture. As of now, most of them are wooden, but I intend to use something 3d printed later. Probes, and other devices are connected to the housing via some type of connector. Example will be 3.5 mm stereo jacks (for kessil) or bnc probes, rj45 (lan cable) etc. You need the probes/devices to have the male counterpart of the connector to hookup with the housing.
In your case since the probe is 3 wire, a 3.5 mm audio jack is perfect. I am assuming you will have a housing at some point, if thats not the case, and plan to use breadboard, then this is not required.

Makes sense?
 
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

denierlexiese

Active Member
View Badges
Joined
Jul 7, 2017
Messages
106
Reaction score
68
Rating - 0%
0   0   0
@Ranjib I'm trying to get the reef-pi system up on an ubuntu machine. I got go version 1.8.1 downloaded and installed. I compiled and ran a helloWorld example. I got your make got-get working by setting GOPATH to the directory I git clone reefPI into. Then when I try to run "make test" i get the following errors:

cannot find package "github.com/ranjib/reef-pi/auth" in any of:
api/api.go:6:2: cannot find package "github.com/ranjib/reef-pi/controller" in any of:
api/lighting.go:4:2: cannot find package "github.com/ranjib/reef-pi/controller/lighting" in any of:

It's seems to be looking for the compiled version of your reef pi raw go files but can't find them. It wants these files because they are listed as import statements in you code. Can "go" work off of source files, or do I need to compile all the go code in your application first before running your "make test" command?

Thanks!!
 
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
@Ranjib I'm trying to get the reef-pi system up on an ubuntu machine. I got go version 1.8.1 downloaded and installed. I compiled and ran a helloWorld example. I got your make got-get working by setting GOPATH to the directory I git clone reefPI into. Then when I try to run "make test" i get the following errors:

cannot find package "github.com/ranjib/reef-pi/auth" in any of:
api/api.go:6:2: cannot find package "github.com/ranjib/reef-pi/controller" in any of:
api/lighting.go:4:2: cannot find package "github.com/ranjib/reef-pi/controller/lighting" in any of:

It's seems to be looking for the compiled version of your reef pi raw go files but can't find them. It wants these files because they are listed as import statements in you code. Can "go" work off of source files, or do I need to compile all the go code in your application first before running your "make test" command?

Thanks!!
You have to keep the repo at $GOPATH/src/github.com/ranjib/reef-pi location.
```
mkdir -p $GOPATH/src/github.com/ranjib
cd $GOPATH/src/github.com/ranjib
git clone https://github.com/ranjib/reef-pi.git .
cd reef-pi
```

I can make it simpler, by integrating a dependency management tool like glide, but I am waiting for something more stable, and from go core team.
 

denierlexiese

Active Member
View Badges
Joined
Jul 7, 2017
Messages
106
Reaction score
68
Rating - 0%
0   0   0
@Ranjib I got reef pi serving json and a basic hello.html I created for testing. I must have some path setting incorrect because i had to call go get manually for all dependencies, instead of make go get. Although looking at it now I don't see where the extra dependencies downloaded to when I called make go get...

Anyways I'm able to serve home.html, however the system can't find ui.js . Inspecting the code it looks like ui.js comes from ui.jsx via the webpack file. How do I build the jsx portions of the system?

Also I had to update server.go with the full path for the the home.html . I'm not sure what relative path it's getting. I'm running reef-pi from the bin directory under the long path src/github.com/ranjib/reef-pi/bin, maybe that has something to do with the relative path problem. No big deal to set the static path for now. I can serve all the json paths like /api/info.

Oh, and I downloaded goClipse plugin for eclipse. Makes go color highlighting in eclipse work so reading go code is a lot easier.

Thanks!!!
 
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
Got my Sparkfun DS18B20. Any chance of releasing a new version of reef-pi with the probe integration? https://github.com/ranjib/reef-pi/releases :)
I have to cut a release, I already got this probe code in master.

BTW I got dfrobot's water level kit working with reef pi, this working. That code it in master as well. I think its time for a new release.
I won'tt have UI though, also the code for these new things might need more tuning..
Let me run a few checks, I 'll do a release in couple of hours.
 
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
@Ranjib I got reef pi serving json and a basic hello.html I created for testing. I must have some path setting incorrect because i had to call go get manually for all dependencies, instead of make go get. Although looking at it now I don't see where the extra dependencies downloaded to when I called make go get...

Anyways I'm able to serve home.html, however the system can't find ui.js . Inspecting the code it looks like ui.js comes from ui.jsx via the webpack file. How do I build the jsx portions of the system?

Also I had to update server.go with the full path for the the home.html . I'm not sure what relative path it's getting. I'm running reef-pi from the bin directory under the long path src/github.com/ranjib/reef-pi/bin, maybe that has something to do with the relative path problem. No big deal to set the static path for now. I can serve all the json paths like /api/info.

Oh, and I downloaded goClipse plugin for eclipse. Makes go color highlighting in eclipse work so reading go code is a lot easier.

Thanks!!!
I am sorry for the setup pain. I should have done a better job in documenting this process.
You'll need nodejs setup for developing the UI/UX parts. Here are the steps. Everything assumes your current working directory is reef-pi 's repo i.e $GOPATH/src/github.com/ranjib/reef-pi

- Grab latest nodejs and npm (use google to find your OS specific infrastructure),
-then run npm install which will bring webpack.
- Then run /node_modules/.bin/webpack -d.
- This should generate the ui.js file.
Other than the reef-pi binary and ui.js files, you will also need an example configuration file. Copy build/reef-pi.yml and save it as dev-reef-pi.yml, with dev_mode: true in it (if you are developing without the electronics, like I do in mac book)
 
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
Ok, I just cut 0.0.7 release.
https://github.com/ranjib/reef-pi/releases/tag/0.0.7

This release has both temperature controller and ATO controller code. Following things are tested:
- Temperature sensor is tested on pi zero and pi 3. You can checkout my adafruit.io chart for reference.
- Temperature controller code, which switch on /off cooler (such as fan or chiller or a custom peltier setup) and heater is bread board tested, but not tested in an actual tank. I am still working on the housing (also I want just the sensor data for a few weeks for reference, to ensure controller is working as expected)
- ATO sensor code is also tested on breadboard. I am yet to build the housing for this as well, and then tank based testing will come.
Both ATO and temperature sensor/controller is config driven. I am yet to build the UI for them
Check out the build/reef-pi.yml for configuration details.
 
Back
Top