• Camera, Video, and Time-lapse

    Laz01/27/2015 at 23:32 0 comments

    One of my main goals with the Octopi was to be able to generate time-lapse videos of my 3D prints. I purchased the Raspberry Pi camera board, and followed the directions for connecting it to my Pi. More to come...

  • Image and Configuration

    Laz01/22/2015 at 03:14 0 comments

    I started the process by downloading the latest image of octoprint. I've tried starting with more general images and pulling the requisite packages in, but I end up with lots of stuff that I don't want on my card. You can start by finding the most recent image linked from Octoprint.

    Getting the image on the card was accomplished through the "dd" tool from linux command line. The raspberry pi foundation has a great tutorial on their webpage, located here.

    With the image now loaded on the card, I put it into the Raspberry Pi and booted it up. By default, the image is set up to run raspi-config on the first boot. For this boot, you need to have a mouse, keyboard, and monitor connected to the Raspberry Pi. During that first setup, I changed some stuff to make that unnecessary. Here is the list of things that I changed:

    • Expand Filesystem - to make sure that there is no unused space on the SD card.
    • Change User Password - the default password is widely known, so make up a new password to help keep your Pi safe.
    • Internationalization options - I set my timezone to US Eastern and change my keyboard layout to US Dvorak.
    • Enable Camera - using the time-lapse feature of octoprint is on my list.
    • Advanced options> SSH - enable ssh so that I can communicate with my pi without needing a monitor

    At this point, I'm ready to reboot my RPi. The reboot this time takes me to user log-in. The default user is pi, and the default password is raspberry (but hopefully you changed this). The plan is to use SSH to allow us to connect to the Octopi without having a mouse, keyboard, and monitor connected. Right now, the SSH is enabled, so I can connect to my Octopi by typing "ssh pi@octopi" and being prompted for my password. There are still some steps to take for convenience and security.

    The plan is to add a user with the same username that I have on my laptop. That way, when I SSH into the Octopi, I won't have to specify a username. Again, Raspberry Pi Foundation to the rescue! See page here. After adding my new user, I'll add the user to the list of sudoers, still following directions from the last link. At this point, I should be able to SSH into my octopi from my network by typing the command "ssh octopi", no "user@". It will however ask me for a password, and that's the next thing to change.

    Now that I have a user with the correct credentials and permissions, the next thing I want to do is create a set of SSH keys for that user. I don't like using passwords for SSH authentication because it's relatively insecure. Using keys takes a little bit of setup, but saves time in the long run because you won't have to worry about remembering or using passwords.

    For this process, Github has a great tutorial to describe how to set up SSH keys here. If you've never done this from your computer, you'll need to follow the key generation process on your computer first so you'll be able to have a key pair that you can use for authentication from your computer to any other computers, such as your Octopi. Their tutorial is a bit specific to using with Github. Once I've created the key pair on my Octopi, I want to copy the public key to the authorized_keys file to any computer that I want my Octopi to be able to SSH into. Likewise, I want to send the public key of my laptop to the authorized_keys file of my Octopi. There is a command all set up for this: ssh-copy-id. Since I've already set up a user with the correct name, I can simply type in "ssh-copy-id octopi". I'll be prompted for my password one last time, then my public key will be pushed into my Octopi's authorized key list. At this point, I can now ssh into my Octopi by typing in "ssh octopi" and it'll connect and authenticate using my key pair and never ask me for a password again. Ta-da!

    Now, that we can ssh into the octopi with key-based authentication into our newly created account, and the account has sudo access, we want to remove the ability to log into ssh using passwords at all. Right now, if someone had access to the...

    Read more »