Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting updated reef-pi code from JFReyes
#30
(01-01-2021, 08:52 AM)JFReyes Wrote: Happy New Year to All!

Rob, what are you up to? Perhaps I can help...

I'm trying to build my own app, I like reef-pi but because I do this for a living I feel I need something I know in and out, if reef-pi ever stops then my days are limited and that can't happen. 

For the backend I'm using c++, php and mysql, frontend is html, javascript, css and ajax. I think the benefit to these languages is more people know them and easy but probably not ideal. I originally started with python but man that's stuff isn't easy, everything goes against what I know so I dumped it.

For charting I'm using Dygraphs, this was the best I could find that was open source, I've tested 3 years of data (written every 15 minutes) and it loads in under 2 seconds which is pretty good. Later I'm going to have custom chart so user can select multiple parameters and overlay data, already tested.

https://dygraphs.com/

There's a single c++ program running in the background which I view as an Arduino because it has a startup and main loop that runs forever where everything is done. Currently there's 3 threads running in the program, one is dedicated to communications from frontend to backend, there's a socket running so any commands from frontend immediately update variables in the c++ program, this was the hardest piece to figure out. The 2nd thread is used to read temp sensors and pH probes, used a thread because DS18B20 pauses the loop during a read, and the 3rd is for the remaining program. 

That's the overall structure, the downside I see so far is it uses quite a bit of CPU, it uses about 65% on average across the 4 cores on Pi 3. However I believe that won't increase no matter how much is being controlled based on how it's setup but time will tell. I've also done nothing to optimize so something to figure out down the road. I've had it running as long as a week not touched and it's always responsive so I think it'll be ok. The memory remains low so that's good.

To date I have temp sensors working and put a lot of effort into an auto management system, plug in a DS18B20 and it'll figure out if it's new or existing and take action accordingly, unplug and it will auto disable, I think it has cool factor haha. And the pca9685, pH, AC outlets and charting for temp and pH work as well. Now I'm at a point where I'm trying to design a friendly frontend and add features to backend as I go. I'm going with a set of wizards for managing hardware/sensors, everything will be step by step with pictures. For example if you add sensor, it'll ask some basic questions and then display how to wire the connector and set the jumpers on controller, no guessing. This is what I have so far, nothing works yet just setting up a menu system but this is the idea.

   

I don't think I'm ready for help just yet but would love some as time goes on, everything will be open source. I'm definitely not ready to post yet but if you want to try and install I can send you a package, I would love to hear how it goes and what you think. I have a script setup so it's automated but does take a lot longer than reef-pi as it needs to install apache, php and mysql.
Reply to top


Messages In This Thread
Latest JFR version as of 18-Nov-2020 - by JFReyes - 11-18-2020, 04:02 PM
Latest version as of Dec-14-2020 - by JFReyes - 12-14-2020, 02:33 PM
RE: Getting updated reef-pi code from JFReyes - by Rob F - 01-01-2021, 05:33 PM
Latest JFR version as of 12-Jan-2021 - by JFReyes - 01-12-2021, 12:22 PM
News: Submitted changes to upstream - by JFReyes - 01-28-2021, 12:06 PM
Latest version as of Feb-5-2021 - by JFReyes - 02-05-2021, 12:36 PM
RE: Latest version as of Feb-5-2021 - by Rob F - 02-05-2021, 08:04 PM
RE: Latest version as of Feb-5-2021 - by JFReyes - 02-05-2021, 08:27 PM
Latest version as of Feb-6-2021 - by JFReyes - 02-06-2021, 09:52 AM
New release on 3-Apr-2021 - by JFReyes - 04-03-2021, 11:43 AM
RE: New release on 3-Apr-2021 - by JFReyes - 04-12-2021, 03:49 AM
RE: New release on 3-Apr-2021 - by JFReyes - 04-12-2021, 07:24 AM
RE: New release on 3-Apr-2021 - by Rob F - 04-12-2021, 11:18 PM
New release on 7-Apr-2021 - by JFReyes - 04-07-2021, 01:39 PM
New release on 17-Apr-2021 - by JFReyes - 04-17-2021, 08:17 AM
New version as of 5-May-2021 - by JFReyes - 05-05-2021, 04:29 PM
Updated version as of 6-May-2021 - by JFReyes - 05-06-2021, 12:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Two issues: Failed to init I2C & Reef-pi.service not Binding BlakeD 6 2,612 05-12-2023, 10:36 PM
Last Post: Rob F
  Code changes / repo mginster 1 1,402 10-21-2022, 07:20 PM
Last Post: Rob F
  Reef-Pi or Robo-Tank 6.x Wolfw28 6 3,122 09-01-2022, 01:11 AM
Last Post: Rob F
  reef-pi with v2 controller gandalf 1 1,551 04-06-2022, 12:48 PM
Last Post: Rob F

Forum Jump:

Current time: 05-03-2024, 05:41 AM