Author Archives: Alex Bate

Designing the Raspberry Pi Compute Module 4

via Raspberry Pi

Raspberry Pi Compute Module 4 designer Dominic Plunkett was kind enough to let us sit him down for a talk with Eben, before writing up his experience of bringing our latest board to life for today’s blog post. Enjoy.

When I joined Raspberry Pi, James, Eben and Gordon already had some ideas on the features they would like to see on the new Compute Module 4, and it was down to me to take these ideas and turn them into a product. Many people think design is a nice linear process: ideas, schematics, PCB, and then final product. In the real world the design process isn’t like this, and to get the best designs I often try something and iterate around the design loop to get the best possible solution within the constraints.

Form factor change

Previous Compute Modules were all in a 200-pin SODIMM form factor, but two important considerations pushed us to think about moving to a different form factor: the need to expose useful interfaces of the BCM2711 that are not present in earlier SoCs, and the desire to add extra components, which meant we needed to route tracks differently to make space on the PCB for the additional parts.

Breaking out BCM2711’s high-speed interfaces

We knew we wanted to get the extra features of the BCM2711 out to the connector so that users could make use of them in their products. High-speed interfaces like PCIe and HDMI are so fast coming out of the BCM2711 that they need special IO pins that can’t also support GPIO: if we were to change the functionality of a GPIO pin to one of the new high-speed signals, this would break backwards compatibility.

We could consider adding some sort of multiplexer to swap between old and new functionality, but this would cost space on the PCB, as well as reducing the integrity of the fast signals. This consideration alone drives the design to a new pinout. We could have tried to use one of the SODIMM connectors with extra pins; while this would give a board with similar dimensions to the existing Compute Modules, it too would break compatibility.

Compute Module 4 mounted on the IO Board
Compute Module 4 mounted on the IO Board

PCB space for additional components

We also wanted to add extra items to the PCB, so PCB space to put the additional parts was an important consideration. If you look carefully at a Compute Module 3 you can see a lot of tracks carrying signals from one side of the SoC to the pins on the edge connector. These tracks take up valuable PCB space, preventing components being fitted there. We could add extra PCB layers to move these tracks from an outer layer to an inner layer, but these extra layers add to the cost of the product.

This was one of the main drivers in changing to having two connectors on different edges of the board: doing so saves having to route tracks all the way across the PCB. So we arrived at a design that incorporated a rough split of which signals were going to end up on each of the connectors. The exact order of the signals wasn’t yet defined.

Trial PCB layouts

We experimented with trial PCB layouts for the Compute Module 4 and the CM4 IO Board to see how easy it would be to route the signals; even at this stage, the final size of the CM4 hadn’t been fixed. Over time, and after juggling parts around the PCB, I came to a sensible compromise. There were lots of things to consider, including the fact that the taller components had to go on the top side of the PCB.

The pinout was constantly being adjusted to an ordering that was a good compromise for both the CM4 and the IO Board. The IO Board layout was a really important consideration: after we made the first prototype boards, we decided to change the pinout slightly to make PCB layout on the IO Board even easier for the end user.

When the prototype Compute Module 4 IO Boards arrived back from manufacture, the connectors hadn’t arrived in time to be assembled by machine, so I fitted them by hand in the lab. Pro tip: if you have to fit connectors by hand, take your time to ensure they are lined up correctly, and use lots of flux to help the solder flow into the joints. Sometimes people use very small soldering iron tips thinking it will help; in fact, one of the goals of soldering is to get heat into the joint, and if the tip is too small it will be difficult to heat the solder joint sufficiently to make a good connection.

Compute Module 4 IO Board

New features

Whilst it was easy to add some headline features like a second HDMI port, other useful features don’t grab as much attention. One example is that we have simplified the powering requirements. Previous Compute Modules required multiple PSUs to power a board, and the power-up sequence had to be exactly correct. Compute Module 4 simply requires a single +5V PSU.

In fact, the simplest possible base board for Compute Module 4 just requires a +5V supply and one of the connectors and nothing else. You would need a CM4 variant with eMMC and wireless connectivity; you can boot the module with the eMMC, wireless connectivity gives you networking, and Bluetooth connectivity gives you access to IO devices. If you do add extra IO devices the CM4 also can provide a +3.3V supply to power those devices, avoiding the need for an external power supply.

We have seen some customers experience issues with adding wireless interfaces to previous Compute Modules, so a really important requirement was to provide the option of wireless support. We wanted to be as flexible as possible, so we have added support for an external antenna. Because radio certification can be a very hard and expensive process, we have a pre-certified external antenna kit that can be supplied with Compute Module 4. This should greatly simplify product certification for end products, although engineering designers should check to make certain of meeting all local requirements.

Antenna Kit and Compute Module 4

PCIe

This is probably the most exciting new interface to come to Compute Module 4. On the existing Raspberry Pi 4, this interface is used internally to add the XHCI controller which provides the USB 3 ports. By providing the PCIe externally, we are giving end users the choice of how they would like to use this interface. Many applications don’t need USB 3 performance, so the end user can make use of it in other ways — for NVMe drives, to take one example.

Ethernet

In order to have wired Ethernet connectivity with previous Compute Modules, you needed to add an external USB-to-Ethernet interface. This adds complexity to the IO board, and one of the aims of the new Compute Module 4 is to make interfacing to it simple. With this in mind, we added a physical Ethernet interface to CM4, and we also took the opportunity to add support for IEEE1588 to this. As a result, adding Gigabit wired networking to CM4 requires only the addition of a magjack; no extra silicon is needed. Because this is a true Gigabit interface, it is also faster than the USB-to-Ethernet interfaces that previous Compute Modules use.

Raspberry Pi Compute Module 4

Open-sourcing the Compute Module 4 IO Board design files

Early on in the process, we decided that we were going to open-source the design files for the Compute Module 4 IO Board. We used our big expensive CAD system for Compute Module 4 itself, and while we could have decided to do the design for the IO Board in the big CAD system too and then port it across to KiCAD, it’s easy to introduce issues in the porting process.

So, instead, we used KiCAD for the IO Board from the start, and the design files that come out of KiCAD are the same ones that we use in manufacture. During development I had both CAD systems running at the same time on the computer.

Easier integration and enhanced possibilities

We have made some big changes to our new Compute Module 4 range, and these should make integration much simpler for our customers. Many interfaces now just need a connector and power, and the new form factor should enable people to design more compact and more powerful products. I look forward to seeing what our customers create over the next few years with Compute Module 4.

High-density connector on board underside

Get your Compute Module 4

The new Raspberry Pi Compute Module 4 is available from our network of Approved Resellers. Head over to the Compute Module 4 product page and select your preferred variant to find your nearest reseller.

Can’t find a reseller near you? No worries. Many of our Approved Resellers ship internationally, so try a few other locations.

The post Designing the Raspberry Pi Compute Module 4 appeared first on Raspberry Pi.

3D-printable cases for the Raspberry Pi High Quality Camera

via Raspberry Pi

Earlier this year, we released the Raspberry Pi High Quality Camera, a brand-new 12.3 megapixel camera that allows you to use C- and CS-mount lenses with Raspberry Pi boards.

We love it. You love it.

How do we know you love it? Because the internet is now full of really awesome 3D-printable cases and add-ons our community has created in order to use their High Quality Camera out and about…or for Octoprint…or home security…or SPACE PHOTOGRAPHY, WHAT?!

The moon, captured by a Raspberry Pi High Quality Camera. Credit: Greg Annandale

We thought it would be fun to show you some of 3D designs we’ve seen pop up on sites like Thingiverse and MyMiniFactory, so that anyone with access to a 3D printer can build their own camera too!

Adafruit did a thing, obvs

Shout out to our friends at Adafruit for this really neat, retro-looking camera case designed by the Ruiz Brothers. The brown filament used for the casing is so reminiscent of the leather bodies of SLRs from my beloved 1980s childhood that I can’t help but be drawn to it. And, with snap-fit parts throughout, you can modify this case model as you see fit. Not bad. Not bad at all.

Nikon to Raspberry Pi

While the Raspberry Pi High Quality Camera is suitable for C- and CS-mount lenses out of the box, this doesn’t mean you’re limited to only these sizes! There’s a plethora of C- and CS-mount adapters available on the market, and you can also 3D print your own adapter.

Thingiverse user UltiArjan has done exactly that and designed this adapter for using Nikon lenses with the High Quality Camera. Precision is key here to get a snug thread, so you may have to fiddle with your printer settings to get the right fit.

And, for the Canon users out there, here’s Zimbo1’s adapter for Canon EF lenses!

Raspberry Pi Zero minimal adapter

If you’re not interested in a full-body camera case and just need something to attach A to B, this minimal adapter for the Raspberry Pi Zero will be right up your street.

Designer ed7coyne put this model together in order to use Raspberry Pi Zero as a webcam, and according to Cura on my laptop, should only take about 2 hours to print at 0.1 with supports. In fact, since I’ve got Cura open already…

3D print a Raspberry Pi High Quality Camera?!

Not a working one, of course, but if you’re building something around the High Quality Camera and want to make sure everything fits without putting the device in jeopardy, you could always print a replica for prototyping!

Thingiverse user tmomas produced this scale replica of the Raspberry Pi High Quality Camera with the help of reference photos and technical drawings, and a quick search online will uncover similar designs for replicas of other Raspberry Pi products you might want to use while building a prototype

Bonus content alert

We made this video for HackSpace magazine earlier this year, and it’s a really hand resource if you’re new to the 3D printing game.

Also…

…I wasn’t lying when I said I was going to print ed7coyne’s minimal adapter.

The post 3D-printable cases for the Raspberry Pi High Quality Camera appeared first on Raspberry Pi.

Maddie and Greg go live with computers!

via Raspberry Pi

This Saturday morning, our friends Maddie Moate and Greg Foot will be live at The Centre for Computing History for a computing- and retro gaming-inspired episode of their show Let’s Go Live, and you can tune in from 10am to join the fun.

Retro gaming and computer funtimes

Saturday’s show will be a retro feast of vintage video games, and will answer questions such as ‘What is a computer?’ and ‘How do computers work?’. As always, Maddie and Greg have a number of activities planned, including designing pixel art and going on a tech safari! They’re also extremely excited to step inside a giant computer and try to put it back together!

Let’s Go Live

Let’s Go Live is a family science show that Maddie and Greg began on day 1 of lockdown to help with the challenge of homeschooling. Since then, Maddie and Greg have hosted 50 live shows from their ‘spare room studio’ and caught the attention of millions of families across the world who enjoy tuning into their daily dose of fun, facts, and science activities.

After a short break, the two are now back for the summer holidays and plan to make Let’s Go Live bigger and better than ever by bringing you live shows from unique locations across the UK — a new venue each week!

Maddie and Greg will be live on Facebook and YouTube, and we recommend subscribing to Maddie’s channel to ensure you never miss an episode.

Do you know: All Maddie’s T-shirt merch is made in a factory run by Raspberry Pis? Here’s her video about her new line of T-shirts, and here’s our video about the factory.

But I want more!

We don’t blame you! If you’ve already been following Maddie and Greg on their Let’s Go Live journey throughout lockdown, and you’re looking for more fun online content to entertain you and your family, look no further than the Raspberry Pi Foundation’s Digital Making at Home:

Digital Making at Home

Each week, we share a themed code-along video and host a live stream to inspire families to have fun with coding and digital making at home! Join Christina, Marc, Mr C and their host of special guests as they work their way through our great coding activities. This week, the Digital Making at Home team has been exploring outer space, and they show you how to use Scratch and Python code to race the International Space Station, animate astronauts, and defy gravity.

And our next theme for Digital Making at Home — out tomorrow just when Let’s Go Live finishes — is retro games!

You’ll find all the episodes of Digital Making at Home on our website — new ones are added every Saturday morning. And on the website, you can also tune into our weekly code-along live stream every Wednesday at 2pm BST!

The post Maddie and Greg go live with computers! appeared first on Raspberry Pi.

Website hosting on Raspberry Pi 4 with Mythic Beasts

via Raspberry Pi

Here’s Mythic Beast’s Pete Stevens to talk about how we run the Raspberry Pi website on Raspberry Pis, and how Mythic Beasts can run your site on Raspberry Pis too!

Rent a Raspberry Pi

In late 2016, Mythic Beasts launched a Raspberry Pi cloud, allowing you to rent a Raspberry Pi 3 as a service.

Raspberry Pi 4 is a much more capable computer, with more than twice the performance and, crucially, four times the memory. We were so excited by it, we bet Eben Upton a beer that we could host the launch site for Raspberry Pi 4 on Raspberry Pi 4. We’d demonstrated that it was just about possible to run a normal day on a cluster of eight Raspberry Pi 3s, but launch day is a bit more exciting — tens of millions rather than a million visitors.

Eben, being a fool supremely confident in the work that his team had done, took the bet and let us. On Thursday 20 June 2019, he dropped off eighteen 4GB RAM Raspberry Pi 4 computers that had previously been used in testing. We set about configuring them to replace all the web servers that run the Raspberry Pi blog.

  • 14× Dynamic Web server (PHP/Apache)
  • 2× Static webserver (Apache, flat files)
  • 2× Memcache (in memory store to accelerate web serving)

We started the build on Friday 21 June. We immediately ran into our first ‘chicken and egg’ problem. The Raspberry Pi web servers are built from Puppet, based (at the time) on Debian Jessie. Raspberry Pi 4’s release OS was a not-yet-released version of Debian Buster, which at the time wasn’t supported by Puppet. In conjunction with Greg Annandale at the Raspberry Pi Foundation, we created a Puppet build that would run on Raspberry Pi 4, updated the configuration from Jessie to Buster (newer Apache/PHP), and did some testing.

A rack of Raspberry Pis and a mess of wires connecting them
The enclosures were built to accommodate a larger PoE HAT, which is why this doesn’t stand up beautifully neatly.

We have pre-built enclosures from our Raspberry Pi 3 cloud. We followed the same approach using Power over Ethernet to provide power and data to each Raspberry Pi 4. This dramatically reduces the cabling and complexity of the setup. Late on Friday 21, just over 24 hours after we started, we moved the hastily constructed Raspberry Pi 4 setup to Sovereign House, a key Mythic Beasts data centre and one of the best-connected buildings in Europe.

Over the course of a few hours, we gradually moved the entire production load from the existing virtual servers to the Raspberry Pi 4 cloud and every page from the blog was being served directly off Raspberry Pi 4. We left it for two days to bed in before the real test: launch day.

The launch was almost perfectly smooth. The Raspberry Pi cluster coped fine with the tens of millions of users. However, the Raspberry Pi cluster and website is fronted by Cloudflare, which provides acceleration for static resources and protects the site from denial of service. Unfortunately, they had a two-hour outage in the middle of the launch thanks to a misconfigured internet optimiser run by a customer of Verizon. So the Raspberry Pi 4 cluster had a long lunch break wondering where all the users had gone.

We ran the website on the Raspberry Pi 4 cluster for over a month before reverting back to the usual virtual server-based environment. We’d proved that RaspberryPi 4 would make an awesome hosting platform.

Commercialising Raspberry Pi 4 as a service

We were already running Raspberry Pi 3 as a service for many customers (e.g. PiWheels, which builds Python packages for Raspberry Pi), and being able spin up Raspberry Pi 3 on demand is incredibly useful.

At launch, Raspberry Pi 4 wasn’t suitable. We rely on network boot in order to be able to remotely re-image Raspberry Pi. SD cards just aren’t very reliable; visiting the data centre for manual intervention on every SD card failure is not only expensive in time, but also means we’d have to maintain physical access to every Raspberry Pi 4 in our cloud. Netboot means that we just build large enclosures of 108 Raspberry Pis and seal them in, as they will never require physical attention. If one fails — and we’ve not yet seen one fail — we can shut it down and take it out of our database.

For Raspberry Pi 4 we had to wait for network booting to be a reality. We had access to beta firmware in November 2019 and built a sample Raspberry Pi 4 network boot setup. We then had to integrate it into our management code, build Raspberry Pi 4–compatible operating system images, and enhance our billing to cope with multiple models and by-the-hour billing. Then we had to do a file server and network upgrade: serving lots of machines with true gigabit needs more ‘oomph’ than the 100Mbps of Raspberry Pi 3. This also all needed to be backward-compatible so as not to break the existing Raspberry Pi 3 users. On 17 June 2020 we launched, and Raspberry Pi 4 is now ready to order in our cloud.

Is it any good?

Yes. Raspberry Pi is twice as fast as the same-sized instances in AWS, for a quarter of the price. Just see for yourself:

Raspberry Pi 4a1.largemg6.medium
Spec4 cores @ 1.5GHz
4GB RAM
2 cores
4GB RAM
1 core
4GB RAM
Monthly price£8.63$45.35
(~£36.09)
$34.69
(~ £27.61)
Requests per second1075257
Mean requests per second457ms978ms868ms
99th percentile request time791ms1247ms1056ms

But what about 8GB and 64-bit Raspberry Pi OS?

That sounds like a jolly nice idea. Keep watching the Mythic Beasts blog for updates.

The post Website hosting on Raspberry Pi 4 with Mythic Beasts appeared first on Raspberry Pi.

OpenVX API for Raspberry Pi

via Raspberry Pi

Raspberry Pi is excited to bring the Khronos OpenVX 1.3 API to our line of single-board computers. Here’s Kiriti Nagesh Gowda, AMD‘s MTS Software Development Engineer, to tell you more.

OpenVX for computer vision

OpenVX™ is an open, royalty-free API standard for cross-platform acceleration of computer vision applications developed by The Khronos Group. The Khronos Group is an open industry consortium of more than 150 leading hardware and software companies creating advanced, royalty-free acceleration standards for 3D graphics, augmented and virtual reality, vision, and machine learning. Khronos standards include Vulkan®, OpenCL™, SYCL™, OpenVX™, NNEF™, and many others.

Now with added Raspberry Pi

The Khronos Group and Raspberry Pi have come together to work on an open-source implementation of OpenVX™ 1.3, which passes the conformance on Raspberry Pi. The open-source implementation passes the Vision, Enhanced Vision, & Neural Net conformance profiles specified in OpenVX 1.3 on Raspberry Pi.

Application developers may always freely use Khronos standards when they are available on the target system. To enable companies to test their products for conformance, Khronos has established an Adopters Program for each standard. This helps to ensure that Khronos standards are consistently implemented by multiple vendors to create a reliable platform for developers. Conformant products also enjoy protection from the Khronos IP Framework, ensuring that Khronos members will not assert their IP essential to the specification against the implementation.

OpenVX enables a performance and power-optimized computer vision processing, especially important in embedded and real-time use cases such as face, body, and gesture tracking, smart video surveillance, advanced driver assistance systems (ADAS), object and scene reconstruction, augmented reality, visual inspection, robotics, and more. The developers can take advantage of using this robust API in their application and know that the application is portable across all the conformant hardware.

Below, we will go over how to build and install the open-source OpenVX 1.3 library on Raspberry Pi 4 Model B. We will run the conformance for the Vision, Enhanced Vision, & Neural Net conformance profiles and create a simple computer vision application to get started with OpenVX on Raspberry Pi.

OpenVX 1.3 implementation for Raspberry Pi

The OpenVX 1.3 implementation is available on GitHub. To build and install the library, follow the instructions below.

Build OpenVX 1.3 on Raspberry Pi

Git clone the project with the recursive flag to get submodules:

git clone --recursive https://github.com/KhronosGroup/OpenVX-sample-impl.git

Note: The API Documents and Conformance Test Suite are set as submodules in the sample implementation project.

Use the Build.py script to build and install OpenVX 1.3:

cd OpenVX-sample-impl/
python Build.py --os=Linux --venum --conf=Debug --conf_vision --enh_vision --conf_nn

Build and run the conformance:

export OPENVX_DIR=$(pwd)/install/Linux/x32/Debug
export VX_TEST_DATA_PATH=$(pwd)/cts/test_data/
mkdir build-cts
cd build-cts
cmake -DOPENVX_INCLUDES=$OPENVX_DIR/include -DOPENVX_LIBRARIES=$OPENVX_DIR/bin/libopenvx.so\;$OPENVX_DIR/bin/libvxu.so\;pthread\;dl\;m\;rt -DOPENVX_CONFORMANCE_VISION=ON -DOPENVX_USE_ENHANCED_VISION=ON -DOPENVX_CONFORMANCE_NEURAL_NETWORKS=ON ../cts/
cmake --build .
LD_LIBRARY_PATH=./lib ./bin/vx_test_conformance

Sample application

Use the open-source samples on GitHub to test the installation.

The post OpenVX API for Raspberry Pi appeared first on Raspberry Pi.

Volunteer your Raspberry Pi to IBM’s World Community Grid

via Raspberry Pi

IBM’s World Community Grid is working with scientists at Scripps Research on computational experiments to help find potential COVID-19 treatments. Anyone with a Raspberry Pi and an internet connection can help.

Why is finding potential treatments for COVID-19 so important?

Scientists all over the globe are working hard to create a vaccine that could help prevent the spread of COVID-19. However, this process is likely to take many months — or possibly even years.

In the meantime, scientists are also searching for potential treatments for the symptoms of COVID-19. A project called OpenPandemics – COVID-19 is one such effort. The project is led by researchers in the Forli Lab at Scripps Research, who are enlisting the help of World Community Grid volunteers.

What is World Community Grid and how does it work? 

World Community Grid is an IBM social responsibility initiative that supports humanitarian scientific research. 

Image text reads: Accelerate research with no investment of time or money. When you become a World Community Grid volunteer, you donate your device's spare computing power to help scientists solve the world's biggest problems in health and sustainability.

As a World Community Grid volunteer, you download a secure software program to your Raspberry Pi, macOS or Windows computer, or Android device. This software program (called BOINC) is used to run World Community Grid projects, and is compatible with the Raspberry Pi OS and most other operating systems. Then, when your device is not using its full power, it automatically runs a simulated experiment in the background that will help predict the effectiveness of a particular chemical compound as a possible treatment for COVID-19. Finally, your device automatically returns the results of the completed simulation and requests the next simulation.

Over the course of the project, volunteers’ devices will run millions of simulations of small molecules interacting with portions of the virus that causes COVID-19. This is a process known as molecular docking, which is the study of how two or more molecules fit together. When a simulated chemical compound fits, or ‘docks’, with a simulation of part of the virus that causes COVID-19, that interaction may point to a potential treatment for the disease.

An image of a calendar with the text: Get results that matter. As a World Community Grid volunteer, your device does research calculations when it's idle, so just by using it as. you do every dat you can help scientists get results in months instead of decades. With your help, they can identify the most important areas to study in the lab, bringing them one step closer to discoveries that save lives and address global problems.

World Community Grid combines the results from your device along with millions of results from other volunteers all over the world and sends them to the Scripps Research team for analysis. While this process doesn’t happen overnight, it accelerates dramatically what would otherwise take many years, or might even be impossible.

OpenPandemics – COVID-19 is the first World Community Grid project to harness the power of Raspberry Pi devices, but the World Community Grid technical team is already working to make other projects available for Raspberry Pi very soon.

Getting ready for future pandemics

Scientists have learned from past outbreaks that pandemics caused by newly emerging pathogens may become more and more common. That’s why OpenPandemics – COVID-19 was designed to be rapidly deployed to fight future diseases, ideally before they reach a critical stage.

A image of a scientist using a microscope. Text reads: Your device could help search for potential treatments for COVID-19. Scientists are using World Community Grid to accelerate the search for treatments to COVIS-19. The tools and techniques the scientists develop to fight COVID-19 could be used in the future by all researchers to help more quickly find treatments for potential pandemics

To help address future pandemics, researchers need access to swift and effective tools that can be deployed very early, as soon as a threatening disease is identified. So, the researchers behind OpenPandemics – COVID-19 are creating a software infrastructure to streamline the process of finding potential treatments for other diseases. And in keeping with World Community Grid’s open data policy, they will make their findings and these tools freely available to the scientific community. 

Join a global community of science supporters

World Community Grid is thrilled to make OpenPandemics – COVID-19 available to everyone who wants to donate computing power from their Raspberry Pi. Every device can play a part in helping the search for COVID-19 treatments. Please join us!

The post Volunteer your Raspberry Pi to IBM’s World Community Grid appeared first on Raspberry Pi.