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

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,519
Reaction score
1,508
Rating - 0%
0   0   0
I have an issue with the mobile site. If i go to the temperature submenu, and expand the menu for a sensor, the expansion works, but after a second or so, i get Something went wrong, TypeError: t is undefined.

Graphs in dashboard work fine, and if i request desktop site instead of mobile i dont have the issue.

If i create a new sensor, and immediately expand the menu, the problem doesn't occur, but if i close it and open it again, then it does. My guess is that it has something to do with the graph rendering in the submenu, although the graphs in dashboard work fine, maybe duplicate code that wasn't updated?
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
I think it's the full desktop - I had installed the newest version of lite and was having a ton of issues - found a post saying newest version was causing all sorts of issues with reef-pi, so downgraded.

Running headless - so maybe that's it.

Used version @robsworld78 (I think it's him ) suggested in here:

The issue I was referring to for the Pi 4 has been fixed in reef-pi 3.5 but it wasn't related to what you're experiencing. My reference to running the desktop version was based on that issue. Just before Ranjib fixed the Pi 4 bug Raspberry Pi had rolled the troublesome update into the main image so you had to directly download an old image file, I couldn't find one for the lite version so the desktop version had to be used. I always assume the lite version is the better way to go as there's less to go wrong in the OS but I don't think it really matters as plenty use the desktop version.

I haven't come across this yet, maybe it's a faulty SD card that causing it, if you have another try it. If you're running wifi maybe try an Ethernet cable or vice versa. I'll see if I can find anything on this.
 

92Miata

Valuable Member
View Badges
Joined
Feb 26, 2020
Messages
1,523
Reaction score
2,485
Location
Richmond, VA
Rating - 0%
0   0   0
The issue I was referring to for the Pi 4 has been fixed in reef-pi 3.5 but it wasn't related to what you're experiencing. My reference to running the desktop version was based on that issue. Just before Ranjib fixed the Pi 4 bug Raspberry Pi had rolled the troublesome update into the main image so you had to directly download an old image file, I couldn't find one for the lite version so the desktop version had to be used. I always assume the lite version is the better way to go as there's less to go wrong in the OS but I don't think it really matters as plenty use the desktop version.

I haven't come across this yet, maybe it's a faulty SD card that causing it, if you have another try it. If you're running wifi maybe try an Ethernet cable or vice versa. I'll see if I can find anything on this.
The original issue I was having was similar to what he was having - basically it couldn't connect to the pH probe. Similar error messages. As soon as I went to Buster it could read and calibrate just fine.

If there's any way to save off/restore the calibration data for the probe, I could probably load lite and see what happens.
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
The original issue I was having was similar to what he was having - basically it couldn't connect to the pH probe. Similar error messages. As soon as I went to Buster it could read and calibrate just fine.

I think this is something different. I did a quick search and see lots of connection issues for various reasons, one common was wifi issues. If you use wifi I would try a hard wire connection and if you have an extra SD card maybe load the Raspberry Pi OS as it won't be a problem now.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
Wait you can use a pi to co troll your tank hmmm I'm gunna have to look into this iv got 2 sitting around from the 3d printers I used to have(got a better one and scavenged the parts I used to build it)
Yes, you can monitor and or control temps, ph, lights, dosers, ato and other equipment. There are ready made boards to help with a build or if you prefer, you can roll your own following the adafruit guides.

Read a few reef-pi build threads to see what others have done. Decide what you want to do with your controller. Start a build thread of your own and if you get stuck there is plenty of help on the boards.
 

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
Is it possible to trigger a macro from an external input or sensor value?

I note that it's possible to create a simple driver using a text file to read an input into the system, but is it possible to use this in an if-this-then-that type of scenario. Or even do the same from an input from the GPIO.

I have a built in switch on the case I'm using and I'm thinking of using it to trigger things like feeding mode. So when the switch is pressed it can trigger a 'feed' macro or start a timer that calls a feed macro.

The macro would turn my power heads off, reduce return pump flow (more on that later), turn my roll filter off and optionally other stuff.

TIA

/DM

It should be possible using an ATO. A momentary switch is set up as an Input should be able to trigger a Macro. When I last played with that, I could not get an input on an ATO to trigger a Macro in any way. But it should be possible as the options are built in.
 

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
79
Reaction score
70
Location
Parma, Italy
Rating - 0%
0   0   0
You don’t need the upper function or threshold , since you don’t have anything that can bring down ph. Set lower threshold to 6.7 with hysteresis .1 and that will tell reef-pi to turn on the solenoid when the ph goes below 6.6 (6.7-.1) . Reef-pi will automatically turn off the solenoid when Ph goes above 6.8 (6.7+.1) .

Does that make sense ?


On a separate note, ph chasing via direct dosing is risky. I feel it’s safer to just do periodic dosing and slowly adjust the quantity to attain an expected value.

Make sense, but i can't save the parameters witout set the upper threshold and hysteresis is always zero. So a set upper threshold to 10

I don't want ph chasing, but to block te co2 just in case the ph reach 6.5 to avoid disasters
 

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
79
Reaction score
70
Location
Parma, Italy
Rating - 0%
0   0   0
I have another little problem, I'd bought a simple relay board, like this 8 relay, one of this relay turn on my freshwater led light, like 6 light for 60W totals. But the relay is stuck in on position. So I changed every relay with Omron product and 16A contact (8 inductive) but I have the same problem, one relay is stuck in on position. I can see the little red led light turn on and off but not the relay.

any suggestion?
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
I have another little problem, I'd bought a simple relay board, like this 8 relay, one of this relay turn on my freshwater led light, like 6 light for 60W totals. But the relay is stuck in on position. So I changed every relay with Omron product and 16A contact (8 inductive) but I have the same problem, one relay is stuck in on position. I can see the little red led light turn on and off but not the relay.

any suggestion?
We need alot more info to help you.
How are you wiring the relay?
Are you using the uln2803 to switch the relay?
Are the grounds for all dc power supplies tied together?

The pi itself wont reliable switch a 5v relay so the uln2803 has to be used.

Show us some pics of how everything is wired amd im sure you will get good advice.
 

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
79
Reaction score
70
Location
Parma, Italy
Rating - 0%
0   0   0
We need alot more info to help you.
How are you wiring the relay?
the neutral is in common, the phase wire into the COM contact of every relay. I'm using a "star" connection, every single wires are tied together in one single point. I'm an electronic and electrician.

Are you using the uln2803 to switch the relay?
nope
Are the grounds for all dc power supplies tied together?
Yes, all ground of DC power supplies are in common

The pi itself wont reliable switch a 5v relay so the uln2803 has to be used.

Show us some pics of how everything is wired amd im sure you will get good advice.

I have bought a board with optocoupler, so the 3,3V and the 5V are optical isolated to each-other, le GND are in common.

wiring.jpg
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
the neutral is in common, the phase wire into the COM contact of every relay. I'm using a "star" connection, every single wires are tied together in one single point. I'm an electronic and electrician.


nope

Yes, all ground of DC power supplies are in common



I have bought a board with optocoupler, so the 3,3V and the 5V are optical isolated to each-other, le GND are in common.

wiring.jpg
Im workin today so keep in mind ill respond as I can.

First off, those relay boards require 15-20ma Per channel to switch on and off, the pi can source or sink 16ma per gpio pin and only a total of 50ma for the whole pi, which is why you need to use an uln2803. 8 relays x 20ma each is 160ma with all relays on.

The uln2803 is an 8 channel transistor chip. The pi turns on the 2803, which can handle the current of the relay board much better.

This leads me to another thing. Those relay boards work by supplying VCC to the opticals and each relay input is actually sinking current to ground to turn the opticals on.

Id suggest using a uln2803 between the pi and relay board. Roll your own on a breadboard, or get one of the fantastic hats with one built in.
 

sellereef

New Member
View Badges
Joined
Sep 28, 2020
Messages
4
Reaction score
2
Location
Grand Rapids
Rating - 0%
0   0   0
Has anyone setup reef-pi light controller for Mars Aqua? I am reading some things now that looks like I may need an additional converter to be able to use PWM?

Thank you!
 

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
79
Reaction score
70
Location
Parma, Italy
Rating - 0%
0   0   0
Im workin today so keep in mind ill respond as I can.

First off, those relay boards require 15-20ma Per channel to switch on and off, the pi can source or sink 16ma per gpio pin and only a total of 50ma for the whole pi, which is why you need to use an uln2803. 8 relays x 20ma each is 160ma with all relays on.

The uln2803 is an 8 channel transistor chip. The pi turns on the 2803, which can handle the current of the relay board much better.

This leads me to another thing. Those relay boards work by supplying VCC to the opticals and each relay input is actually sinking current to ground to turn the opticals on.

Id suggest using a uln2803 between the pi and relay board. Roll your own on a breadboard, or get one of the fantastic hats with one built in.

15-20 ma per channel? even if they have optocoupler on-board? ... ok ill'try the uln2803 .. i don't find the hat on amazon.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
15-20 ma per channel? even if they have optocoupler on-board? ... ok ill'try the uln2803 .. i don't find the hat on amazon.
Yes even with the octocouplers...there are several reef pi specific hats that have the uln onboard...wont find them on amazon.

@Michael Lane sells a nice goby hat on tindie
@robsworld78 sells nice hat type boards
@theatrus sells his pico board

Forgive me if i forgot anyone.

Anyways they make for a cleaner install and are big time savers.
 

Zippyfear

Community Member
View Badges
Joined
Apr 30, 2019
Messages
86
Reaction score
152
Rating - 0%
0   0   0
Yes even with the octocouplers...there are several reef pi specific hats that have the uln onboard...wont find them on amazon.

@Michael Lane sells a nice goby hat on tindie
@robsworld78 sells nice hat type boards
@theatrus sells his pico board

Forgive me if i forgot anyone.

Anyways they make for a cleaner install and are big time savers.

Also Brandon with Leviathan
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
1,950
Reaction score
3,351
Location
Sacramento, CA area
Rating - 0%
0   0   0
15-20 ma per channel? even if they have optocoupler on-board? ... ok ill'try the uln2803 .. i don't find the hat on amazon.

Optocouplers are.. an LED and a photo sensor potted together in a small box, so its quite normal. Usually the optocouplers can run down to about 5mA, it all depends on the part they specced.

To be honest I'm not sure why they add optocouplers to a relay board, unless they're scared of the quality of relay they provide. If you just power both sides of the optocoupler with the same supply there is no isolation or other gain.
 

92Miata

Valuable Member
View Badges
Joined
Feb 26, 2020
Messages
1,523
Reaction score
2,485
Location
Richmond, VA
Rating - 0%
0   0   0
I think this is something different. I did a quick search and see lots of connection issues for various reasons, one common was wifi issues. If you use wifi I would try a hard wire connection and if you have an extra SD card maybe load the Raspberry Pi OS as it won't be a problem now.


I did some digging through the syslogs and found a basic pattern - I'd stop seeing API requests, then about 5-10 minutes later it would log a carrier lost, and then unregister everything and reconnect - so I think the problem was that it was dropping off the wifi and not realizing it. I'm not sure if my crappy wifi router is dropping the connection, or if the pi is.


Anyways - I put a script in that basically scans for wifi networks every 2 minutes and then pings the router - and its been up for 12 hours now.


Got pH and temp logging and alerts set up. Knocked the temp probe out this morning and started getting text messages. They're false alarms, but cool to see.

Gonna give it a couple days and make sure it stays up - and if it does I'll start moving my less vital stuff onto it first.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
I did some digging through the syslogs and found a basic pattern - I'd stop seeing API requests, then about 5-10 minutes later it would log a carrier lost, and then unregister everything and reconnect - so I think the problem was that it was dropping off the wifi and not realizing it. I'm not sure if my crappy wifi router is dropping the connection, or if the pi is.


Anyways - I put a script in that basically scans for wifi networks every 2 minutes and then pings the router - and its been up for 12 hours now.


Got pH and temp logging and alerts set up. Knocked the temp probe out this morning and started getting text messages. They're false alarms, but cool to see.

Gonna give it a couple days and make sure it stays up - and if it does I'll start moving my less vital stuff onto it first.
I use a pi zero w, never had a wifi issue, but i have a good wifi router. I did make sure the pi was not in a metal enclosure which would block signal.

Is your stand , enclosure or the combo causimg wifi signal to the pi to be weak perhaps?
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
Optocouplers are.. an LED and a photo sensor potted together in a small box, so its quite normal. Usually the optocouplers can run down to about 5mA, it all depends on the part they specced.

To be honest I'm not sure why they add optocouplers to a relay board, unless they're scared of the quality of relay they provide. If you just power both sides of the optocoupler with the same supply there is no isolation or other gain.
The octocouplers on those boards let either a 3.3 or a 5 v signal turn on the octocoupler to let the relays work. Yes they could spec 5ma ones but i tested my boards which are the same board as the posters and they run 15-20ma.
The board has a jumper that determines if you run completely isolated or commonly grounded. People wiring things wrong were hosing their arduinos so i think that is the reasoning for isolation.

These boards are kind of a universal fit for arduinos and pi and general experimenting. The relays are the songle ones like in the american DJ power strip so not very robust.

That being said, even though i got a great ebay deal on a crapload of nice phoenix contact 24v mini relays with inductive protection and suppression with din rail sockets to go with them, that I was going to change out if my cheapy board failed. The cheapy relays have been working for 2 years running my heaters and return pump. Maybe its because I run most of the relays normally closed in case reef pi goes nuts. Reef pi has to energize the relays to turn them off so most of the time the relay coils are sitting not energized.
 
Last edited:

Fusion in reefing: How do you feel about grafted corals?

  • I strongly prefer grafted corals and I seek them out to put in my tank.

    Votes: 2 4.1%
  • I find grafted corals appealing and would be open to having them in my tank.

    Votes: 31 63.3%
  • I am indifferent about grafted corals and am not enthusiastic about having them in my tank.

    Votes: 11 22.4%
  • I have reservations about grafted corals and would generally avoid having them in my tank.

    Votes: 4 8.2%
  • I have a negative perception and would avoid having grafted corals in my tank.

    Votes: 1 2.0%
Back
Top