0

INFO

I have a Raspberry Pi 4 setup with Raspberry Pi OS Lite (64 bit) (Debian Bullseye port). On top of that, I followed this guide to install Motion Eye.

https://github.com/motioneye-project/motioneye/wiki/Install-on-Raspbian-Bullseye

but on step 2, I used this package instead because my pi is 64 bit:

https://github.com/Motion-Project/motion/releases/download/release-4.5.1/bullseye_motion_4.5.1-1_arm64.deb

I have attached a C922 Pro Stream Webcam to the Pi and the whole thing works great.

GOAL

My goal is to toggle the motion detection of camera 1 from a command line.

ATTEMPT

I am not able to achieve my goal, following the documentation found here:

https://motion-project.github.io/motion_config.html#OptDetail_Webcontrol

Under Web Control: It states I can make http requests to (view and change) the status of any cameras' motion detection switch. and doing so would be just the same as operating this switch on the Web Interface:

enter image description here

In the documentation to see the status of this switch, you can execute a command like this:

sudo wget -q -O - "http://raspberrypi:7999/1/detection/status" | grep Camera | sed -e "s/<[^>]*>//g" -e "s/.*Camera/Camera/"

and the output of that for me is:

Camera 1 Detection status PAUSE

Then if I toggle the Web Interface switch above to ON, click Apply, and rerun that wget command, I get:

Camera 1 Detection status ACTIVE

So I know these http requests are working. But when I try to execute this similar command, to toggle the switch on, from a PAUSED state:

sudo wget -q -O - "http://raspberrypi:7999/1/detection/start" | grep Camera | sed -e "s/<[^>]*>//g" -e "s/.*Camera/Camera/"

The response is:

Camera 1 Detection resumed

And if I rerun the status command, it now says:

Camera 1 Detection status ACTIVE

MAIN ISSUE

But when I go back to the web interface, and refresh the page. The Motion Detection toggle switch is still set to OFF and it wont detect motion. I tried restarting the cam1 and the Pi and it still shows Motion Detection set to OFF.

I thought it might be a permissions issue somewhere, but the start command is executing successfully, its just not actually doing what its saying its doing.

CONFIG FILES

Here is the current contents of my /etc/motioneye/motion.conf

# @enabled on
# credentials have been removed 

webcontrol_interface 2
webcontrol_port 7999
setup_mode off
webcontrol_parms 2
webcontrol_localhost off

camera camera-1.conf

and here is the current contents of my /etc/motioneye/motioneye.conf

# path to the configuration directory (must be writable by motionEye)
conf_path /etc/motioneye

# path to the directory where pid files go (must be writable by motionEye)
run_path /var/run

# path to the directory where log files go (must be writable by motionEye)
log_path /var/log

# default output path for media files (must be writable by motionEye)
media_path /var/lib/motioneye

# the log level (use quiet, error, warning, info or debug)
log_level debug

# the IP address to listen on
# (0.0.0.0 for all interfaces, 127.0.0.1 for localhost)
listen 0.0.0.0

# the TCP port to listen on
port 8765

# path to the motion binary to use (automatically detected if commented)
#motion_binary /usr/bin/motion

# whether motion HTTP control interface listens on
# localhost or on all interfaces
motion_control_localhost true

# the TCP port that motion HTTP control interface listens on
motion_control_port 7999

# interval in seconds at which motionEye checks if motion is running
motion_check_interval 10

# whether to restart the motion daemon when an error occurs while communicating with it
motion_restart_on_errors false

# interval in seconds at which motionEye checks the SMB mounts
mount_check_interval 300

# interval in seconds at which the janitor is called
# to remove old pictures and movies
cleanup_interval 43200

# timeout in seconds to wait for response from a remote motionEye server
remote_request_timeout 10

# timeout in seconds to wait for mjpg data from the motion daemon
mjpg_client_timeout 10

# timeout in seconds after which an idle mjpg client is removed
# (set to 0 to disable)
mjpg_client_idle_timeout 10

# enable SMB shares (requires motionEye to run as root)
smb_shares false

# the directory where the SMB mount points will be created
smb_mount_root /media

# path to the wpa_supplicant.conf file
# (enable this to configure wifi settings from the UI)
#wpa_supplicant_conf /etc/wpa_supplicant.conf

# path to the localtime file
# (enable this to configure the system time zone from the UI)
#local_time_file /etc/localtime

# enables shutdown and rebooting after changing system settings
# (such as wifi settings or time zone)
enable_reboot false

# timeout in seconds to use when talking to the SMTP server
smtp_timeout 60

# timeout in seconds to wait for media files list
list_media_timeout 120

# timeout in seconds to wait for media files list, when sending emails
list_media_timeout_email 10

# timeout in seconds to wait for zip file creation
zip_timeout 500

# timeout in seconds to wait for timelapse creation
timelapse_timeout 500

# enable adding and removing cameras from UI
add_remove_cameras true

# enables HTTP basic authentication scheme (in addition to, not instead of the signature mechanism)
http_basic_auth false

# overrides the hostname (useful if motionEye runs behind a reverse proxy)
# server_name motionEye

Any help would be greatly appreciated.

Mark Lewis
  • 45
  • 5

1 Answers1

0

ANSWER

Okay so I figured this out. For anyone else who has this issue.

Those http requests I'm calling are only interacting with Motion and are truly toggling the motion detection of the system. As confirmed by me going into the movies and seeing the new videos recorded.

Those http requests don't interact with Motioneye so the interface is not updated. Still not sure why Motioneye doesnt update to latest Motion state when i refresh the browser.

Mark Lewis
  • 45
  • 5