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

Rajpreet Gill @rajpreet_gill

Joined:
Dec 10, 2024

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

Publish Date: May 15
1 0

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/

Comments 0 total

    Add comment