# Raspberry Pi 5 support

**URL:** <https://openflexure.discourse.group/t/raspberry-pi-5-support/1739>\
**Category:** Request Help\
**Created:** [27 August 2024 15:04 UTC](https://openflexure.discourse.group/t/raspberry-pi-5-support/1739 "2024-08-27T15:04:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![leander01](https://yyz2.discourse-cdn.com/free1/user_avatar/openflexure.discourse.group/leander01/32/1911_2.png) [@leander01](https://openflexure.discourse.group/u/leander01)\
**Post date:** [27 August 2024 15:04 UTC](https://openflexure.discourse.group/t/raspberry-pi-5-support/1739/1 "2024-08-27T15:04:09Z")

</div>

So I have assembled the entire OpenFlexure high-res microscope and included the SD card with the custom OS image in the raspberry pi 5 4GB. Unfortunately, there does not seem support for the Raspberry Pi 5.

 ![image](https://global.discourse-cdn.com/free1/uploads/openflexure/original/2X/1/18bd883f67d21ee91a69a8f4b619e06afcd47463.jpeg)

I was wondering whether anyone encountered a similar problem and overcame it or has ideas to solve this. Is there software support for raspberry pi 5 planned and any way I could contribute to the software development?

---

<div class="post-metadata">

**Author:** ![WilliamW](https://yyz2.discourse-cdn.com/free1/user_avatar/openflexure.discourse.group/williamw/32/106_2.png) [@WilliamW](https://openflexure.discourse.group/u/WilliamW)\
**Post date:** [27 August 2024 21:15 UTC](https://openflexure.discourse.group/t/raspberry-pi-5-support/1739/2 "2024-08-27T21:15:05Z")

</div>

Unfortunately the Pi5 introduced some changes that are not compatable with the OpenFlexure OS. The installation notes specify Pi3 or 4. Pi2 are still compatable with the software I think but are significantly more sluggish. We only have electronics drawers to fit Pi3 and Pi4.  
Similarly the Pi camera 2 is the only camera that is compatable with the software.

One of the key things in the robotic microscope is integration of the camera feed, including the flat field and lens shading. This allows the fast autofocus to work, and gives flat colour images that tile well. We were using `picamerax`, but the underlying Pi has moved to `picamera2`. Porting autofocus and lens shading to the new Pi software stack is in progress with the server version 3. There are some notes on that on another thread: [Developing v3 of the OpenFlexure software](https://openflexure.discourse.group/t/developing-v3-of-the-openflexure-software/847) .

---

<div class="post-metadata">

**Author:** ![r.w.bowman](https://yyz2.discourse-cdn.com/free1/user_avatar/openflexure.discourse.group/r.w.bowman/32/15_2.png) [@r.w.bowman](https://openflexure.discourse.group/u/r.w.bowman)\
**Post date:** [28 August 2024 10:04 UTC](https://openflexure.discourse.group/t/raspberry-pi-5-support/1739/3 "2024-08-28T10:04:37Z")

</div>

As @WilliamW has said, the “current” (horribly out of date) image is based on Buster, which won’t work. I have a build based on Bookworm (i.e. the current one) and v3 of the server software - this is not yet an alpha, but I hope to be able to share something soon. In fact, I spent this morning sorting out some build server stuff that’s required to do that.

v3 of the software is based on `picamera2` and the `libcamera` software stack, so it should in principle be compatible with Pi 5. **However** the Pi 5 has a different camera stack (it’s still using `libcamera` but I think a chunk of the code in the Broadcom blob - i.e. the stuff that’s not open source - is different. That results in different handling of black level and camera modes.

The conclusion is that, even on the new image, I don’t expect Pi 5 will work out of the box. However, once that new image is out, in principle it should be possible to fix it, and the changes ought to be contained to [labthings-picamera2](https://github.com/labthings/labthings-picamera2/). If you’re keen to pitch in and help there, hopefully that’s feasible once I’ve got a build of the new image in a shareable state. If you want to short-circuit my build server, you can build a Bookworm-based image using the [OS Customiser](https://gitlab.com/openflexure/raspberry-pi-os-image-customiser/). I believe this works, but it’s not been tested much yet - I’m not trying to be secretive, but this image definitely isn’t ready to be unleashed on the wider community yet!

---

<div class="post-metadata">

**Author:** ![leander01](https://yyz2.discourse-cdn.com/free1/user_avatar/openflexure.discourse.group/leander01/32/1911_2.png) [@leander01](https://openflexure.discourse.group/u/leander01)\
**Post date:** [28 August 2024 14:52 UTC](https://openflexure.discourse.group/t/raspberry-pi-5-support/1739/4 "2024-08-28T14:52:49Z")

</div>

Thank you so much for your fast & detailed reply, @WilliamW and @r.w.bowman! I highly appreciate such active community.

My quick fix was ordering a Raspberry Pi 4B and it works beautifully 🙂  
My first priority to gain further understanding, fix core issues (Sangaboard v5 connected but motor/light not working), reprint some parts that encountered damages during my assembly.

Then, I am very happy to contribute. I suggest by starting with testing the v3 server version initially with the raspberry pi 4 and then pi 5. From there, it will be clearer what issues are and what’s required for development / writing automated tests.

My very first action step will be reading the current source code and "short-circuit your build server via the [OS Customiser] building next week (I’m travelling this week)

---

<div class="post-metadata">

**Author:** ![Rajay](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@Rajay](https://openflexure.discourse.group/u/Rajay)\
**Post date:** [8 December 2024 06:37 UTC](https://openflexure.discourse.group/t/raspberry-pi-5-support/1739/5 "2024-12-08T06:37:47Z")

</div>

Has anyone else been trying to get pi 5 to work with openflexure?

---

<div class="post-metadata">

**Author:** ![j.stirling](https://yyz2.discourse-cdn.com/free1/user_avatar/openflexure.discourse.group/j.stirling/32/3_2.png) [@j.stirling](https://openflexure.discourse.group/u/j.stirling)\
**Post date:** [8 December 2024 10:37 UTC](https://openflexure.discourse.group/t/raspberry-pi-5-support/1739/6 "2024-12-08T10:37:52Z")

</div>

Hi @Rajay and @leander01,

Pi5 will probably be some time. The big worry is that in a few weeks Richard will be on paternity leave for a few months. I still don’t really have much time to look into OpenFlexure software right now and am also probably not the best person to be hacking into the nuts and bolts of the software.

Our current phase of work is to try to make sure that more of us understand the software and the roadmap, as we move towards v3 which should support the Pi5.

We now have little diagram which helps me understand how the repos fit together:

> [@Developing v3 of the OpenFlexure software](https://openflexure.discourse.group/t/developing-v3-of-the-openflexure-software/847/19):
>
> I am starting to try to get my head around the v3 software structure so I can help when I have capacity. Richard has drawn me a nice sketch of the framework which I have tarted up and added to: This may help people understand the structure enough to start some debugging.

Also, it is worth noting that it turns out that the [v3 OS that was compiled](https://build.openflexure.org/raspbian-openflexure/testing/) doesn’t use the [`v3` branch](https://gitlab.com/openflexure/openflexure-microscope-server/-/merge_requests/159). It instead uses a branch called [`blood_stack`](https://gitlab.com/openflexure/openflexure-microscope-server/-/merge_requests/190), which is most of the v3 changes plus a lot of new features taking high quality scans of blood smears which would be needed for malaria diagnosis.

As @leander01 says the [Pi OS Customiser](https://gitlab.com/openflexure/raspberry-pi-os-image-customiser) is a good place to see what is getting built.
