(TL;DR at bottom)
I am totally a neeewb to Linux and, for all intents and purposes, a neewb to programming. I bought a picam and the awesome Pan-Tilt Hat because I thought it would be easy to do what I want to do. Working longer days at the moment so I set up a doggie monitor to ensure the rascals aren’t tearing up the house.I got the web interface working, but the Pan-Tilt mech. has me quite bedeviled.
I noticed the problem when I tried to run “timeout.py” and IDLE 3 spit back an error message onto my screen. Something like, “‘module’ object has no attribute idle_timeout”. I also noticed that it was running Python 2, but it was easy to change the default program to 3. I really don’t know what difference it makes! I tried just deleting the line and running it, but it made the servos vibrate all crazy and I couldn’t get it to stop, so I had to reboot.
Anyhoo, I dug and dug in the swamps of sadness known as the file directory, and after having trod the desert of misunderstanding, I was able to locate something that resembled "the thing (init.py) that tells the stuff (Python scripts) that it’s okay to tell the other thing (Raspi) to do something (move the servos).
Alas, I found that the “distribution package”, I suspected, was lacking idle_timeout = pantilthat.idle_timeout
. I looked at the github page under library, and it said that exactly the thing that it was lacking, was missing.
“PERFECT! GOTCHA! I’ll just add that line to the init file!”, I exclaimed. But the celebration was short lived as I attempted to save the changes I had just made. Permission was denied.
After several hours of trying to figure out what I needed to do, forgetting where the package was located, throwing something, traversing the swamp, retreading the desert, locating the thing again, still not figuring out what I need to do, I decided to start over and put a fresh Raspbian install on (in?) my Pi, just in case I unwittingly skipped a step in the first place…
…Didn’t work. Here’s what I did from the fresh install:
- update/ dist.upgrade, enable I2C, etc. followed by reboot
- shcurl -sS https://get.pimoroni.com/pantilthat | bash
- sudo apt-get install python3-pantilthat
- found init.py again and saw that the library still lacked the timeout line!
So, here I am, several days later at work and certainly a little balder. I figured out how to grant myself the permissions necessary to edit “init.py”, and remotely accessed the Pi, and added the line and finally saved it successfully. I’ll wait until I get home to try to run it because I don’t want any misbehaving, unstoppable servos throwing a party in my living room while I’m not there. If there’s a servo party I’d like to be there, you know?
TL;DR: I know something’s wrong, but what is it? Is it https://github.com/pimoroni/pantilt-hat.git, or how the terminal command retrieves the package for installation, me, or something else? I’m trying to learn how to integrate keyboard controls of pan/tilt into my Rpi-cam website, and it’s not going to be easy, so I want to be sure that the thing’s working right before I delve into it, because I won’t know if it’s not because I’m a neeeeeewb.