RPI ZERO W keeps rebooting

I installed dietpi today on a Zero w. (did it on a 3B+ and setup as Hotspot no problem). I wanted to setup the zero as a webcam.
I did this 4 times before I started to install or change the configuration and reboot at least 2 times to make sure all was good.
I changed the setup to US. connected to the Wi-Fi.
Updated to the latest version of dietpi. Update the firmware.
Changed drop bear to ssh.
installed REALVNC.
But when I Install RPI WEB CAM it keeps rebooting and I can’t stop it.
As I said after the 3rd time I flashed a fresh image again and rebooted at least 2 times after each change or install until I got to the RPI Web CAM issue.
I get "You’re in emergency mode. Enter root password for maintenance or CTRL D.
I tried dietpi for the password and root. CTRL D does nothing but reboot back to the same area.
I’m assuming there is am issue with RPI Web Cam.
Anyone have any ideas?

Sounds like you might have a low voltage situation…check to make sure you are getting good 5Vdc or even higher…says 5.2vdc output from your power device

Actually that’s the first thing I checked. I replaced the power supply with one used on my Pi3B+. It’s 5.2V, 3amps.
I even tested it with my voltmeter. The issue is this pi Zero W setup works fine with a full version of Raspian and the RPI WEB CAM version I had to manually configure. I switched back to that card and all is fine. I just like the small footprint and ease of setup with DietPi. And it only starts to reboot when I add in the Web Cam distro on DietPi. I even tried some other packages after my initial posting, on the card, flashed a new image. In fact I added a few distros to the DietPi setup and had no problem. But when I went back to flashing the card and the same steps for the Pi Web cam distro it keeps rebooting. I even tried different SD cards. I only use high quality SanDisk SD cards on all my Pi’s .SanDisk Ultra 64GB Micro SDXC UHS-I. For the Pi camera I used the 64GB on the original setup with Raspian and RPI Web Cam ( I actually have 3 running for over 2 months) and had no issues at all. For other projects that don’t require a lot of space I use smaller size cards but same quality.

It looks like v6.13 is up now. Is that true?
My upgrade took me up to v6.12. Could that be an issue?
I’ll try once more with a fresh image and upgrade to v6.13.

The only issue I can think of is RPI Web Cam likes to use Apache 2 (At least when I installed it with a full version of Raspian on the Zero W that worked). DietPi installs Lighttpd by default.
I’ll install Apache 2 and remove Lighttpd and reboot 2 times. If I’m not in a reboot loop I’ll try installing RPI Web Cam.
I’ll get back to the group after this.

It wasn’t Apache 2.

It looks like the errors are related to the keyboard (which I did not have issues with under the initial setup with full Raspian).
I use a wireless keyboard. I switched it to a wired usb keyboard and still have the same issue.

The one thing I did do is enable serial console (which I did not do on the full version of Raspian). I’m wondering since the PiZero W has only one USB hub it somehow gets confused with serial console and a keyboard attached?

I will try to start over with a new image and not enable serial console.

So, after a new flashed image on a new card I had no issues when doing the software and firmware updates.
I set my Locals info (US, English, keyboard) Which did not get save on the first boot. Went back to UK defaults. I had to set them again.
I did not enable serial console. I just replaced Dropbear with SSH support. Apache 2 for webserver. Reboot (2 times) after each change/install.
No other software installs. Rebotted a few times with no issues.
I picked RPI Webcam to install. It installed Apache 2 and then RPI Webcam. And I’m back with the same issues.
It looks like it has a problem with the keyboard. I made sure it was setup correctly and wired. It draws .01 amps.
Has anyone any idea what’s going on here? It it just a bad Apache 2 or RPI Webcam package?
As I stated I have the setup on a Pi Zero W card with full blown Raspian, and the Apache 2 and RPI Webcam and have no issues at all.

Issue happens with a fresh image and REALVNC install.

Goint back to Raspian lite and manual package install.

I opened an issue for investigation on github: https://github.com/Fourdee/DietPi/issues/2008

Since it also happened with Lighttpd, I guess it is related to cam firmware/kernel module. We need to check on own RPi (Zero W).

Can you catch some error messages on boot? In case you need to enable persistent logging (disable dietpi-ramlog first).
If no chance for boot up, check logs from rsyslog on external device.

I do know that you don’t remove the GB from locales…leave it selected but select US as default…I think it might cause oddities if it is removed

Thanks for opening an investigation. I’ll try to get some error messages.

I’m not exactly sure what you mean leave GB selected but select US as default.

I also had the same issue with a fresh image and REALVNC install. I did not install the Webcam distro. It may be an issue with the PiZero W. I’ll also try it on a Pi3B+ (don’t know when I’ll have time) and get back to you.

Okay, as RealVNC and the RPi cam control do not share obvious dependencies (vnc ← desktop, cam control ← webserver), I guess it is not related and a hardware related issue, maybe related to a certain setting.

About locales:
If you set the locale via dietpi.txt directly after flash, before first boot, every should be fine with it and the locale should be as well present on the system afterwards. It needs to be UTF-8 locale, for US: en_US.UTF-8
If you overwrite/set the locale with any other way (outside dietpi.txt), then indeed first run will overwrite it. DietPi ensures that en_GB is always present as well (not chosen as default for shell, but available), as we use it within our scripts to have reliable command outputs that we can check. But even if you manually remove en_GB, this should not result in boot loops, just some error messages and DietPi scripts/banner not working correctly.

About serial console:
On initial boot, serial console is enabled by default, to allow setting some other defaults, that I don’t understand too much :rofl:. If there is no serial console available, it will throw some error messages, which are expected then an can be ignored. Maybe we should mute them to not confuse users :thinking:.
After initial boot, serial console will then be set according to dietpi.txt choice. But again, even if there is no serial console available, but you enable it, it should not cause boot loops.

Serial console and USB devices have different /dev/ location schemes, thus there should be nothing mix up.

If you find time, could you try the following, if you have another Linux machine to access the ext4 partition on the SDcard:

  • After fresh install, switch from dietpi-ramlog to full persistant logging (rsyslog) with dietpi-software.
  • Then after this is enabled (and at best reboot) install the software that caused the boot loop.
  • If it happens, plug the SDcard into the other Linux system and check the /var/log/syslog, perhaps daemon.log boot.log and some other log files for errors. There should be definitely a hint what exactly causes the boot failure.

I’ll give it a try this weekend and get back to you.

Thanks for the quick response.
FYI I still plan on doing it on the Pi3B+ and see if I have the same issues.

Thanks again,