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

Dave's Reef

Active Member
View Badges
Joined
Nov 4, 2018
Messages
102
Reaction score
148
Rating - 0%
0   0   0
Just found this, it says network-online.target will time out after 90 seconds so it looks like I was fretting for nothing.

So how I do I make mine do this cause now it looks for the kasa right away and ofcourse the pi has no network so it doesn't see it and I need to reboot?.
Sorry I'm a little slow on how all this works
Thanks
 

robsworld78

Valuable Member
View Badges
Joined
Feb 14, 2020
Messages
1,029
Reaction score
1,293
Location
Edmonton, Canada
Rating - 0%
0   0   0
So how I do I make mine do this cause now it looks for the kasa right away and ofcourse the pi has no network so it doesn't see it and I need to reboot?.
Sorry I'm a little slow on how all this works
Thanks
You have to edit the service file from the SSH terminal. Do the following.
  • Run the command sudo nano /lib/systemd/system/reef-pi.service to edit the file
  • At the bottom add the following two lines.
    • After=network-online.target
      Wants=network-online.target
  • Press CTRL + S to save
  • Press CTRL + X to exit
  • Run the command sudo reboot to reboot
Hopefully that works.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
You have to edit the service file from the SSH terminal. Do the following.
  • Run the command sudo nano /lib/systemd/system/reef-pi.service to edit the file
  • At the bottom add the following two lines.
    • After=network-online.target
      Wants=network-online.target
  • Press CTRL + S to save
  • Press CTRL + X to exit
  • Run the command sudo reboot to reboot
Hopefully that works.
Eh I prefer vi but nano will work ;)

I would add those to command at the end of the unit section and not at the bottom. Here is what the file looks like now:

Code:
[Unit]
Description=raspberry pi based reef tank controller

[Service]
ExecStart=/usr/bin/reef-pi daemon -config /etc/reef-pi/config.yaml
WorkingDirectory=/var/lib/reef-pi
Restart=always
RestartSec=90
StartLimitInterval=400
StartLimitBurst=10

[Install]
WantedBy=multi-user.target

How I think you want it to look like:
Code:
[Unit]
Description=raspberry pi based reef tank controller
After=network-online.target
Wants=network-online.target

[Service]
ExecStart=/usr/bin/reef-pi daemon -config /etc/reef-pi/config.yaml
WorkingDirectory=/var/lib/reef-pi
Restart=always
RestartSec=90
StartLimitInterval=400
StartLimitBurst=10


[Install]
WantedBy=multi-user.target

You don't have to reboot just do this command and you will be good...

Code:
sudo systemctl daemon-reload
 
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
Working on this new version of float switch mount for ato . I have to readjust the old one for hight and width , for each of the tanks. This time I also added some pass through shapes for the water line. I have noticed they get wonky when not fixed properly , and the turning point develop kinks . Hopefully this will address it .

side view

E163604C-55E4-43A2-B193-0E7CA44C554D.jpeg

top view
5D08B5A3-54D6-4408-AA85-7BD57D72CA18.jpeg


3D design file: https://www.thingiverse.com/thing:5316107
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
.
Working on this new version of float switch mount for ato . I have to readjust the old one for hight and width , for each of the tanks. This time I also added some pass through shapes for the water line. I have noticed they get wonky when not fixed properly , and the turning point develop kinks . Hopefully this will address it .

side view

E163604C-55E4-43A2-B193-0E7CA44C554D.jpeg

top view
5D08B5A3-54D6-4408-AA85-7BD57D72CA18.jpeg


3D design file: https://www.thingiverse.com/thing:5316107
Yeah, I've not been happy with mine either, I need something more adjustable but thanks for sharing always looking for something new.
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Working on this new version of float switch mount for ato . I have to readjust the old one for hight and width , for each of the tanks. This time I also added some pass through shapes for the water line. I have noticed they get wonky when not fixed properly , and the turning point develop kinks . Hopefully this will address it .

side view

E163604C-55E4-43A2-B193-0E7CA44C554D.jpeg

top view
5D08B5A3-54D6-4408-AA85-7BD57D72CA18.jpeg


3D design file: https://www.thingiverse.com/thing:5316107


I would have a 3d printer if I could figure out how to make things with a 3d Cad program... That stuff baffles me.
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Im making pretty good progress with porting some of the functions over to Arduino, specifically ESP32 hardware.

I have a little work yet to do on building the json commands to send to the kaza api, but it's moving along. It would go a bit faster if I actually had a clue what I was doing with C/C++.

I was actually thinking of just using one ESP32 or ESP8266 for each function. Yes, the hardware cost can creep that way, however, if only doing one or two temp sensors and one or two lights, it should be pretty manageable.

As for UI, right now it'll be minimal to nonexistent. Everything for now will be configured prior to uploading to the device and output will be done thru a prometheus metrics export. I've gotten pretty good with that in the last few weeks. I have all sort of things in my house spitting out metrics to prometheus.
This may not sound that exciting to most (especially my Spousal Equivalent), but I have a KP303 on my desk with one outlet being repeatedly turned on and off by an ESP32. Turning on / off a single outlet Kaza device is not trivial, adding the 2 extra outlets on a strip increases the complexity. Having to identify the target relay with only knowing the ip address of the power strip is a task. (Im sure @Ranjib can relate) I was able to (with some help from Stack Overflow) make a function to encrypt the json string to send to the Kaza device..

I just need to integrate a temp sensor and the logic to monitor it and use what I have built here on my desk now to turn the thing on and off when the temps are outside the set parameter.

My test board is this Adafruit ESP32-S2 TFT Feather (https://www.adafruit.com/product/5300). I plan to use the TFT on it to display the current temp and status of the heater. Thinking just display the temp nice and large with 2 decimal places and color the background either green for not heating or red for heating. And since the ds18b20 is supported by ardiuno, should be a robust little temp controller.

1647339224993.png
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
I don't disagree but we are left with drivers that says they are supported yet on a reboot or power outage are not fully functional. I don't believe that is a good option either. Honestly I think the users that are using a reef-pi in stand alone mode with no network to be more of a minority than those using it with a network. IMHO it would be better to support the majority and have the stand alone users update the systemd file. As it is now reef-pi states that they support Kasa devices with drivers available but they are not fully supported as it is today and depending on what the user has off of the kasa strips will not be reachable until they logon and do a reload.

@Ranjib I guess I am the only one that sees this as an issue, I was hoping that there would be a solution that could be done after a reboot/power loss. I know we have to do a reload but is there anything else besides restarting reef-pi service that will get the Kasa strips working?

If this is the case and it remains I think somewhere it needs to be stated and maybe it is, that integration with the Kasa strips require this workaround. Maybe when you select the driver have some words printed in the default configuration screen that warns the user.

Just my .02... :)
This is why a long while ago i was very adamant, maybe even rudely so, about wanting hardwired outlets and no wifi smart devices. I actually ran rather often into the situation where the network/router wasn't up.

And in that case, or if the pis network chip dies, or whatever, I'd rather have the pi continue operating the ato and dosers and alarms and stuff than shut all that down and wait for a network that might never come or only hours or days later, particularly if noone is home. Power outage situations/ running on backup power are another consideration.

I've got a better router now, and some smart plugs, but i still only give them noncritical devices to control like some unimportant pumps and other stuff unrelated to the tank.

I am not sure compromising reefpi by default for the sake of one driver for one particular device is a great idea, especially when people that have those can make their own choice to do that if they want.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
I would have a 3d printer if I could figure out how to make things with a 3d Cad program... That stuff baffles me.
I use several but the one I use the most is tinkercad, free to use. It comes across as pretty simple solid cad tool but you can make some pretty complex stuff with it, once you get used to it you can make things pretty quickly - https://www.tinkercad.com/
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
This is why a long while ago i was very adamant, maybe even rudely so, about wanting hardwired outlets and no wifi smart devices. I actually ran rather often into the situation where the network/router wasn't up.

And in that case, or if the pis network chip dies, or whatever, I'd rather have the pi continue operating the ato and dosers and alarms and stuff than shut all that down and wait for a network that might never come or only hours or days later, particularly if noone is home. Power outage situations/ running on backup power are another consideration.

I've got a better router now, and some smart plugs, but i still only give them noncritical devices to control like some unimportant pumps and other stuff unrelated to the tank.

I am not sure compromising reefpi by default for the sake of one driver for one particular device is a great idea, especially when people that have those can make their own choice to do that if they want.
You may want to re-think things and make sure to understand how relays fail open or close based on their default setting. If the rpi locks up, loose power, etc it may leave those devices that are directly connected not as you intended. The Kasa strips remember the power state and return to that state regardless of the rpi, so for me I have my return pump on, I almost always want it onn regardless. If the rpi sd card gets corrupted on a power outage it may not come back up and if it doesn't then what is the state of the relays that you are using will determine if they continue with power or not, fail-open or fail close states. I split things across the strips based on failure scenario and what I want to keep running vs what I want off if things are in a wonky state. If the rpi gets corrupted etc, your not going to get any alarms unless you have some external monitoring program setup to notify you, if you don't have such a thing I would recommend that you do. Automation is really nice up to the point where its not, lol. :)

Keep in mind that wait for network times out after a period of time it doesn't wait forever...
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
You may want to re-think things and make sure to understand how relays fail open or close based on their default setting. If the rpi locks up, loose power, etc it may leave those devices that are directly connected not as you intended. The Kasa strips remember the power state and return to that state regardless of the rpi, so for me I have my return pump on, I almost always want it onn regardless. If the rpi sd card gets corrupted on a power outage it may not come back up and if it doesn't then what is the state of the relays that you are using will determine if they continue with power or not, fail-open or fail close states. I split things across the strips based on failure scenario and what I want to keep running vs what I want off if things are in a wonky state. If the rpi gets corrupted etc, your not going to get any alarms unless you have some external monitoring program setup to notify you, if you don't have such a thing I would recommend that you do. Automation is really nice up to the point where its not, lol. :)

Keep in mind that wait for network times out after a period of time it doesn't wait forever...

The outlets remembering whatever unpredictable state they happened to be in at the time, with any switching operations or failsafes disabled for a while is precisely on of the scenarios i am scared of. I'd much rather have them revert to the default state given by the relay's switching properties. Normally closed relays for things i want to stay on, normally open ones for things i want to stay off in an emergency. Or in the case of my smart plugs, programming them to remember the default i chose, not their last state. The real worry is then about things that aren't okay to be just always on, but leaving them always off is not fine either, like heaters that aren't controlled by redundant temperature controllers.

But yeah, i didn't know the wait for network part times out, not such an issue then regarding disabling reefpis functionality in that case i guess
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0
I use several but the one I use the most is tinkercad, free to use. It comes across as pretty simple solid cad tool but you can make some pretty complex stuff with it, once you get used to it you can make things pretty quickly - https://www.tinkercad.com/
I forgot about that one.. I'll have to log in and take a look..
 

JachPot

Active Member
View Badges
Joined
Feb 12, 2022
Messages
444
Reaction score
601
Location
Colorado
Rating - 0%
0   0   0

has anyone looked into these? They have 25+ in stock right by my house and I'd be willing to go pick some up
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0

has anyone looked into these? They have 25+ in stock right by my house and I'd be willing to go pick some up
Not even in the same category as any other pi, those are not a proper computer, just microprocessor, like arduino etc.
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0

has anyone looked into these? They have 25+ in stock right by my house and I'd be willing to go pick some up

Those are cool, but they won't run reef-pi. Its similar to an Arduino.
 

DrWTF

New Member
View Badges
Joined
Mar 15, 2022
Messages
1
Reaction score
0
Location
United States
Rating - 0%
0   0   0
Just got my Reef Pi running on a Robo Tank and am really loving it. However, I do see some misc. noise spikes in the data stream that could be solved with a simple filter on the data (I'd choose a median, or really a Hampel filter).

Both for displaying and for taking action based, this seems prudent. Curious if anyone has looked into it?
 
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 found that calibrating the temp probe using the GO button on the pop up key pad gives error if value is not in a given range. If I use APPLY and not the GO button it seems to use the value given. This might be a UI issue. And I don't understand the GO value limits given at all. Can you explain? Thank you and nice work.
I’ll have to go through the ui and reproduce it. It will be big help if you can test if it’s present in 5.2 , and file a bug if it’s present. I suspect a few other ui bugs … I want to address these as first priority
 
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
Is it possible to delay the start or have it start with out a network after a 30s or 1 minute? I do think it's good idea for it to run with network or not but could the start be delayed somehow?
I’m pretty sure you can craft something with systemd to do this .
 

TOP 10 Trending Threads

WHAT AMOUNT OF LIVE ROCK AND SAND SHOULD BE PRIORITIZED FOR OPTIMAL BIODIVERSITY/FILTRATION?

  • 100% live rock + bagged sand

    Votes: 37 27.2%
  • 100% dry rock + 100% live sand

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

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

    Votes: 13 9.6%
  • 25% live rock, 75% live sand

    Votes: 10 7.4%
Back
Top