Thanks so much for taking the time to review my code and offer up excellent suggestions. I apologize for not responding sooner. There have been some health issues that have kept me away for a while. I will be making use of these suggestions, of that you can be certain!

I do want to explain (excuse) the bit about connecting and disconnecting from the DB each time. I too generally leave the connection open and reuse it. My concern has been power usage and power interruption. This system is powered by a solar panel/battery setup in an area where there can be some fairly extreme weather and intermittent supply of light. I have some protection on the Pi which shuts it down gracefully when voltage drops low enough in the battery. And yet I have had some instances where power suddenly drops out. My concern was that the DB file might get corrupted were it being accessed at the point at which power fails. Thus, I open and close that DB file the way that I do. I may be wasting my time on that, but it seemed reasonable to me.

Power consumption is pretty high on a RPi3, and there is no good on-board way of reducing that. There are however some add-ons (which I have yet to order) which will act as 'wake-on' devices. I may use one of these to address battery life in the field. Those too, literally shut down the Pi and restart it on some detected event. I figured that when I implement that, the DB being shut down is one less worry.

My long term intent is to use a MySQL (Maria) DB, instead of the SQLite DB. But that won't happen until I get LoRa enabled Arduinos doing the data gathering and communication. At that point, the Pi will be at a location where standard power is available and consumption will not be a concern. Going to be a while though... Lots of learning to do first.

At any rate, I wanted you to know that your efforts are greatly appreciated. This to me is what Perl Monks is about. I never fail to learn something here...

...the majority is always wrong, and always the last to know about it...

A solution is nothing more than a clearly stated problem...


In reply to Re^2: DBD::SQLite - Can't Connect to file - Solved by wjw
in thread DBD::SQLite - Can't Connect to file - Solved by wjw

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.