MotionEye on RasPi1 with BullsEye missing

Suggestions for features and software you would like to see in DietPi, goes here.
omavoss
Posts: 75
Joined: Thu Sep 24, 2020 11:08 pm

Re: MotionEye on RasPi1 with BullsEye missing

Post by omavoss »

@The_Raven:
Thanks for your support.
The_Raven
Posts: 33
Joined: Sat Aug 12, 2017 12:51 pm

Re: MotionEye on RasPi1 with BullsEye missing

Post by The_Raven »

@MichaIng
Can you give me a hint how to install Motioneye using python3?
User avatar
Joulinar
Posts: 5617
Joined: Sat Nov 16, 2019 12:49 am

Re: MotionEye on RasPi1 with BullsEye missing

Post by Joulinar »

@MichaIng
I simply followed the install steps from our script on a RPi3B+ 32bit ARMv7 Bullseye.

Code: Select all

root@DietPi3:~# pip3 install -U motioneye
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple/
Collecting motioneye
  Downloading https://www.piwheels.org/simple/motioneye/motioneye-0.42.1-py3-none-any.whl (792 kB)
     |████████████████████████████████| 792 kB 774 kB/s
Collecting jinja2
  Downloading https://www.piwheels.org/simple/jinja2/Jinja2-3.0.1-py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 1.5 MB/s
Collecting pillow
  Downloading https://www.piwheels.org/simple/pillow/Pillow-8.3.1-cp39-cp39-linux_armv7l.whl (1.1 MB)
     |████████████████████████████████| 1.1 MB 791 kB/s
Collecting pycurl
  Downloading https://www.piwheels.org/simple/pycurl/pycurl-7.44.1-cp39-cp39-linux_armv7l.whl (286 kB)
     |████████████████████████████████| 286 kB 1.5 MB/s
Collecting tornado<6,>=3.1
  Downloading https://www.piwheels.org/simple/tornado/tornado-5.1.1-cp39-cp39-linux_armv7l.whl (457 kB)
     |████████████████████████████████| 457 kB 763 kB/s
Collecting MarkupSafe>=2.0
  Downloading https://www.piwheels.org/simple/markupsafe/MarkupSafe-2.0.1-cp39-cp39-linux_armv7l.whl (25 kB)
Installing collected packages: MarkupSafe, tornado, pycurl, pillow, jinja2, motioneye
Successfully installed MarkupSafe-2.0.1 jinja2-3.0.1 motioneye-0.42.1 pillow-8.3.1 pycurl-7.44.1 tornado-5.1.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@DietPi3:~#
But service is not able to start at the end.

Code: Select all

root@DietPi3:~# journalctl -u motioneye.service
-- Journal begins at Tue 2021-07-13 19:29:24 CEST, ends at Wed 2021-08-18 12:08:13 CEST. --
Aug 18 12:08:12 DietPi3 systemd[1]: Started motionEye Server.
Aug 18 12:08:12 DietPi3 meyectl[5519]: Traceback (most recent call last):
Aug 18 12:08:12 DietPi3 meyectl[5519]:   File "/usr/local/bin/meyectl", line 5, in <module>
Aug 18 12:08:12 DietPi3 meyectl[5519]:     from motioneye.meyectl import main
Aug 18 12:08:12 DietPi3 meyectl[5519]:   File "/usr/local/lib/python3.9/dist-packages/motioneye/meyectl.py", line 28, in <module>
Aug 18 12:08:12 DietPi3 meyectl[5519]:     import settings
Aug 18 12:08:12 DietPi3 meyectl[5519]: ModuleNotFoundError: No module named 'settings'
Aug 18 12:08:13 DietPi3 systemd[1]: motioneye.service: Main process exited, code=exited, status=1/FAILURE
Aug 18 12:08:13 DietPi3 systemd[1]: motioneye.service: Failed with result 'exit-code'.
root@DietPi3:~#
An issue someone already faced and reported on Motioneye GitHub https://github.com/ccrisan/motioneye/is ... -734874856

Answer from end of 2020
I did the Python 2 to 3 port, but I stopped with it (I don't see a merge happen anytime soon)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
The_Raven
Posts: 33
Joined: Sat Aug 12, 2017 12:51 pm

Re: MotionEye on RasPi1 with BullsEye missing

Post by The_Raven »

More and more I remember this annoying thing with python2...
I think python2 has different syntaxes than python3. Because of this a py2 script does NOT work with py3.
There is a way to bring back py2 to bullseye, but it is absolutely the wrong way. The correct way is to move it to py3.

BTW: I hate python :x

Edit: Here is how to bring back pip2 to bullseye, but i am not sure if this source is trusty. https://blog.emacsos.com/pip2-in-debian ... lseye.html
Dirty if you ask me.
User avatar
Joulinar
Posts: 5617
Joined: Sat Nov 16, 2019 12:49 am

Re: MotionEye on RasPi1 with BullsEye missing

Post by Joulinar »

Honestly I don't think we will bringt back Python2 on Bullseye. To bad that MotionEye is not working on the transition to Python3 :roll:


Anyway it's working using Python2 on Bullseye

motion.service

Code: Select all

● motion.service - Motion detection video capture daemon
     Loaded: loaded (/lib/systemd/system/motion.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2021-08-18 15:03:33 CEST; 52s ago
       Docs: man:motion(1)
   Main PID: 5940 (motion)
      Tasks: 4 (limit: 2178)
        CPU: 2.588s
     CGroup: /system.slice/motion.service
             └─5940 /usr/bin/motion

Aug 18 15:03:33 DietPi3 systemd[1]: Started Motion detection video capture daemon.
Aug 18 15:03:33 DietPi3 motion[5940]: [0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf
Aug 18 15:03:33 DietPi3 motion[5940]: [0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf
Aug 18 15:03:33 DietPi3 motion[5940]: [0:motion] [NTC] [ALL] motion_startup: Logging to file (/var/log/motion/motion.log)
Aug 18 15:03:33 DietPi3 motion[5940]: [0:motion] [NTC] [ALL] motion_startup: Logging to file (/var/log/motion/motion.log)
motioneye.service

Code: Select all

 motioneye.service - motionEye Server
     Loaded: loaded (/etc/systemd/system/motioneye.service; disabled; vendor preset: enabled)
     Active: active (running) since Wed 2021-08-18 15:03:54 CEST; 30s ago
   Main PID: 5961 (meyectl)
      Tasks: 5 (limit: 2178)
        CPU: 2.192s
     CGroup: /system.slice/motioneye.service
             ├─5961 /usr/bin/python2 /usr/local/bin/meyectl startserver -c /etc/motioneye/motioneye.conf
             └─5972 /usr/bin/python2 /usr/local/bin/meyectl startserver -c /etc/motioneye/motioneye.conf

Aug 18 15:03:54 DietPi3 systemd[1]: Started motionEye Server.
Aug 18 15:03:55 DietPi3 meyectl[5961]:     INFO: hello! this is motionEye server 0.42.1
Aug 18 15:03:56 DietPi3 meyectl[5961]:     INFO: main config file /etc/motioneye/motion.conf does not exist, using default values
Aug 18 15:03:56 DietPi3 meyectl[5961]:     INFO: cleanup started
Aug 18 15:03:56 DietPi3 meyectl[5961]:     INFO: wsswitch started
Aug 18 15:03:56 DietPi3 meyectl[5961]:     INFO: tasks started
Aug 18 15:03:56 DietPi3 meyectl[5961]:     INFO: mjpg client garbage collector started
Aug 18 15:03:57 DietPi3 meyectl[5961]:     INFO: server started
At least web interface is working. I could not test it further as I don't have any camara

Code: Select all

root@DietPi3:/var/log# ss -tulpn | grep LISTEN
tcp   LISTEN 0      1000         0.0.0.0:22        0.0.0.0:*    users:(("dropbear",pid=473,fd=4))
tcp   LISTEN 0      128          0.0.0.0:8765      0.0.0.0:*    users:(("meyectl",pid=5961,fd=12))
tcp   LISTEN 0      4096       127.0.0.1:8080      0.0.0.0:*    users:(("motion",pid=5940,fd=7))
tcp   LISTEN 0      4096       127.0.0.1:8081      0.0.0.0:*    users:(("motion",pid=5940,fd=5))
tcp   LISTEN 0      1000            [::]:22           [::]:*    users:(("dropbear",pid=473,fd=5))
root@DietPi3:/var/log#
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
The_Raven
Posts: 33
Joined: Sat Aug 12, 2017 12:51 pm

Re: MotionEye on RasPi1 with BullsEye missing

Post by The_Raven »

I am trying to install motioneye. But it does not work. :?

Code: Select all

pip3 install -U motioneye
Works, but i don't get a service "motioneye". Looks like i miss something. Any idea?
User avatar
Joulinar
Posts: 5617
Joined: Sat Nov 16, 2019 12:49 am

Re: MotionEye on RasPi1 with BullsEye missing

Post by Joulinar »

first you would need to install Python2 ;)

and to install MotionEye

Code: Select all

python2 -m pip install -U motioneye
Personally I hacked dietpi-software to get Python2 along with Python3 8)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
The_Raven
Posts: 33
Joined: Sat Aug 12, 2017 12:51 pm

Re: MotionEye on RasPi1 with BullsEye missing

Post by The_Raven »

Too fast sorry... :P
What is needed?

Code: Select all

apt install python2
What else?
User avatar
Joulinar
Posts: 5617
Joined: Sat Nov 16, 2019 12:49 am

Re: MotionEye on RasPi1 with BullsEye missing

Post by Joulinar »

give me some time. I will create a small how-to next days. Just need to find time.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
The_Raven
Posts: 33
Joined: Sat Aug 12, 2017 12:51 pm

Re: MotionEye on RasPi1 with BullsEye missing

Post by The_Raven »

Perfect, THX. :D
I can test it, have 6 cameras connected to 3 pi's managed by a central debian server. ;)
But it really should be moved to py3! We need someone to poke the motioneye team :P
Post Reply