AquaPy - Django REST Framework Controller

whitej6

Community Member
View Badges
Joined
Feb 8, 2020
Messages
33
Reaction score
64
Rating - 0%
0   0   0
I’ve been toying with the idea on creating my own controller and weighed the idea of extending ReefPi or start my own project. It came down to three deciding factors: plug & play, grafana for dashboards and I’m a python automation developer. As far as plug & play is concerned I will be using a Raspberry Pi with a shield and various Atlas Scientific sensors, my goal is to buy pre-assembled products and my primary focus is code development. For graphing dashboards grafana is hard to beat. For language it’s a personal preference not so much as believing one would work better than the other.

Short term goals will be to have the controller contained to one raspberry pi with the intent for the controller to be highly scalable.

Long term the raspberry pi becomes a worker node listening on a message queue to perform an action. Totally overkill but could scale for large deployments fairly easily with the majority of the bottleneck being system resources for backend systems. May also deploy a read only copy to AWS, a coworker does data sciences and she’s interested in mining the telemetry data.


Build starts next week once the last part for phase one arrives.
 
OP
OP
whitej6

whitej6

Community Member
View Badges
Joined
Feb 8, 2020
Messages
33
Reaction score
64
Rating - 0%
0   0   0
I've decided to break development out into 4 phases that are targeted to solve specific use cases in each phase. The phases were determined based on satisfying needs that I currently do not a solution in place for. This is why I chose to prioritize monitoring and 1-10v control over 110v outlet control. There may be additional phases added at a later date.

Phase 1: Monitoring Parts List
First frustration has been I did not do enough reading on the Tentacle T3 hat or EZO circuits before making my purchase, I have received everything but the i2c toggler which is arriving next week. There are methods of setting the EZO circuits to i2c without the toggler however my goal is to have an end to end solution that only requires assembly, cloning the repo and basic configuration. Taking this approach is not going to produce the cheapest end solution but should lower the barrier for entry for those who do not have a developer background or do not want to mess with soldering/breadboards.

Phase 2: 1-10v Control Parts List
TBD

Phase 3: 110v Power Control Parts List
TBD

Phase 4: Dosing Parts List
TBD
 

MaddyP

'Til Reefdom Come...
View Badges
Joined
Jul 21, 2016
Messages
1,907
Reaction score
4,530
Location
Vancouver, WA
Rating - 0%
0   0   0
I've decided to break development out into 4 phases that are targeted to solve specific use cases in each phase. The phases were determined based on satisfying needs that I currently do not a solution in place for. This is why I chose to prioritize monitoring and 1-10v control over 110v outlet control. There may be additional phases added at a later date.

Phase 1: Monitoring Parts List
First frustration has been I did not do enough reading on the Tentacle T3 hat or EZO circuits before making my purchase, I have received everything but the i2c toggler which is arriving next week. There are methods of setting the EZO circuits to i2c without the toggler however my goal is to have an end to end solution that only requires assembly, cloning the repo and basic configuration. Taking this approach is not going to produce the cheapest end solution but should lower the barrier for entry for those who do not have a developer background or do not want to mess with soldering/breadboards.

Phase 2: 1-10v Control Parts List
TBD

Phase 3: 110v Power Control Parts List
TBD

Phase 4: Dosing Parts List
TBD
For out of the box functionality, it's hard to beat the Tentacle T3 and Ezo curcuits. I have two stacked on my RPI for my build. If you haven't yet ordered a toggle, I have an extra I'd be happy to send you.
 
OP
OP
whitej6

whitej6

Community Member
View Badges
Joined
Feb 8, 2020
Messages
33
Reaction score
64
Rating - 0%
0   0   0
Thank you for the offer, I have one on the way.

I agree it's hard to beat the T3, I'm debating on ordering the enclosure made for the Pi and a single T3.
 
OP
OP
whitej6

whitej6

Community Member
View Badges
Joined
Feb 8, 2020
Messages
33
Reaction score
64
Rating - 0%
0   0   0
Base dashboard is in place, right now it's a cron posting to an InfluxDB and Grafana for the dashboard. Woohoo progress!
1592959388424.png
 

sosinskim

New Member
View Badges
Joined
Jun 25, 2020
Messages
1
Reaction score
1
Rating - 0%
0   0   0
I've decided to break development out into 4 phases that are targeted to solve specific use cases in each phase. The phases were determined based on satisfying needs that I currently do not a solution in place for. This is why I chose to prioritize monitoring and 1-10v control over 110v outlet control. There may be additional phases added at a later date.

Phase 1: Monitoring Parts List
  • Raspberry Pi 3+ (reuse from previous project)
  • 64Gb SanDisk Micro SD
  • Atlas Scientific i2c Toggler (needed to ensure EZO circuits are set to i2c)
  • Atlas Scientific Temperature Kit (only using sensor and EZO circuit)
  • Atlas Scientific Lab Grade pH Probe
  • Atlas Scientific EZO-pH Circuit
  • Whitebox Labs Tentacle T3 for Raspberry Pi
First frustration has been I did not do enough reading on the Tentacle T3 hat or EZO circuits before making my purchase, I have received everything but the i2c toggler which is arriving next week. There are methods of setting the EZO circuits to i2c without the toggler however my goal is to have an end to end solution that only requires assembly, cloning the repo and basic configuration . Taking this approach is not going to produce the cheapest end solution but should lower the barrier for entry for those who do not have a developer background or do not want to mess with soldering/breadboards.

Phase 2: 1-10v Control Parts List
TBD

Phase 3: 110v Power Control Parts List
TBD

Phase 4: Dosing Parts List
TBD

Following,

I always wanted to automate it. I found one and update this thread with full instructions once you complete it.
 
OP
OP
whitej6

whitej6

Community Member
View Badges
Joined
Feb 8, 2020
Messages
33
Reaction score
64
Rating - 0%
0   0   0
Quick update, everything is now up and running in containers for phase 1 MVP on the Raspberry Pi. I am going to see what I can do for prepackaged Grafana dashboards based on a yaml file that will be used for initial build. Grafana is great for setting up alerts and can be based on what suits you best, for now I am using Slack messaging for alerts but email, PagerDuty and many other options are available. Once I am ready for a v0.0.1-beta release I will make the repo public and share the link for GitHub.

Example Alert - Needs work to be more elegant
1593540853285.png


Docker containers
1593540626424.png
Completed:
  • Django REST Framework API (aquapy_web_1)
  • Django rq_worker (aquapy_worker_1)
  • Auto configure InfluxDB container (aquapy_influxdb)
  • Deploy Redis and Postgres dependencies (aquapy_redis_1 & aquapy_postgres_1)
  • Deploy and manually configured dashboards & alerts (aquapy_grafana_1)
Remaining:
  • Easy to understand management UI (aquapy_web_1)
  • Auto configure base dashboards, alerts & sensors (aquapy_web_1 & aquapy_grafana_1)
 

laverda

2500 Club Member
View Badges
Joined
Jun 6, 2008
Messages
2,893
Reaction score
2,165
Location
Anaheim
Rating - 0%
0   0   0
I have to be admit I have no idea what some of the things your tslking sbout mean. But I believe there has to be a much more reliable wsy to control our aquariums then with an Apex.
 
OP
OP
whitej6

whitej6

Community Member
View Badges
Joined
Feb 8, 2020
Messages
33
Reaction score
64
Rating - 0%
0   0   0
Just added support for power control via Belkin Wemo switches, really like the idea of zero soldering and plug & play solutions. Uses uP&P to discover and control the switches. Will update parts list once next beta release is ready. 0-10v parts are ordered and will begin development "soon". Once I have most of the nuts and bolts functionality working I will move on to building the admin UI which will be based on the current API.
 
OP
OP
whitej6

whitej6

Community Member
View Badges
Joined
Feb 8, 2020
Messages
33
Reaction score
64
Rating - 0%
0   0   0
Kind of a cool snapshot into the power of telemetry data. Red arrow represents initial state of temperature swings for my tank and green arrow represents when the ability to control power based on sensor readings was added. The initial plan was not to care about on/off power control in the near term since I already had that handled for lights via timers BUT once I saw the temp swing I knew I needed to do something to reduce the swing. I added event based actions and set temperature thresholds to toggle fans in the hood on and off. Now my average temperature swing is .1 degrees on average.
1594305942911.png
 

Hepcio

New Member
View Badges
Joined
Jan 11, 2020
Messages
1
Reaction score
0
Rating - 0%
0   0   0
Hi Jeremy,
could you have a look at this project:
I am trying to test it and I'm struggling on installing InFluxDB on current raspbian release, maybe you could give some help, and maybe the project itself would be interesting to codevelop it along with yours?
 
OP
OP
whitej6

whitej6

Community Member
View Badges
Joined
Feb 8, 2020
Messages
33
Reaction score
64
Rating - 0%
0   0   0
I prefer to use docker containers. InfluxDB has an ARM version of the container that I used. I am happy to help where I can, TBH I am thinking about biting the bullet for an Apex. I don't have has much time as I did a year ago to work on it.
 

Creating a strong bulwark: Did you consider floor support for your reef tank?

  • I put a major focus on floor support.

    Votes: 15 50.0%
  • I put minimal focus on floor support.

    Votes: 6 20.0%
  • I put no focus on floor support.

    Votes: 8 26.7%
  • Other.

    Votes: 1 3.3%
Back
Top