How It All Started

So yesterday I dug out two dusty Raspberry Pis from my junk drawer – Penny was the black one covered in old stickers, Red had actual chipped red paint. Figured I’d make ‘em talk to each other using Python. Grabbed spare cables, cheap sensors laying around, nothing fancy.

penny and red

The Setup Disaster

Tried installing libraries first. Broke Python right away – kept getting “ImportError: no module named anything freakin’ useful”. Googled error messages for two hours straight, banged my head against the keyboard. Finally found some geezer’s old Stackoverflow thread suggesting pip install --upgrade some_random_lib. Magically worked. Who knows why.

  • Penny’s job: Temperature sensor
  • Red’s job: Light sensor plus LED blinkin
  • My job: Not screaming

Wrote basic scripts – Penny reads temp, shoots data to Red; Red controls lights based on Penny’s numbers. Simple! Hooked sensors via breadboards. Penny’s sensor fell off three times. Fixed it with electrical tape and frustration.

When Nothing Talks Right

Ran the scripts. Penny stayed silent like a brick. Checked cables – yup, plugged in. Checked code – typo in print('Temprature:' + str(temp)) (spelled “temperature” wrong, oops). Fixed it. Penny started spitting numbers! But Red just blinked SOS forever. Realized I forgot threshold values – told Red when to blink slow vs fast. Added dumb logic: if temp > 25: blink_fast() else chill_blink(). Still nothing.

Spotted it – Red’s script was listening on port 5000, but Penny shouted on 5050. Changed both to 5005. Ran again. Red’s LED did a slow blink! Pumped my fist like an idiot. Then it froze solid.

The Victory Dance

Turns out both Pis tried talkin’ at once. Made Penny wait 2 seconds after sending data. Added *(2) to her script. Ran it one last time – Red’s light blinked slow when room was cold, fast when my heater kicked in. Success tasted like cold pizza leftover.

penny and red

End result? Two ugly boxes flashin’ lights about my room temp. Took six hours instead of one. Screwed everything together with duct tape for good measure. Moral? Old hardware fights back hard… but cheap tape fixes pride & wires.

LEAVE A REPLY

Please enter your comment!
Please enter your name here