Open FireflyJar opened 2 years ago
I have a similar type of problem. My target is to control a servo with an action button integrated with the motioneyeos. This is my first raspberry pi project by the way. After reading about the action buttons I have tried the following.
motioneye.conf
is in /etc
and it says that conf_path
is in /data/etc/
. There is no /etc
subforder in /data
folder so I created one. EDIT: I realized that the files and /etc folder inside /data actually exist. Originally I just added the action button related files when I made the original configuration with my desktop PC (which doesn't have wifi). This way you cannot see the hidden files and folders for some reason. So 1) I made ssh connection with my mobile phone and motioneye raspberry pi in "Access point" operation-mode, 2) then I wrote the action button right_1 files using Nano and 3) finally I changed the rights of the file(s) and the action button started working without any reboot.
right_1
file
#!/bin/bash
/usr/bin/python /data/etc/right.py
and my right.py looks like this
#!/usr/bin/python
import RPi.GPIO as GPIO
from time import sleep
gpioPIN = 12 freq = 20
GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(gpioPIN,GPIO.OUT) pwm=GPIO.PWM(gpioPIN,freq) pwm.start(0) sleep(1)
dutyC = 4.2 pwm.ChangeDutyCycle(dutyC) sleep(1)
pwm.stop() GPIO.cleanup()
- I tested that right.py works in raspberry pi os (the servo really moves).
- I also did a `chmod +x /data/etc/right_1` and `chmod +x /data/etc/right.py` to make both files executable. Even though as far as I understand this should be carried out only for _1 files.
- I moved both files to `/data/etc/` and rebooted the system.
- I don't get the action button visible in camera. Even though I click on the camera view, the action button doesn't appear.
- I also tested: [https://github.com/motioneye-project/motioneye/wiki/Monitoring-Commands]() but it did not work in my opinion either.
- I have raspberry pi zero w
Is there a hint or help what I am doing wrong?
First thing, I would backup my camera config (Settings, General, Backup) I would then re-image with dev20201026,as there are a number of issues with 20200606. I would then restore the camera config, and put your script in the /data/etc folder. Then try it. Please include the motioneye log and messages log (Settings, Expert Settings)
Although the script works in RRPiOS, does it work if you manually call it in motioneyeOS?
I did load a copy of your 'right.py' script into /data/etc in a dev20201026 on a PiZeroW and it didn't give any errors when run. I wasn't able to check it on the GPIO pins, though.
Thanks a lot for the help. The problem was actually in my second bullet point. I will edit the answer there so maybe it helps somebody else.
Hoping someone that knows how to do this. what code to use to move the focus a bit at a time.
! I am not looking for Autofocus, just to setup the camera and adjust the focus once and leave on. and yes if it reboots, the focus will be reset to default, it only stays as long it is powered.
so MotionEye has action-buttons to run scripts and Arducam has an example python code to move the focus , I don't know coding enough how to go about making a python code that the motioneye action button can trigger. Is action buttons still working?
this is the example code ArduCam gave for using a keyboard to focus it