DEV Community

Cover image for Day-28: Troubleshooting Raspberry Pi Headless Setup + Servo Script Test
Rajpreet Gill
Rajpreet Gill

Posted on

1

Day-28: Troubleshooting Raspberry Pi Headless Setup + Servo Script Test

Subtitle: When your cat’s food depends on debugging a microcomputer...

🐱 Recap from Day-27

In Day-27, we:

  • Flashed Raspberry Pi OS (Lite) onto a microSD card
  • Enabled SSH by adding a file to /boot
  • (Optionally) added Wi-Fi credentials via wpa_supplicant.conf
  • Inserted the SD card into the Raspberry Pi and powered it on
  • Ran nmap to identify the Pi’s IP β€” but couldn’t connect via SSH

πŸ“š Table of Contents:

  1. βœ… Confirming SSH Still Enabled
  2. 🧠 Checking Possible Issues
  3. πŸ’» Re-Insert & Recheck SD Card
  4. 🌐 Trying .local Hostname
  5. πŸ”Œ Swapping Power & Boot Medium
  6. 🧰 Hardware Test: Running the Servo Script
  7. πŸ•’ Schedule with Cron
  8. βœ… Final Status (Day-28)

πŸ§ͺ Step-by-Step Troubleshooting

πŸ”Ž 1. Confirming SSH Still Enabled

After scanning the network and identifying live hosts:

We attempted SSH But got:

Image description

🧠 2. Checking Possible Issues

Image description

πŸ’» 3. Re-Insert & Recheck SD Card

  • Removed SD card
  • Mounted it back on macOS
  • Verified ssh file:

Image description

Output showed:

Image description

βœ… SSH file still present

🌐 4. Trying .local Hostname:

But Fails ❌ :

Image description

πŸ”Ž Diagnosis: .local resolution (mDNS) not supported or not working on macOS without Bonjour or Avahi.

πŸ”Œ 5. Swapping Power & Boot Medium:

Still not able to reach the Pi?

βœ… Try this:

  • Use another USB-C cable or power adapter
  • Re-flash Raspberry Pi OS

This time, use Raspberry Pi Imager and make sure to:

  • Enable SSH in the advanced options
  • Set Wi-Fi SSID and password (if headless)

🧰 6. Hardware Test: Running the Servo Script:

After finally getting access:

Image description

You can now test your Python script that triggers the servo.

✏️ Example: feed_cat.py

Image description

πŸ•’ 7. Schedule with Cron:

Do Crontab -e and Add:

Image description

πŸ“… This runs the script every day at 8:00 AM.

βœ… 8. Final Status (Day-28)

Image description

πŸ“Œ Lessons Learned:

  • Enabling SSH by file still works β€” just double-check the boot!
  • mDNS can be flaky; nmap is your friend.
  • Power supply really matters for Pi stability.
  • Servo motors may need external power for consistent operation.

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

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

Heroku

Deploy with ease. Manage efficiently. Scale faster.

Leave the infrastructure headaches to us, while you focus on pushing boundaries, realizing your vision, and making a lasting impression on your users.

Get Started

Top comments (0)

ITRS image

See What Users Experience in The Browser β€” Anywhere, Anytime

Simulate logins, checkouts, and payments on SaaS, APIs, and internal apps. Catch issues early, baseline web performance, and stay ahead of incidents. Easily record user journeys right from your browser.

Start Free Trial