motioneye-project / motioneye

A web frontend for the motion daemon.
GNU General Public License v3.0
3.94k stars 651 forks source link

"no device" when starting wifi on RPi Zero 2 W on Jaspers image #2265

Open derolly opened 2 years ago

derolly commented 2 years ago

When trying to boot Jaspers Image for the Raspberry Pi Zero 2 W I get the following error:

` * Detecting disk device: /dev/mmcblk0

I get this error on 2 different boards with this image. Using the official Raspbian Image I do not get this error. I also tried this on 2 differently named wifi networks with the same result. When using a usb-to-network adapter it boots sucessfully. I checked then that the wpa_supplicant.conf was written correctly, and it was.

Any ideas? Maybe a missing driver or something?

starbasessd commented 2 years ago

Sounds like a corrupted image. The whole point of @jawsper s image is because the 'official' motionEyeOS images don't have support for the wifi chip on the PiZero2W.

starbasessd commented 2 years ago

Can you post your wpa_supplicant.conf file (blot out the SSID and password) Make sure that the wpa_supplicant.conf doesn't end with .txt if created on a Win10 machine. Is it the same file that is copied to the /boot partition on the RPiOS image?

derolly commented 2 years ago

The content of my wpa_supplicant.conf:

`country=DE update_config=1 ctrl_interface=/var/run/wpa_supplicant

network={ scan_ssid=1 ssid="MYSSID" psk="MYPASSWD" }`

and the extension is just .conf not .txt

I downloaded the image again, and tried it with balenaEtcher and the Raspberry Pi Imager. No success.

Is it possible that I do not have the same wifi chip as you? How can I check that?

starbasessd commented 2 years ago

You are sure you have the PiZero2W card? What does it have for model number on the back? I haven't heard of any 'newer' models, yet. You state the PiZero2Ws connect on wifi using RaspberryPiOS? Without the usb to ethernet adapter? Also assuming the ` at the beginning of the first line and end of the last line are not in the actual file...

derolly commented 2 years ago

I'm pretty sure. I bought them here: https://www.elektor.de/raspberry-pi-zero-2-w

Added some photos of one of the boards 3037 IMG_20220107_185737

.

MStcz commented 2 years ago

Hi Derolly, I am facing very same issue. Here is the link to img I am trying:

https://github.com/jawsper/motioneyeos/releases/download/20211113/motioneyeos-raspberrypi3.img.gz

And here what is containing wpa_supplicant.conf file. I have used Linux enters "LF".

country=CZ ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1

network={ ssid="ssid" psk="psswd" }

starbasessd commented 2 years ago

For parsing issues, can you move the country=CZ to the 3rd line? Can you add key_mgmt=WPA-PSK to the line after psk= and before }

MStcz commented 2 years ago

Hi Starbasessd,

just tested with the same result.

Here is the config file: ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 country=CZ

network={ ssid="ssid" psk="passwd" key_mgmt=WPA-PSK }

Console output:

starbasessd commented 2 years ago

If it were an official image, I'd be questioning: /dev/mncblko that would be /dev/mmcblk0 , but maybe @jawsper has an idea?

MStcz commented 2 years ago

Sorry, /dev/mncblko is my fault. I took a picture of the screen and did OCR. I can see "0" (zero) on the picture but OCR wrote it as "o". Again sorry for this confusing.

jawsper commented 2 years ago

Hi @MStcz, can you check if there's a file called bcm2710-rpi-zero-2.dtb in your boot partition? (the same as where you put the wpa_supplicant.conf)

MStcz commented 2 years ago

Hi @jawsper, it is there. MD5 of the file is E3C5B4E88C84C8351E8FD44C4FCD652B.

jawsper commented 2 years ago

Hmm that matches the one I have. Have you tried running the official Raspberry Pi OS on this specific Pi, to rule out a hardware issue?

derolly commented 2 years ago

On my two Pi zero 2 w the official Raspbian Buster runs perfect. Thats what I'm using motioneye on right now. But your image still does not work with both zero 2 w.

MStcz commented 2 years ago

This image is working with the same wpa_supplicant.conf config file. https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2021-11-08/2021-10-30-raspios-bullseye-armhf.zip

dvandijk commented 2 years ago

I'm having the same issue with zero results in changing the wpa_supplicant.conf (I've tried them all). I have another Pi Zero2 which is working fine. Using that image doesn't work either.

The only difference between the Pi Zero2's are the version and chip serial.

Working: version 1.5 with chip serial 210340G Not working: version 2.11 with chip serial 210340E

*edit Both are working fine with bullseye by the way.

starbasessd commented 2 years ago

@dvandijk Interesting. Can you post a pic of both PiZero2W backs (where it shows the version number)? I have been told in the RPi forums that there aren't 2 versions, but that would explain why there are more and more issues...

jawsper commented 2 years ago

Ah that is very interesting! Seems there could be a new chip revision, possibly requires another rpi-firmware update.

dvandijk commented 2 years ago

Sure, hope this helps

comparison

jawsper commented 2 years ago

Interesting, the main CPU does seem to be identical, but perhaps they had to update the Wifi chip. I'll build an image with the latest firmware later tonight.

starbasessd commented 2 years ago

@dvandijk Any chance you could get the identifying info off the silver WiFi chips? Please?

jawsper commented 2 years ago

@dvandijk Can you try this new version? https://github.com/jawsper/motioneyeos/releases/tag/20220119-dev I updated rpi-firmware (not sure if needed) and rpi-wifi-firmware (this may fix your issue).

jawsper commented 2 years ago

(I'm not near my Pi so this image is not tested by me)

derolly commented 2 years ago

I tried the image and can confirm that it works on my pi! Thank you @jawsper 👍

dvandijk commented 2 years ago

Can also confirm that it works! Thanks indeed @jawsper

MStcz commented 2 years ago

Hi @jawsper, great job, thank you for the solution.

john3parker commented 2 years ago

HI @jawsper, thank you for the build. It works for my PiZero2W when other builds would not. However, applying config changes to the camera with you build yields this error for my Remote MotionEye Camera.

2022-01-30 03:02:17: [motioneye] ERROR: 'privacy_mask' Traceback (most recent call last): File "usr/lib/python2.7/site-packages/tornado/web.py", line 1548, in _stack_context_handle_exception File "usr/lib/python2.7/site-packages/tornado/web.py", line 1756, in wrapper File "/usr/lib/python2.7/site-packages/motioneye/handlers.py", line 297, in post File "/usr/lib/python2.7/site-packages/motioneye/handlers.py", line 205, in wrapper File "/usr/lib/python2.7/site-packages/motioneye/handlers.py", line 537, in set_config File "/usr/lib/python2.7/site-packages/motioneye/handlers.py", line 376, in set_camera_config File "/usr/lib/python2.7/site-packages/motioneye/config.py", line 834, in motion_camera_ui_to_dict KeyError: 'privacy_mask' 2022-01-30 03:02:17: [motioneye] ERROR: 500 POST /config/1/set/?_username=admin&_admin=true&_signature=adb1e6260cf73e1d5c822e8f0aba57e1f72fa5b9 (192.168.1.31) 15.75ms

starbasessd commented 2 years ago

I do notice an inconsistent use of "/" leading (missing in the first 2 lines), maybe a bad edit? Are both motionEyes running on PiZero2Ws? Or which is which?

john3parker commented 2 years ago

I do notice an inconsistent use of "/" leading (missing in the first 2 lines), maybe a bad edit? Are both motionEyes running on PiZero2Ws? Or which is which?

I doubled check and was able to reproduce the missing "/" - its not a bad edit. I am running PiZero2W.

20220129_202258

starbasessd commented 2 years ago

@jawsper thoughts?

john3parker commented 2 years ago

@jawsper Looks like this is a missing privacy_mask setting in config.py for _set_default_motion_camera. This sets the default camera_config (line 567) and sent to motion_camera_ui_to_dict (line 570) but privacy_mask doesn't have a default value. It's referenced on line 834 and the error is thrown. May want to solve for this by setting an initial value for privacy_mask = False and the checking for the True/False instead whether the value actually exists. I'm not a Python developer and not really sure how the packaging/builds work or I'd give that a try myself.

john3parker commented 2 years ago

More debugging - I'm running a central server with MotionEye web frontend server and an attached MotionEyeOS camera. Configuring the camera directly from the camera IP it works fine. The request payload clearly has entries privacy_mask and privacy_mask_lines.

{
  "enabled": true,
  "name": "Camera11",
  "proto": "mmal",
  "auto_brightness": false,
  "rotation": "0",
  "framerate": "2",
  "privacy_mask": false,
  "privacy_mask_lines": [],
  "extra_options": [],
  "storage_device": "custom-path",

When I try to configure the camera from the MotionEye frontend server it throws the privacy_mask error. Here you can see the request payload is missing the privacy_mask attribute.

{
    "enabled": true,
    "name": "Camera11",
    "proto": "motioneye",
    "auto_brightness": false,
    "rotation": "0",
    "framerate": "2",
    "extra_options": [],
    "storage_device": "custom-path",
john3parker commented 2 years ago

I'm running the local MotionEye server from a docker container. It's version is 0.42. There seems to be a mismatch in versions between these builds. Can you update the docker image with the latest version?

#      
# meyectl -v
motionEye 0.42
# 

The camera is running version 0.42.1

[root@meye-2854046f ~]# meyectl -v
motionEye 0.42.1
[root@meye-2854046f ~]# 
starbasessd commented 2 years ago

How are you logging into the docker container to run meyectl -v? What does the WebGUI report for the docker container as to version for motion, motionEye, and OS?

starbasessd commented 2 years ago

Nevermind. Confirmed 0.42.0 for the docker image. Along with motion 4.2.2 and OS Ubuntu 18.10. Checking the Install in Docker Build Instructions, will report shortly.

starbasessd commented 2 years ago

OK, Build Docker gives motionEye 0.42.1, but motion 4.1.1, and OS is Debian 10. Will look at it further...

starbasessd commented 2 years ago

I do not have enough time to figure out how to add the binary from motion-project, rather than the default motion from the Debian 10 repo used by the docker build... Anyone want to make suggestions, I'll be happy to re-write the Install in Docker instructions to update them. It is much more viable for the 'average' user (read: script kiddie like me) to build the latest docker than build a motionEyeOS image.

jawsper commented 2 years ago

So the version of motioneye on motioneyeos doesn't seem to be actually 0.42.1, there just hasn't been a bump to the version numbers since then, but @ccrisan did update motioneye since then, and that privacy mask feature was added after the 0.42.1 release. The actual version is 1b04e8968c2a127b23341575ab80e9892893b576

starbasessd commented 2 years ago

dev20201026 does have the privacy mask option & 0.42.1, with motion 4.3.1. Privacy Mask in motion first appeared 4.1

starbasessd commented 2 years ago

Working on adding motion 4.3.2-1 to amd64 Dockerfile build. Suggestions on how to add 1b04e8968c2a127b23341575ab80e9892893b576?

starbasessd commented 2 years ago

If there is any interest, I can try for updating to Bullseye, or including RPi specific changes, too... I am not anywhere near a Dev or Programmer, but want to extend usability as long as possible, and the docker container may be the way to go for motionEye.

starbasessd commented 2 years ago

OK, have new Dockerfile working, gives Debian 10 (Buster) OS, latest motionEye (with Privacy Mask) and motion 4.3.2-1

attached as Dockerfile.zip unzip and place in motioneye/extra folder replacing existing Dockerfile

Command to build:

docker build --build-arg VCS_REF=$(git rev-parse HEAD) \
    --build-arg BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ") \
    -t ccrisan/motioneye:master-amd64 -f extra/Dockerfile .

command to run:

docker run --name="motioneye" -p 8765:8765 --hostname="motioneye" \ -v /etc/localtime:/etc/localtime:ro \ -v /etc/motioneye:/etc/motioneye \ -v /var/lib/motioneye:/var/lib/motioneye \ --restart="always" \ --detach=true ccrisan/motioneye:master-amd64

If someone would test it, and let me know it's working as expected, I will then add to Install in Docker documentation.

Dockerfile.zip

john3parker commented 2 years ago

@starbasessd i was able to build with the new Dockerfile and deploy the container. Everything appears to be working perfectly for me. MotionEye 0.42.1 (with Privacy Mask) and motion 4.3.2. My host operating system is Ubuntu 20.04. I was able to add and update cameras from MotionEye server. Looks good to me! Thank you for doing all the heavy lifting!

fils02 commented 2 years ago

Hi @jawsper, hi @starbasessd I found your build for motioneyeos rpi0 2 w, and I tried to run but it seems not connecting to wifi even if I tried a lot of times with different wpa_supplicant files. Then I found this topic about the two version of chip and realized that mine is a third one version! I was wondering if you could add a new version for this, it'll be very helpful for me!

chip serial RP3A0-AU 2104 201221A

Thank you very much in advance

Slipery commented 11 months ago

Looks like this problem has raised its head again. Pi Zero 2W marked as version 4.6 on boot up I get Starting wpa _supplicant: no device Configuring wireless network: no device Configuring wired network: no device panic: rebooting (caused by network)

C4pric commented 8 months ago

hi @jawsper, I have a Raspberry pi zero 2w and I have the same problems as many, my wpa_supplicant file does not detect any service. I would like to know if it was possible to update motioneyes for rpi2w. My raspberry 2w is part of version 4.2.