Aurora Inverter Monitoring Done Quick

Last time I set up inverter monitoring for my Aurora solar inverter, it had a lot of moving parts. I had a RaspberryPi ModelB hosting utilities writing to CSV files, which were periodically scooped up by a monitoring service. The monitoring service had a bit of setup and a few issues, but in the end it would get the data up to PVOutput.org.

This time around I decided to cut out all the bullshit and write to the PVOutput API with as little fuss as possible.

Note that to set all this up you will require a free account on PVOutput, and you will need to set up an API Key. You will also need to add your solar details which will give you a system Id.

Curtronics Aurora

Grab this great little utility - Curtronics Aurora. Download, unzip, and install:

wget http://www.curtronics.com/Solar/ftp/aurora-1.9.3.tar.gz
tar -xf aurora-1.9.3.tar.gz
cd aurora-1.9.3
make
sudo make install

At this point you should try a query and see if you can contact the inverter (keep in mind if it is dark outside the inverter is probably powered down).

Try the following command:

/usr/local/bin/aurora -a 2 /dev/ttyUSB0 -Y15 -e

If you are not having any luck, check if /dev/ttyUSB0 is correct (this is your usb-to-serial device). You should be able confirm it by reading through your start up messages with dmesg.

solar-logger.sh

Save this script in your home folder as solar-logger.sh.

If you are using the default pi user, the path will be /home/pi/solar-logger.sh

Make sure you set execute permission: chmod 755 solar-logger.sh

#!/bin/bash

# configuration
apikey="your api key here"
system="your system Id here"

rd=$(date +%Y%m%d)
rt1=$(date +%H)
rt2=$(date +%M)
rt="${rt1}%3A${rt2}"
solarout=`/usr/local/bin/aurora -a 2 /dev/ttyUSB0 -Y15 -e -c | awk '{printf $1}'`
solarwatts=`echo ${solarout} | sed -e "s/\.//"`
url="https://pvoutput.org/service/r2/addstatus.jsp?d=${rd}&t=${rt}&v1=${solarwatts}"

# only make the request if we have a value from the inverter
if [[ ! -z $solarwatts  ]]; then
    result=`curl -H "X-Rate-Limit: 1" -H "X-Pvoutput-Apikey: ${apikey}" -H "X-Pvoutput-SystemId: ${system}" ${url}`
    if [[ $result == *"OK"* ]]; then
        echo "${rd} $(date +%H:%M) : API call successful, power output: ${solarout}"
    else
        echo "${rd} $(date +%H:%M) : API call failed, ${result}"
    fi
else
    echo "${rd} $(date +%H:%M) : Inverter communication failure"
fi

Cron Job

Edit your crontab (using crontab -e) and add the following record:

*/5 5-18 * * * /home/pi/solar-logger.sh >> /home/pi/solar-log.txt

This cron task will run the solar logger every 5 minutes between the hours of 5am and 6pm. You may want to adjust those times depending on your latitude.

This will give you a solar-log.txt file with entries like this:

20191201 18:25 : API call successful, power output: 20.373
20191201 18:30 : API call successful, power output: 20.373

Once you start seeing successful API calls you should be able to see your shiny new chart on PVOutput.

pvoutput live output chart

Troubleshooting

If you are having issues, check the permissions on the aurora binary (755 should work).

/eof

Bathroom Vanity Ikea Hack

2 weeks ago I decided my pink 80's vanity had to go. It occupies a 1680mm space in the "powder room", which is not exactly a standard size for a vanity unit.

Ikea to the rescue. Having installed an Ikea kitchen before, I had an idea of the pain and suffering that was to come. The cabinets are decent, but do have some oddities. For example, Ikea vanity drawers are not solid, they use a weird slat system. On the plus side, the runner mechanism is an Australian manufactured Blum part with soft close.

Ikea vanity before and after Before and after

Ikea vanity drawers Ikea vanity drawers are weird, but work well

To fill the space I needed 3 Ikea GODMORGON cabinets - one 80cm unit, and two 40cm units.

Ikea vanity benchtops are only 120cm long, so I used one of their kitchen benchtops. I went for the EKBACKEN "concrete" look model. I had to cut it to size - kitchen benchtops are 60cm deep, versus 49cm for a bathroom benchtops.

The sink is a HORVIK and the tap is the tall version BROGRUND. Note that the sink includes a trap.

Plumbing was surprisingly easy. The trap Ikea supply is designed to fit in a compact space. It gets tucked at the back behind the drawers.

Basic install notes

These cabinets need to be bolted to wall studs. You will probably find that the studs do not line up with all of the cabinet mounts. What you can do is run a small timber rail along the length of the wall for the cabinets to rest on. That will allow you to screw the rail into the wall studs at the bottom.

For the cabinets themselves, as long as you can get at least 2 of the mount points lined up to studs - that is fine. For the other mounts, drill 25kg rated wall mate plasterboard anchors in.

Ikea vanity install

Cabinet joiners

Cross connect the cabinets using these handy cabinet joiners (one per each corner of each cabinet).

The benchtop can be installed using some silicon caulk along the tops of the cabinets, with l-brackets if you feel a stronger bond is needed.

Finishing touches

  • used a bench off cut at the back of the bench to "frame" the vanity unit
  • cut down some Ikea gloss white filler panels to fill the edge gaps
  • charcoal black caulk between the sink and bench, and the back of the bench
  • white caulk along the wall edges

Costs

Here is the cost break down (in Aussie dollars):

Item Price
HORVIK Sink $149
BROGRUND Tap $129
GODMORGON 20cm cabinet $230
GODMORGON 20cm cabinet $230
GODMORGON 40cm cabinet $320
EKBACKEN Worktop $79
Caulk white $10
Caulk "charcoal" $10
Plumbing supplies $30
Total $1,187

Overall I'm happy with these cabinets.

/eof

Make great git diagrams

If you’re a developer, sooner or later you find yourself having to talk about git branching strategies. Drawing this up in a drawing tool can be very time consuming for most of us mere mortals. Luckily there is a great little javascript library that exists purely for making git branching diagrams.

See the nice diagram below? it is being created in real time by gitgraph.js.

Setting things up is pretty straight forward. You can install with npm i --save @gitgraph/js, or simply import the CDN version:

<script src="https://cdn.jsdelivr.net/npm/@gitgraph/js" crossorigin="anonymous"></script>

Add a div to the page, then pass that DOM node into createGitgraph. You can roll with the defaults, or pass in customisations via createGitgraph().

Once you graph is created, you draw the diagram in the same way you would work with git branches.

  • Use .branch() against an existing branch to create a new branch
  • Use .commit() against a branch to create a commit
  • Use .tag() to tag a branch
  • Use destinationBranch.merge(yourBranch) to merge

Creating a Custom Template

To create a custom template, call GitgraphJS.templateExtend(templateName, options) where template name is one of the 2 defaults:

  • GitgraphJS.TemplateName.Metro
  • GitgraphJS.TemplateName.BlackArrow

The options object provides all the overrides. To see which objects you can override, take a look in the Gitgraph repo.

Pass the new template object into the create call createGraph():

createGitgraph(container, { template: yourTemplate })

Check out the code sample for more detail.

Browser Support

This library supports modern browsers - IE and Edge do not work. Edge will start working once Edge-Chromoium is out in the wild, but for now stick with Chrome or Firefox.

Code Sample


const graphContainer = document.getElementById("graph-container");

const gitTemplate = GitgraphJS.templateExtend(GitgraphJS.TemplateName.Metro, {
  commit: {
    message: {
      displayAuthor: false,
      font: "12pt sans-serif"
    },
  },
  branch: {
    lineWidth: 8,
    label: {
      font: "12pt sans-serif"
    }
  }
});

// Instantiate the graph.
const gitgraph = GitgraphJS.createGitgraph(graphContainer, {
  template: gitTemplate
});

var master = gitgraph.branch("master");
master.commit("Initial commit");

var develop = gitgraph.branch("develop");
develop.commit("new dev stream").commit("bug fix");

var feature = develop.branch("feature");
feature.commit("Display blog posts in 3d");
feature.commit("Add OpenGL option");
develop.merge(feature, "Pull Request: feature TO develop");

develop.tag("RC1");
master.merge(develop, "Pull Request: develop TO master");

/eof

Put a 12v fan on a 24v 3d printer

More and more 3d printers are coming with 24 volt fans… which can be a problem because 24v fans can be hard to find. Here is how you can attach a 12 volt Noctua fan.

If you want a great, quiet hot-end fan… look no further than the Noctua (NF-A4x10 FLX). It is 12volt, practically silent, and comes with some handy adaptors.

The OmniJoin adaptor is the black connector in the first photo with 2 wires attached. You’ll also need:

  • a cheap buck converter
  • a 2 pin JST plug (for the printer end)
  • soldering iron
  • multi meter

parts Parts needed

Steps

  1. Solder the positive and negative wires from the JST connector to the input terminals of your buck converter.
  2. Ensure the printer is off, connect your multi-meter to the output terminals of the buck converter (set the multimeter for DC voltage)
  3. Plug in the jst cable to your hot end fan header
  4. Power up the printer, and check the voltage on the multimeter. Use a small flathead screw driver to adjust the buck converter voltage down to 12volts
  5. Power down the printer, disconnect the buck converter and solder the OmniJoin adaptor to the output terminals of the buck converter
  6. Mount the buck converter near your hot end. Note that you will need to insulate the back of it if you are fixing it on a metal surface. Electrical tape is fine for this.

You are now able to run 12 volt fans on your printer.

adjusting the voltage Adjusting the voltage

mounted buck converter Buck converter in place

/eof

About

Danny Frencham is a software developer, based in Brisbane Australia.

Projects

Tags