• Monitoring a SunPower Solar System

    [Update: Here is a new Node-RED flow that works better with Home Assistant's Energy Dashboard.]

    After years of waffling on if I should install solar on my house, I finally decided that it would be a good investment. While the federal tax credit went down from 30% to 26%, I would still get a bit of my investment back. The tax credit goes to 22% next year and then goes away, so if I didn't make the leap now, I'm not sure financially it would make sense for a long time until the panel prices come way down.

    Like most major investments, I did a significant amount of research. I got proposals from 9 companies using a variety of panels and inverters. For better or worse, I went with a SunPower system. SunPower wants to make it easy for people to see how much energy they are producing and their monitoring site has a very, very simple dashboard. Apparently their older dashboard (still available via a different URL that uses Flash) showed output on a per panel basis. When I asked SunPower about this, here was their response:

    Unfortunately, our monitoring website only shows production data of the system as a whole. Inverter level monitoring was only offered to dealers for troubleshooting and/or repair purposes. This was not offered to homeowners because, after lengthy evaluation, that feature offers more information than is necessary to monitor ongoing system performance, but not enough information to help identify problems (on the rare occasions when they do occur). We also had concerns about the feature’s design, in part due to negative feedback from customers.

    After a bit of research, I found that the monitoring device (PVS6) actually has the ability to be queried for local data. An individual with better hacking/detective skills than me figured out the commands to send to the unit and posted information on GitHub describing the setup. That looked pretty straight forward. So I decided to figure out how to integrate it into Home Assistant and into my Grafana graphs.

    First step was to configure a Raspberry Pi as basically a bridge where HTTP requests sent to one port would be redirected out the other port. I didn't need a full fledged router for this, just an HTTP proxy. I decided to use a Raspberry Pi Zero W that I had lying around as a base. I ordered an Ethernet adapter for it and that was it for hardware. My son designed a case for both pieces and I 3D printed it.

    Configuring the Raspberry Pi

    1. Download the Raspberry Pi Imager
    2. Select the Raspbian Lite image.
    3. Write the image to an SD card.
    4. Create a file called wpa_supplicant.conf at the root of the image with the following:
      ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
      update_config=1
      country=US
    5. Printing on a Glass Bed and printing really flexible filament

      When I purchased the Ender 3 Pro, I liked the idea of the magnetic flexible bed so that prints would easily come off of it. Reading on various forums, a large number of people seemed to prefer glass beds with either hairspray or a glue stick to get prints to stick to the bed. I've had good success with the magnetic bed, so I just filed the glass bed information in the back of my head.

      As I wrote recently, I've been printing using flexible filament just because I think it is kind of neat. The ease with which I was able to print amazed me as I had read about people having problems left and right with flexible filament. In response to a video about a broken extruder by Chuck Hellebuyck, I commented that I had no problems printing TPU using on my Ender 3. Chuck pointed out that there are different types of TPU characterized by their shore hardness, which should have been obvious to me, but didn't dawn on me until Chuck's response. The SainSmart Flexible TPU filament has a shore hardness of 95A meaning it is pretty stiff and basically prints like PLA. This got me curious about printing more flexible filaments, so I purchased a roll of NinjaTek NinjaFlex which has a shore hardness of 85A and is basically light spaghetti.

      My first print with it with the following settings:

      • Infill density: 10%
      • Print Speed: 10 mm/s
      • Regular Fan Speed: 0%
      • Regular Fan Speed at Layer: 1
      • Material Flow: 110%
      • Enable Retraction: Off

      Seemed to work OK, but the bottom layer wasn't the best.

      After thinking I was successful, I tried printing a poop emoji for my son. No matter what I tried, I couldn't get the TPU to stick to the bed. After a few unsuccessful tries, the filament started jamming in the extruder. Ah yes, exactly what Chuck said would happen. I ordered an EZR Struder to help with the extruding. However, that would only solve part of the problem. The other part was getting the print to stick to the bed.

      I was somewhat prepared to use a glass bed as my wife had some scrap glass from a project of hers and I asked her to save a few pieces for me. She cut down the glass for me and then I beveled the edge and polished the edges. I removed the magnetic build sheet and put the glass bed on top of the magnetic layer on the bed. Since I could only find one binder clip, I used blue painter's tape to tape the glass to the bed.

      For my first test, I cleaned the glass, put down 3 layers of glue, and printed a test cube. It printed out quite well, but was a bit of a challenge getting off the glass. I really liked how smooth the bottom of the cube was compared to the magnetic bed.

      For my next test after installing the EZR Struder was to print a small poop emoji. From the settings above, I increased the flow to 115%. I put down the layer of glue and printed. The print came out flawlessly and it had no problems during the print.

      Lessons learned:

      • Different hardness TPU prints differently (duh!)
      • A glass bed with a glue stick makes a world of difference in adhering prints (especially TPU) to the bed
      • The EZR Struder is absolutely necessary to print more flexible TPU; if you are printing the stiffer TPU, the stock (or replacement metal) extruder works fine.

      With this new setup, can I print the NinjaFlex faster? Only one way to know and that's to try it!

      I'm quite pleased with the new extruder and the glass bed. 3D Printing is definitely a trial and error process. Each change, be it large or small, can have huge ramifications. If you combine them, it makes it even harder to figure out what is good. I'm having fun with this and learning a huge amount.

    6. 3D Printing Using Flexible Filament (TPU)

      Through my short journey with 3D printing, I've spent a lot of time reading through the 3D Printing SubReddit and something that I found interesting was people talking about printing using flexible filament (TPU). While I didn't have a real use for printing squishy things, I was curious. A few weeks ago, I purchased a roll of SainSmart Flexible TPU filament to see if I could print.

      The forums and other references indicated that printing flexible filament was difficult because pushing the filament through the printer was like pushing a wet noodle! Some people had said that they printed with the stock printer, others said that for best results they modified the printer into a direct drive system. I was up for the challenge!

      Before I started, I had already made the following modifications to my printer:

      • Replaced the extruder with an all metal one

      • Replaced the Bowden feed tube with a Capricorn one. The basic gist behind this change was that the tighter tolerances on the tubing doesn't allow the filament to wiggle around and bunch up. In addition, when switching filaments, I don't have to purge as much filament as very little gets stuck in the tube.

      • Added a filament guide that I printed. This should create a smoother path for the filament.

      • Added a filament runout sensor with guide. The main goal with this modification was to be notified when filament runs out so I can change it during a print. It also really helps feed the filament (with the flexible filament, I have to push down the microswitch to feed it).

      • Added a filament holder with bearings. This took awhile to print, but has been great. On my first flexible print, I noticed the extruder was having trouble pulling the filament because the roll wasn't spinning freely. I helped things along, but realized that reducing friction would be a big help.

      • Leveled the bed manually and with the BLTouch.

      Other than that, I'm using the stock magnetic bed that I cleaned.

      My Cura settings are pretty straightforward.

      For the TPU material settings, I used:

      • Print temperature: 215°C
      • Build plate temperature: 50°C

      Profile settings:

      • Infill density: 10% (I was printing something squishy)
      • Print Speed: 20 mm/s (I'm going to try increasing this as things worked well)
      • Regular Fan Speed: 0%
      • Regular Fan Speed at Layer: 1
      • Material Flow: 110%
      • Enable Retraction: Off

      That's really all there was to my settings. Since I'm sometimes not the most adult person, I thought it would be funny to print a Poop Emoji for my son. It was squishy (10% infill) and I printed it at 50% of the original size keeping the print time to about 2 hours. My son absolutely loved the print. I was amazed at the print as I did it on the first try with my cold printer.

      I'm going to keep experimenting with TPU and try to figure out what else I can print. I have no need for flexible filament, but why not print more stuff!

    7. Installing a BLTouch on an Ender 3 Pro

      I recently purchased a Creality Ender 3 Pro 3D printer as an "upgrade" to my Monoprice Select Mini Pro printer. There were a few reasons I decided to do this:

      1. Larger print area. While the Select Mini Pro is a great little printer, I am limited to what I can print and I've started getting interested in printing lithophanes which can get a bit larger than the printer can handle.
      2. Automatic bed leveling has no fallback. The Mini Pro uses an inductive sensor for automatic bed leveling and if that fails, I either have to replace it or am pretty much out of luck (someone has posted instructions on how to level the bed if the sensor fails, but it is a tad cumbersome).
      3. No ability to switch out the build plate for glass or another material. I've done a lot of reading about 3D printing and people swear by glass build plates and the Select Mini Pro doesn't make it easy to add one. A shim has to be added to the Z axis limit switch and then you have to figure out the bed leveling.
      4. Limited to what filament types can be used. The printer has a maximum build plate temperature of 70°C and limited nozzle temperature which can limit the filaments used. Also, I've read that while some people have had success with TPU (a flexible filament), it may not work so well.
      5. No ability to modify the firmware for different features. The Ender 3 runs the Marlin firmware which is open source and can be easily modified.

      In any case, I've read about manual bed leveling and while doable, it seems like a lot of work and I like easy! After setting up the printer and running it for a few days, I decided to install the BLTouch automatic bed leveling probe. In the weeks leading up to setting up the printer and the probe, I had read numerous articles and watched a number of videos on the subject, so I thought I was prepared for it. Parts of the setup seemed a bit daunting, but nothing I couldn't handle.

      The first step to installing the probe was printing out a mount for it. Thingiverse has a number of options. I settled on this mount as it was adjustable. Printing it and attaching the BLTouch was quite easy; I didn't have the right size M3 screw, so I had to cut off a longer one.

      After attaching the BLTouch, I had to run the extension wires through the sleeve that had the other wires. This was a little bit of a pain. The only mistake I made here that bit me later on is that the extension cable became disconnected and the BLTouch failed to operate causing the nozzle to hit the build plate. Oops. The lesson here was to hot glue the connectors together so that any jiggling of the cables wouldn't cause them to disconnect. The second lesson is to always make sure the BLTouch performs its self test when the printer powers up.

      Fhew, I'm exhausted just writing that up! After the wires were run, I had to attach them to the motherboard. The BLTouch has 2 connections; the first is done through a pin 27 connector and is just unplug the LCD cable, plug in the connector, plug in the LCD again and attach the 3 wires from the BLTouch making sure the orientation was correct by verifying the labeled pins were attached to the correct, color coded wires. The second part of attaching to the motherboard was to replace the Z axis end stop. The extension cable I bought had a non-keyed connector that just plugged in. Unfortunately it wasn't a secure connection so I used hot glue on it the first time I connected it. On my second poke at the motherboard (due to troubleshooting the connector that came loose as I mentioned earlier), I decided to just cut the wires on the Z axis end stop, solder on the extension cable and use some heat shrink tubing. I had to make sure the white wire was towards the front and the black wire was towards the back. This was a much better connection and has less of a chance of coming close. After I buttoned up the motherboard, it was onto the firmware.

      Once I initially got the printer setup and running properly, I upgraded the firmware mostly to know that I had thermal runaway protection and had the latest changes. Compiling the firmware was straightforward and explained in various posts and videos. Most of the posts talk about installing the initial firmware with a bootloader using an Arduino board. As I don't have any Arduino boards around, I opted for installing using a Raspberry Pi 3B that I purchased to run OctoPrint. I used this guide which was easy to follow and perform the initial install. The printer didn't come with a boot loader which required the extra steps to install the firmware the first time; why this was done, I have no idea. Over the course of a few days, I managed to pick the options I wanted for my firmware. Unfortunately my Creality 1.1.4 board doesn't have much space on it, so I had to disable SD card support. This wasn't a big deal as I do all my printing through OctoPrint. Using the base Ender 3 Marlin 2.0.1 example, I made the following changes:

      Old Configuration.h:

          #define SHOW_CUSTOM_BOOTSCREEN
          #define BAUDRATE 115200
          #define CUSTOM_MACHINE_NAME "Ender-3"
          //#define BLTOUCH
          #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
          #define MIN_PROBE_EDGE 10
          #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
          #define Z_CLEARANCE_DEPLOY_PROBE   10 // Z Clearance for Deploy/Stow
          //#define Z_MIN_PROBE_REPEATABILITY_TEST
          //#define PROBING_FANS_OFF          // Turn fans off when probing
          //#define AUTO_BED_LEVELING_BILINEAR
          //#define RESTORE_LEVELING_AFTER_G28
          //#define LEVEL_BED_CORNERS'
          //#define Z_SAFE_HOMING
          #define SDSUPPORT
          //#define NOZZLE_PARK_FEATURE
          //#define SLIM_LCD_MENUS
      

      New Configuration.h:

          //#define SHOW_CUSTOM_BOOTSCREEN
          #define BAUDRATE 250000
          #define CUSTOM_MACHINE_NAME "Ender 3 Pro"
          #define BLTOUCH
          #define NOZZLE_TO_PROBE_OFFSET { -44, -16, 0 }
          #define MIN_PROBE_EDGE 44
          #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z / 5
          #define Z_CLEARANCE_DEPLOY_PROBE   15 // Z Clearance for Deploy/Stow
          #define Z_MIN_PROBE_REPEATABILITY_TEST
          #define PROBING_FANS_OFF          // Turn fans off when probing
          #define AUTO_BED_LEVELING_BILINEAR
          #define RESTORE_LEVELING_AFTER_G28
          #define LEVEL_BED_CORNERS
          #define Z_SAFE_HOMING
          //#define SDSUPPORT
          #define NOZZLE_PARK_FEATURE
          #define SLIM_LCD_MENUS
      

      Old Configuration_adv.h:

          //#define BABYSTEP_DISPLAY_TOTAL          // Display total babysteps since last G28
          //#define BABYSTEP_ZPROBE_OFFSET          // Combine M851 Z and Babystepping
            //#define BABYSTEP_ZPROBE_GFX_OVERLAY   // Enable graphical overlay on Z-offset editor
          //#define ADVANCED_PAUSE_FEATURE
      

      New Configuration_adv.h:

          #define BABYSTEP_DISPLAY_TOTAL          // Display total babysteps since last G28
          #define BABYSTEP_ZPROBE_OFFSET          // Combine M851 Z and Babystepping
            #define BABYSTEP_ZPROBE_GFX_OVERLAY   // Enable graphical overlay on Z-offset editor
          #define ADVANCED_PAUSE_FEATURE
      

      Downloading the firmware after the first install was easily done through OctoPrint without having to install jumper wires and remove the motherboard. It is so easy that I made changes, recompiled, and uploaded new firmware a few times.

      Was I done yet? Of course not! I hadn't even leveled the bed! Some guides say to add a G29 command to Cura settings which runs the auto bed leveling on every print. Auto bed leveling is slow and that's just a waste of time. So I decided that I'll just level the bed every few days. I started up the printer, did an Auto Home, verified that touching the probe sent the hot end up (if it didn't, I would have stopped the printer). Using OctoPrint, I sent

      G28; auto home