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.