Forum Discussion

full_mosey's avatar
full_mosey
Explorer
Apr 24, 2017

MorningStar TriStar-45 PWM and Raspberry Pi 3 data project

I am working my way through the MS MODBUS Specification specs to capture data onto the RPi3.

The plan is to avoid fixed control panels, and instead, run a web server on the RPi3 and then view info via smartphone, tablet, laptop, etc clients. A mifi will provide LAN connections.

As of last Friday, I have been capturing the 'RAM' data fields for each minute. The fields are listed on page 4.

I have no plans to use spreadsheets. I store the data in an sqlite3 database.

Here is a sample output from an sql query run from the sqlite3 CLI:

day cs cstate avg_bvolts min_btemp max_btemp minutes
---------- -- ------ ---------- ---------- ---------- ----------
2017-04-23 3 Night 12.93 9 25 620
2017-04-23 5 Bulk 13.35 9 26 178
2017-04-23 6 PWM 14.86 10 22 328
2017-04-23 7 Float 13.36 22 27 314

The query displays a summary of the minutes for each control state for the previous day.

The bank is 270ah AGM which should explain the high Night battery Volts. I do run two 12V compressor fridges 24/7.

Looking for Comments, Suggestions, Questions.

HTH;
John

To correct broken MODBUS link. And, yes, I still refer back to this topic.
  • Very good to hear I'm not alone in my madness :)

    I don't have solar, but do have a RPI2 collecting data from my Magnum and several other custom built WiFi sensors and switches around the trailer... it all ties together in a web based "dashboard" that I can bring up on any tablet or smartphone.

    Not familiar with the RPI3, but if it's using one of those tiny microsd cards for the database, you'll want to move the db over to a USB stick or external USB hard drive. The SQL server on my RPI2 burned through two microsd cards already, the constant writes killed the cards dead.
  • full_mosey wrote:
    I am working my way through the MS MODBUS Specification specs to capture data onto the RPi3.

    The plan is to avoid fixed control panels, and instead, run a web server on the RPi3 and then view info via smartphone, tablet, laptop, etc clients. A mifi will provide LAN connections.

    As of last Friday, I have been capturing the 'RAM' data fields for each minute. The fields are listed on page 4.

    I have no plans to use spreadsheets. I store the data in an sqlite3 database.

    Here is a sample output from an sql query run from the sqlite3 CLI:

    day cs cstate avg_bvolts min_btemp max_btemp minutes
    ---------- -- ------ ---------- ---------- ---------- ----------
    2017-04-23 3 Night 12.93 9 25 620
    2017-04-23 5 Bulk 13.35 9 26 178
    2017-04-23 6 PWM 14.86 10 22 328
    2017-04-23 7 Float 13.36 22 27 314

    The query displays a summary of the minutes for each control state for the previous day.

    The bank is 270ah AGM which should explain the high Night battery Volts. I do run two 12V compressor fridges 24/7.

    Looking for Comments, Suggestions, Questions.

    HTH;
    John


    Comment Number 1: COOL!!!!!!!!!! :)

    Number 2: Sounds like you're a RPi expert but just my two cents: invest in a good microSD card if you're hammering the card with IO, like sqlite will do. I have 6 RPis in the house, and when I buy cheap SD cards they last about 8 months. I bought a couple of Samsung SD cards and they've gone three years.

    Web Server - Not sure if you have a favorite, but if not I've been running lighttpd on my home Pi and like it. Small. Solid.



    I've got an RPi3 with a SensorHat in our coach collecting environment and OBD2 data. I'll follow your lead if/when we add solar!

About RV Must Haves

Have a product you cannot live without? Share it with the community!8,793 PostsLatest Activity: Feb 08, 2025