Makes sense. I snipped it for later reference.
On shut down, they come back on right before you get the 10 blinks which is nice so you can tell if it shut down. They will initially be on, on bootup too, but once motion eye starts up they turn off. Best of both worlds IMHO. Works for me =)
I think my next mod is going to be having it pan tilt to a default on power up.
My servos move slightly when I plug my power supply in.
I’m thinking a crontab entry may do it. Run one of my py files on boot up.
EDIT: crontab didn’t work? I have used it before to run a python file on boot up, not sure why its not working in motion eye though?
Yes mine moves on power up too. Probably the driver board waking up.
It would be nice to come up with an enclosure for the thing.
I went in via putty and deleted all my preset files. Then ran my custom script for that and rebooted. Everything works. I will eventually put it all in the one file, pan tilt and presets.
Still can’t get crontab to run my preset3.py file though. =(
I opened an issue on it on the Motion Eye GitHub page.
I made a wire stand for mine out of a coat hanger. It hooks in the slot where the windows slides to open. I stuck it to the bottom of my Pibow case with some double sided 3M stick pads. I’ll have to figure out something better once summer comes and I want to open that window. It will do for now though.
I figured it out.
Log in as root with putty
then run nano /data/etc/userinit.sh
add the following line
ctrl x, y, enter.
preset3_1 is preset 3, the one I wanted to use.
I haven’t faced mine out yet. I want to get all the kinks out while it’s sitting on my desk. I’m thinking of a clear dome over the camera and some kind of case around the Pi.
You really should put all your code mods all together into a file at some point. For posterity. ;)
I run MacOS and it turns out that there’s a built-in SSH client in Terminal. Handy.
Thats on my todo list for today. Put my motion eye tweaks all in one folder.
I think I can put it all in the one install file too.
I have some command line / terminal stuff I need to sort into another folder too, so its all in one place.
I found it quite handy to use WinSCP to copy all *.py settings to my LapTop. It gives me an easy view how to setup/modify the settings in each file. As well they serve as backup for new installations on any MoEyeOS may it be RPiZW, RPi2B, RPi3A&B or RPi4
I have a ton of setup and tweak files. I have 2 dozen of so Pi’s half or more of which are setup and used on a regular basis. The tweaks I do to every one of them are on a thumb drive and backed up on my PC.
Stuff like killing the rainbow screen on boot. Stopping the cursor from always going to the Raspberry in the status bar on boot up. My custom clock layout etc. Stuff like that.
Interesting, how do stop cursor from goingto status bar on boot ?
and remove the
It appears the cursor always going to status bar fix is no longer required. Once you do a sudo apt update, sudo apt upgrade it will default to center screen on a reboot or power up. The Pi foundation patched it themselves, likely after feedback asking them to fix it so it doesn’t default to going to the raspberry every boot up.
And more on topic, I redid my Pan Tilt setup yesterday. I wanted to swap in a faster bigger Micro SD card. I got Motion Eye all working the way I wanted then ran my one master script. No typo’s and no errors. =)
I even rolled in the LED’s off and start up preset into the one script. Clip past into Putty and reboot, done deal.
i’m so noob in linux command, can you explain your method for create a up button GUI for exemple ? i can’t create a file :(
in SSH :
nano /data/etc/up_1 ==> open file, copy, paste
ctrl + X and Yes for save
i can’t save the file :( i’m error message “[ Error writing /data/etc/up_1: No such file or directory ]”
please help me
Did you log in as root? It may be a permission issue. When I log in via putty the first open windows says
“log in as”, I just type in root and hit enter.
i’m using a “terminal” from mac os and i’m connect to “ssh firstname.lastname@example.org…” i trying with sudo also it’s a same things. (sudo nano /data/etc…)
sudo nano is what I use when on a Pi in Raspbian.
If I do that in putty on Motion Eye I get a command not found error.
Your trying to do this on Motion Eye OS right?
Have a look at this, it was posted earlier. I found it after I figured it all out the hard way.
I’m use MotionEye (no OS)…
Sorry for the sporadic replies, I’m having a hard time today with chronic pain issues.
Anyway, in putty if I clip and past all the code from mkdir to that last EOF command in that link I posted. The whole block of code as its listed, it creates all the files and folders in one go. I added to it my presets and a couple of other tweaks and saved it as a text file. Now if I have to reinstall I can setup my action buttons quick and easy with one clip and past into putty. The following is just the up down left right part from that link.
mkdir /data/etc/python-scripts/ cat <<EOF >>/data/etc/left_1 #!/bin/bash /usr/bin/python /data/etc/python-scripts/left.py EOF cat <<EOF >>/data/etc/right_1 #!/bin/bash /usr/bin/python /data/etc/python-scripts/right.py EOF cat <<EOF >>/data/etc/up_1 #!/bin/bash /usr/bin/python /data/etc/python-scripts/up.py EOF cat <<EOF >>/data/etc/down_1 #!/bin/bash /usr/bin/python /data/etc/python-scripts/down.py EOF cat <<EOF >>/data/etc/preset1_1 #!/bin/bash /usr/bin/python /data/etc/python-scripts/reset.py EOF chmod +x /data/etc/left_1 /data/etc/right_1 /data/etc/up_1 /data/etc/down_1 /data/etc/preset1_1 cat <<EOF >>/data/etc/python-scripts/left.py #!/usr/bin/python import time import pantilthat currentPos = pantilthat.get_servo_one() newPos = currentPos +20 if newPos >= 80: newPos = 80 pantilthat.servo_one(newPos) time.sleep(1) EOF cat <<EOF >>/data/etc/python-scripts/right.py #!/usr/bin/python import time import pantilthat currentPos = pantilthat.get_servo_one() #print (currentPos) newPos = currentPos - 20 if newPos <= -80: newPos = -80 pantilthat.servo_one(newPos) time.sleep (1) EOF cat <<EOF >>/data/etc/python-scripts/up.py #!/usr/bin/python import time import pantilthat currentPos = pantilthat.get_servo_two() #print (currentPos) newPos = currentPos - 20 if newPos <= -80: newPos = -80 pantilthat.servo_two(newPos) time.sleep (1) EOF cat <<EOF >>/data/etc/python-scripts/down.py #!/usr/bin/python import time import pantilthat currentPos = pantilthat.get_servo_two() newPos = currentPos +20 if newPos >= 80: newPos = 80 pantilthat.servo_two(newPos) time.sleep(1) EOF cat <<EOF >>/data/etc/python-scripts/reset.py #!/usr/bin/python import time import pantilthat pantilthat.servo_one(0) pantilthat.servo_two(0) time.sleep(1) EOF