DietPi icon indicating copy to clipboard operation
DietPi copied to clipboard

Image | Orange Pi Zero 2W

Open jamsinclair opened this issue 1 year ago • 104 comments

Creating an image request

Formal device information

  • Device name | Orange Pi Zero 2W
  • Official product URL | http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html
  • GitHub resource URL (if available) | https://github.com/orangepi-xunlong
  • Image download URL | Google Drive Link – There's different images depending on the RAM installed, 1-2GB RAM, 1.5GB RAM and 4GB RAM.

Is the SBC officially supported by the Debian installer?

  • No

If not, is a reliable 3rd party Debian image available for this SBC?

  • Kind of, made by the manufacturer (see image download URL)

If not, are there install instructions for Debian available?


I see previous issues that requested an Orange Pi image had been closed. If this is still the case, feel free to close this issue 🙇

jamsinclair avatar Dec 30 '23 05:12 jamsinclair

I tried making my own distribution, following the guide, however, I couldn't get the created image working on the device. I can only connect headlessly over wifi to the device, so this may have been the overall issue 😅

Looking at the specs between the OPi Zero 3 and the OPI Zero 2W there's a lot of similar components used, I've just flashed the Zero 3 image to my device and it seems to be working ok so far... 🤞 and the wifi definitely works – due to my reliance on headless setup.

OPi Zero 3 OPi Zero 2W
CPU Allwinner H618 Quad-core Cortex-A53 processor 1.5GHz Allwinner H618 Quad-core Cortex-A53 processor 1.5GHz
GPU Mali G31 MP2 Mali G31 MP2
Memory 1GB/1.5GB/2GB/4GB LPDDR4 1GB/1.5GB/2GB/4GB LPDDR4
On-board storage 16MB SPI Flash 16MB SPI Flash

Are there any other board features that we should care about that might affect the usage of the Zero 3 image on the Zero 2W? On paper they look pretty similar, the only difference really being their form factor and the Zero 3 having some additional physical I/O, like ethernet.

Edit: it seems like there's already a lot discussion over in #6594

Edit 2: (5 Jan 2024) I've been using the Orange Pi Zero 3 image successfully for a week now with no issues. It's only connected via WiFi. I have successfully been using software like Tailscale, NFS network drive etc with it.

jamsinclair avatar Dec 30 '23 05:12 jamsinclair

I'm also using the OPi Zero 3 dietpi image on an OPi Zero 2W, only issue I've had is some instability because of thermals (system hot to the touch when it crashed).

I changed the Governor to max out at 1008Mhz (down from 1502Mhz) and that seems to have stabilised the system.

deftdawg avatar Jan 23 '24 05:01 deftdawg

It actually makes sense, since the kernel/dtb package contains device trees for the Zero 2 and Zero 2W as well: image

The bootloader is Zero 3 specific, but since it is the same SoC/RAM/SPI flash, it makes sense that this works as well on Zero 2. And after the kernel booted, the bootloader is not relevant anymore.

Only one thing would be good to check: Does the bootloader enforce the Zero 3 device tree or does it choose the correct one based on the actual model:

cat /proc/device-tree/model

Does someone have a Zero 2 non-W and can check whether it is the same issue with the Ethernet adapter disappearing on reboot?

MichaIng avatar Jan 23 '24 12:01 MichaIng

Only one thing would be good to check: Does the bootloader enforce the Zero 3 device tree or does it choose the correct one based on the actual model:

cat /proc/device-tree/model

@MichaIng it doesn't seem to. Running this from an OPi Zero 2W it returns OrangePi Zero3.

Are there any quick workaround to selecting the correct device tree during the bootload (or after the fact)?

jamsinclair avatar Jan 24 '24 15:01 jamsinclair

Try the following:

G_CONFIG_INJECT 'fdtfile=' 'fdtfile=allwinner/sun50i-h616-orangepi-zero2w.dtb' /boot/dietpiEnv.txt
reboot

MichaIng avatar Jan 24 '24 22:01 MichaIng

Thanks for the quick response! That makes sense, I'll be away from my OPi for a couple of weeks. If someone else can confirm in the interim, go ahead!

jamsinclair avatar Jan 25 '24 11:01 jamsinclair

G_CONFIG_INJECT said I didn't have permissions, when I prefixed with sudo command wasn't found. So applied the change with sudo nano and rebooted.

dietpi@DietPi:~$ cat /proc/device-tree/model
OrangePi Zero2 W

One thing I noticed is that with this Zero2 W booted with the proper config my dual nic carrier board doesn't work properly (nics light up, but don't work, stay lit after disconnecting Ethernet). Reverting dietpiEnv.txt and rebooting restores function of the nics.

The carrier board connects via 4 pogo pins to the middle USB port (visible around green led)

image

As an aside, the following message is present regardless which dtb is used

-
[
57.0884801 sproul:wlan_delba_event: NOT FOUND sta_lut_index: 6, tid: 4
57.107166]
sprowl:wlan_delba_event: NOT FOUND
sta_lut_index: 6, tid: 5
57. 109182)
sprdul: wlan_delba_event: NOT FOUND sta_lut_index: 6,
_index: 6, tid: 6
57.1159271 sprdwl: wlan_delba_event: NOT FOUND sta_lut_index: 6, tid: 7

deftdawg avatar Jan 25 '24 21:01 deftdawg

Back in business 💼

Following @MichaIng's instruction

  • Switched to the root user
  • Ran the command to modify the /boot/dietpiEnv.txt file
  • Rebooted the device

The device on boot now reports the correct device tree:

$ cat /proc/device-tree/model
OrangePi Zero2 W

jamsinclair avatar Feb 13 '24 12:02 jamsinclair

I still don't get why the carrier board (which is a usb hub connected over pogo pins) would work fine out of the box with the OrangePi Zero 3 device tree but not work at all with the OrangePi Zero 2 W tree.

deftdawg avatar Feb 13 '24 12:02 deftdawg

I still don't get why the carrier board (which is a usb hub connected over pogo pins) would work fine out of the box with the OrangePi Zero 3 device tree but not work at all with the OrangePi Zero 2 W tree.

Hmm, that is nasty indeed 🤔.

MichaIng avatar Feb 15 '24 18:02 MichaIng

Can confirm the Orange Pi Zero 3 image DOES technically work on the Zero 2W, however I can't get GPIO serial to work. I'm trying to use the Zero 2W as an Octoprint board in my Prusa, and can't get it working on any of the 5 GPIO serial connections. No issue with DietPi-Software or any of the typical usage stuff, but for the life of me I can't get communication working. Having an attempt with converting the OrangePi image to DietPi but haven't gotten far yet.

samjw-nz avatar Mar 03 '24 10:03 samjw-nz

Some someone else test/verify this: https://dietpi.com/forum/t/manually-install-wifi-package-or-firmware-file/13182/21?u=michaing

  • Bluetooth only works when WiFi is enabled as well. Or more precisely, the modprobe sprdbt_tty fails as long as modprobe sprdwl_ng has not been loaded.
  • Loading sprdwl_ng via /etc/modules-load.d/ at boot time fails, but it can be loaded later from console via modprobe.

MichaIng avatar Mar 06 '24 18:03 MichaIng

Reckon I can give this a test this week. Do you have any example tests / commands I can use to verify? I'm not experienced with testing these things and don't currently have a bluetooth use-case, I'm just a user who just happens to own the hardware and have some time to chip in.

samjw-nz avatar Mar 24 '24 09:03 samjw-nz

I installed the Orange Pi Zero 3 image on my Zero 2W and when running i2c-detect over the ports (should be i2c-1 on zero 2w so im checking i2c-3 on the zero3) my device isn't connected. I have went ahead and checked all other ports (0 and 1 are present when checking /dev/i2c* but also 2, 3, and 4.

Also, when modifying /boot/dietpiEnv.txt to set the dtb file to zero2w, it doesn't work, and after checking the dtb directory, only the file for zero3 is present.

srimanachanta avatar Mar 30 '24 03:03 srimanachanta

I have the same issue,

I ran Michael command as recommended, and after reboot i can no longer ssh into the device.

As mentioned the zero2w dtb files does not exist in the dtb directory

Since this device uses the same chip as zero3 , it would be nice to have a universal image for it same way we do for raspberry pi etc. as the saying goes it will kill two bird with one stone.

el-bakkali avatar Mar 30 '24 11:03 el-bakkali

Orange Pi supplies a Debian image here. Im going to install that and then install DietPi using these docs. Hopefully, that works better.

srimanachanta avatar Mar 30 '24 13:03 srimanachanta

I have the same issue,

I ran Michael command as recommended, and after reboot i can no longer ssh into the device.

As mentioned the zero2w dtb files does not exist in the dtb directory

Since this device uses the same chip as zero3 , it would be nice to have a universal image for it same way we do for raspberry pi etc. as the saying goes it will kill two bird with one stone.

I think the issue with a universal issue is that they have different IOs and bus-to-pin layouts. I'm not super knowledgeable on the DietPi system though, so I may be wrong here.

srimanachanta avatar Mar 30 '24 13:03 srimanachanta

Without a matching device tree, most hardware features won't work, simple as that. And indeed, the latest kernel build does not contain a Zero 2W device tree anymore: image

Not sure why it was present in the first place. Mainline Linux 6.6 does not contain it either: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/boot/dts/allwinner?h=linux-6.6.y But Linux 6.8 added one: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/boot/dts/allwinner?h=linux-6.8.y

  • https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit?id=c505ee1

There is already a draft at Armbian to add support based on this DTB: https://github.com/armbian/build/pull/6451

Allwinner edge kernel builds with Armbian are still Linux 6.7, otherwise we would not need to wait for the PR: https://github.com/armbian/build/blob/main/config/sources/families/include/sunxi64_common.inc

I just started builds based on this PR:

  • https://github.com/MichaIng/DietPi/actions/runs/8491375886/job/23263287258
  • https://github.com/MichaIng/DietPi/actions/runs/8491377766/job/23263290664

MichaIng avatar Mar 30 '24 14:03 MichaIng

Is there is an Image I can test with? I don't see any artifacts under those builds unless I'm just blind lol.

srimanachanta avatar Mar 30 '24 14:03 srimanachanta

There is no image yet.

Joulinar avatar Mar 30 '24 15:03 Joulinar

These were kernel and bootloader builds. I triggered an image build here: https://github.com/MichaIng/DietPi/actions/runs/8491738902/job/23264002541

It can be found here once done: https://dietpi.com/downloads/images/testing/

MichaIng avatar Mar 30 '24 15:03 MichaIng

These were kernel and bootloader builds. I triggered an image build here: https://github.com/MichaIng/DietPi/actions/runs/8491738902/job/23264002541

It can be found here once done: https://dietpi.com/downloads/images/testing/

Thank you, I will test that out after its done and report back

srimanachanta avatar Mar 30 '24 15:03 srimanachanta

Btw, the SBC has no GPIO header exposed by default, but it can be soldered onto the PCB to be usable? I.e. does it make sense to enable a UART console by default, and e.g. expose the SPI toggle we added for Orange Pi Zero 3?

Or does it support USB UART on one of the USB ports in OTG/gadget mode?

MichaIng avatar Mar 30 '24 15:03 MichaIng

Btw, the SBC has no GPIO header exposed by default, but it can be soldered onto the PCB to be usable? I.e. does it make sense to enable a UART console by default, and e.g. expose the SPI toggle we added for Orange Pi Zero 3?

Or does it support USB UART on one of the USB ports in OTG/gadget mode?

Not sure about the latter part but yes, it includes a 2x20 header set that I had to solder on the SBC. I think UART console should be left the same as the OPI Zero3 because people are already prompted to disable it if they aren't using it. I also thing its supported over USB but regardless, prob just leave it on.

srimanachanta avatar Mar 30 '24 15:03 srimanachanta

@MichaIng Seems the build failed, I don't think an artifact was uploaded either.

srimanachanta avatar Mar 30 '24 15:03 srimanachanta

Yes, I forgot to move the bootloader package in place. It is rerunning.

Okay, I'll enable /dev/ttyS0 then. Would still be great to have some feedback of someone actually using it, and e.g. as well SPI 🙂.

MichaIng avatar Mar 30 '24 16:03 MichaIng

Not sure why but I don't have an HDMI output nor can I SSH or ping it. For context, I am setting up my OPI headlessly by preseeding the network info according to this guide. I went back and reinstalled the DietPi OPI Zero3 image and can confirm that still works (minus HDMI) in terms of immediately connecting and me being able to ping and SSH into it.

srimanachanta avatar Mar 30 '24 17:03 srimanachanta

You tried it with this image? https://dietpi.com/downloads/images/testing/DietPi_OrangePiZero2W-ARMv8-Bookworm.img.xz And configured WiFi for first boot via dietpi.txt and dietpi-wifi.txt?

MichaIng avatar Mar 30 '24 17:03 MichaIng

You tried it with this image? https://dietpi.com/downloads/images/testing/DietPi_OrangePiZero2W-ARMv8-Bookworm.img.xz And configured WiFi for first boot via dietpi.txt and dietpi-wifi.txt?

Yes

srimanachanta avatar Mar 30 '24 17:03 srimanachanta

Maybe the bootloader does not pick the correct device tree automatically. I'll redo a build later with this defined explicitly.

MichaIng avatar Mar 30 '24 17:03 MichaIng