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 ?
edit /etc/xdg/lxsession/LXDE-pi/autostart
and remove the point-rpi
line.
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.
hello alphanumeric,
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
#!/bin/bash
/usr/bin/python/data/etc/up.py
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 pi@192.168…” 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
@alphanumeric , I’m currently trying to set up something similar but totally different at the same time.
Similar being the pan tilt, different being that it will be about 60m up in the air under a kite (hanging by a thread).
Instead of the pan/tilt hat I have ordered the Adafruit 16-Channel Servo HAT.
Does anyone know if it would behave similarly using the above mentioned code?
The code I posted only works with the Pan Tilt Hat.
You would use this code, etc.
Python Usage | Adafruit 16-Channel PWM/Servo HAT & Bonnet for Raspberry Pi | Adafruit Learning System
Are you going to be using Motion Eye OS? If yes, that could really complicate things.
What would you advise me to use in this case then?
The thing about Motion Eye OS is its built with BuildRoot. That makes to tricky to add things to it. And its missing a whole bunch of stuff that your normal PiOS would have. This makes it hard to install software etc. Just look what I had to go through above to get my Pan Tilt Hat working. I was lucky in a way as support for the Pan tilt Hat was added to Motion Eye OS. The library etc is already there. Otherwise I would have been SOL.
My code for creating the action buttons and the files tied to them will work. The Pan Tilt commands won’t work on your servo hat though, is the issue.
You could try doing the sudo pip3 install adafruit-circuitpython-servokit
but I don’t think it will work.
I don’t have a suggestion for an alternative. Motion Eye OS is all I have ever used. I went with it as it lets me view the streams over my LAN. No having to go over the Internet first, of view it from a Web Page etc.
Tried the installing line and motioneyeOS does not recognise the sudo command, so that’s a no for that then.
edit
Removed the sudo as suggested.
[root@meye-b15a079d ~]# install -t adafruit-circuitpython-servokit
BusyBox v1.29.3 (2020-06-06 11:47:04 UTC) multi-call binary.
Usage: install [-cdDsp] [-o USER] [-g GRP] [-m MODE] [-t DIR] [SOURCE]… DEST
Copy files and set attributes
-c Just copy (default)
-d Create directories
-D Create leading target directories
-s Strip symbol table
-p Preserve date
-o USER Set ownership
-g GRP Set group ownership
-m MODE Set permissions
-t DIR Install to DIR
That worked better, as I got this as a reply.
If your going in with Putty, try it without the sudo. Your already logged in as root.
Everything I did above was done “without” using sudo.
I am attempting to set up pan/tilt hat on my raspberry pi 4. I have followed your steps and am able to get the buttons to appear. as you did I got an error message. I then made the corrections you made and now the button is clickable with no error message. However no matter how many times I click it or how long I wait it never moves. I also tried other variations of commands/values to no avail. Any help is appreciated
Did you make the required files executable by running chmod +x
?