Sunday, November 09, 2025

Configuring IPv6 on pfSense Behind an AT&T BGW210 Gateway

 

How I Configured IPv6 on My Home Network Using pfSense and an AT&T BGW210 Gateway

Introduction

IPv6 adoption has been steadily growing, and configuring it correctly in a home network can improve gaming, streaming, and overall connectivity. In this post, I’ll walk through how I set up IPv6 on a pfSense router behind an AT&T BGW210 gateway. This setup provides fully functional IPv6 for all devices on the LAN while keeping the network secure.


Network Overview

  • ISP: AT&T U-verse

  • Gateway/Modem: AT&T BGW210 (model 700 series)

  • Router: pfSense 2.7.2-RELEASE

  • LAN Devices: Mix of macOS, Windows, and smart home devices

  • IPv6 Goal: Enable full IPv6 connectivity for LAN devices, including gaming and VoIP, with minimal configuration and proper inbound/outbound traffic control.


Key IPv6 Challenges with BGW210

The BGW210 is a typical AT&T gateway, which presents a few unique challenges:

  1. It provides only a single /64 IPv6 subnet to downstream routers in IP Passthrough mode.

  2. It does not support full prefix delegation to multiple LAN subnets.

  3. The WAN interface of pfSense receives a single IPv6 address, and the delegated prefix is “virtual” — pfSense cannot track it automatically.

As a result, a standard Track Interface setup won’t work. Instead, we assign a static IPv6 to the pfSense LAN interface and use Router Advertisements (RA) to let clients auto-configure their own addresses.


pfSense IPv6 Configuration

WAN Interface

  • IPv6 Configuration Type: DHCP6

  • Do Not Wait for RA: Checked (required for AT&T)

  • Prefix Delegation Size: 60 (ignored by AT&T, still recommended)

  • Send IPv6 Prefix Hint: Checked

  • IPv4 as Parent: Checked

  • Firewall Consideration: Allow ICMPv6 inbound (all types recommended for proper connectivity)


LAN Interface

  • IPv6 Configuration Type: Static IPv6

  • IPv6 Address: 2600:xxxx:xxxx::1/64 (redacted example)

  • Router Advertisements (RA) Mode: Assisted

  • DNS via RA: Enabled, mirrored from DHCPv6

Notes:

  • Prefix length /64 is required.

  • Clients receive addresses automatically via SLAAC.

  • Temporary privacy addresses are generated automatically by macOS, Windows, etc.


Firewall Rules

LAN (Outbound)

  • Rule Type: Pass

  • Address Family: IPv4 + IPv6 (combined)

  • Protocol: Any

  • Source: LAN net

  • Destination: Any

WAN (Inbound)

  • Allow ICMPv6: Protocol ICMP, Type: any (ensures RA, NDP, and PMTU work)

  • Optional: Specific TCP/UDP ports for gaming or VoIP

NAT is not required for IPv6; firewall rules handle inbound/outbound traffic.


Client Verification (macOS Example)

  1. Open Terminal and run:

ifconfig en0 | grep inet6
  1. Expected output:

inet6 2600:xxxx:xxxx::abcd prefixlen 64 autoconf inet6 2600:xxxx:xxxx::ef12 prefixlen 64 autoconf temporary inet6 fe80::xxxx prefixlen 64 scopeid 0xf
  • Global IPv6 addresses (2600:…) are assigned via RA/SLAAC.

  • Temporary addresses are for privacy.

  • fe80:: is the link-local address.

  1. Test connectivity:

ping6 google.com

Additional Settings

I found out also through this page that the AT&T gateway has limited states so we should limit the number of states on pfSense to not go over it.

Set the pfSense state limit in Advanced -> Firewall & NAT -> Firewall Maximum States
 to 7500 as suggested

Why This Setup Works

  • All LAN devices automatically receive a global IPv6 address from the pfSense LAN /64.

  • ICMPv6 rules ensure proper Neighbor Discovery, Path MTU, and RA messages.

  • Games and VoIP apps that support IPv6 can connect directly without NAT.

  • Minimal configuration is required — no manual IP assignment on each device.


Conclusion

Even with AT&T’s BGW210 gateway, which only provides a single /64 and limited prefix delegation, it is possible to configure a fully functional IPv6 LAN using pfSense. The key is to assign a static IPv6 on the LAN interface, enable RA in Assisted mode, and allow ICMPv6 traffic on the WAN.

This setup ensures modern devices get the benefits of IPv6 automatically while keeping your network secure and accessible for gaming and VoIP.

Sunday, March 10, 2024

How to download photos from an Amazon Photos Album



Option 1: To download all the photos in the album

Click on the vertical 3 dots icon on the top right. A menu should open allowing you to download all of them.




Option 2: To download a single photo

Open the photo you want to download so you can see the big version of it. Then click on the horizontal 3 dots icon on the top right to expand the menu with the download option.



Saturday, November 19, 2022

Getting my old Logitech Quickcam Pro 4000 to work on Octoprint

 The library that Octoprint uses to connect to a webcam and stream images to the octoprint window is called mjpg-streamer. It works for many webcams, but of course not my trusty Logitech Quickcam Pro 4000. Upon further investigation it turns out my camera only supports the Y12 format but that library can support just the YUV version of that format (there's even a pull request to add support for it). Luckily someone has made their own service called PICS which can read that format and it works pretty well. I forked the project and added some helpful code to allow you to automatically run PICS at boot. Clone the repo, follow the steps to build and run in the Readme, then scroll to the end and follow the steps to "Creating a service to start PICS on boot". This creates a stream that can be viewed at http://octopi.local:8080/dev/video0 which is the URL you can use in the Octoprint WebCam config.




Monday, October 31, 2022

Connecting the Raspberry Pi to the Robin Nano via GPIO pins

Since the Robin Nano board is mounted such that the USB port is only accessible outside the printer, I had to snake the USB cable out through one of the holes and around the printer to reach the port. For a clean installation, I need a way to let the Raspberry Pi connect to the nano using the GPIO pins.

USB port can only be reached from the outside

Currently, however, most of the easily accessible pins are already taken on my board as part of enabling SPI communication on the TMC2209 drivers.

Most easy to access pins are used
So I went hunting for pins that I could use and it turns out most of the pins on the TF connector can at least be used for SPI freeing up the pins on the WIFI connector that are most commonly used for RPI communication. So the plan now is to rewire the 5 SPI wires into a single 9-pin JST-XH connector and then use the WIFI pins for RPI.



Establishing Common Grounds

Before we can hookup I/O pins between separate devices, we need to ensure that they all have a common I/O ground. This is different from grounding the printer (which you should do as well). What I mean is that the negative terminal on the DC side of all the power supplies should be connected together. This ensures that the 24v line from the 24v PSU is actually 24 volts above any of the DC grounds and the 5v line from the 5v PSU is actually 5 volts above the same ground lines. When I had the USB cable connected, there was a ground wire that joined the PSU's together. Although, I could have added a ground wire as part of the wires connecting the RPI with the Robin Nano, its usually better practice to join the PSUs directly to minimize any current going over the ground GPIO pins.

In the end, I connected the GPIO pin14/15 (which are pins for a serial port) on the RPi4 to pins PA10/PA9 on the Robin Nano, respectively. Note that you must cross the wires so that the TX from one boards goes to the RX pin on the other board and vice versa. 

Klipper/RPi Configuration

Next, I had to build a new klipper firmware so that it would know to listen on the correct pins.
I ran through make menuconfig as per the klipper installation instructions being sure to use the same settings described in the top of my printer.cfg regarding booloader size, startup pins, etc. The difference this time, is I picked the serial connection to match the new pins we're using.




After this I: 
  1. saved the config
  2. ran "make" to build the image
  3. used the mks script to convert the image to one compatible with robin nano
  4. used Filezilla to get the file onto my computer
  5. copied image to sd card
  6. booted robin nano with sd card (the image file will get renamed with a *.CUR extension)
Next I had to configure printer.cfg to use the correct serial port. Klipper docs don't document this correctly. They assume you are using USB. Instead of using their command, use "ls /dev/serial*" but at this point the serial ports are not configured correctly. This doc proved helpful: https://docs.google.com/document/d/1kFasg5H_YDpIwc0PZpKph6RTX4BPROkNgTojQ0RWks8/edit

Basically, I first need to configure RPi to disable bluetooth, enable serial ports, disable shell on serial ports. This was done with a combination of editing /boot/config.txt and running raspi-config.
After all was set and done, I had 2 serial interfaces /dev/serial0 and /dev/serial1 with serial1 mapped to /dev/ttyS0 which is the one that corresponds to the GPIO pin 14/15.

Finally, in printer.cfg under the [mcu] section, I set the "serial" to "/dev/ttyS0". Restarted everything and then it all worked.
 

Wednesday, August 17, 2022

Crashplan Scripts on QNAP

 Looks like QNAP will delete/recreate many directories like /root when it reboots so you can't keep your crashplan scripts there. You can get around this by creating a shared directory. I made one called scripts which can be access by /share/scripts.

I put the update scripts there too so now I can ssh into the QNAP, cd to /share/scripts and run update_crashplan.sh.


Sunday, June 26, 2022

Refuting the Chinese Room Argument

This post assumes you already know about the Chinese Room Argument developed by John Searle.

Before I refute it, let's begin with a simple explanation of what the experiment entails:

  • A person who understands Chinese writes down a message using Chinese characters and places it into the mail slot of a room. The person cannot observe anything about the room's contents including what is going on inside of it.
  • Inside the room is John Searle, he has buckets of Chinese symbols and a book that describes for each combination of Chinese symbols, English instructions on how to arrange the Chinese symbols in the buckets onto a piece of paper which he send back out through the same mail slot. Searle, himself has no understanding of Chinese, he blindly follows the instruction in the book.
  • The person outside the room, reads the message from Searle and because it's content and the fact that it is written in Chinese is then convinced that there must be a person who understands Chinese in the room.
  • Because Searle never understands Chinese, he is only performing syntactic symbol manipulation. There is no semantics going on. Without semantics there can be no strong AI.
Let me now write the steps of the thought experiment down so it's clear before I make changes to them:
  1. Chinese speaker writes down message, places it in mail slot
  2. Searle looks at message, thumbs through book to find matching page
  3. Searle follows the instructions on the page to form a response
  4. Searle places the response back through the mail slot
  5. Chinese speaker reads Searle's message and concludes Searle understands Chinese
Now suppose we make a small alteration to the experiment, but in a way that you shall see is immaterial to the experiment itself.
  • Suppose that the room has a 2nd mail slot on the back wall that leads to a 2nd room. Just as the Chinese speaker cannot see into Searle's room, Searle cannot see into the 2nd room. Additionally, to the Chinese speaker, the original room and this room are identical (conceptually the original room is divided into 2 rooms internally).
  • The book that Searle uses is also different. It still contains all the same Chinese symbols except now, the place where there were English instructions is blank.
  • Searle however can now tear out that page from his book and place it into the 2nd mail slot and within a negligible amount of time, the page will be returned through the same slot with the previously missing English instructions. Assume these instructions match the instructions in the original experiment.
So now let's write these new steps down:
  1. Chinese speaker writes down message, places it in mail slot
  2. Searle looks at message, thumbs through book to find matching page
    1. Searle tears out the page and places it into 2nd mail slot
    2. The page is returned with the instructions on it
    3. Searle puts the page back into his book
  3. Searle follows the instructions on the page to form a response
  4. Searle places the response back through the mail slot
  5. Chinese speaker reads Searle's message and concludes Searle understands Chinese
As you can see, the additional steps we added are inconsequential to the experiment. Whether the page already had the instructions on it or whether Searle performs an extra step using purely syntactical operations to get that instruction, the result is the same. Searle still doesn't understand Chinese, so we must conclude there is no Chinese understanding going on and thus strong AI is false.

But wait! I haven't told you what was in the 2nd room

Inside the 2nd room was a person who understands both Chinese & English. He/she used their understanding of Chinese to formulate a response in Chinese, then used their understanding of English to create the necessary instructions for Searle to construct that response.

So what's the problem?

The Chinese room is an analog for a Turing Machine (aka digital computer). By having Searle in essence "be the computer", the idea is that if Searle never understands Chinese, then all computers for which he is an analog for would never understand Chinese either. The test requires that if Chinese understanding were to exist in the Chinese room, then it must be within Searle. Is that true though? Because, didn't we just show that understanding could definitively be in the Chinese room and entirely separate from Searle?

A test that fails to detect what it's meant to detect, shouldn't be used to infer anything.

Systems Reply?

Some may point to Searle's systems reply as a rebuttal. Namely that Searle could internalize the content of the book (with the instructions). However doing so results in the same conclusion that he made --> Searle doesn't understand Chinese and that's precisely the point. In this case, where we know Chinese understanding exists, we'd want Searle to then understand Chinese (not only that the same understanding of Chinese as the person in the 2nd room).

I don't believe the 2 experiments are truly identical, surely their difference is consequential

Okay, lets have the same person from the 2nd room go through the entire book filling out the instructions, then and only after doing all of them, he places the book in Searle's original room and leaves. The Chinese room starts off indistinguishably from the original. The room, book, people are all the same. The only difference being the author of the book. In the original it's a programmer, in the 2nd it's the person who understands Chinese and English. 

Monday, January 31, 2022

[3D Printer Series] AC powered heated bed and safety

 A normal 24v DC heated bed usually takes a while to come up to temp, especially if you want to print with higher temperature filament. Not only does it take a long time, but it also consumes a lot of the PSU power. That's why if you want to heat up your bed faster, you'll want an AC powered unit.

I purchased this:

Which perfectly fit my new cast aluminum plate and it's mounting holes. Since we can no longer use the Robin Nano controller board to feed this 120V AC and 750 watts is much more than my PSU can handle, I also got a 40amp solid state relay (SSR). You'll want an SSR so that the Robin Nano can still control the heater with a PWM signal. The SSR needs to support a control input of 24V DC and be able to switch 120V AC. For our needs a good quality 10A SSR would suffice but since I don't trust these off brand models I went with a 40A model for extra insurance.

DC to AC 40A SSR

Thermal Runaway

Even good SSRs can fail and the worst way for it to fail is if they fail with the circuit closed (i.e. permanently on) which would mean there's nothing stopping the AC power from flowing to the heater until it catches on fire. 

First line of defence: Thermal Fuse

To prevent this, I added a thermal fuse in series with the wire for the heater power. If the temperature exceeds a certain level, the fuse should blow and the heater should get disconnected. To attach the thermal fuse, I used RTV silicone sealant, which seems to be the adhesive of choice for this task among the Voron crowd. Then to insulate the bottom, I added a self stick foil faced insulated pad used on automobiles. The adds another layer of insurance to keep the thermal fuse in contact with the heater pad.
 
Thermal Fuse

Insulated Pad

RTV Silicone Sealant

2nd Line of defense: Pi controlled relay

Relying just on the thermal fuse might be okay if you plan to continuously monitor your printer but I don't want to monitor my prints so closely. So for an added measure of safety, we want to make sure our heater bed remains disconnected at all times except when the bed is heating. A regular relay can do this for us if we connect the wires leading to the SSR through our relay using the relay's NO (normally open connection). This is nice because we have to actively supply power to the relay to keep the power flowing to the heated bed. The relay I used is the Elegoo 4 relay module. It's nice because the inputs can be isolated from the power used to energize the relay coils.
Elegoo 4 relay module

Why do we need to electrically isolate?

The logic/GPIO pins on the RPi operate at 3.3V but the coils on the relay work on 5V. To make this work we need to separate the relay's logic voltage from the relay's coil voltage. According to the documentation this can be done by removing one of the jumpers:

Remove the jumper to allow mixed voltages

Then you can wire up the module like so. (Note only the top pin under the jumper should be supplied with 5V)


Luckily, the RPi has some 3.3V pins close to some GPIO pins so I chose the first 3 pins since I knew I wanted to control 2 relays, but you can choose the ones that work for you. 
I chose these pins (green), but you do you
For the 5V and ground connections, you can either use the same 5V PSU connections as the RPi or daisy chain it from the header pins (pins 4 & 6).

Configuration

In OctoPrint, I first used the GPIO Control plugin which is good if you want to manually control the relay. The thing to remember is that you need to configure the "Active" dropdown to "LOW" to indicate that activating the relay requires the GPIO pin to be connected to ground (0V). That's usually how these relays work. If you see the relay light come on when you command the pin to be "ON" then it's configured correctly. If the light doesn't come on then you might have a relay that's configured for active "HIGH". If the light works correctly, but the relay itself is opposite, then you've likely wired the output of the relay to the "NC" (normally closed) pin instead of the "NO" (normally open) pin which we want for passive safety. The "GPIO" number should match the label in the pic above.
Active should be set to "LOW" for most relay modules

 Advanced Configuration

Using GPIO Control is relatively straight forward, but you'll have to remember to turn on your heatbed before every print and then turn it off after. I'd rather have Klipper do that for me automatically. Additionally, since Klipper has temperature safety checks, that will shutdown the printer when it detects a temperature abnormality, I want that to also shutdown the relay controlling the heat bed. But how can you get it to trigger a GPIO pin on the RPi? Answer: RPi microcontroller 

You can add the RPi to Klipper as a secondary microcontroller (mcu) and use it's GPIO pins as if it was just another driver board. To do so, follow the instructions in the link above and in the end you should have added something similar to the following lines to the klipper printer.cfg:

[mcu pi]
serial: /tmp/klipper_host_mcu

In my case, I named the RPi mcu as "pi" but you can name it whatever you like, just remember it.
At this point your config doesn't do anything, it just establishes the RPi as something klipper can control. To have it turn on the heated bed when the bed is active we can use the [controller fan] configuration which essentially enables the configured pin when the specified heater is active. Just make sure we keep the speed at 1.0 (ie 100%) since we don't want to pulse the pin on/off. Luckily the default config is just that.

[controller_fan heater_relay]
pin: !pi:gpiochip0/gpio3
heater: heater_bed

Notice that we include a "!" in the pin configuration. That inverts the logic of the pin just like how we set active to "LOW" using GPIO Control. The rest of the pin configuration is explained in the klipper docs.

Now I just start my prints as normal and the heater bed relay turns on automatically, sweet!

Tuesday, January 18, 2022

[3D Printer Series] Understanding how to set z_offset on Klipper

 Z-Offset is a general name for telling the printer how far the nozzle is from some reference point. The reference point can be either a z end stop or the probe position of a bed probe like a BLTouch. The confusing bit is what happens when you have both an end stop and a probe. In that case you'll want to use the end stop to move the z-axis to a fixed position and then rely on the bed probe only for bed leveling/compensation.

Klipper doesn't explain how the different options interact with each other making this process very confusing. Additionally, following their calibration guide will lead you down the wrong path if you are using a similar configuration as me. Here's how I do it and why:

Offset for z end stop/probe for bed mesh

We will essentially be using the z end stop as our absolute reference, but when we add bed mesh leveling there's an important config that makes our bed mesh work relative to the z end stop, and that is the key. You don't need to do PROBE_CALIBRATE as we never try to use the probed position for absolute positioning.

  1. Use the [bed_screws] and [screws_tilt_adjust] configuration to define where the bed level screws are on the xy plane. While you're at it, create an OctoPrint macro/button to move the nozzle above the first screw, this will come handy later.
  2. Next, tighten all the bed screws so the nozzle doesn't crash into the bed.
  3. Use your macro to move the head above the first screw and home the z-axis.
  4. Adjust the first bed screw so that the nozzle is about 1-2 mm above the bed.
  5. Use the SCREWS_TILT_CALCULATE command to level the other 3 screws, repeat till you get it pretty close
  6. ACCEPT when you are done
  7. SAVE_CONFIG
  8. Preheat the bed to your normal print temp
  9. Run Z_ENDSTOP_CALIBRATE but use a feeler gauge to get a precise gap between the nozzle and bed, then subtract out the thickness of the gauge. We do this instead of the paper test because the bed is now heated and the gauge is an accurate thickness. This is your effective z offset. If you get an out of bounds error, you will need to configure the min z position with a small negative number.
  10. ACCEPT when you are done
  11. SAVE_CONFIG
  12.  Add a [bed_mesh] config, but be sure to include a relative_reference_index that corresponds to the first screw position.
  13. Run BED_MESH_CALIBRATE
  14. SAVE_CONFIG, if you look at your printer.cfg, see if you can find the bed mesh values at the end. The value for the relative_reference_index should be 0 if you've configured it correctly.
  15. Do a single layer test print. I use calipers measure the thickness of the layer. I'll then manually change the [stepper_z] position_endstop to tweak the first layer until I get a thickness that matches the thickness specified in the gcode.

[3D Printer Series] Updating Octoprint/Klipper for Python 3

 After upgrading/resurrecting my Sapphire Plus with a new cast aluminum build plate, 750 AC silicone bed heater, SSR, relay board, magnetic textured PEI build surface, I was prompted to update OctoPrint since it was going to stop supporting Python 3. Unfortunately, if you use OctoPrint w/ Klipper the update steps are a lot more involved than explained.

After you update your Raspberry Pi, you basically have to reinstall Klipper as well and installing Klipper on the Sapphire has a lot of special steps that are unique to the Robin Nano 1.2 board that we use. 

You need to follow the klipper install guide: https://www.klipper3d.org/Installation.html , but during the make menuconfig section you need to match this:



Then the make command failed for me. Previously, when running one of the earlier scripts I got a message that looked more like a warning than a true error: 
 InRelease' changed its 'Suite' value from 'stable' to 'oldstable' N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
This turned out to be important and you need to run: sudo apt update --allow-releaseinfo-change

Which then allows you to update all the packages. The subsequent errors to make can be resolved by installing the missing packages using apt-get install <package>

Once make can run successfully, you still need to run (do not attempt to flash the mcu):

./scripts/update_mks_robin.py ./out/klipper.bin ./out/Robin_nano35.bin

Then you can use something like Filezilla to SFTP the Robin_nano35.bin file to your computer and then onto a microSD card to put in the Robin nano. If the LCD screen never goes blank, you will likely have to repeat the process starting from make, but before you do run:

make clean

If the screen does go blank, it means the update succeeded so you should remove the SD card and restart the MCU

Monday, January 17, 2022

Fixing my Blogger Theme

I figured out why I didn't have the same configuration options in my theme as others. Turns out blogger has a completely customizable theme configuration engine (mind blown). You can define variables and metadata about them in your HTML code and then blogger will scan the code and build a dynamic UI for you to tweak it.


My issue was that there was no way to style the fonts for the different heading types in blog posts:


The lesser headings turned out to be bigger than the major ones. This turned out to be a bad CSS rule, but still its good to be able to change it.

So now my headings look like this:

Major Heading

Heading

Subheading

Minorheading

Paragraph

Normal 

Source code syntax highlighting on Blogger

Making code look nice on blogger is pretty hard. Most of the time we use a fancy IDE with syntax highlighting to write the code, but once we want to talk about it here on blogger, all we can show is mono-space text... yuck! The best thing I've found so far is to add hightlight.js as part of the theme HTML. Then whenever you add HTML in the form of:
<pre><code>YOUR CODE GOES HERE</code></pre>

it will highlight it. However if you have HTML in the code, you will still need to escape it first using something like https://www.freeformatter.com/html-escape.html. Also highlight.js will try to figure out the language that you're code is in, but if you want to force it, you can by adding a class="language-<ALIAS>" attribute to the <code> element. For instance, to do Typescript:

<pre><code class="language-typescript">class MyClass extends SubClass {
  private field;
  constructor() {}
}</code></pre>
And you'd get something like this:
class MyClass extends SubClass {
  private field;
  constructor() {}
}


Configuration

Blogger doesn't allow <link> elements in the post template so we have to edit the whole theme HTML to add the CSS styles. Goto the dashboard and click on "Theme" then click on the down arrow next to "Customize"


Then click on "Edit HTML"

And paste in the following code somewhere in the <head> section of the HTML
<link href='https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@latest/build/styles/stackoverflow-dark.min.css' rel='stylesheet'/>
<script src='https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@latest/build/highlight.min.js'/>
<script>hljs.highlightAll();</script>
Like this:


You can find other themes on the highlight.js site, but make sure you use the CDN path like I did so you will always get the latest version.

Friday, December 24, 2021

Automating Crashplan Updates

 In my previous post, I showed the run command I used to get Crashplan running on my QNAP device. Fast forward a few months and Crashplan stopped working because it looks like they have updated their app. Unfortunately, the container image cannot update itself so I wrote a script that goes through the same process described here: https://github.com/jlesage/docker-crashplan-pro#docker-image-update


#!/bin/sh

echo "========================"
echo "Updating container image"
echo "========================"

docker pull jlesage/crashplan-pro

echo "=================="
echo "Stopping container"
echo "=================="

docker stop crashplan-pro

echo "======================"
echo "Removing the container"
echo "======================"

docker rm crashplan-pro

echo "================="
echo "Run the container"
echo "================="

docker run -d --name=crashplan-pro -e USER_ID=0 -e GROUP_ID=0 -e CRASHPLAN_SRV_MAX_MEM=12G -p 5800:5800 -p 5900:5900 -v /share/docker/appdata/crashplan-pro:/config:rw -v /share:/share:ro jlesage/crashplan-pro


Be sure to chmod +x the file so you can run it.

Crashplan on QNAP

Turns out there's a nice docker image that can run on QNAP, but to really use it to its full potential you can't use Container Station because it won't let you map the /share drive into the container.

I use the https://github.com/jlesage/docker-crashplan-pro image and it works wonderfully. This issue really helped: https://github.com/jlesage/docker-crashplan-pro/issues/8

The solution is to SSH into your QNAP, and manually run the docker command. Container Station will then be able to "see" your running container so you can manage it afterwards.

The command to run is:

docker run -d \

    --name=crashplan-pro \

    -e USER_ID=0 \

    -e GROUP_ID=0 \

    -e CRASHPLAN_SRV_MAX_MEM=12G \

    -p 5800:5800 \

    -p 5900:5900 \

    -v /share/docker/appdata/crashplan-pro:/config:rw \

    -v /share:/share:ro \

    jlesage/crashplan-pro

Monday, March 15, 2021

[3D Printer Series] Calibrating a cheap high temp thermistor for accuracy

 If you want to start printing with more functional filaments like ABS, Nylon, Polycarbonate, and even some PETGs you'll definitely want to upgrade to an an all-metal hotend and keep that PTFE tube from getting over 250C where it will start to burn/breakdown. Even with that out of the way you might still run into an issue where your thermistor can't reliably read high temperature either. 

In Klipper, I was getting a "Requested temperature out or range" error when trying to print higher than 250C. After updating my printer.cfg to support higher temps, I then started to get:

MCU 'mcu' shutdown: ADC out of range.


Turns out my stock thermistor starts throwing out invalid numbers once it goes out of the temperature range. To fix this I purchased the WINSINN 3D Printer HT-NTC100K Thermistor for Sensor Heater Block Hotend Extruder - 3x15 3950 Wiring Female 2Pin XH2.54 (Pack of 5Pcs) . Installing it is pretty easy, but I do recommend that you take the time to attach your own connectors if the ones that come with aren't your typical ones.

The hard part however was configuring it in Klipper. There is a built-in config for "NTC 100K beta 3950" which is technically what this thermistor is however, I would recommend people stay away from using it. It turns out that these kind of thermistors work by a property where their resistance changes due to heat. The change though is not linear but curved and the "beta 3950" part of that description is a mathematical description of that curve. Unfortunately, that curve only applies to a very narrow temperature range at the lower end of the spectrum, totally useless for our needs. The Klipper algorithm assumes this beta is correct for the whole range and, in the end, your thermistor will be about 15-20C off at the upper range which is pretty bad.

The best way to configure a thermistor is to actually use it's resistance to temperature table found in the thermistor's datasheet. The one I bought didn't provide one, but I found one that's pretty much the same here: https://www.makeralot.com/download/Reprap-Hotend-Thermistor-NTC-3950-100K.pdf 

Armed with the table, I then had to configure Klipper to use a custom [adc_temperature custom_name] section. The name you put for custom_name becomes the "sensor_type" parameter under the [extruder] section. As you can see I used "winsinn_ht_ntc100k" below. You can copy and paste the code at the bottom anywhere in your printer.cfg as long as it is above the [extruder] section.

Results: Using a thermocouple equipped multimeter, I got consistently no more than 1C difference between this custom config and the thermocouple wedged in the slot of the dragon hotend heatblock where the heater cartridge is. I waited till the temps stabilized before comparing. I also used the klipper command QUERY_ADC NAME=extruder PULLUP=4700  to verify the resistance at various temps and they were in fact matching the table in the datasheet very closely.

[adc_temperature winsinn_ht_ntc100k]
temperature1: -30
temperature2: -29
temperature3: -28
temperature4: -27
temperature5: -26
temperature6: -25
temperature7: -24
temperature8: -23
temperature9: -22
temperature10: -21
temperature11: -20
temperature12: -19
temperature13: -18
temperature14: -17
temperature15: -16
temperature16: -15
temperature17: -14
temperature18: -13
temperature19: -12
temperature20: -11
temperature21: -10
temperature22: -9
temperature23: -8
temperature24: -7
temperature25: -6
temperature26: -5
temperature27: -4
temperature28: -3
temperature29: -2
temperature30: -1
temperature31: 0
temperature32: 1
temperature33: 2
temperature34: 3
temperature35: 4
temperature36: 5
temperature37: 6
temperature38: 7
temperature39: 8
temperature40: 9
temperature41: 10
temperature42: 11
temperature43: 12
temperature44: 13
temperature45: 14
temperature46: 15
temperature47: 16
temperature48: 17
temperature49: 18
temperature50: 19
temperature51: 20
temperature52: 21
temperature53: 22
temperature54: 23
temperature55: 24
temperature56: 25
temperature57: 26
temperature58: 27
temperature59: 28
temperature60: 29
temperature61: 30
temperature62: 31
temperature63: 32
temperature64: 33
temperature65: 34
temperature66: 35
temperature67: 36
temperature68: 37
temperature69: 38
temperature70: 39
temperature71: 40
temperature72: 41
temperature73: 42
temperature74: 43
temperature75: 44
temperature76: 45
temperature77: 46
temperature78: 47
temperature79: 48
temperature80: 49
temperature81: 50
temperature82: 51
temperature83: 52
temperature84: 53
temperature85: 54
temperature86: 55
temperature87: 56
temperature88: 57
temperature89: 58
temperature90: 59
temperature91: 60
temperature92: 61
temperature93: 62
temperature94: 63
temperature95: 64
temperature96: 65
temperature97: 66
temperature98: 67
temperature99: 68
temperature100: 69
temperature101: 70
temperature102: 71
temperature103: 72
temperature104: 73
temperature105: 74
temperature106: 75
temperature107: 76
temperature108: 77
temperature109: 78
temperature110: 79
temperature111: 80
temperature112: 81
temperature113: 82
temperature114: 83
temperature115: 84
temperature116: 85
temperature117: 86
temperature118: 87
temperature119: 88
temperature120: 89
temperature121: 90
temperature122: 91
temperature123: 92
temperature124: 93
temperature125: 94
temperature126: 95
temperature127: 96
temperature128: 97
temperature129: 98
temperature130: 99
temperature131: 100
temperature132: 101
temperature133: 102
temperature134: 103
temperature135: 104
temperature136: 105
temperature137: 106
temperature138: 107
temperature139: 108
temperature140: 109
temperature141: 110
temperature142: 111
temperature143: 112
temperature144: 113
temperature145: 114
temperature146: 115
temperature147: 116
temperature148: 117
temperature149: 118
temperature150: 119
temperature151: 120
temperature152: 121
temperature153: 122
temperature154: 123
temperature155: 124
temperature156: 125
temperature157: 126
temperature158: 127
temperature159: 128
temperature160: 129
temperature161: 130
temperature162: 131
temperature163: 132
temperature164: 133
temperature165: 134
temperature166: 135
temperature167: 136
temperature168: 137
temperature169: 138
temperature170: 139
temperature171: 140
temperature172: 141
temperature173: 142
temperature174: 143
temperature175: 144
temperature176: 145
temperature177: 146
temperature178: 147
temperature179: 148
temperature180: 149
temperature181: 150
temperature182: 151
temperature183: 152
temperature184: 153
temperature185: 154
temperature186: 155
temperature187: 156
temperature188: 157
temperature189: 158
temperature190: 159
temperature191: 160
temperature192: 161
temperature193: 162
temperature194: 163
temperature195: 164
temperature196: 165
temperature197: 166
temperature198: 167
temperature199: 168
temperature200: 169
temperature201: 170
temperature202: 171
temperature203: 172
temperature204: 173
temperature205: 174
temperature206: 175
temperature207: 176
temperature208: 177
temperature209: 178
temperature210: 179
temperature211: 180
temperature212: 181
temperature213: 182
temperature214: 183
temperature215: 184
temperature216: 185
temperature217: 186
temperature218: 187
temperature219: 188
temperature220: 189
temperature221: 190
temperature222: 191
temperature223: 192
temperature224: 193
temperature225: 194
temperature226: 195
temperature227: 196
temperature228: 197
temperature229: 198
temperature230: 199
temperature231: 200
temperature232: 201
temperature233: 202
temperature234: 203
temperature235: 204
temperature236: 205
temperature237: 206
temperature238: 207
temperature239: 208
temperature240: 209
temperature241: 210
temperature242: 211
temperature243: 212
temperature244: 213
temperature245: 214
temperature246: 215
temperature247: 216
temperature248: 217
temperature249: 218
temperature250: 219
temperature251: 220
temperature252: 221
temperature253: 222
temperature254: 223
temperature255: 224
temperature256: 225
temperature257: 226
temperature258: 227
temperature259: 228
temperature260: 229
temperature261: 230
temperature262: 231
temperature263: 232
temperature264: 233
temperature265: 234
temperature266: 235
temperature267: 236
temperature268: 237
temperature269: 238
temperature270: 239
temperature271: 240
temperature272: 241
temperature273: 242
temperature274: 243
temperature275: 244
temperature276: 245
temperature277: 246
temperature278: 247
temperature279: 248
temperature280: 249
temperature281: 250
temperature282: 251
temperature283: 252
temperature284: 253
temperature285: 254
temperature286: 255
temperature287: 256
temperature288: 257
temperature289: 258
temperature290: 259
temperature291: 260
temperature292: 261
temperature293: 262
temperature294: 263
temperature295: 264
temperature296: 265
temperature297: 266
temperature298: 267
temperature299: 268
temperature300: 269
temperature301: 270
temperature302: 271
temperature303: 272
temperature304: 273
temperature305: 274
temperature306: 275
temperature307: 276
temperature308: 277
temperature309: 278
temperature310: 279
temperature311: 280
temperature312: 281
temperature313: 282
temperature314: 283
temperature315: 284
temperature316: 285
temperature317: 286
temperature318: 287
temperature319: 288
temperature320: 289
temperature321: 290
temperature322: 291
temperature323: 292
temperature324: 293
temperature325: 294
temperature326: 295
temperature327: 296
temperature328: 297
temperature329: 298
temperature330: 299
temperature331: 300

resistance1: 1733200
resistance2: 1630408
resistance3: 1534477
resistance4: 1444903
resistance5: 1361220
resistance6: 1283000
resistance7: 1209327
resistance8: 1140424
resistance9: 1075949
resistance10: 1015588
resistance11: 959050
resistance12: 906011.7
resistance13: 856288.3
resistance14: 809650.6
resistance15: 765886.5
resistance16: 724800
resistance17: 685650.7
resistance18: 648892.9
resistance19: 614364.9
resistance20: 581916.9
resistance21: 551410
resistance22: 522690.8
resistance23: 495667.4
resistance24: 470228.6
resistance25: 446271.4
resistance26: 423700
resistance27: 402056
resistance28: 381665.8
resistance29: 362448.8
resistance30: 344330.1
resistance31: 327240
resistance32: 311039.7
resistance33: 295750.6
resistance34: 281315.7
resistance35: 267682
resistance36: 254800
resistance37: 242582.7
resistance38: 231032.1
resistance39: 220108
resistance40: 209772.4
resistance41: 199990
resistance42: 190557.8
resistance43: 181631.9
resistance44: 173182.2
resistance45: 165180.4
resistance46: 157600
resistance47: 150425.3
resistance48: 143623.4
resistance49: 137172.6
resistance50: 131052.8
resistance51: 125245
resistance52: 119658.2
resistance53: 114355.9
resistance54: 109322.1
resistance55: 104541.5
resistance56: 100000
resistance57: 95819.1
resistance58: 91839.2
resistance59: 88049.4
resistance60: 84439.5
resistance61: 81000
resistance62: 77623.8
resistance63: 74409.1
resistance64: 71347.2
resistance65: 68430.1
resistance66: 65650
resistance67: 62983.8
resistance68: 60442
resistance69: 58018.1
resistance70: 55706
resistance71: 53500
resistance72: 51370.8
resistance73: 49339.1
resistance74: 47399.8
resistance75: 45548.3
resistance76: 43780
resistance77: 42055.5
resistance78: 40409.2
resistance79: 38836.9
resistance80: 37335
resistance81: 35899.9
resistance82: 34616
resistance83: 33385.5
resistance84: 32205.9
resistance85: 31074.8
resistance86: 29990
resistance87: 28905.3
resistance88: 27866
resistance89: 26870
resistance90: 25915.3
resistance91: 25000
resistance92: 24109.9
resistance93: 23256.5
resistance94: 22438.1
resistance95: 21653.1
resistance96: 20900
resistance97: 20174.1
resistance98: 19477.4
resistance99: 18808.7
resistance100: 18166.6
resistance101: 17550
resistance102: 16945.9
resistance103: 16365.9
resistance104: 15808.9
resistance105: 15273.9
resistance106: 14760
resistance107: 14281.3
resistance108: 13820.6
resistance109: 13377.4
resistance110: 12950.7
resistance111: 12540
resistance112: 12134.7
resistance113: 11744.7
resistance114: 11369.4
resistance115: 11008
resistance116: 10660
resistance117: 10324.3
resistance118: 10001
resistance119: 9689.5
resistance120: 9389.3
resistance121: 9100
resistance122: 8817.1
resistance123: 8544.4
resistance124: 8281.6
resistance125: 8028.3
resistance126: 7784
resistance127: 7553.8
resistance128: 7331.6
resistance129: 7117.2
resistance130: 6910
resistance131: 6710
resistance132: 6526.5
resistance133: 6349
resistance134: 6177.2
resistance135: 6010.9
resistance136: 5850
resistance137: 5683.2
resistance138: 5522.1
resistance139: 5366.3
resistance140: 5215.6
resistance141: 5070
resistance142: 4929.1
resistance143: 4792.8
resistance144: 4661
resistance145: 4533.4
resistance146: 4410
resistance147: 4290.6
resistance148: 4175.1
resistance149: 4063.2
resistance150: 3954.9
resistance151: 3850
resistance152: 3741
resistance153: 3635.7
resistance154: 3533.8
resistance155: 3435.3
resistance156: 3340
resistance157: 3255
resistance158: 3172.6
resistance159: 3092.7
resistance160: 3015.2
resistance161: 2940
resistance162: 2863.4
resistance163: 2789.3
resistance164: 2717.3
resistance165: 2647.6
resistance166: 2580
resistance167: 2514.4
resistance168: 2450.7
resistance169: 2389
resistance170: 2329.1
resistance171: 2271
resistance172: 2213.5
resistance173: 2157.7
resistance174: 2103.5
resistance175: 2051
resistance176: 2000
resistance177: 1951.3
resistance178: 1904
resistance179: 1858
resistance180: 1813.4
resistance181: 1770
resistance182: 1731.9
resistance183: 1694.7
resistance184: 1658.6
resistance185: 1623.3
resistance186: 1589
resistance187: 1552
resistance188: 1516
resistance189: 1481.1
resistance190: 1447.1
resistance191: 1414
resistance192: 1381.2
resistance193: 1349.4
resistance194: 1318.4
resistance195: 1288.3
resistance196: 1259
resistance197: 1230.1
resistance198: 1201.9
resistance199: 1174.5
resistance200: 1147.9
resistance201: 1122
resistance202: 1095.6
resistance203: 1069.9
resistance204: 1044.9
resistance205: 1020.6
resistance206: 997
resistance207: 975.7
resistance208: 955
resistance209: 934.8
resistance210: 915.1
resistance211: 896
resistance212: 875
resistance213: 854.7
resistance214: 834.9
resistance215: 815.7
resistance216: 797
resistance217: 780.6
resistance218: 764.6
resistance219: 749
resistance220: 733.8
resistance221: 719
resistance222: 702.9
resistance223: 687.3
resistance224: 672.1
resistance225: 657.4
resistance226: 643
resistance227: 630.2
resistance228: 617.7
resistance229: 605.5
resistance230: 593.6
resistance231: 582
resistance232: 571.7
resistance233: 561.7
resistance234: 551.9
resistance235: 542.3
resistance236: 533
resistance237: 522.5
resistance238: 512.2
resistance239: 502.2
resistance240: 492.5
resistance241: 483
resistance242: 473.3
resistance243: 463.9
resistance244: 454.7
resistance245: 445.7
resistance246: 437
resistance247: 428.4
resistance248: 420
resistance249: 411.8
resistance250: 403.8
resistance251: 396
resistance252: 388.4
resistance253: 381
resistance254: 373.9
resistance255: 366.8
resistance256: 360
resistance257: 353.3
resistance258: 346.7
resistance259: 340.3
resistance260: 334.1
resistance261: 328
resistance262: 322
resistance263: 316.1
resistance264: 310.4
resistance265: 304.8
resistance266: 299.3
resistance267: 294
resistance268: 288.8
resistance269: 283.6
resistance270: 278.6
resistance271: 273.7
resistance272: 268.9
resistance273: 264.2
resistance274: 259.6
resistance275: 255.1
resistance276: 250.7
resistance277: 246.4
resistance278: 242.2
resistance279: 238
resistance280: 234
resistance281: 230
resistance282: 226.2
resistance283: 222.3
resistance284: 218.6
resistance285: 215
resistance286: 211.4
resistance287: 207.9
resistance288: 204.5
resistance289: 201.1
resistance290: 197.8
resistance291: 194.6
resistance292: 191.4
resistance293: 188.3
resistance294: 185.3
resistance295: 182.3
resistance296: 179.4
resistance297: 176.5
resistance298: 173.7
resistance299: 171
resistance300: 168.3
resistance301: 165.6
resistance302: 163
resistance303: 160.4
resistance304: 157.9
resistance305: 155.5
resistance306: 153.1
resistance307: 150.7
resistance308: 148.4
resistance309: 146.1
resistance310: 143.9
resistance311: 141.7
resistance312: 139.6
resistance313: 137.5
resistance314: 135.4
resistance315: 133.4
resistance316: 131.4
resistance317: 129.5
resistance318: 127.5
resistance319: 125.7
resistance320: 123.8
resistance321: 122
resistance322: 120.2
resistance323: 118.5
resistance324: 116.8
resistance325: 115.1
resistance326: 113.4
resistance327: 111.8
resistance328: 110.2
resistance329: 108.6
resistance330: 107.1
resistance331: 105.6