I had a couple Pine64 boards sitting in a drawer, and decided it was finally time to replace that old Raspberry Pi running OctoPrint (err, OctoPi) for my 3D printer. The Raspberry Pi has served admirably, but it was definitely time for an upgrade, and a chance to improve a lot of my overall printing workflow.
If you're unfamiliar, the Pine64 is a 64-bit, single board computer. I'm using the A64+ 2GB board, which comes with a quad core ARM Cortex A53 processor operating at 1.2 Ghz, 2Gb of DDR3 memory, dual core graphics, and gigabit ethernet. With double the memory of the Raspberry Pi 3, plus gigabit ethernet, the Pine64 is a steal at just $29.
Downloading an Image
If you're used to a Raspberry Pi, the initial configuration of the Pine64 is going to feel nice and familiar. Start off by grabbing the image of your choice from the Pine64 Wiki. I didn't want a desktop environment, so I'm using the July 16, 2016 Longsleep image. It has to be said that the downloads from the Pine64 Wiki are painfully slow, so even at just ~170Mb, plan ahead a little. Some of the images listed in the wiki are available via torrent, so if go that route, you'll likely see much better download performance.
Creating the SD Card
Identical to the Raspberry Pi process, you'll want to use something like SD Card Formatter to prep your card, then "burn" the image to it using Win32 Disk Imager. If you happen to be using a Pine64 for another project, you'll notice that the Android images are "burned" using PhoenixCard. Note that these processes are not interchangeable; you cannot make a Linux SD card using PhoenixCard.
Once you've got your SD card ready to go, insert it into the Pine64. For my initial setup, I plugged in a local keyboard and mouse, monitor (via HDMI port), and a network cable. The Pine64 is a bit more power hungry than a Raspberry Pi, and consequently you must use a decent quality USB power adapter that puts out a nice clean 2A. I'm using a Power-over-Ethernet splitter for mine, which splits apart a POE network cable into standard gigabit ethernet and a micro-USB for power. Whatever method you choose will work, don't just grab an old mid-2000s USB adapter from a drawer and expect to be successful.
Once you've seen a clean boot, login with the default password for the image you've chosen (credentials will be listed on the Wiki with the download). Any time you've downloaded an image from the community, step 1 should always be to run passwd and change the password! Once you've done that, be sure to expand the root partition to use your full SD card. For my image, a script was included to perform this, so it was as simple as running:
Now is also a great time to grab and install any updates, since your image may be out of date, by simply running:
sudo apt-get update && sudo apt-get upgrade.
One of the things I always wanted to do with my Raspberry Pi, was point OctoPrint at a network share for logs, timelapse videos and uploads. This gets these files off of my OctoPrint machine, allows me to back them up easier, and makes transferring those files between OctoPrint and my Windows machines much easier. With the limited processing and network bandwidth of the Raspberry Pi, this never really worked well, but it works just fine on a Pine64! I went ahead and created a new user on my Windows network, a network share for my "RigidBot" 3D Printer, and gave that user full control over the share, now we just have to mount it.
- Start by installing the CIFS utilities by running sudo apt-get install cifs-utils.
- Create a new file to store your network credentials. It's important that you use a credential file to avoid storing plain text credentials in our mount definition later. Create this file by running sudo nano ~/.smbcredentials.
- Enter your credentials in this file. It is important that your file is structured the same way as the example below (username on one line, password on the next, etc.). If your user is affiliated with a domain, include the domain line.
username=myUsername password=myPassword domain=myDomain
- Once you've created your file, we need to set the appropriate permissions on it by running:
chmod 600 ~/.smbcredentials
- Before we define our mount point, run id and make note of the output. This is likely something like 1000, but we'll need this number to ensure OctoPrint can correctly read and write to our share.
- Now we're ready to define our mount point and tell the system how to connect. To do this, open up /etc/fstab by running:
sudo nano /etc/fstab.
- Here we'll enter a new row that defines the path to our share, the path to our local mount point, the file system type, and our credentials. Be sure to replace SERVERIP, SHARE, USERNAME and ID with your own values. Note that for this step, USERNAME is your Linux logon username, not the network credential.
//SERVERIP/SHARE /media/SHARE cifs credentials=/home/USERNAME/.smbcredentials,sec=ntlm,uid=ID 0 0
- Now, tell the OS to process the chances to our fstab file by running:
sudo mount -a
- If all goes well, you'll now be able to cd /media/SHARE and see any content from your Windows share.
More to Come
In Part 2 we'll look at how to install and configure OctoPrint on the Pine64, setup webcam streaming to OctoPrint, and make our first print!