Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Raspberry Pi Zero 2 W #2829

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

jawsper
Copy link
Collaborator

@jawsper jawsper commented Oct 30, 2021

  • Updates for: kernel, rpi-firmware, rpi-wifi-firmware, v4l2loopback (needed for kernel 5.7+)

* Updates for: kernel, rpi-firmware, rpi-wifi-firmware, v4l2loopback (needed for kernel 5.7+)
@vleeuwenmenno
Copy link

I would like to use this with my Zero 2 W, is there a way I can compile a image myself.
Or can someone just approve this PR and make a new release 🙃

@starbasessd
Copy link

@vleeuwenmenno
https://github.com/ccrisan/motioneyeos/wiki/Building-From-Source
Issue: the version of buildroot in the source is 2 years old, and doesn't know about PiZero2W
#2827 (comment)
seems to mostly work, but not 100% tested. YMMV

@FriendlyNGeeks
Copy link

FriendlyNGeeks commented Dec 8, 2021

I downloaded @jawsper image make sure you name wifi config ".conf" most important part. any word on when this merge will happen?

@MarkJC67
Copy link

MarkJC67 commented Dec 10, 2021

I successfully installed your img and it successfully booted my Pi Zero 2W into motioneyeOS (eventually after I creating the wpa_supplicant.conf file and ssh correctly!) However I stupidly click the "Check For Updates" and of course it downloaded and overwrote your setup installation and would not boot up afterwards! I can easily re-install but I guess we need this fix checked out and updated to the main repository soon. Thanks for your work. :-) Oh after rebooting and changing too a static IP - I lost the date and time from the NTP. This might be due to my setup but it was working under DHCP.

@starbasessd
Copy link

@MarkJC67 It is always better to have your DHCP server issue a static (reserved) IP address, less chance of 'messing things up'.
As to 'updates', that's a problem on @jawsper 's side. (If it were me, I'd disable it.)
As to Time settings, what are you using? Failure to connect to an internet time source usually indicates a bad gateway setting, bad subnet mask setting, or a bad DNS setting.
It would explain it if you were able to get a time sync with DHCP, that one of the above is bad.
If you insist on setting static ip on the Pi, use the settings here:
https://github.com/ccrisan/thingos/wiki/static_ip.conf
static_ip.conf example:


STATIC_IP="192.168.42.1/24"
STATIC_GW="192.168.42.1"
STATIC_DNS="192.168.42.1"


Change as appropriate for your network
Place in the /boot partition along with wpa_supplicant.conf and ssh or ssh.txt files

@rickblair
Copy link

I downloaded the release image and wifi seems to be missing. WLAN0 interface is missing. I can use a USB network adaptor and boot. The only network interfaces present are lo and eth0.
The boot log looks like this:

---- booting motionEyeOS unknown ----

  • Detecting disk device: /dev/mmcblk0
  • Creating data partition: done
  • Formatting data partition: done
  • Mounting data partition: done
  • Copying data skeleton: done
  • Mounting filesystems: done
  • Mounting overlay filesystems: done
  • Setting empty root password: done
  • Copying version file: done
  • Setting UTC timezone: done
  • Loading kernel modules: done
  • Setting hostname: done
  • Configuring CPU frequency: done
  • Starting syslogd: done
  • Loading device-tree overlays: done
  • Starting throttle watcher: done
  • Starting eudev: done
  • Starting watchdog: done
  • Starting rngd: done
  • Preparing AP interfaces: none
  • Starting wpa_supplicant: no device
  • Configuring wireless network: no device
  • Configuring wired network: no device
    ---- shutting down motionEyeOS unknown ----

there is nothing in dmesg or messages that indicate anything failed.

Any clues as to where to begin?

@starbasessd
Copy link

@rickblair There is a build that works here:
#2827 (comment)
The issue for any 'official release' is that they are pre-release of the PiZeroW2, and buildroot doesn't support the other chips used on it.

@rickblair
Copy link

rickblair commented Dec 31, 2021 via email

@jawsper
Copy link
Collaborator Author

jawsper commented Jan 19, 2022

Created a new release updating rpi-firmware and rpi-wifi-firmware to support Pi Zero 2W revision 2.1 https://github.com/jawsper/motioneyeos/releases/tag/20220119-dev

@starbasessd
Copy link

@herdier0 Did you post then delete your post?

@Herdeir0
Copy link

I did, I was having this exact problems until I realized that my SSID was missing a character... Spent hours trying to understand the problem, to realizing that it was my totally my fault.
Anyways, the 20220119 works! My RPi Zero 2 is revision 3.16

@starbasessd starbasessd mentioned this pull request Feb 2, 2022
@motioneye-project motioneye-project deleted a comment from allpaulval Feb 2, 2022
@Gonioul
Copy link

Gonioul commented Feb 15, 2022

So, how can we properly update to 20220119-dev if update button is wrong?

@starbasessd
Copy link

@Gonioul Unfortunately, since it isn't a part of the Official issues, you need to do a backup, re-image, and restore data.

@jawsper
Copy link
Collaborator Author

jawsper commented Feb 15, 2022

Also, if the older version works on your Zero 2, there is no need to upgrade either

@Rtitude
Copy link

Rtitude commented Mar 25, 2022

I have the same issue as rickblair: #2829 (comment)

New to all this, and no coding background.
I have been able to get motioneyeos working on my 3b and 3b+ by just flashing the image and booting up those.

I have tried both images from jawsper, 2nd last gives the same as rickblair, latest gives this:

*Starting rngd: done
*Preparing AP interfaces: ap0
*Configuring wired network: no device
panic: rebooting in 40 seconds (caused by network)

Anything i can do to make the wifi work on the zero 2 w ?

Thanks in advance!

@starbasessd
Copy link

@Rtitude did you include / add your wpa_supplicant.conf file to the /boot partition to activate wifi before inserting and starting the PiZero2W?

@Rtitude
Copy link

Rtitude commented Mar 26, 2022

@Rtitude did you include / add your wpa_supplicant.conf file to the /boot partition to activate wifi before inserting and starting the PiZero2W?

I was 100% sure i did, turns out with trying different things i forgot, new flash and adding the wpa file it works now.
Thanks for pointing out my obvious mistake!

@MichaIng MichaIng added this to the v0.43.0 milestone Apr 20, 2022
@MichaIng MichaIng removed this from the v0.43.0 milestone Apr 20, 2022
@MichaIng
Copy link
Member

@jawsper
Could you update the commits to use latest stable RPi kernel with Linux 5.15, please?

@jawsper
Copy link
Collaborator Author

jawsper commented Apr 23, 2022

Hmm it's not currently working after updating to 5.15.34 (also updated rpi-firmware), it can't find the wifi adapter anymore...

@MichaIng
Copy link
Member

Not sure how the userland firmware parts are implemented in motionEyeOS, i.e. on Debian and Raspberry Pi OS one uses the firmware-brcm80211 APT package. Also assure that the bootloader is updated.

And I'd also update everything for all RPi models, as otherwise there may be incompatibilities between rpi-firmware and kernel.

@jawsper
Copy link
Collaborator Author

jawsper commented Apr 23, 2022

That firmware comes via this repo: https://github.com/LibreELEC/brcmfmac_sdio-firmware-rpi, I also tried the repo linked in the readme from RPI-Distro, but that also doesn't find the wifi. I tried the same image on a regular Pi 3, also does not work anymore...

@MichaIng
Copy link
Member

Not sure about installed userland tools, e.g. does the ip command exist and ip l doesn't show the network interface either? As always, then dmesg should give a hint.

@eggerr
Copy link

eggerr commented Jun 19, 2022

got "panic: rebooting in 40 seconds (caused by network)" on my zero 2 w, and I'm pretty sure I created a wpa_supplicant.conf at the boot partition, the same path with config.txt, before the first boot.
and this wpa_supplicant.conf file always got deleted after the first boot, anyone has a clue?

@starbasessd
Copy link

@eggerr You don't say what image you are using, for a PiZero2W you have to use Jawspers fork here {special](#2875) not the Pi4 or PiZero images in Releases.

@eggerr
Copy link

eggerr commented Jun 19, 2022

https://github.com/jawsper/motioneyeos/releases/tag/20220421-alpha
@starbasessd
Sorry, I was using 20220421-alpha
is this the right one to use?

update: I tried #2875 too, same.
now I'm trying to add ext4 support to my mac, maybe I can update the wifi config file directly.

@starbasessd
Copy link

It says right on that page that Wifi isn't working on that image. Use this

@starbasessd
Copy link

https://github.com/jawsper/motioneyeos/releases/tag/20220421-alpha
@starbasessd
Sorry, I was using 20220421-alpha
is this the right one to use?

update: I tried #2875 too, same. now I'm trying to add ext4 support to my mac, maybe I can update the wifi config file directly.

You can just re-add the wpa_supplicant.conf file to the /boot partition, it should re-read it.

@eggerr
Copy link

eggerr commented Jun 19, 2022

tried 3 times with 20220119-dev, won't work ...
write a new image , copy the wpa_supplicant.conf, got error msg on first boot, copy the conf file again, reboot and got the same error msg:
Starting wpa_supplicant: failed(brcmfmac)
...
...
panic: rebooting (caused by network)

@starbasessd
Copy link

2 usual causes
bad format of wpa_supplicant.conf file
bad file name (if created on a Windows box) (ends up with a wpa_supplicant.conf.txt filename)
For the first, if using Windows, use NotePad++ to edit it.
If Mac, use nano
the file format needs to look like:


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

network={
ssid="SSID"
psk="password"
key_mgmt=WPA-PSK
}


country needs to be yours, in lower case.
SSID and Password are case SeNsTive, and need to be yours.

@eggerr
Copy link

eggerr commented Jun 19, 2022

2 usual causes bad format of wpa_supplicant.conf file bad file name (if created on a Windows box) (ends up with a wpa_supplicant.conf.txt filename) For the first, if using Windows, use NotePad++ to edit it. If Mac, use nano the file format needs to look like:

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

network={ ssid="SSID" psk="password" key_mgmt=WPA-PSK }

country needs to be yours, in lower case. SSID and Password are case SeNsTive, and need to be yours.

problem solved, god bless you!

the conf's filename was fine because it got deleted every time, but if I make a copy of the conf file, that copy won't be deleted.
and I compared our conf files, two differences:
my conf was copied from the official site, the first line was:

ctrl_interface=/var/run/wpa_supplicant

and it doesn't have the last line, which is:
key_mgmt=WPA-PSK

also, maybe because I edited the conf file with vim but not nano? I'm not sure.

anyway, thanks, man!

@MichaIng
Copy link
Member

Use /run/wpa_supplicant nowadays, /var/run is only a symlink to /run anyway, for backwards-compatibility.

@starbasessd
Copy link

@MichaIng Have you confirmed in ThingOS? (in motionEyeOS/ThingOS/Buildroot, the final destination for /var/run and /run go to /tmp, at least in 20200606 and dev20201026) which is a ramdisk (tmpfs). Can't say I like this method... But I'm not a dev...

@MichaIng
Copy link
Member

Ah right, should be confirmed. I'm however pretty sure it points to the same directory since /var/run deprecation was a long time ago.

Probably both point to /tmp for simplicity, so that a single tmpfs is used only? However, I agree that it might be better to keep it split like on other distros, there is no overhead involved with multiple tmpfs's, also no actual RAM is used/reserved or such.

@Mario-vminion
Copy link

hi great script motioneyeos .. is it possible that some can make it work with the camera v3 ....maybe jawsper....

@HABoova
Copy link

HABoova commented Jan 2, 2024

I've been playing around with various ways of getting a RPIØ2 to play nicely with a camera module 3 and home assistant/homekit. But to my novice skills it very much looks like the new OS are playing with me. Has anyone had better luck than me?

@starbasessd
Copy link

@HABoova if you are refering to Jawsper's image, we might be able o help. If you are refering to RaspiOS Bookworm, not much works with it. You can go with Buster and it should work with the motionEye on another OS found here

@tegwin
Copy link

tegwin commented Apr 7, 2024

I have tried this on a RPI Zero 2 W. And it does not work

I have added the wpa_suplicant.conf file with the following information in it

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

network={
ssid="Mynetwork name"
psk="password"
key_mgmt=WPA-PSK
}

I copy it in to the file structure that was created by Balena which looks like this

image

The green light comes on for booting and nothing happens. Just does not give me an Ip Address.

Any idea

@jawsper
Copy link
Collaborator Author

jawsper commented Apr 7, 2024

@tegwin do you have an HDMI cable so you can see the console output?

@tegwin
Copy link

tegwin commented Apr 7, 2024

@tegwin do you have an HDMI cable so you can see the console output?

Hey @jawsper Yes I do .. This is What I get

@tegwin
Copy link

tegwin commented Apr 7, 2024

Looks like its trying to find a WIRED network which there is none.

CleanShot 2024-04-07 at 21 26 40

@tegwin
Copy link

tegwin commented Apr 8, 2024

I have actually found out why this does not work. It would appear that I spelled wpa_supplicant.conf incorrectly. I have now spelled it right and its working

@tegwin
Copy link

tegwin commented Apr 8, 2024

Actually another question, does any one know how to add multiple RPI Zeros to this. What installation do i use and how do I set it up

Thanks
Chris

@jawsper
Copy link
Collaborator Author

jawsper commented Apr 8, 2024

@tegwin You have (at least) two options:

  • Use one of the Raspberry Pis as a "master" and add the other cameras in there
  • Run a separate motioneye on some other machine in your network and add the cameras there

Either way, you can add multiple cameras by opening the menu, and then clicking the dropdown directly next to the menu button, there should be an option to "add camera...". You then select Remote motionEye Camera and enter the URL and credentials for your other camera.

@tegwin
Copy link

tegwin commented Apr 8, 2024

@tegwin You have (at least) two options:

  • Use one of the Raspberry Pis as a "master" and add the other cameras in there
  • Run a separate motioneye on some other machine in your network and add the cameras there

Either way, you can add multiple cameras by opening the menu, and then clicking the dropdown directly next to the menu button, there should be an option to "add camera...". You then select Remote motionEye Camera and enter the URL and credentials for your other camera.

Not sure I understand. When you say Use one as a Master. what do you mean ? Do I need to put any special camera software on this.

What I was hoping is that I could install camera software on a PI and just add it through the interface

@jawsper
Copy link
Collaborator Author

jawsper commented Apr 8, 2024

No extra software needed. Each of the cameras with motioneyeOS will run the motioneye software. You just need to pick one camera, and you can add the other cameras to that interface.

@tegwin
Copy link

tegwin commented Apr 8, 2024

No extra software needed. Each of the cameras with motioneyeOS will run the motioneye software. You just need to pick one camera, and you can add the other cameras to that interface.

Ok thanks. So I can just install MotionEyeOS on any device I want and then I can add them as additional from there. Is there is an option in the UI to do this ?

@martybates
Copy link

Hi folks. I need to set up a Pi Zero W, to act as an AP. I have been asked to set up cctv in out local apiary, and it is remotely located without internet or wifi. I am wondering if anyone had any link to an image of Motioneye, suitable for a PI zero W, that would already have the hostapd, dnsmasq, and the other files necessary for it to function. I have tried to create one myself, but my coding skills are just not up to the task. Both the bees and myself urgently need help. Thanks in advance.

@starbasessd
Copy link

This is for PiZero or Pi1, and has the files needed already. Here is the link to specific instructions.
I just confirmed the instructions are correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet