motioneye-project / motioneyeos

A Video Surveillance OS For Single-board Computers
Other
7.81k stars 895 forks source link

Request: external trigger recording #842

Closed iceboatLen closed 2 years ago

iceboatLen commented 7 years ago

Hello, Would it be possible to add a feature where a camera will record when prompted by an external trigger on a GPIO of the Pi, such as a PIR sensor.

Thanks Ben.

tonicxx commented 2 years ago

Hi, i try run script about motion control by PIR connected to the Raspberry Pi Zero W (the same effect on two diffrent Pi and SD Card): https://github.com/avanc/motioneye-pir and i have problem because my raspberry still rebooting after i add options: motion_control_port 7999 to the motioneye.conf and i cant check if script working correctly, below is my configuration an logs, maybe someone have some idea where is the problem:

motion.conf: webcontrol_interface 1 setup_mode off camera camera-1.conf webcontrol_parms 2 webcontrol_localhost off webcontrol_port 7999

motioneye.conf: conf_path /data/etc run_path /tmp log_path /var/log media_path /data/output motion_binary /usr/bin/motion log_level debug listen 0.0.0.0 port 8765 mount_check_interval 300 motion_check_interval 10 motion_restart_on_errors false motion_control_localhost true motion_control_port 7999 cleanup_interval 43200 remote_request_timeout 10 mjpg_client_timeout 10 mjpg_client_idle_timeout 10 smb_shares false smb_mount_root /data/media wpa_supplicant_conf /data/etc/wpa_supplicant.conf local_time_file /data/etc/localtime enable_reboot false enable_update true smtp_timeout 60 list_media_timeout_email 10 zip_timeout 500 timelapse_timeout 500 add_remove_cameras true http_basic_auth false password_hook /usr/libexec/meyepasswd

motion.log motioneye.log dmesg.log messages.log camera-1.conf.log

many thanks

starbasessd commented 2 years ago

In motioneye.conf: motion_control_localhost true needs to be set to false

tonicxx commented 2 years ago

the same effect, any other idea?

starbasessd commented 2 years ago

@tonicxx what do you get when you run the command: netstat -tulpn I get for TCP: [root@meye-4cec78b8 ~]# netstat -tulpn Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:80 0.0.0.0: LISTEN 641/python tcp 0 0 0.0.0.0:8082 0.0.0.0: LISTEN 657/motion tcp 0 0 0.0.0.0:21 0.0.0.0: LISTEN 561/proftpd: (accep tcp 0 0 0.0.0.0:22 0.0.0.0: LISTEN 546/sshd: /usr/sbin tcp 0 0 0.0.0.0:445 0.0.0.0: LISTEN 582/smbd tcp 0 0 0.0.0.0:7999 0.0.0.0: LISTEN 657/motion tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 582/smbd

This line: tcp 0 0 0.0.0.0:7999 0.0.0.0:* LISTEN 657/motion indicates that motion is properly listening on port 7999 for commands. If you use a browser, what do you see? http://ip_address:7999 If you don't see something like: Motion 4.3.1 Running [1] Camera 1 If not, something is corrupted, and it might be faster to save your camera settings, and re-load the SD Card. If you use dev20201026, you can boot from a USB stick instead of the SD Card on Pi3B+ and newer.

tonicxx commented 2 years ago

i get: tcp 0 0 0.0.0.0:139 0.0.0.0: LISTEN 1087/smbd tcp 0 0 0.0.0.0:80 0.0.0.0: LISTEN 1147/python tcp 0 0 0.0.0.0:8081 0.0.0.0: LISTEN 1168/motion tcp 0 0 0.0.0.0:21 0.0.0.0: LISTEN 1065/proftpd: (acce tcp 0 0 0.0.0.0:22 0.0.0.0: LISTEN 1049/sshd tcp 0 0 0.0.0.0:445 0.0.0.0: LISTEN 1087/smbd tcp 0 0 0.0.0.0:7999 0.0.0.0:* LISTEN 1168/motion

Pi Zero W restarting after i add line "motion_control_port 7999" to motioneye.conf, if i remove them Pi Zero W working correctly, i try use 4 diffrent SD card with new installation and the same effect, any idea?

starbasessd commented 2 years ago

What do you get if you open a browser and go to http://ip_address:7999

tonicxx commented 2 years ago

i see: Motion 4.2.2+gitUNKNOWN Running [1] Camera 1

starbasessd commented 2 years ago

Motion is watching the port correctly. Your issue lies with the python scripting, and should be addressed to the creator of the scripting add-on.