:: Re: [DNG] question on programming (…
Inizio della pagina
Delete this message
Reply to this message
Autore: Simon Walter
Data:  
To: dng
Oggetto: Re: [DNG] question on programming (maybe OT???)
On 2024-03-21 22:00, o1bigtenor via Dng wrote:
> On Thu, Mar 21, 2024 at 10:15 AM Vince Mulhollon <vince@???
> <mailto:vince@mulhollon.com>> wrote:
>
>     On Thu, Mar 21, 2024 at 8:42 AM o1bigtenor via Dng
>     <dng@??? <mailto:dng@lists.dyne.org>> wrote:
>     > Some would consider what I want to set up as IoT, some might
>     suggest using SCADA some would suggest a web based system - - - but
>     I'm wondering if I could be served by something else.

>
>     Sometimes it helps to look at similar working systems.

>
>     You are reinventing the PLC.  Codesys is a commercial soft-PLC that
>     runs on Debian, quite cheap and affordable on a raspi, I've messed
>     around with this stuff and it works well.  Even if you end up not
>     using codesys if you're reinventing the concept of a PLC this would
>     give you some insight into what you're trying to invent.

>

...
>
>
> Fan(s) in question run some over 6k cfm - - - this is not quite regular
> household stuff. 
> Controlls are available - - - I don't like because not a one is rated to
> work below 
> 0C (32F) and as my facility is unheated - - - - well this winter like
> was on the warm 
> side but we still got to -20C (if not slightly colder). 
> This lack in commercial controls is one reason why I want to roll my own!


I would also give the same advice, but you know your hardware and if
it's compatible.

If you have to go the roll your own route, I would counter:

On 2024-03-21 15:22, karl@??? wrote:
...
> A database management system like postgresql is just an unnessesary
> overhead.


This statement could create a false dichotomy in your mind.

"A database management system" vs "text file"

What about a "database" vs "text file"?

Also somewhat misleading, since a text file could be considered a database.

If you do have your flat file in a common format such as CSV, well your
making a database anyway - literally. You're just re-inventing the wheel.

In my professional opinion, too many professionals are scared of the
word "database". In my experience, they are really scared of relational
databases, as they often jump on the "NoSQL" band wagon.

Some "NoSQL" database might be a good fit for collecting large amounts
of data, but if you know some SQL, you can start with SQLite (just a
file) and then use a database server (MariaDB, PostgreSQL) later if you
need to.

A time series database sounds to be a good fit for your project.
Prometheus is a decent one that I use. Though a time series database
might not be necessary. https://en.wikipedia.org/wiki/Time_series_database

The code to connect and write to and read data from a database is not
complicated in most languages.

ORMs are where you may find a lot of nonsense. With relational
databases, the key (no pun) is to understand database normalization.
https://en.wikipedia.org/wiki/Database_normalization

I just tried to search for a good site for you to check, but I'm not
sure what happened to the Internet since I last looked at it. :(

Anyone know a site with concise info about normalization?

Now the real important reason why you want to use a database for your
project:

- There was that strange weather event some weeks ago and you want to
query the data to see if sensor xyz also showed the anomaly.
- Or you want to plot the difference between several sensors, motors,
and load.
- You want to see the average of xyz data (temp, fan speed, whatever).

All sorts of insights can be found without fancy reporting tools such as
Pentaho and Jasperreports. They are pretty nice though. I suppose you
could even plot your live data.

Maybe not. I haven't tried all the newfangled cloud generation AI stuff
written in Rust and JS. Maybe they have found a new way to screw in a
light bulb.

All the best,

Simon