Raspberry Pi Zero image broken?

Hi. I’m trying to install OSMC on a Raspberry Pi Zero using the disk image, but I’m running into issues.

Upon powering the device, the green light flashes twice, the “rainbow square” appears on screen, and then the screen goes black.

After writing the image, the output of fdisk:

Disk /dev/mmcblk0: 1.9 GiB, 1967128576 bytes, 3842048 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00001530

Device         Boot Start    End Sectors  Size Id Type
/dev/mmcblk0p1       2048 499711  497664  243M  c W95 FAT32 (LBA)

This single partition includes the following files, as expected:

bootcode.bin  cmdline.txt  config.txt  filesystem.tar.xz  fixup_cd.dat  kernel.img  start_cd.elf

I performed the same steps and successfully installed this on a Raspberry Pi 3 with no issues (using the corresponding image for the Pi 2 / 3 of course) . After searching the forum, it appears that this issue affects multiple users. One workaround seems to be to use a RPI1 to boot the image and after the initial file system is set up properly, the image can be moved back to the Zero. Another workaround is to use the osmc-installer to write the sd card image. Unfortunately, I do not own a RPI1 nor do I have root permissions necessary to install/use the osmc-installer. (I also see no reason why an installer should be required as long as disk images are provided.) I do however have access to use dd to write an image as well as full write access to the sd card.

###Steps I’ve taken to install:

  1. Downloaded the image from http://download.osmc.tv/installers/diskimages/OSMC_TGT_rbp1_20160306.img.gz
  2. Verified the checksum to be correct. (31e47e995a6c1671a1ae32bd84a13e59)
  3. Extract the img file.
  4. Use dd to write the image to the sd card. (dd if=/path/to/OSMC_TGT_rbp1_20160306.img of=/dev/mmcblk0 bs=4M)
  5. Safely remove SD card, insert in the Pi Zero, plug in HDMI, and plug in power.

###Troubleshooting done so far:

  1. Use dd to read the image back to verify there was not a write error.
  2. Use older images to verify it was not a single bad build. (Downloaded from disk images: Download - OSMC)
  3. Use a different Raspberry Pi Zero to verify it was not defective.
  4. Use different SD cards (including larger capacity) to verify that it was not defective.
  5. Booting with and without a WiFi adapter plugged in.
  6. Use raspbian and other operating systems to verify all hardware works.
  7. Use different power supplies. All power supplies also work just fine for the other operating systems and even the Pi 3.

Am I doing something wrong or is the image broken?
Have any users or devs verified that the releases under the “Disk images” will work correctly for a Pi Zero?

Are the images on the download page identical to those produced by the installer and if not, how do they differ? My best guess is that the images listed are built differently than the installer.

Please let me know if I’m missing any other critical debugging info.

Thanks!

When the Zero first came out, images at the time weren’t compatible, so an update was needed. This is no longer the case if a more recent image is used.

It’s not broken, or it wouldn’t work for Pi 1 either and we’d definitely have heard from some users about that.

The installer doesn’t produce disk images, it uses the same ones listed on the site.

Leave it a while, does an install.log get created on the SD card?

1 Like

Thanks for the super fast reply!

I assume that the image I mentioned above ( http://download.osmc.tv/installers/diskimages/OSMC_TGT_rbp1_20160306.img.gz ) is the latest image for the Pi Zero, so it should be compatible.

This is likely just something silly that I’m missing on my end. For reference, other users that I was referring to with similar symptoms:
This post was soon after it came out, so it was probably before the image was made compatible.
Another post was more recent, however.

I’ve left it running for maybe 10-15 minutes or so before pulling the power, but no log file was created. Should that be long enough to generate the log?

I think if there was an issue with the images we would have seen more than one report in the last two months.

The image you linked to is compatible. Two green LED flashes means that the SD card cannot be read properly. Can you try with another card?

1 Like

Yea, the lack of reports leads me to agree with you.

I tried 3 different SD cards (2GB, 8GB, 16GB) and 3 Pi Zeros as well.

Since all of the SD cards and Zeros worked fine with other linux distros and since most people have no issues with the image, I suspect that it’s the method I’m using to write the image to the SD card may be different than the method the osmc-installer is using.

I’m using the following:
sudo dd if=/tmp/OSMC_TGT_rbp1_20160306.img of=/dev/mmcblk0 bs=4M

file /tmp/OSMC_TGT_rbp1_20160306.img 
/tmp/OSMC_TGT_rbp1_20160306.img: DOS/MBR boot sector; partition 1 : ID=0xc, start-CHS (0x10,0,1), end-CHS (0x3ff,3,32), startsector 2048, 497664 sectors

I’m writing the image file to the entire disk, not just one partition.

(Also to followup on your previous question: After putting the SD card in the Pi Zero for a while I removed it. There was no log file created. I even used dd to copy the first 268435456 bytes from the drive back to the computer and the checksum is still the same as the original .img file, so nothing has changed on the SD card.)

Edited for md5 hashes:

84d279839c772d3a040b80187388975b  bootcode.bin
06578193696132d4371c7f4c9732d778  cmdline.txt
f32be7a0c6d16d01f540d1e6023b640b  config.txt
83a874e6c6d4870ece7e9de733224f78  filesystem.tar.xz
bbd14a866e6df4f852b1667442450e06  fixup_cd.dat
b49b0b2f4bcacc86938f127d7b70ac8b  kernel.img
9420edea03120b1298621e98bea5b29f  start_cd.elf

I know you mentioned that you tried different power supplies, but you also mentioned the rainbow box showing up.

When you tried different power supplies, did you just switch the power brick, or did you try switching the brick and cable? If you are using the same cable each time, try a different cable; you may have a bad cable.

1 Like

Thanks for the help!

I tried both different power bricks and different cables in various combinations. I’ve got a bunch of cables, but changing them around does not seem to have any affect.

I have 5 different bricks. All of them worked without the rainbow box when using a different OS on the Pi Zero. Some are lower amperage, however, and caused the Pi 3s to underclock. I’m currently using a 1.8A for most of the tests mentioned above. The 1.8A seemed to be good enough for the Pi 3 running raspbian, so I think it should be fine for the lower powered Zero.

My next question would be why can’t you just use the official installer? I’ve used it from my Linux Mint 17.3 with no problems, and I don’t remember it need root.

What is the system running that you are running dd from?

1 Like

I’m unable to install packages on my system. I’m running Ubuntu 15.10. Is it possible to use the installer via the git repo without root?

I’m running dd from a fully updated Ubuntu 15.10 install.

Actually, I can boot up a live cd and attempt to install using that. If that works, then I think there is something that the installer is doing which is different than simply using dd on the img file.

Why can’t you sudo on your system? You are just a user and don’t own it?

But trying from a Live CD would be a good test.

1 Like

If you can dd, then you can run sudo for sure.

I don’t think this will resolve the issue for you however.

1 Like

Ok, turns out I do have root access, sorry about that. I’m not sure why I thought I did not.

Either way, I used the Live CD. I installed the osmc-installer package and wrote to the SD card to check the differences. I took note of the checksums of the files on the drive. They were all identical except an additional preseed.cfg file with md5 513abe7a87e579f5a9a209169f66b9bd. During installation I selected wired connection.

Contents of preseed.cfg:

d-i target/storage string sd
d-i network/interface string eth
d-i network/auto boolean true

Then I realized the issue…

I noticed that the light on my WiFi adapter was not powered (it must have broke). After replacing the WiFi adapter it booted up and worked! This made me curious as to why this did not boot without the adapter, so I tried the dd method again and discovered the following:

  • Using dd to install and with the USB WiFi adapter unplugged: No boot
  • Using dd to install and with the USB WiFi adapter plugged in: Boots!

So it seems like a network interface required for the initial boot? Keep in mind that there is still no network connection since I never even specified my SSID/password. I’m going to do a bit more testing, but this seems like a small bug.

Thank you both for your help! I really appreciate helping me troubleshoot!

A network connection isn’t needed to boot, unless you set up an NFS installation. Again, this is something we’d be aware of if this was the case.

I’m not sure what your issue is, but it would definitely help if you documented all the peripherals you have attached, and where you got them from. Further – I notice you say that your old WiFi dongle didn’t work (it may have caused issues if it was dead), and that you replaced it. Did you test booting the Zero without the new dongle? It may be the case that the older dongle was simply causing the booting issue.

When it doesn’t boot, is it always still the two flashes of green? This does mean that the SD card cannot be read.

1 Like

As you mentioned, NFS isn’t set up since this is a 100% clean install.

Good suggestion - here’s what I have attached:

  1. A 1.8A power brick and usb cable attached to the proper PWR port (unknown origin).
  2. A cheap HDMI to mini-HDMI adapter (from China) attached to a TV with CEC.
  3. A cheap micro-USB OTG cable (from China) attached to an 802.11n WiFi adapter (AZiO AWU101N)

To clarify my previous post:

  • When 1 and 2 are plugged in but 3 is not plugged in: No boot
  • When all of the above is plugged in (1, 2, and 3): Boots!

To confirm, yes the test where it would not boot was without the broken dongle - the micro USB port on the Pi was empty.
It may also be possible that the broken dongle damaged the Pi. To verify that it did not create a short, or some other issue, I just swapped out the Zero for another brand new Zero. I get the same results.

I also notice that when it does not work, the rainblow block apperas, LED blinks 2 times then the LED never turns on again.
When it does work, the same thing happens except the LED flickers after.

Now here’s the weird part…
it’s not the WiFi dongle that’s doing it… it’s the cable!
If I plug in the OTG cable without the WiFi dongle, it also works! So it seems like the OTG cable is required for it to boot.

So far this has been completely repeatable. I’m even reflashing the SD card between tests. What the hell is this magic OTG cable doing?? I’m so confused.

Edit: Just wanted to mention that I just tried both raspbian and OpenELEC and they both boot up without the OTG cable being plugged in (just the HDMI and power), so this seems like an issue specific to OSMC.

Edit 2: Another thought… The Raspberry Pi 1, 2, and 3 all have full USB ports while the Zero is the only model that does not. Does the boot process assume that a full size USB port exists and thus hangs on the Zero?

This seems to indicate poor shielding, either from the PSU or the HDMI cable. I know the other OS’ boot fine, but I haven’t the foggiest why, and there are certainly a lot of variables here.

I’ll say it one final time, and I don’t mean it disrespectfully. OSMC runs on the Raspberry Pi Zero. It’s not a problem with the image, there’s no pre-requisite for a network connection and it’s not a USB problem.

1 Like

Thanks for the help! I just tried this without the HDMI cable and HDMI adapter plugged in at all (looking only at the LED flickering) and it still works the same way, so it can’t be the HDMI shielding. Swapping out the PSU also has the no change in behaviour.

I believe you that it runs on the Zero since I’m able to successfully run it myself now! I just can’t boot it with an empty micro USB port for some reason. It’s not an issue for me since I intend intend to always use WiFi with it, but this may be helpful for anyone who has the same issue.

And don’t worry, I take no disrespect :smiley:, especially from those that take the time to help me out! I just hope that I’m not being annoying, I’m just trying to fix what I believe may be a bug.

I can’t completely rule out the shielding since for all I know, all of my USB cables are bad, however my money is still on a USB problem.

One more piece of info - the USB OTG cable is only necessary on the initial boot. All subsequent boots (after the file system is set up) no longer require the USB cable to be plugged in. This is consistent with the other reports from users with the same issue who used a RPI1 to initialize the file system and then reported the SD working fine in the Zero afterwords.

To prove the USB theory wrong: Is anyone able to boot a 100% new install (before the file system is set up) on a Zero with the micro USB slot empty? My guess is that everyone with a successful initial boot has done so with something in the micro USB slot.

I’ll ask @gezb, who has a Pi Zero.

Sam

1 Like

I can confirm that OSMC will not install without an OTG cable in the micro USB slot. As soon as I plugged in my OTG cable in (with nothing plugged into it) and powered back up the install proceeded

1 Like

The lack of this commit: dwc_otg: Force host mode to fix incorrect compute module boards · raspberrypi/linux@59e76bb · GitHub
would cause the issue described (without an OTG cable, the Pi0 will boot in gadget mode).

But that change is present on rpi-4.4.y kernel so it should be okay.

1 Like

I will pick this and backport to 3.18.

Sam

1 Like