User Tools

Site Tools


surv_camera

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
surv_camera [2024/02/27 09:08] memeruizsurv_camera [2024/04/09 23:31] (current) – [Configuration] memeruiz
Line 25: Line 25:
  
 https://www.amazon.com/dp/B0771GQMPT?psc=1&ref=ppx_yo2ov_dt_b_product_details https://www.amazon.com/dp/B0771GQMPT?psc=1&ref=ppx_yo2ov_dt_b_product_details
 +
 https://www.amazon.com/dp/B09KGDDS37?psc=1&ref=ppx_yo2ov_dt_b_product_details https://www.amazon.com/dp/B09KGDDS37?psc=1&ref=ppx_yo2ov_dt_b_product_details
 +
 https://www.amazon.com/dp/B0BZH7CTGX?psc=1&ref=ppx_yo2ov_dt_b_product_details https://www.amazon.com/dp/B0BZH7CTGX?psc=1&ref=ppx_yo2ov_dt_b_product_details
 +
 https://www.amazon.com/gp/product/B08HLYKXC6/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 https://www.amazon.com/gp/product/B08HLYKXC6/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
 +
 https://www.amazon.com/dp/B079GNVSTL?psc=1&ref=ppx_yo2ov_dt_b_product_details https://www.amazon.com/dp/B079GNVSTL?psc=1&ref=ppx_yo2ov_dt_b_product_details
 +
 https://www.amazon.com/dp/B09B5DXTLS?psc=1&ref=ppx_yo2ov_dt_b_product_details https://www.amazon.com/dp/B09B5DXTLS?psc=1&ref=ppx_yo2ov_dt_b_product_details
 +
 https://www.amazon.com/dp/B085NVDC3K?psc=1&ref=ppx_yo2ov_dt_b_product_details https://www.amazon.com/dp/B085NVDC3K?psc=1&ref=ppx_yo2ov_dt_b_product_details
  
 +
 +===== Software =====
 +
 +  * MotionEyeOS version: 20200606
 +    * MotionEye 4.2.2
 +    * Motion 0.42.1
 +  * Motionpush
 +
 +==== Configuration ====
 +
 +=== MotionEye ===
 +
 +  * File Storage:
 +    * Upload Service: SFTP server
 +      * We setup a user in my server for this. User: motioneye
 +      * location: /home/user/camera1
 +      * Include Subfolders: yes
 +  * Video Device
 +    * Video Resolution: 800x600 (fast),  2592x1944 (max, very slow)
 +    * Automatic Brightness: yes
 +  * Motion detection
 +    * Auto Noise Detection: yes
 +    * Motion Gap 30
 +    * Mininum motion Frames: 20 frames
 +    * Use mask
 +  * Motion Notifications
 +    * Run a command: yes
 +      * Command: /data/usr/bin/motionpush %H:%M
 +      * Motionpush
 +        * Has to be downloaded to the dev computer
 +        * Edit example.conf and motionpush executable:
 +        * motionpush:
 +          * CONFIG_FILE="/data/etc/motionpush.conf"
 +        * Follow Telegram instructions to create a bot
 +        * Create a Telegram Channel
 +        * Configure (with BotFather) the bot to be able to "post in the channel" "manage channel"
 +        * Add the bot to the channel administrators
 +        * Edit Telegram stuff in example.conf
 +        * Copy example.conf to /data/etc/motionpush.conf with scp to raspberry pi
 +        * Copy motionpush to /data/usr/bin/
 +
 +Test bot with :
 +
 +
 +  curl -X POST "https://api.telegram.org/bot<Token>/sendMessage" -d "chat_id=-<channelid>&text=my sample text"
 +
 +Edit example.conf with:
 +
 +  TELEGRAM_BODY="Tap <a href=\"http://cam.memelabs.net:9000\">here</a> to view live stream
 +Tap <a href=\"<nextcloud share weburl here>\">here</a> for event videos"
 +
 +
 +Project:
 +
 +https://github.com/motioneye-project/motioneyeos
 +
 +Download image:
 +
 +https://github.com/ccrisan/motioneyeos/releases/download/20200606/motioneyeos-raspberrypi-20200606.img.xz
 +
 +wiki:
 +
 +https://github.com/motioneye-project/motioneyeos/wiki
 +
 +Telegram Push notifications:
 +
 +https://github.com/1pav/motionpush
 +
 +
 +
 +=== ssh remote forwarding ===
 +
 +  * On the PI you must run: 
 +
 +  ssh -R *:9000:localhost:80 memeruiz@192.168.2.22 -N
 +
 +  * Now you can access from 2.22 with localhost:9000 the PI web server with motioneye
 +  * Configure your modem to forward port 9000 to internal computer 192.168.2.22 to port 9000
 +
 +
 +=== nextcloud ===
 +
 +  * Install nextcloud on debian. Follow these instructions: 
 +
 +https://www.linuxtuto.com/how-to-install-nextcloud-on-debian-12/
 +
 +  * For configuring apache:
 +
 +https://docs.nextcloud.com/server/18/admin_manual/installation/source_installation.html#apache-web-server-configuration
 +
 +  * In nextcloud config.php file add this:
 +
 +   ‘filesystem_check_changes’ => 1,
 + 
 +  * This will instruct nextcloud to update new available files to its webfront end
 +  * Add motioneye debian user to group www-data (to be able to put files inside nextcloud data directory)
 +  * Inside motioneye home directory do a symlink to nextcloud directory:
 +
 +  mkdir /var/www/nextcloud/data/motioneye/files/camera1
 +  chown -R www-data:www-data /var/www/nextcloud/data/motioneye/files/camera1
 +  chmod g+w /var/www/nextcloud/data/motioneye/files/camera1
 +  cd /home/motioneye
 +  ln -s camera1 /var/www/nextcloud/data/motioneye/files/camera1
 +  chown -R www-data:www-data camera1
 +
 +=== UART + Wanderer ===
 +
 +In motioneyeOS things are a bit different:
 +
 +For activating the UART raspberry pi zero w port:
 +
 +Edit /boot/config.txt
 +
 +Add this:
 +
 +  dtoverlay = miniuart-bt
 +
 +/dev/ttyAMA0 existed before but it doesn't work by default. After activiting miniuart-bt it starts working
 +
 +With this configuration two uart units are activated
 +
 +Bluetooth is not necessary to be disabled. Apparently it is already disabled on MotionEyeOS. Also the console is not redirected to the serial.
 +
 +Test with a loopback cable between tx and rx and with this test program:
 +
 +
 +  import serial
 +  test_string = "Test serial port ...".encode('utf-8')
 +  port_list = ["/dev/ttyAMA0","/dev/ttyAMA0","/dev/ttyS0","/dev/ttyS"]
 +  for port in port_list:
 +    try:
 +      serialPort = serial.Serial(port, 9600, timeout = 2)
 +      print ("Serial port", port, " ready for test :")
 +      bytes_sent = serialPort.write(test_string)
 +      print ("Sended", bytes_sent, "byte")
 +      loopback = serialPort.read(bytes_sent)
 +      if loopback == test_string:
 +        print ("Received ",len(loopback), "bytes. Port", port,"is OK ! \n")
 +      else:
 +        print ("Received incorrect data:", loopback, "on serial part", port, "loopback \n")
 +      serialPort.close()
 +    except IOError:
 +      print ("Error on", port,"\n")
 +
 +== Wanderer ==
 +
 +For the serial connection to the wanderer we used:
 +
 +https://github.com/rosswarren/renogymodbus
 +
 +It must be converted to python2 along with several dependencies
 +
 +It works!
 +
 +== references ==
 +
 +https://di-marco.net/blog/it/2020-06-06-raspberry_pi_3_4_and_0_w_serial_port_usage/
 +https://www.raspberrypi.com/documentation/computers/configuration.html#configuring-uarts
  
  
  
surv_camera.1709024908.txt.gz · Last modified: 2024/02/27 09:08 by memeruiz