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

T-MIKE

Active Member
View Badges
Joined
Apr 4, 2019
Messages
152
Reaction score
84
Rating - 0%
0   0   0
@Ranjib

I did a search of old posts and installed gdrive cli client and motion(4.0-1) with apt. What else do I need to do make live streaming and gdrive upload work? I don't see the files on gdrive and it is still only showing the last photo taken. Thank you! Good work here!

Edit:
Actually going back and reading the posts again I don't think reef-pi works with motion yet. What else do I need to do to get gdrive to work?
 
Last edited:
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

I did a search of old posts and installed gdrive cli client and motion(4.0-1) with apt. What else do I need to do make live streaming and gdrive upload work? I don't see the files on gdrive and it is still only showing the last photo taken. Thank you! Good work here!

Edit:
Actually going back and reading the posts again I don't think reef-pi works with motion yet. What else do I need to do to get gdrive to work?
have you configured the gdrive cli with your google credentials? reef-pi will log the errors , you can check it for pointers (more on the troubleshooting guide). reef-pi just embeds the video component which can be provided by motion. I use it sporadically as and when im going out of home. Camera and video operations significantly reduces Pi's performance, for my zero based builds I run them headless and with no camera/video.
I do want to better motion (optical image analysis in general) gears in reef-pi, but thats not something of a priority in near future.
 

T-MIKE

Active Member
View Badges
Joined
Apr 4, 2019
Messages
152
Reaction score
84
Rating - 0%
0   0   0
have you configured the gdrive cli with your google credentials? reef-pi will log the errors , you can check it for pointers (more on the troubleshooting guide). reef-pi just embeds the video component which can be provided by motion. I use it sporadically as and when im going out of home. Camera and video operations significantly reduces Pi's performance, for my zero based builds I run them headless and with no camera/video.
I do want to better motion (optical image analysis in general) gears in reef-pi, but thats not something of a priority in near future.

I got the log and the PWM lighting control does not appear to be working as well. What should I do?

As for the gdrive, it looks like it's using the command "drive push" but that's not documented on the gdrive github. I downloaded gdrive-linux-rpi and ran "gdrive-linux-rpi about" and it is connected to my account at the moment. This is the CLI I'm using that was mentioned in previous posts: https://github.com/gdrive-org/gdrive

I understand that motion uses a lot of resources but I would like to get it working for now. I installed motion with apt-get. Do I need to build it from source?

I'm running reef-pi 2.3 on Raspberry Pi Zero W with Raspbian.

Code:
May 21 09:02:21 reefpi reef-pi[235]: 2019/05/21 09:02:21 Camera subsystem: Image captured: /var/lib/reef-pi/images/09-02-01-Tue-May-21-2019.png
May 21 09:02:31 reefpi reef-pi[235]: 2019/05/21 09:02:31 ERROR: Failed to upload image. Command: drive push -quiet -destination reef-pi-images -files /var/lib/reef-pi/images/09-02-01-Tue-May-21-2019.png Error: exec: "drive": executable file not found in $PATH
May 21 09:02:31 reefpi reef-pi[235]: 2019/05/21 09:02:31 lighting-subsystem: Setting PWM value: 50  at channel: 1
May 21 09:02:31 reefpi reef-pi[235]: 2019/05/21 09:02:31 Setting pwm driver: rpi pin: 1 value: 50
May 21 09:02:31 reefpi reef-pi[235]: 2019/05/21 09:02:31 ERROR: lighting-subsystem: Failed to set pwm value. Error: write /sys/class/pwm/pwmchip0/pwm1/duty_cycle: invalid argument
May 21 09:02:31 reefpi reef-pi[235]: 2019/05/21 09:02:31 lighting-subsystem: Setting PWM value: 50  at channel: 0
May 21 09:02:31 reefpi reef-pi[235]: 2019/05/21 09:02:31 Setting pwm driver: rpi pin: 0 value: 50
May 21 09:02:31 reefpi reef-pi[235]: 2019/05/21 09:02:31 ERROR: lighting-subsystem: Failed to set pwm value. Error: write /sys/class/pwm/pwmchip0/pwm0/duty_cycle: invalid argument
 
Last edited:

T-MIKE

Active Member
View Badges
Joined
Apr 4, 2019
Messages
152
Reaction score
84
Rating - 0%
0   0   0
I tried updating the jack for the pwm light control and got this message, "{"error":"Failed to update. Error: write /sys/class/pwm/pwmchip0/pwm0/period: invalid argument"} | HTTP 500".

I think I had this same problem when I first installed reef-pi and I deleted the database to start over and didn't get the message the 2nd time but now it's showing up again.

EDIT:
Deleting database and starting over again.

EDIT 2:
Deleted database but still get same error when setting up jack. I selected rpi and tried to use pins "0,1".

EDIT:
Deleted database and re-installed with "sudo dpkg -i reef-pi-2.3-pi0.deb", same error. If I use pca9685 with "0,1" then I get no error.
 
Last edited:

Zippyfear

Community Member
View Badges
Joined
Apr 30, 2019
Messages
86
Reaction score
150
Rating - 0%
0   0   0
I'd like to deploy at least 2 cameras, one on the tank, and one under for the sump. what inexpensive cameras is everyone using, or looking at using?
 

T-MIKE

Active Member
View Badges
Joined
Apr 4, 2019
Messages
152
Reaction score
84
Rating - 0%
0   0   0
I'd like to deploy at least 2 cameras, one on the tank, and one under for the sump. what inexpensive cameras is everyone using, or looking at using?

I'm currently using Yi Home webcams, I got a pack of 4 or five for $75 on Amazon. Not sure if they still have that deal.
 
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

DirtDiggler2823

If I can't break it, it doesn't exist
View Badges
Joined
Jul 31, 2018
Messages
1,667
Reaction score
2,075
Location
Gambrills
Rating - 0%
0   0   0
I calibrated against tank water directly , you can try ph 4, and 7 or 7 and 10. Any two known sample at the same temperature as your tank
Ok. I'll need the commands for calibration as well since I don't believe its built into the UI that works with the pico boards.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
I tried updating the jack for the pwm light control and got this message, "{"error":"Failed to update. Error: write /sys/class/pwm/pwmchip0/pwm0/period: invalid argument"} | HTTP 500".

I think I had this same problem when I first installed reef-pi and I deleted the database to start over and didn't get the message the 2nd time but now it's showing up again.

EDIT:
Deleting database and starting over again.

EDIT 2:
Deleted database but still get same error when setting up jack. I selected rpi and tried to use pins "0,1".

EDIT:
Deleted database and re-installed with "sudo dpkg -i reef-pi-2.3-pi0.deb", same error. If I use pca9685 with "0,1" then I get no error.
If you are using the raspberry pi pins then install reef pi 2.2, if using the pca9685 use 2.3.

There was a frequency issue fixed for the pca9685 in 2.3 but the consensus is it broke the rasp pi pwm.
 

T-MIKE

Active Member
View Badges
Joined
Apr 4, 2019
Messages
152
Reaction score
84
Rating - 0%
0   0   0
If you are using the raspberry pi pins then install reef pi 2.2, if using the pca9685 use 2.3.

There was a frequency issue fixed for the pca9685 in 2.3 but the consensus is it broke the rasp pi pwm.

Ah thanks! I did not see that post. By the way, do you know if the frequency on the UI is in Hz or kHz?
 

T-MIKE

Active Member
View Badges
Joined
Apr 4, 2019
Messages
152
Reaction score
84
Rating - 0%
0   0   0
The light arrived today and it is actually PWM controlled so it will work much easier with reef-pi. The PWM signal is generated by a NE555 chip.

The WiFi version is $40 more which I think is worth the money but I already got it so will be using reef-pi with it.

8BB3E8E7-30A8-405C-A33F-24AAD7A38CFC.jpeg
1A591EDA-11EA-436A-BE37-ABDCDE8DA621.jpeg
 
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
Ok. I'll need the commands for calibration as well since I don't believe its built into the UI that works with the pico boards.
Sure. Here is the rundown of calibration:
1) Setup the ph probe by creating a new driver in configuration -> drivers, specify ph-board as type and number of channels 0, i2c address 64. Create an analog input under Configuration -> connectors and associate the new driver, pin 0 with it. Create a new ph monitor and associate the analog input with it. Enable it. At this point you'll start seeing ph readings, usually in the range of -8K.
2) Keep your probe in reference solution(s) and note down the reading. Create a file named calibration.json with observed and expected values. For me it was like this:
Code:
[
 {"expected":8.21, "observed": -8768},
 {"expected":8.12, "observed": -8189}
]
Note: i used my tanks water (i.e. probe hooked up to tank) and hanna ph checker for my calibration. All we need is one or two set of points each specifying expected vs observed value
3) Disable the probe. Apply calibration using api. Since reef-pi uses cookie for session based authentication, first we'll signin and save the cookie via api, and then use the cookie to make calibration api request with the json file
Code:
curl -c cookie.txt -X POST -d '{"user":"reef-pi","password":"reef-pi"}' http://<IP>/auth/signin
curl -b cookie.txt -X POST -d @calibration.json http://<IP>/api/phprobes/1/calibrate
4) Enable the ph monitor via ui

you'll need a build from master. You know how to do that? or want me to publish one?
 

DirtDiggler2823

If I can't break it, it doesn't exist
View Badges
Joined
Jul 31, 2018
Messages
1,667
Reaction score
2,075
Location
Gambrills
Rating - 0%
0   0   0
Sure. Here is the rundown of calibration:
1) Setup the ph probe by creating a new driver in configuration -> drivers, specify ph-board as type and number of channels 0, i2c address 64. Create an analog input under Configuration -> connectors and associate the new driver, pin 0 with it. Create a new ph monitor and associate the analog input with it. Enable it. At this point you'll start seeing ph readings, usually in the range of -8K.
2) Keep your probe in reference solution(s) and note down the reading. Create a file named calibration.json with observed and expected values. For me it was like this:
Code:
[
 {"expected":8.21, "observed": -8768},
 {"expected":8.12, "observed": -8189}
]
Note: i used my tanks water (i.e. probe hooked up to tank) and hanna ph checker for my calibration. All we need is one or two set of points each specifying expected vs observed value
3) Disable the probe. Apply calibration using api. Since reef-pi uses cookie for session based authentication, first we'll signin and save the cookie via api, and then use the cookie to make calibration api request with the json file
Code:
curl -c cookie.txt -X POST -d '{"user":"reef-pi","password":"reef-pi"}' http://<IP>/auth/signin
curl -b cookie.txt -X POST -d @calibration.json http://<IP>/api/phprobes/1/calibrate
4) Enable the ph monitor via ui

you'll need a build from master. You know how to do that? or want me to publish one?
We may need to pursue that. I probably won't be the only pico board user who needs help with this. Going to purchase calibration solution and a probe now.
 
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
We may need to pursue that. I probably won't be the only pico board user who needs help with this. Going to purchase calibration solution and a probe now.
you are using pico board? My instruction was for ph board.
I'll update the pico board thread with ph probe specific instruction, we can cross post here :-)
 

DirtDiggler2823

If I can't break it, it doesn't exist
View Badges
Joined
Jul 31, 2018
Messages
1,667
Reaction score
2,075
Location
Gambrills
Rating - 0%
0   0   0
you are using pico board? My instruction was for ph board.
I'll update the pico board thread with ph probe specific instruction, we can cross post here :-)
Super. Yes, I'm using a pico board, and I have the board with the updated driver on it.
 

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 27.3%
  • 100% dry rock + 100% live sand

    Votes: 47 33.8%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 30 21.6%
  • 75% live rock, 25% live sand

    Votes: 14 10.1%
  • 25% live rock, 75% live sand

    Votes: 10 7.2%
Back
Top