DEV Community

Cover image for 🐾 Setting Up the Raspberry Pi-Based IoT Cat Feeder (Day-27)
Rajpreet Gill
Rajpreet Gill

Posted on

3

🐾 Setting Up the Raspberry Pi-Based IoT Cat Feeder (Day-27)

Introduction

In today’s guide (Day-27), we’ll walk through the complete process of setting up your own IoT-based pet feeder using a Raspberry Pi. Our goal is to automate the feeding process using a servo motor, Python, and scheduled cron jobs.


🎯 Objective

Set up a Raspberry Pi-powered automated pet feeder that runs a Python script to control a servo motor — scheduled to feed your cat daily.


📚 Table of Contents (Day-27)

  1. 💾 Flashing Raspberry Pi OS to SD Card
  2. 🔐 Enabling SSH Access
  3. 📶 (Optional) Configure Wi-Fi for Headless Boot
  4. 🔌 Booting the Raspberry Pi
  5. 🌐 Detecting Raspberry Pi on Local Network
  6. 🛜 Attempting SSH Access
  7. 🧠 Verifying SSH Setup Again
  8. 🖥️ Tried Accessing via Hostname
  9. 📌 Diagnosis
  10. ✅ Final Status (Day-27 Recap)

🐱 Step-by-Step Setup Guide


1. Flashing Raspberry Pi OS to SD Card

  • Download Raspberry Pi OS (Lite) from the official website.
  • Use Raspberry Pi Imager or Balena Etcher to flash it to a microSD card (32GB in our case).
Tool Used: Raspberry Pi Imager
Card Size: 32GB microSD
Status   : ✅ OS flashed and verified
Enter fullscreen mode Exit fullscreen mode

Image description

Image description

Image description

2. Enabling SSH Access

Inserted SD card into MacBook → Mounted as:

Image description

Created the SSH file in boot partition:

Image description

SSH enabled successfully for headless access.


3. (Optional) Configure Wi-Fi for Headless Boot

Created wpa_supplicant.conf inside the boot partition (optional if using Ethernet):

Image description

💡 Replaced with real credentials, saved and ejected the SD card.


4. Booting the Raspberry Pi

  • Inserted the SD card into Raspberry Pi
  • Powered on via USB-C
  • Waited ~2 minutes for the OS to boot

Image description

Expected: Pi should connect to local network (via Wi-Fi or Ethernet)


5. Detecting Raspberry Pi on Local Network

Ran a network scan and see the 🖥️ Output (Filtered):

Image description


6. Attempting SSH Access

Tried to connect But ❌ Error:

Image description


7. Verifying SSH Setup Again

  • Reinserted SD card into Mac
  • Confirmed ssh file still exists in /Volumes/bootfs
  • Reinserted back into Pi and rebooted

Still, SSH failed. Possibly:

  • SSH service didn’t start properly
  • Raspberry Pi didn’t boot fully
  • Network issue

8. Tried Accessing via Hostname

But ❌ Error:

Image description

🔍 9.Diagnosis:

  • .local resolution via mDNS might be missing on Mac
  • Or Raspberry Pi never fully booted

📌 10. Final Status (Day-27 Recap)

Task Status
SD Card flashed ✅ Done
SSH file added ✅ Done
Wi-Fi config (optional) ✅ Skipped or Done
Booted Pi ✅ Boot attempted
Detected IP via nmap ✅ Partial
SSH connection established ❌ Failed
Hostname access (.local) ❌ Failed
Next: Servo wiring + script 🔜 Pending

🔜 Coming Up: Day-28

In the next post, we’ll troubleshoot Raspberry Pi SSH issues step-by-step, verify if the OS is booting correctly, and check if the SSH service is running. Once resolved, we’ll test the Python servo script and complete our cat feeder automation.


#30DaysLinuxChallenge #CloudWhisler
#DevOps #Linux #RHCSA #Opensource #AWS #CloudComputing

Catch out by My LinkedIn profile
https://www.linkedin.com/in/rajpreet-gill-4569b4161/

What if your devs could deploy infrastructure like launching a game?

What if your devs could deploy infrastructure like launching a game?

In this session, we'll show how you can build a user-friendly self-service portal for deploying infrastructure with Spacelift, in the flavor of deploying Minecraft servers.

Learn More

Top comments (0)

Feature flag article image

Create a feature flag in your IDE in 5 minutes with LaunchDarkly’s MCP server 🏁

How to create, evaluate, and modify flags from within your IDE or AI client using natural language with LaunchDarkly's new MCP server. Follow along with this tutorial for step by step instructions.

Read full post

👋 Kindness is contagious

Take a moment to explore this thoughtful article, beloved by the supportive DEV Community. Coders of every background are invited to share and elevate our collective know-how.

A heartfelt "thank you" can brighten someone's day—leave your appreciation below!

On DEV, sharing knowledge smooths our journey and tightens our community bonds. Enjoyed this? A quick thank you to the author is hugely appreciated.

Okay