Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Robo-Tank Web App - Development
#61
Rob, I wanted to jump on here and say thanks for all of your efforts. I just ordered the DIY kit from you. I have been tinkering with Reef Pi and as much fun as that can be in my free time I really like what you have done. I look forward to getting a look at your web AP as well. P.S. There is no such thing as disposable income. I started this hobby with a free 50 gal tank and slowly build it making every mistake along the way. I have learned what is important to spend money on and how to DIY if I can to save some money.


Thanks again
[-] The following 2 users Like coaxman's post:
  • Rob F, Weasel1960
Reply to top
#62
Thanks Coaxman, I appreciate that! Glad to hear you'll give the app a go, I need some brave people to run it. :) It's been doing everything it should so hopefully it goes well. I got in with little money too, made my own light, found deals on equipment and got a good deal on a used tank as well. With a little searching there easy to find.
Reply to top
#63
Rob your hardware is very nice and I do not regret the purchase in the least. When I got it it was running reef-pi and it still continues to run reef-pi. I hope when you release your closed source software that you continue to support the reef-pi project for this hardware...although I dont know if you even need to because it seems complete. I was just passing time while having no power from a hurricane. I too have built my own LEDs and drivers and didn't mean to offend anyone with my comments about disposable income. I purchased this system because I wanted a turn key solution to run reef-pi. My last reef system reef-keeper just decided to disappear in the cover of night and that will not happen with the setup I purchased from you. I have been doing reefs for over 11 years and love the custom stuff. I just got overly excited that someone was doing such a new open project and may have been a bit too excited. Your time is not mine to spend.


I wish you nothing but success and hope you are the next major neptune systems. I absolutely know you are great at customer service and I can't recommend your hardware enough.
[-] The following 2 users Like deeproot's post:
  • coaxman, zee_zout
Reply to top
#64
Thanks for understanding deeproot, I definitely hear where you are coming from, after I flip flopped I immediately thought of you, in your shoes I would be disappointed as well. I do have plans to continue supporting reef-pi, it really does have the potential to become the next big name, just the other day another software engineer bought the controller for the purpose of adding to and improving reef-pi. In my eyes there's only a few more things it needs to pop.
Reply to top
#65
(08-30-2021, 11:58 PM)Rob F Wrote: I hope you got my private message, I know you mentioned you were only buying the controller because software would be open source, check it out and we can figure something out, I'm sorry to mislead you.

It does appear a lot of reefers have plenty of money, it's not a cheap hobby however that's not everyone. The reason people choose me / reef-pi is mainly due to being affordable, I hear this all the time. Most people I cater too don't care to get into the code, they want reliable, easy to use and ideally it can do everything. The controller and reef-pi pretty much covers that. I feel reef-pi is quite proven and reliable otherwise I wouldn't push it, I think Ranjib has done a great job. Another reason out of many I'm making the app is I can't rely on reef-pi, if Ranjib stops good chance the project is over. Then a few Pi OS updates and it doesn't work and nobody can fix it. Reef-pi is growing though so this gets less likely as time goes by.

My original controller didn't work because price was $429 basically the same as the Apex and basically had no web access. Now it's under $250 to get semi equivalent with a lot more ports, my numbers are day and night different due to just that fact. If I could get some extra hardware I would like I can really increase the price to value ratio. There is definitely a good size market for me.

When I got my first aquarium I wanted a controller but Apex was out of my range, that's what got me into this. It was only going to be for me but people were liking it so I decided to sell them. My goal has and always will be to keep the prices as low as I can because I know there's many like myself. Even though reefing is very expensive it doesn't have to be. It also attracts a lot of freshwater folks.
Hi Rob, catching up on the thread…while I don’t understand all of it, you got to do what’s right for you.

I am one of those reefers getting restarted and don’t have a lot of ready cash for getting everything at once. I just spent the last year catching up on the hobby and now it looks like it could be that long again before I get it all bought and put together.  I am not into buying something just because of the name on the box, especially when I see threads on R2R where folks are having problems with it.

Still following along with your progress. Time will tell if I actually jump in and get started.
Reply to top
#66
Thanks for following along Weasel1960 and I hear you, things add up quick especially when starting with nothing. I have a 125g freshwater tank I've been running about 6 years and it's almost time it needs redone, just waiting for the fish to pass as I don't want to disturb them. I'm amazed how long they lasted, still have 5 Red Tetras that are 6 years old and 1 Amano shrimp the same age. The tank is soil which isn't cheap, plus plants and fish and a light I need to fix due to allowing water droplets to hit it during water changes, not looking forward to the expense.
[-] The following 1 user Likes Rob F's post:
  • Weasel1960
Reply to top
#67
Time for a little update.

The custom rules are officially working, I was a little worried I over extended myself with the multiple conditions but it all went very well and the code is small and easy to read. The code went together so well I should be able to easily tweak it so more than 2 sensors can be used, technically there will be no limit, the tricky part might be mixing AND OR conditions but I think it's doable. Any parameter the controller produces will be available in the customs rules and any types can be used together.

Because each piece of equipment in the custom rule can have a delay saying when to switch the equipment, the custom rule is technically running until the last piece of equipment is switched so I came across a couple Y's in the flow and this is what I settled on for now.

Example: 

Rule 1: Sensor touching water turns on Outlet 1 immediately, Outlet 4 is on 10 seconds after the rule starts and Outlet 5 is on 30 minutes after rule starts.

Rule 2: Sensor not touching water turns off Outlet 1 immediately, Outlet 4 is off 10 seconds after the rule starts and Outlet 5 is off 30 minutes after rule starts.

1st Scenario - Normal

Sensor touching water triggers Rule 1, Outlet 1 turns on, 10 seconds later Outlet 4 turns on and nearly 30 minutes later Outlet 5 turns on. - Rule Completed

Sensor not touching water triggers Rule 2, Outlet 1 turns off, 10 seconds later Outlet 4 turns off and nearly 30 minutes later Outlet 5 turns off. - Rule Completed

2nd Scenario - Half Cycle

Sensor touching water triggers Rule 1, Outlet 1 turns on, 10 seconds later Outlet 4 turns, then 40 seconds later the sensor state changes triggering Rule 2. - Rule Didn't Complete

This means Outlet 5 will have never turned on as the sensor wasn't in the proper state for 30 minutes. At this point as the sensor state changed the rule is aborted and Rule 2 will run. This means if you expect Outlet 5 to turn on you need to ensure the sensor will remain in the proper state for 30 minutes. Just typing this out now I realize this might not be best, maybe I will change so rule follows through all steps no matter if sensor changes. This was a Y, what to do, I think I picked the wrong one.

3rd Scenario - Another action during custom rule

Sensor touching water triggers Rule 1, Outlet 1 turns on, 10 seconds later Outlet 4 turns on, 10 minutes later a schedule turns Outlet 4 off, finally 30 minutes into rule Outlet 5 turns on.



You can see I added an edit and delete button, the edit button doesn't work right now, I'm leaving it for another day as it's a lot of messing with the UI and time is ticking. If you need to change something just delete and add back for now.

[Image: rules20.PNG]


The custom rule allows you to set a delay so dosing pumps can't run again via any system after the custom rule for X number of minutes, I decided to extend that as a feature for each dosing pump, you can see the new setting on 2nd picture. Later I plan to redo this screen... This is just a safety feature so there's no accidental overdosing. The delay entered on the dosing pumps settings page is the program default, if you create a custom rule and leave that delay as a 0 it will use the default, if you put a number in the custom rule it'll over ride the default however only for that custom rule. A manual dose will bypass the delay and not reset it, it'll continue counting from the last system dose. Hope that makes sense.

Now I'm trying to decide the best for startup. Should the delay set be used at startup meaning a dosing pump won't run when controller starts until after that period expires. Problem with this is if interval is long, can be up to 7 days, that would be excessive. So I'm thinking maybe 1 hour needs to pass after controller starts before dosing is allowed, except for manual doses.

[Image: dosing2.PNG]
[-] The following 1 user Likes Rob F's post:
  • albinochicken89
Reply to top
#68
Actually I think I did do the right thing, kind of forgot my reasoning, can't have a custom rule follow through to the end if the sensor that trigger the rule changes states otherwise you could have all kinds of rules running.

Using the example above.

If the sensor was saying run Rule 1, then it's state changed and said run Rule 2, then the state changed again and again before the 30 minutes is up you would have all kinds of unexpected actions coming. So yeah I think it'll be ok. As time goes there will be little info icons a person can hover that will explain a setting so a user doesn't have to discover. Eventually I'll get fancy like first time using something like creating a custom rule you get guides, at the end you can say "never show again". As much as I want it all just to make sense there's no getting around certain features.
[-] The following 1 user Likes Rob F's post:
  • vilich
Reply to top
#69
Rob, Now that I have the controller set up how can I go about getting your software to test out?
Reply to top
#70
It's not quite ready yet but getting close. Here's my list.
  • Allow custom rules to be triggered via schedules. This uses the existing schedule system so not to much work.
  • Add a "Manual Run" button on custom rules.
  • Need to figure out a way to get new custom rule to backend, amount of data will vary so I need to do some tweaking. 
  • Get dashboard auto updating for a few remaining things, like dosing pumps and health meter.
  • Forgot to save pH calibration to database, not difficult though.
  • Sort out the empty sensor boxes on dashboard so they disappear on mobile.
  • Add smart start routine, this ensures equipment set in the correct state.
  • Spend a few more hours testing everything.
Would be nice to get all finished by end of weekend minus maybe final testing and then a teaser video.

Then I'll spend a few days doing fresh installs and slight polishing here and there on the UI and let it run another 72 hours untouched. I think it can be ready to install in 2 weeks.

One thing I've never done is loaded this on a Pi 4 or Pi Zero W, I'm using the Pi 3. I feel pretty good that it'll be ok on those but it's one of those things if I don't test it won't work, if I do it will. So yeah maybe I spend a day doing that as well.

I haven't released yet as I don't like things to be in progress, it's like trying to setup a house when the painters are still there. It takes me a long time because everything I do is fully tested during every step of making it. As an example I probably created 100's of custom rules during the process, spent more time doing that then making the system. Doing that though I feel confident there will be no funny issues. So yeah even though this is a beta I expect it to be stable, fingers crossed.
Reply to top
#71
Oh one thing I should have mentioned long ago. 

There's one thing that does worry me, date and time. 

If the Pi isn't connected to the network and can't give the correct date and time it's big trouble for Robo-Tank. I don't think it's good for reef-pi but not sure to what extent, for mine it'll shut it down mainly due to my scheduling system.

The whole program runs on timers using date and time in milliseconds, this is updated every millisecond or more by reading the network time on the Pi. The problem comes because schedules have a timestamp when they were created due to the feature saying run schedule X number of days. For that you need to know when the schedule was created. If the network time on the Pi isn't updated, I'm not sure how that works, it will crash the program because the date timestamp used will be before the timestamp of the schedules.

To get around this when the Pi starts the program won't start until a network connection is made and it gets the date/time. No network no controller. Personally I've never experience any issues but I know it will be for someone.

So for this reason I highly recommend using a real time clock (RTC) module. I've added this to the updated controller but sadly current connectors don't have one however it's easy to add. The controller has an I2C port so you can simply plug one it. I'm using the DS1307 on controller but if you get one may as well go with a DS3231 as they are more accurate. Here's some affiliate links.

DS3231

https://www.amazon.com/gp/product/B082G6MXVR/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=5302020-20&creative=9325&linkCode=as2&creativeASIN=B082G6MXVR&linkId=8b85c5c380873b768c181f048bfaa01b

DS1307

https://www.amazon.com/gp/product/B07XB2265S/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=5302020-20&creative=9325&linkCode=as2&creativeASIN=B07XB2265S&linkId=52724100bee1754aeb25800659caa1da

Now with all that said the program isn't able to use one yet, I'm debating before release or right after. Shouldn't be too difficult so might do first. I have a DS3231 on hand and probably the other somewhere in a box.
Reply to top
#72
I got the needle added to the health meter, thought I would explain what it means.

The program is technically split into 3 programs because it's using multiple threads. One thread is used for all operations that need to happen in real time, this is what the meter is monitoring.

On my system using Pi 3 this thread loops over and over 195 times every second, meaning all systems are checked every loop. I expect a Pi 4 will be faster and a Pi Zero slower.

As mine is running at 195 loops per second I based the meter on 100 loops. 100% means it's running 200 loops or more per second, 0% means it's running less than 100 loops per second which is still extremely fast. I don't expect it should ever get under that so I'll start it here and see how it goes. When lights are fading it will drop but I haven't been monitoring it, if I find it drops more than I like I can speed things up during a fade. If you look carefully you can see the needle isn't flat because I'm only 195 loops not 200+.

[Image: health.PNG]

This is slower than the original controller with the Arduino Due, I believe that was around 300-400 loops per second, unfortunately I don't have the number recorded in the code but I know this is lower.

Does this mean the Raspberry Pi 3 is slower than an Arduino Due? Actually the Arduino is no comparison. If I run the 3rd thread without a throttle it can actually run 52,000 to 55,000 loops per second, that's crazy. Kind of makes the 195 not sound so real time. At full speed the CPU runs at 100% so there's a sleep function that slows it down. Running at 195 it uses about 2-4% of CPU and that's plenty fast enough.

The memory used on the Pi is on the higher side though, mine is using 180mb. The reason this is high is Apache and especially MySQL, I think it alone uses half of that. Pi Zero is 512mb so I think it'll be ok.
Reply to top
#73
Hi Rob. Not really sure I am following your examples above but….

If there is a change in status while rule 1 is running that starts rule 2 why wouldn’t rule 1 just end and reset until the next time it’s startup condition is met?
Reply to top
#74
Hey Weasel1960, yeah I'm not the greatest at explaining, what your thinking is what happens. If the status changes half way through, rule 1 will end and reset then wait until the condition is met again.

For the beta custom rules will be used for everything, if you want to controller a heater or ATO you would create 2 basic custom rules for each. Those system will be first on the list after initial release. Custom rules in only half, later there will be Custom Modes for more advanced controls.
[-] The following 1 user Likes Rob F's post:
  • Weasel1960
Reply to top
#75
Forgot to post some pics of real world custom rules. You can see I added a button to enable/disable the rule.

This is an ATO using 2 float switches. Because the controller has those hardware backup ports for DC and AC ports you can have a 3 sensor setup like my standalone ATO. Two sensors are monitored by the program and one simply cuts single to the port so it turns off.

The start condition requires both sensor 1 and sensor 2 not to be touching water. 

The stop condition requires either sensor 1 or sensor 2 to touch water.

[Image: rules21.PNG]


This is a basic rule to monitor a reservoir using a non-contact sensor. Maybe you don't want to automate a refill, you can see no equipment will be switched, only an email and dashboard alert will be sent. For now this will be how you setup alerts.

[Image: rules22.PNG]


These two control a heater, you can see the condition required. 

Just spotting it now, going to change "10 seconds" to read "10 consecutive seconds" everywhere.

[Image: rules23.PNG]
[-] The following 2 users Like Rob F's post:
  • albinochicken89, Weasel1960
Reply to top
#76
This is going to make my life so much easier!
Reply to top
#77
Time will tell I guess. :)
[-] The following 1 user Likes Rob F's post:
  • albinochicken89
Reply to top
#78
The two custom rules above:
TurnHeaterOn if DispTankTemp > 75.9 for 10 sec
TurnHeaterOff if DispTankTemp < 75.7 for 10 sec

would seem to translate to:
If the tank is warm, make it warmer
If the tank is cool, let it get cooler

Or am I somehow mis-interpreting the rules?

-Phil
[-] The following 1 user Likes pwest's post:
  • Rob F
Reply to top
#79
Dohhhh, after flipping the rule around I didn't realize the on/off was backwards, you read it correct. I updated the pic, thanks for pointing it out.
Reply to top
#80
2 more weeks...  K05163  K0503 K05164  It really is coming, unfortunately last week I didn't get a lot done, but some. I thought it was to the point I could finally make a video and wow was that tuff. My mic for computer broke so I used phone for audio and screen capture software for video, after 30 seconds you could see audio and video were no longer synced and after full 20 minute video it was out by minutes. So I made a bunch of 1-3 minutes clips so I could get things lined up better but still very visible, sorry about that.

So to finish I need to get smart start running, save custom rule, add the actual alert emails and create the install package. I have decided I am going to add an update software feature before releasing, I expect something will have been overlooked or not right and I don't want people fumbling to update using SSH commands. One goal is a user never needs to use the SSH Pi terminal after installing and without this well obviously that can't happen. With I can make the smallest of changes or large, push an update and one click users will get it. I need a good start out of the gate and this will help greatly.

[-] The following 3 users Like Rob F's post:
  • Brooks, Dom59, vilich
Reply to top


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to Install Robo-Tank App Rob F 8 2,323 02-04-2024, 06:44 PM
Last Post: Rob F

Forum Jump:

Current time: 04-19-2024, 04:11 PM