A Forum run by Enthusiasts of MidNite Solar

The Open Source software/hardware corner => The Black Box project => Topic started by: Syonyk on January 25, 2019, 11:28:36 PM

Title: Reworking TBBP for MySQL 5.7/PHP 7.2: Any requests?
Post by: Syonyk on January 25, 2019, 11:28:36 PM
My experimental Raspberry Pi logging setup sort of blew up recently (don't use btrfs on a USB SSD), and now that my home/office network link is a bit more solid, I set about reinstalling The Blackbox Project on an Ubuntu 18.04 server in my VM cluster, to avoid some of the complexity of setup from the Pi.

And discovered, to my dismay, that it flat out doesn't work, at ALL, under PHP 7.2 and MySQL 5.7 - there are quite a few database constraints that are not obeyed (inserts with unset fields that are defined as "not null" with no defaults - MySQL used to silently ignore that), PHP 7 makes some breaking changes in functions that throw errors, etc.

Since it seems nobody has really been working on this lately, and I can't find code more recent than a few years (for the bulk of it - there are some forks on Github that fix a few bugs), I've decided to go about and fix it up.  I'm stripping out support for things like SQLite and PDO, fixing errors, and generally trying to update the code to work with modern installs, while ideally adding a few features.

I suck at the front end of web dev, but I've got some legacy LAMP stack knowledge (made my living with it for a while back a decade ago), so other than being out of practice, I'm familiar with how stuff is supposed to work.

So, with that, are there any feature requests?  I'm planning to add some options for larger graphs (if you click them), and I'm considering adding memcache support - despite the regular logging going to the ramdisk in this setup, the whole system is still pretty darn hard on SD cards with regular minutely writes (both graphs and the database), so I'm considering redoing some of that as well to store stuff in RAM (compressed) to reduce SD card traffic on a Pi based install.

Or, is anyone else actively working on this?  I haven't seen many indications of active development recently.

I've forked dan-da's work to here: https://github.com/Syonyk/theblackboxproject  And will be actively working on this over the next few weeks until I have something that runs properly. ;)
Title: Re: Reworking TBBP for MySQL 5.7/PHP 7.2: Any requests?
Post by: ClassicCrazy on January 29, 2019, 11:00:40 PM
Did you see that Graham is working on mqtt and also may be working on something with esp32 ?
Larry
Title: Re: Reworking TBBP for MySQL 5.7/PHP 7.2: Any requests?
Post by: Syonyk on January 29, 2019, 11:19:35 PM
Can't say I have.

The ESP32 doesn't have the capabilities to run anything near TBBP...
Title: Re: Reworking TBBP for MySQL 5.7/PHP 7.2: Any requests?
Post by: ClassicCrazy on January 30, 2019, 04:55:06 PM
I don't understand  what you are trying to do but here is link for Grahams mqtt  project
http://midniteftp.com/forum/index.php?topic=4464.new#new

Larry
Title: Re: Reworking TBBP for MySQL 5.7/PHP 7.2: Any requests?
Post by: Syonyk on January 30, 2019, 06:02:12 PM
The Blackbox Project does not run with modern versions of MySQL/PHP.

I'm trying to fix that.
Title: Re: Reworking TBBP for MySQL 5.7/PHP 7.2: Any requests?
Post by: ClassicCrazy on January 30, 2019, 06:09:52 PM
Okay -- got ya .
I haven't heard anyone talk about the Black Box project in a long time.
If I remember correctly it was to have one thing that could communicate to different controllers, inverters, etc .
Do I have that correct ?

Larry
Title: Re: Reworking TBBP for MySQL 5.7/PHP 7.2: Any requests?
Post by: danda on April 27, 2021, 08:15:51 PM
Hey Syonyk, I just noticed on github that you had forked the project and added some commits.   Very good!   I was hoping someone would pick this project up.

Like you, I've been running it on an rpi, an ancient one.  It's been quite stable for years, but a few weeks back the filesystem got well and truly corrupted, so it looks I will be doing a re-install soon.    So I will try out your fork and see how it goes.

Since you are (were) soliciting requests in this thread, I'll throw a couple related ones out under the general heading of historical data.

1. Graph of historical data.  Just like the present daily graph, but with ability to view daily, weekly, monthly.   Would be really cool to have a dynamic (JS) graph that can be scrolled adjusted, etc.   But I'd be happy with just adding a weekly view to the existing graph for now.
2. Ability to view historical data/summaries.   Perhaps Hourly and Daily views.   min/max batt voltage, etc.

Also, I noticed that on your github page there is no way to file an issue.  I was gonna say hi there, and couldn't see how, so I found my way here instead.
Title: Re: Reworking TBBP for MySQL 5.7/PHP 7.2: Any requests?
Post by: ClassicCrazy on April 27, 2021, 09:00:27 PM
Quote from: danda on April 27, 2021, 08:15:51 PM
Hey Syonyk, I just noticed on github that you had forked the project and added some commits.   Very good!   I was hoping someone would pick this project up.

Like you, I've been running it on an rpi, an ancient one.  It's been quite stable for years, but a few weeks back the filesystem got well and truly corrupted, so it looks I will be doing a re-install soon.    So I will try out your fork and see how it goes.

Since you are (were) soliciting requests in this thread, I'll throw a couple related ones out under the general heading of historical data.

1. Graph of historical data.  Just like the present daily graph, but with ability to view daily, weekly, monthly.   Would be really cool to have a dynamic (JS) graph that can be scrolled adjusted, etc.   But I'd be happy with just adding a weekly view to the existing graph for now.
2. Ability to view historical data/summaries.   Perhaps Hourly and Daily views.   min/max batt voltage, etc.

Also, I noticed that on your github page there is no way to file an issue.  I was gonna say hi there, and couldn't see how, so I found my way here instead.

check this out if you haven't seen it yet
https://github.com/ClassicDIY -
Also the CCDM project
http://midniteftp.com/forum/index.php?topic=5060.0

Larry
Title: Re: Reworking TBBP for MySQL 5.7/PHP 7.2: Any requests?
Post by: Syonyk on April 27, 2021, 09:09:45 PM
Quote from: danda on April 27, 2021, 08:15:51 PM
Hey Syonyk, I just noticed on github that you had forked the project and added some commits.   Very good!   I was hoping someone would pick this project up.

I poked at it for a bit, but it's mostly been running...

Quote1. Graph of historical data.  Just like the present daily graph, but with ability to view daily, weekly, monthly.   Would be really cool to have a dynamic (JS) graph that can be scrolled adjusted, etc.   But I'd be happy with just adding a weekly view to the existing graph for now.
2. Ability to view historical data/summaries.   Perhaps Hourly and Daily views.   min/max batt voltage, etc.

Noted, thanks!

QuoteAlso, I noticed that on your github page there is no way to file an issue.  I was gonna say hi there, and couldn't see how, so I found my way here instead.

Fixed, should have issues enabled there now.

It's just been running on a VM on my server (not a Rpi anymore, screwed up too many filesystems with the constant writing) and boring.