This post is broken up into three parts.
1. Download and Unzip the image
2. Headlessly Enabling SSH
3. Installing an MQTT broker
Download and Unzip the image
- Go to Octoprint.org and download the latest version of OctoPi or click this link
- Follow the steps named Getting Started with OctoPi
- Unzip the .img to an SD card by following this tutorial
- Plug the SD card into a computer and configure the ‘octopi-network.txt’ to connect to your WiFi
Headlessly Enabling SSH
- With the SD card mounted
- Create a file
- Add the following code to the
if [ -e /etc/SSHFLAG ]; then /usr/sbin/update-rc.d -f ssh defaults /bin/rm /etc/SSHFLAG /sbin/shutdown -r now fi
The above code will enable ssh on reboot. I had to reboot my pi a few times for it to work.
Installing an MQTT broker
I follow this hackaday tutorial. Which boils down to the following commands.
curl -O http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key sudo apt-key add mosquitto-repo.gpg.key rm mosquitto-repo.gpg.key cd /etc/apt/sources.list.d/ sudo curl -O http://repo.mosquitto.org/debian/mosquitto-jessie.list sudo apt-get update sudo apt-get install mosquitto mosquitto-clients
This will install the broker and the client package (optional). The client package comes in handy when you want to debug a subscription or if you want to play around with mosquitto in general.