question

mapeje avatar image

Victron OS on new Raspberry Pi Zero 2 W

The new and updated Raspberry Pi Zero 2 W was just released. Will it be possible to run Venus OS Large on it? It seems to be pretty much an RPI 3 but with a lot less power consumption.

Venus OSRaspberry Pi
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

14 Answers
Philip Barclay avatar image
Philip Barclay answered ·

Does look promising, hopefully doesn't have the same issues as the Pi4 booting.

No DSI connector so if you want a screen it would need to be an HDMI connection and some other interface for the touch interface.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

paul-w avatar image
paul-w answered ·

How are you planning to feed data from your Victron devices to the Raspberry Pi Zero 2 W with no USB ports ?

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mapeje avatar image
mapeje answered ·

RPI zero 2 W have one microUSB port. Adapter to a hub should be no problem.

Did a first try tonight with my new PI. No boot... Keep trying...

7 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

did same at weekend, no boot but with changed bootcode.bin from original raspbian i got light. couldn't proof more with zero 2, because no hdmi adapter at home. took same sd card in raspberry pi 2 and is was booting well, made my network konfiguration, got remote console via http://

put also in config file:

[zero]

device_tree=bcm2710-rpi-3-b-plus.dtb

dtoverlay=miniuart-bt

core_freq=400

core_freq_min=400


[zero2]

device_tree=bcm2710-rpi-3-b-plus.dtb

dtoverlay=miniuart-bt

core_freq=400

core_freq_min=400

Thanks for the hint. I took I a step further from here.


I took all the latest files from in boot from the latest raspbian image. To also use the recent device tree files.


Then I added the zero 2 dtb file from here:

https://github.com/raspberrypi/firmware/tree/master/boot


And I think you used the wrong model-filters in the config file.

They are [pi0], [pi0w] and [pi02]

See here:

https://www.raspberrypi.com/documentation/computers/config_txt.html#model-filters


With this I got it booting. But nothing on the wifi for now. I suspect there is a missing wifi driver.

But I have to investigate more. Maybe tomorrow.

And maybee i can find USB OTG kabel and a USB ethernet dongle.

Very interesting! I will try this as well to see if I can boot. Thanks!

thanks for this additional parameters, but without another u-boot.bin it wouldn't work. i'm trying to build a new u-boot.bin if i find the right conf files.

after some research: not possible to build a new u-boot.bin for zero 2 yet, because needed config file is missing (like rpi_3_defconfig for pi 3)

search in github u-boot...

You need to take a look at the Victron energy git repository for u-boot and add some of their patches. There is environment/configuration informationn stored on the SD card that needs to be available

> RPI zero 2 W have one microUSB port.

How about bluetooth, doesn't VenusOS have support for that? (I'm new to Victron, so I don't know). Do you know @mvader (Victron Energy) ?

nebulight avatar image
nebulight answered ·

Moved to the Modification Space for better visibility.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mapeje avatar image
mapeje answered ·

Anyone had any success with the new low-power Raspberry Pi Zero 2 W?

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

stefankde avatar image
stefankde answered ·

Hi, any news here ? I wanna use this kind of Raspberry for a victron installation in my mobilehome in May.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mapeje avatar image
mapeje answered ·

No updates yet. @mvader (Victron Energy) , any chance we will see Venus OS run on low-power Raspberry Pi Zero 2W?

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Hi, maybe. If someone (from the community/outside) comes along with enough experience and time on his hands.


Looks like a cool board!


stefankde avatar image
stefankde answered ·

I bought a board and will give it a try … expected delivery time of the board is 3 weeks :(

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

stefankde avatar image
stefankde answered ·

hey guys, got my pi 2 W today and tried to get the venus OS image booting, so far no. nance, even if I change the files in the boot folder als described on some internet pages. even if I copy file by file from a on the pi 2 w booting bullseye … I am of course not so deep in the boot topic of an raspberry so any other ideas or helpful links?

22 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

not possible to build a new u-boot.bin for zero 2 yet, because needed config file is missing (like rpi_3_defconfig for pi 3)

search in github u-boot...

@mvader (Victron Energy) Is this config file something you would be able to provide?

@henrik

I made an image that I do not know work, since I do not have a pi zero 2w to test on.

Either way, it's based on the latest venus-os image with the latest rpi kernel.

all dtb and overlay files from compile are located on the boot partition. Have also made a sample config.txt, so it is something to work with.

Good luck



https://drive.google.com/file/d/1rIVsWqGkPzRw6ZA5SdkUkWJpgaf479K4/view?usp=sharing

nick-a-1 avatar image nick-a-1 johnny-brusevold ·
just ran it, and this boots to the console! however, the WiFi interface is missing, and BT isn't available; dmesg shows the bluetooth resources initializing successfully, but no controller available in bluetoothctl. we're one big step closer! thank you for sharing

Difficult to get this tested without such a card, but after a quick search it looks like there is another firmware for pi0w2 that is not in the venus-os for wifi / blutooth chip. Since it is proprietary / nonfree I can not find it online for download. But got the files extracted from raspbinos and they should be put in /lib/firmware/brcm/

From image 2021-10-30-raspios-bullseye-armhf-full

brcmfmac43436-sdio.bin

brcmfmac43436-sdio.txt

brcmfmac43436-sdio.clm_blob


EDIT

https://github.com/RPi-Distro/firmware-nonfree/tree/bullseye/debian/config/brcm80211/brcm

nick-a-1 avatar image nick-a-1 johnny-brusevold ·

I burned the latest arm bullseye image, and extracted the files that you mentioned. Had to go on the road, so will try adding them to your build on my Pi02, in a few hours. Stay tuned...

quick update: had a little time to do some tests, but not done...


wifi is working! no bluetooth, though; the device isn't even showing up this time. this could be from something that i changed before, or i didn't copy all of the drivers over correctly (i only extracted "/lib/firmware/brcm/brcmfmac43436*"). Need to try a few things, or will just start w/ a clean install.

a few things, if others want to try:

  • run the resize script so that the filesystem becomes read/write (the image is read-only)
    • /opt/victronenergy/swupdate-scripts/resize2fs.sh
  • apply the missing firmware files
    • i made a folder in the SD card called, "firmware" and just copied the drivers there
    • then, booted the pi, and copied the drivers to the "/lib/firmware/..." dir. not recommended for long-term, but it was a quick way to test if they worked
  • "/sbin/get-unique-id" needs to be updated to use wlan's mac address

forgot to share some proof...whatsapp-image-2022-02-27-at-65507-pm.jpeg

I do not do anything more with this, but then we know that it works

If you have time left, can you test this?

https://drive.google.com/file/d/1lhqt6jjqlUNyrBQRcWGF9L3qKs2Kw0P0/view?usp=sharing

nick-a-1 avatar image nick-a-1 johnny-brusevold ·

hello! this new image is loading the wifi interface out of the gate; wlan0 shows up when running ifconfig. one simply needs to connect to their network of choice (connmanctl?), apply the get-unique-id fix, and they should be able to access the remote portal. thank you for putting these together!

that being said, BT still doesn't work... having Wi-Fi alone may be good for most, but I plan to spend a little more time using this image, and debugging. for those that are also interested in looking into the issue, my current status is this:

the hci uart driver wasn't loading on boot. BT would start to init, and then just stop...

[    9.046639] Bluetooth: Core ver 2.22
[    9.050423] NET: Registered PF_BLUETOOTH protocol family
[    9.055831] Bluetooth: HCI device and connection manager initialized
[    9.056418] Bluetooth: HCI socket layer initialized
[    9.067482] Bluetooth: L2CAP socket layer initialized
[    9.072632] Bluetooth: SCO socket layer initialized

maybe we're missing a driver, b/c "hci_uart" wasn't loading, and the IRQ wasn't even being assigned. so, i took BCM43430B0.hcd from here, https://github.com/RPi-Distro/bluez-firmware/tree/e7fd166981ab4bb9a36c2d1500205a078a35714d/broadcom, added it to "/lib/firmware/brcm", and updated the BT param overlay in "config.txt" to:

dtoverlay=miniuart-bt,krnbt=on

Params: krnbt

Set to "on" to enable autoprobing of Bluetooth driver without need of hciattach/btattach

now, the BT controller loads, and is able to be found, but all messages fail:

[    5.388466] Bluetooth: Core ver 2.22
[    5.394185] NET: Registered PF_BLUETOOTH protocol family
[    5.399810] Bluetooth: HCI device and connection manager initialized
[    5.407714] Bluetooth: HCI socket layer initialized
[    5.407757] Bluetooth: L2CAP socket layer initialized
[    5.407821] Bluetooth: SCO socket layer initialized
[    5.487228] Bluetooth: HCI UART driver ver 2.3
[    5.496608] Bluetooth: HCI UART protocol H4 registered
[    5.514330] Bluetooth: HCI UART protocol Three-wire (H5) registered
[    5.514706] Bluetooth: HCI UART protocol Broadcom registered
[    5.873727] Bluetooth: hci0: BCM: chip id 115
[    5.879223] Bluetooth: hci0: BCM: features 0x0e
[    5.890147] Bluetooth: hci0: BCM43430B0
[    5.894244] Bluetooth: hci0: BCM43430B0 (002.001.012) build 0000
[    5.906017] Bluetooth: hci0: BCM43430B0 'brcm/BCM43430B0.hcd' Patch
[    7.438283] Bluetooth: hci0: BCM4343B0 37.4MHz wlbga_iLNA_iTR [Baseline: 0092]
[    7.445582] Bluetooth: hci0: BCM43430B0 (002.001.012) build 0092
[    9.511288] Bluetooth: hci0: command 0x1004 tx timeout

either, we just need to tweak the baudrate to fix this, or see if the root issue lies w/ hciattach, and can be patched. this repo may help, https://github.com/RPi-Distro/pi-bluetooth

linux kernel stuff is still new for me, so hopefully someone w/ more experience sees this, and can help

BT is working. Sorry to spam, everyone; i didn't think it would happen so quickly, between posts. i need to nap, revisit the changes, and see what's essential, then planning to post a gist, or repo (depends on size)whatsapp-image-2022-02-28-at-25740-pm.jpeg

All, i've posted a gist with a script + readme for patching the custom image. hopefully this helps some of you looking to use the Pi Zero 2:

https://gist.github.com/nicholasaiello/c68b6e3458804e6545111333996286ba

Show more comments
mapeje avatar image mapeje johnny-brusevold ·
Would it be possible to have an image based on Venus OS Large?

@mapeje

I posted a couple of images to test some posts over here. I hoped @Nick A would test them, but if you have the opportunity......

I think all of Nick A's files are in place so just run the script located on the boot partition following his instructions

Test images

nick-a-1 avatar image nick-a-1 johnny-brusevold ·

thank you for putting these images together. i've been on a small holiday, and will return home tomorrow. if others are/have been testing, great! i can also have a look once i get back

mapeje avatar image mapeje johnny-brusevold ·
Correct. I am currently testing the Large image with SignalK and Ruuvi BT tags. So far OK, but I will run more tests, also with a USB GPS. So far OK, but as I said, I have more tests to run.

Wow, simply amazing!!! After a long struggle to remember how I managed to execute the scripts, I finally found out how to enable ssh from https://www.victronenergy.com/live/ccgx:root_access.

I noticed that you already added the BT script, so perhaps the gist instructions from @nick-a-1 could be updated? I however got an error message when executing "./u-boot/venus-os-pi02-patch.sh", but bt works and I even can use my Ruuvitags :)

Now I will go ahead and play with Signal K and Node Red :)

If more people would be interested in this, I hope we could add Pi02W as an "official" image.

hans-olav-norheim avatar image
hans-olav-norheim answered ·

I have not tried VenusOS, but I have successfully installed the Debian packages for VrmLogger, VeDirect and Dbus-MQTT on Raspian Buster Lite on a Raspberry Pi Zero 2 W. It's a bit of manual configuration, but it gets close to a VenusOS setup without the screen. Upload to VRM and publishing to MQTT works great.

For VeDirect connections, I'm using this USB-to-4-UART isolated converter, connected to the single micro-USB port of the Pi.

As the Pi Zero 2 W doesn't have an ethernet adapter, ve_lib blows up trying to find the VRM id of the Pi (it's looking for the MAC address of eth0). I had to modify this line in ve_lib to take the MAC of wlan0 instead.

For display, I've designed a Nextion touchscreen LCD that communicates with the Raspberry Pi over serial. I've shared the in-progress code and screenshot here: https://github.com/hans-olav/dbus-nextion

And it's much more power efficient! In total less than 2W for both with an always-on screen!

1645556162896.png 1645556605642.jpeg



1645556605642.jpeg (53.7 KiB)
6 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

@Hans Olav Norheim

Well done.

Do you have the opportunity to test the image I posted in the link above and see if it boots on pi zero 2w?

Du kan vel preke Fredrikstad dialekt å du da ? ;)

Thanks :-)

I'll try to give your image a try one of the coming weekends.

Jepp, jeg er fra Hvaler :-)

it was part of the plan to bring Pi Zero 2 W close to 2 W(att) ? ;-)

i thougt to stay under 1Watt without display. whats the idle power without display and usb?

I haven't measured the Pi Zero 2's consumption alone, but this blog post suggests it's around 700 mW with Wifi enabled (and idle).
In Reference to the historic jessie/buster apt repositories in some of the other posts indicate it being off-line. Can you share the steps around how you got the debian packages to do the manual install?

I just replied to myself over in that other thread. In short, I extracted the packages from the Venus OS image.

mapeje avatar image
mapeje answered ·

A big thanks to awesome community effort to make Venus OS run on new RP Zero W 2! I just installed from the gist instruction from @nick-a-1, working great so far.

Would it not be fun to have also the Venus OS Large ported to RP Zero W 2? Possible?

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Glad the instructions + script are working out for you! The Pi02 has been working very well for my setup, and uses much less energy than my previous Pi3A+, which is an extra bonus.


One thing to note, the Pi02's Wi-Fi / BT chipset default to power save mode enabled. If you experience connectivity issues or slow speeds, you can easily disable it w/ the following command:

iw wlan0 set power_save off


the following thread has details on how to run this script during boot:

https://forum.clockworkpi.com/t/how-to-disable-wifi-power-save-to-prevent-disconnects/933

mapeje avatar image
mapeje answered ·

Thanks, I will keep an eye out for this. Do you think it could be possible to use the Venus OS Large image instead as base to get SignalK and Node Red?

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

That would be great is thats possible!
tjakse avatar image
tjakse answered ·

Since the link for imege does not have image anymore can I ask if there is another link for working image of Venus os on Rpi Zero w2.

Thank you.

4 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

tjakse avatar image tjakse johnny-brusevold ·
Thank you.
Philip avatar image Philip johnny-brusevold ·

Hi !

I'm trying to make Venus OS work on Raspberry Zero 2W.
I've got to the point where I can see the console on my HMDI monitor and I can type in commands with a USB keyboard. The is just the console, no Victrons screen - is that supposted to be like that ?
On the phone, in Victron app the device appeared on the list of available devices through BT, but it can't connect - it stops on 80% of logging to BT and doesn't want to accept the BT PIN.
Default PIN is: 000000 ?

Is there any other way to connect to a wifi (like wpa_supplicant.conf) ?

Hi @philips

I do not have Pi Zero 2W so I can not check if everything works, but will look at it a bit at the next update of venus-os.

You can try setting up wifi with connmanctl

https://www.ev3dev.org/docs/tutorials/setting-up-wifi-using-the-command-line/

johnny-brusevold avatar image
johnny-brusevold answered ·

Got hold of PI Zero 2W today and have made 2 images for it.

There were issues with the bluetooth driver on the previous version so they have been replaced. Kernel has also been replaced with all victron patches in place.

Login with blootooth works and it is possible to set up wifi

(remember to delete old pairing to pizero on the phone first)

Ruvi tag, cpu-temp and 1wire work

Node-red and signal-k run

VRM logging works


There is a false error in dmesg regarding a missing blob file, blob is integrated in the driver.


Power consumption is around 0.7W with ESS demo, node-red and two ruvi tags.


Files

14 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Hi, thanks for the great work, wanted to see what board version you got on your Pi Zero 2W? I just got my Zero 2W PCB V1.12 and for the life of me can't get it to work, using either of the images or manually using the gist method from nick-a-1 will not work. Both the Bluetooth and wifi will not enable, or even show as present. Connmanctl gives an error, no wifi present, and hciconfig shows no Bluetooth either. If anybody has any ideas let me know.

Thanks!

@Trilitheum

Mine are: Raspberry Pi Zero 2 W Rev 1.0 and 100% working.

The image has 2 sets of firmware for 2 different pi-zero2w, so then there may also be a third version.

check your dmesg for missing firmware and try to find them online and copy them to /lib/firmware/bcm/ directory on your sd card

If this does not resolve the issue, you may need a newer kernel.

trilitheum avatar image trilitheum johnny-brusevold ·
Thanks for the insight, I have zero linux experience, so I am having a hard time making sense of the structure, but in dmesg the only reference it makes to bluetooth is BCM43430B0 and a chip ID=115 a couple lines down from that it says failed to load firmware patch. It does look like the V1.12 changed the wifi/bluetooth chip. I will keep digging but I can't figure out what chip it actually has.

@Trilitheum

You can test this image if you want. Some more drivers and firmware and kernel v5.15.30. It needs a restart after the first boot

Zero image

trilitheum avatar image trilitheum johnny-brusevold ·

Thanks very much for doing this! I just loaded it up, it booted and I can see the four raspberries and the prompt. From hciconfig I can see the bluetooth is now up and running. Wifi appears to still be unavailable, but it is a step closer than before!

I found it, was my lack of experience navigating around linux, I can't connect to the bluetooth even with it active, so something is still fishy, going to try to get it out of headless and see what happens.

Update - I got it into headed mode, confirmed that bluetooth gives an error, and wifi adapter isn't present as far as victron OS can see. Must still be a driver or kernel issues. Thanks for trying though!

@Trilitheum

I looked at it a bit today and it looks like you have version 4 of the radio chip. Found that it is a kernel patch available , but it has not been performed on the rpi linux tree yet. Looks like it uses another firmware as well, but can not find it online.

My pi Zero 2W v1.0

Bluetooth: hci0: BCM: chip id 94

Bluetooth: hci0: BCM43430A1 'brcm / BCM43430A1.hcd' Patch

Anyway, I patched the kernel and created a new image that you can test if you want. Maybe I'll get a new pi zerro next week, which makes it a little easier.

Image

trilitheum avatar image trilitheum johnny-brusevold ·
Thanks! I flashed it this morning, still the same results, wifi and bluetooth are still down, must be the firmware drivers that are the key.


I also flashed the latest Raspberry Pi OS image just to test and the wifi and bluetooth do work, so at least I know my hardware is good.

Hello,

Just wanted to say thanks to @Johnny Brusevold for the images and @Nick_A for the instructions! I was able to successfully install and run the v2.85 image on:

Raspberry Pi Zero 2 W Rev 1.0

BCM: chip id 94

Both Bluetooth and wifi work.

In some rare cases, bluetooth seems to have some issues connecting. At worse, a reboot seems to fix it. Otherwise, I see occasional errors:

[ 1176.464579] Bluetooth: hci0: Frame reassembly failed (-84)

[ 1176.470297] Bluetooth: hci0: Received unexpected HCI Event 00000000

[ 1177.864004] Bluetooth: hci0: link tx timeout

Thanks again!

@sthiell

Possibly this fixes the problem. I added this after install and have no issues.

https://community.victronenergy.com/comments/123698/view.html

sthiell avatar image sthiell johnny-brusevold ·
Thank you!
Hi Johnny,


Thanks for the awesome work. Would you mind sharing the image again please? All the Dropbox links I tried in the above thread have expired.

pau1phi11ips avatar image pau1phi11ips johnny-brusevold ·
Much appreciated!