Website hosting on Raspberry Pi 4 with Mythic Beasts

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 4 a1.large mg6.medium
Spec 4 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 second 107 52 57
Mean requests per second 457ms 978ms 868ms
99th percentile request time 791ms 1247ms 1056ms

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.

Noticia Original

Reducing the load: ways to support novice programmers

What’s your experience of learning to program? Have you given up and thought it just wasn’t for you? This has been the case for many people — and it’s the focus of a lot of research. Now that teaching programming is in the curriculum in many countries around the world, it’s even more important that we understand what we can do to make learning to program accessible and achievable for all students.

What is cognitive load for learners?

In education, one of the problems thought to cause students difficulty with learning anything — not just programming — is cognitive load. Cognitive load, a concept introduced in the 1980s by John Sweller, has received a lot of attention in the last few years. It is based on the idea that our working memory (the part of our memory that processes what we are currently doing) can only deal with a limited amount of information at any one time. For example, you can imagine that when you are just starting to learn to program, there is an awful lot going on in your working memory, and this can make the task of assimilating it all very challenging; selection, loops, arrays, and objects are all tricky concepts that you need to get to grips with. Cognitive load is a stress on a learner’s working memory, reducing their ability to process and learn new information.

Dr Briana Morrison (University of Nebraska-Omaha)

Finding ways of teaching programming that reduce cognitive load is really key for all of us engaged in computing education, so we were delighted to welcome Dr Briana Morrison (University of Nebraska-Omaha) as the speaker at our latest research seminar. Briana’s talk was titled ‘Using subgoal Labels to Reduce Cognitive Load in Introductory Programming’.

The thrust of Briana’s and her colleagues’ research is that, as educators, we can design instructional experiences around computer programming so that they minimise cognitive load. Using worked examples with subgoal labels is one approach that has been shown to help a lot with this. 

Subgoal labels help students memorise and generalise

Think back to the way you may have learned mathematics: in maths, worked examples are often used to demonstrate how to solve a problem step by step. The same can be done when teaching programming. For example, if we want to write a loop in Python, the teacher can show us a step-by-step approach using an example, and we can then apply this approach to our own task. Sounds reasonable, right?

What subgoal labels add is that, rather than just calling the steps of the worked example ‘Step 1’, ‘Step 2’, etc., the teacher uses memorable labels. For example, a subgoal label might be ‘define and initialise variables’. Such labels not only help us to remember, but more importantly, they help us to generalise the teacher’s example and grasp how to use it for many other applications.

Subgoal labels help students perform better

In her talk, Briana gave us examples of subgoal labels in use and explained how to write subgoal labels, as well as how to work with subject experts to find the best subgoal labels for a particular programming construct or area of teaching. She also shared with us some very impressive results from her team’s research examining the impact of this teaching approach. 

Screenshot of Dr Briana Morrison's research seminar talk

Briana and her colleagues have carried out robust studies comparing students who were taught using subgoals with students who weren’t. The study she discussed in the seminar involved 307 students; students in the group that learned with worked examples containing subgoal labels gave more complete answers to questions, and showed that they could understand the programming constructs at a higher level, than students who learned with worked examples that didn’t contain the subgoal labels. The study also found that the impact of subgoal labels was even more marked for students in at-risk groups (i.e. students at risk of performing badly or of dropping out).

It seems that this teaching approach works really well. The study’s participants were students in introductory computer science classes at university, so it would be interesting to see whether these results can be replicated at school level, where arguably cognitive load is even more of an issue.

Briana’s seminar was very well received, with attendees asking lots of questions about the details of the research and how it could be replicated. Her talk even included some audience participation, which got us all tapping our heads and rubbing our bellies!

Screenshot of Dr Briana Morrison's research seminar talk

Very helpfully, Briana shared a list of resources related to subgoal labels, which you can access via her talk slides on our seminars page.

You can also read more about the background and practical application of cognitive load theory and worked examples including subgoal labels in the Pedagogy Quick Read series we’re producing as part of our work in the National Centre of Computing Education.

Next up in our series

If you missed the seminar, you can find Briana’s presentation slides on our seminars page, where we’ll also soon upload a recording of her talk.

In our next seminar on Tuesday 14 July at 17:00–18:00 BST / 12:00–13:00 EDT / 9:00–10:00 PDT / 18:00–19:00 CEST, we’ll welcome Maria Zapata, Universidad Rey Juan Carlos, Madrid, who will be talking about computational thinking and how we can assess the computational thinking skills of very young children. To join the seminar, simply sign up with your name and email address and we’ll email you the link and instructions. If you attended Briana’s seminar, the link remains the same.

The post Reducing the load: ways to support novice programmers appeared first on Raspberry Pi.

Noticia Original

New keyboards for Portugal, Norway, Sweden, and Denmark

It feels like just yesterday that we released the Raspberry Pi keyboard and hub to the world. Well, it turns out it’s been more than a year, and time really has flown for the next stage of this project, which brings four new language/country options: Portugal, Norway, Sweden, and Denmark. They’re available to buy now from Raspberry Pi Approved Resellers.

Raspberry Pi keyboards

The keyboard and hub has been a great success, with many users adopting our Raspberry Pi red and white colour scheme for their setup. As well as this satisfying uptake of the keyboard on its own, we’ve also sold tens of thousands of Raspberry Pi Desktop Kits which include a keyboard, alongside the official mouse, Beginners Guide and, of course, a Raspberry Pi.

Raspberry Pi official keyboard
If I say so myself, it’s quite a cool-looking desktop setup, with the boxes and cables all colour-coordinated.

We made the black and grey set up for users who own a black and grey Raspberry Pi case, but, with four out of five people choosing the red and white variant, it just goes to show what a bit of company branding can do for business!

We’ve found that the US keyboard is the most popular model, with over half our users choosing that option. As a Brit, I prefer the chunkier Enter key of the UK keyboard.

Close-up photo of UK keyboard Enter key
Easy to find

New variants

There is always a demand to support more users with keyboards to match their country and language so, as a second phase, we are announcing keyboards for the following countries:

  • Portugal
  • Norway
  • Sweden
  • Denmark
Photo: Raspberry Pi Portugal keyboard in red and white
The new European Portuguese variant of our keyboard and hub

These new keyboards are available now in red and white, with black and grey options coming soon. They are just print changes from previously released variants, but the devil proved to be in the detail.

For example, we hoped early on that the Portuguese keyboard would suit users in Brazil too, but we learned that Brazilian and European Portuguese keyboard layouts are quite different. Given the differences between UK and US keyboard layouts, this really shouldn’t have surprised us!

There is a very subtle difference between the Norway and Denmark keyboards. I wonder if anyone can spot it?

 

We also discovered that a Finnish keyboard layout exists, but I couldn’t identify any differences between it and the Sweden keyboard. While I don’t speak Finnish, I do speak Swedish – an awesome language that everyone should learn – so I came to these investigations with a bit of relevant knowledge. I found that there are very small changes between different manufacturers, but no consistent differences between Finnish and Swedish keyboards, and ultimately I was guided by what Raspberry Pi OS expects as the correct function for these keyboards. I do hope I am right about these two keyboards being the same… I expect I’ll soon find out in the comments!

Photo: Raspberry Pi Sweden keyboard in red and white
Our new Swedish keyboard. If you know of a way in which a Finnish keyboard should differ from this, please tell us in the comments

We know that many users are waiting for a Japan keyboard variant. We hardly ever talk about new products before they are released, but we’re breaking our rule, in this case, to let you know that we hope to have some news about this very soon – so watch this space!

I’d like to give special thanks to Sherman Liu of Gembird for the new key matrix design, and Craig Wightman of Kinneir Dufort for his patience in designing all the key print revisions.

Happy coding, folks!

The post New keyboards for Portugal, Norway, Sweden, and Denmark appeared first on Raspberry Pi.

Noticia Original

Code Jetpac’s rocket building action | Wireframe #40

Pick up parts of a spaceship, fuel it up, and take off in Mark Vanstone’s Python and Pygame Zero rendition of a ZX Spectrum classic

The original Jetpac, in all its 8-bit ZX Spectrum glory

For ZX Spectrum owners, there was something special about waiting for a game to load, with the sound of zeros and ones screeching from the cassette tape player next to the computer. When the loading screen – an image of an astronaut and Ultimate Play the Game’s logo – appeared, you knew the wait was going to be worthwhile. Created by brothers Chris and Tim Stamper in 1983, Jetpac was one of the first hits for their studio, Ultimate Play the Game. The game features the hapless astronaut Jetman, who must build and fuel a rocket from the parts dotted around the screen, all the while avoiding or shooting swarms of deadly aliens.

This month’s code snippet will provide the mechanics of collecting the ship parts and fuel to get Jetman’s spaceship to take off.  We can use the in-built Pygame Zero Actor objects for all the screen elements and the Actor collision routines to deal with gravity and picking up items. To start, we need to initialise our Actors. We’ll need our Jetman, the ground, some platforms, the three parts of the rocket, some fire for the rocket engines, and a fuel container. The way each Actor behaves will be determined by a set of lists. We have a list for objects with gravity, objects that are drawn each frame, a list of platforms, a list of collision objects, and the list of items that can be picked up.

Jetman jumps inside the rocket and is away. Hurrah!

Our draw() function is straightforward as it loops through the list of items in the draw list and then has a couple of conditional elements being drawn after. The update() function is where all the action happens: we check for keyboard input to move Jetman around, apply gravity to all the items on the gravity list, check for collisions with the platform list, pick up the next item if Jetman is touching it, apply any thrust to Jetman, and move any items that Jetman is holding to move with him. When that’s all done, we can check if refuelling levels have reached the point where Jetman can enter the rocket and blast off.

If you look at the helper functions checkCollisions() and checkTouching(), you’ll see that they use different methods of collision detection, the first being checking for a collision with a specified point so we can detect collisions with the top or bottom of an actor, and the touching collision is a rectangle or bounding box collision, so that if the bounding box of two Actors intersect, a collision is registered. The other helper function applyGravity() makes everything on the gravity list fall downward until the base of the Actor hits something on the collide list.

So that’s about it: assemble a rocket, fill it with fuel, and lift off. The only thing that needs adding is a load of pesky aliens and a way to zap them with a laser gun.

Here’s Mark’s Jetpac code. To get it running on your system, you’ll need to install Pygame Zero. And to download the full code and assets, head here.

Get your copy of Wireframe issue 40

You can read more features like this one in Wireframe issue 40, available directly from Raspberry Pi Press — we deliver worldwide.

And if you’d like a handy digital version of the magazine, you can also download issue 40 for free in PDF format.

Make sure to follow Wireframe on Twitter and Facebook for updates and exclusive offers and giveaways. Subscribe on the Wireframe website to save up to 49% compared to newsstand pricing!

The post Code Jetpac’s rocket building action | Wireframe #40 appeared first on Raspberry Pi.

Noticia Original

OpenVX API for 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.

Noticia Original

Volunteer your Raspberry Pi to IBM’s World Community Grid

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.

Noticia Original

Be a better Scrabble player with a Raspberry Pi High Quality Camera

One of our fave makers, Wayne from Devscover, got a bit sick of losing at Scrabble (and his girlfriend was likely raging at being stuck in lockdown with a lesser opponent). So he came up with a Raspberry Pi–powered solution!

Using a Raspberry Pi High Quality Camera and a bit of Python, you can quickly figure out the highest-scoring word your available Scrabble tiles allow you to play.

Hardware

  • Raspberry Pi 3B
  • Compatible touchscreen
  • Raspberry Pi High Quality Camera
  • Power supply for the touchscreen and Raspberry Pi
  • Scrabble board

You don’t have to use a Raspberry Pi 3B, but you do need a model that has both display and camera ports. Wayne also chose to use an official Raspberry Pi Touch Display because it can power the computer, but any screen that can talk to your Raspberry Pi should be fine.

Software

Firstly, the build takes a photo of your Scrabble tiles using raspistill.

Next, a Python script processes the image of your tiles and then relays the highest-scoring word you can play to your touchscreen.

The key bit of code here is twl, a Python script that contains every possible word you can play in Scrabble.

From 4.00 minutes into his build video, Wayne walks you through what each bit of code does and how he made it work for this project, including how he installed and used the Scrabble dictionary.

Fellow Scrabble-strugglers have suggested sneaky upgrades in the comments of Wayne’s YouTube video, such having the build relay answers to a more discreet smart watch.

No word yet on how the setup deals with the blank Scrabble tiles; those things are like gold dust.

In case you haven’t met the Raspberry Pi High Quality Camera yet, Wayne also did this brilliant unboxing and tutorial video for our newest piece of hardware.

And for more projects from Devscover, check out this great Amazon price tracker using a Raspberry Pi Zero W, and make sure to subscribe to the channel for more content.

The post Be a better Scrabble player with a Raspberry Pi High Quality Camera appeared first on Raspberry Pi.

Noticia Original

Let’s learn about encryption with Digital Making at Home!

Join us for Digital Making at Home: this week, young people can learn about encryption and e-safety with us! With Digital Making at Home, we invite kids all over the world to code along with us and our new videos every week.

So get ready to decode a secret message with us:

Check out this week’s code-along projects!

And tune in on Wednesday 2pm BST / 9am EDT / 7.30pm IST at rpf.io/home to code along with our live stream session.

The post Let’s learn about encryption with Digital Making at Home! appeared first on Raspberry Pi.

Noticia Original

Wes’s wonderful Minecraft user notification display

This Minecraft sign uses a Raspberry Pi to notify you when, and how many of, your friends are logged into your dedicated Minecraft server.

Let’s start by pointing out how wonderfully nostalgic many of Wes ‘Geeksmithing’ Swain’s projects are. From his Raspberry Pi–housing cement Thwomp that plays his favourite Mario games to The NES Project, his NES replica unit with a built-in projector — Wes makes the things we wished for as kids.

The NES Project covered in HackSpace magazine

We honestly wouldn’t be surprised if his next project is a remake of Duckhunt with servo-controlled ducks, or Space Invaders but it’s somehow housed in a flying space invader that shoots back with lasers. Honestly, at this point, we wouldn’t put it past him.

Making the Minecraft friend notification display

In the video, Wes covers the project in two parts. Firstly, he shows off the physical build of making the sign, including laser-cut acrylic front displayed with controllable LED lights, a Raspberry Pi Zero, and the wooden framing.

Secondly, he moves on to the code, in which he uses mcstatus, a Python class created by Minecraft’s Technical Director Nathan Adams that can be used to query servers for information. In this instance, Wes is using mcstatus to check for other players on his group’s dedicated Mincecraft server, but the class can also be used to gather mod information. You can find mcstatus on GitHub.

Each friend is assigned a letter that illuminates if they’re online.

Lucky for Wes, he has the same number of friends on his server as the number of letters in ‘Minecraft’, so for every friend online, he’s programmed the display to illuminate a letter of the Minecraft logo. And while the server is empty, he can also set the display to run through various light displays, including this one, a dedication to the new Minecraft Nether update.

If you’d like to try making this project yourself, you can: Wes goes into great detail in his video, and the code for the project can be found on his GitHub account.

And while we have your attention, be sure to subscribe to Geeksmithing on YouTube and show him some love for such a great project.

The post Wes’s wonderful Minecraft user notification display appeared first on Raspberry Pi.

Noticia Original

Pi Commander | The MagPi 95

Adrien Castel’s idea of converting an old electronic toy into a retro games machine was no flight of fancy, as David Crookes discovers

The 1980s was a golden era for imaginative electronic toys. Children would pester their parents for a Tomytronic 3D or a Nintendo Game & Watch. And they would enviously eye anyone who had a Tomy Turnin’ Turbo Dashboard with its promise of replicating the thrill of driving (albeit without the traffic jams).

All of the buttons, other than the joystick, are original to the toy – as are the seven red LED lights

Two years ago, maker Matt Brailsford turned that amazing toy into a fully working Out Run arcade machine and Adrien Castel was smitten. “I loved the fact that he’d upcycled an old toy and created something that could be enjoyed as a grown-up,” he says. “But I wanted to push the simulation a bit further and I thought a flying sim could do the trick.”

“I didn’t want to modify the look of the toy”

Ideas began flying around Adrien’s mind. “I knew what I wanted to achieve so I made an overall plan in my head,” he recalls. First he found the perfect toy: a battery-powered Sky Fighter F-16 tabletop game made by Dival. He then decided to base his build around a Raspberry Pi 3A+. “It’s the perfect hardware for projects like this because of its flexibility,” Adrien says.

Taking off

The toy needed some work. Its original bright red joystick was missing and Adrien knew he’d have to replace the original screen with a TFT LCD. To do this, he 3D-printed a frame to fit the TFT display and he created a smaller base for the replacement joystick. Adrien also changed the microswitches for greater sensitivity but he didn’t go overboard with the changes.

The games can make use of the full screen. Adrien would have liked a larger screen, but the original ratio oddly lay between 4:3 and 16:9, making a bigger display harder to find

“I knew I would have to adapt some parts for the joystick and for the screen, but I didn’t want to modify the look of the toy,” Adrien explains. “To be honest, modifying the toy would have involved some sanding and painting and I was worried that it would ruin the overall effect of the project if it was badly executed.”

A Raspberry Pi 3A+ sits at the heart of the Pi Commander, alongside a mini audio amplifier, and it’s wired up to components within the toy

As such, a challenge was set. “I had to keep most of the original parts such as throttle levers and LEDs and adapt them to the new build,” he says. “This meant getting them to work together with the system and it also meant using the original PCB, getting rid of the components and re-routing the electronics to plug on the GPIOs.”

There were some enhancements. Adrien soldered a PAM8403 3W class-D audio amplifier to Raspberry Pi and this allowed a basic speaker to replace the original for better sound. But there were some compromises too.

The original PCB was used and the electronics were re-routed. All the components need to work between 3.3 to 5V with the lowest possible amperage while fitting into a tight space

“At first I thought the screen could be bigger than the one I used, but the round shape of the cockpit didn’t give much space to fit a screen larger than four inches.” He also believes the project could be improved with a better joystick: “The one I’ve used is a simple two-button arcade stick with a jet fighter look.”

Flying high

By using the retro gaming OS Recalbox (based on EmulationStation and RetroArch), however, he’s been able to perfect the overall feel. “Recalbox allowed me to create a custom front end that matches the look of a jet fighter,” he explains. It also means the Pi Commander plays shoot-’em-up games alongside open-source simulators like FlightGear (flightgear.org). “It’s a lot of fun.”

Read The MagPi for free!

Find more fantastic projects, tutorials, and reviews in The MagPi #93, out now! You can get The MagPi #95 online at our store, or in print from all good newsagents and supermarkets. You can also access The MagPi magazine via our Android and iOS apps.

Don’t forget our super subscription offers, which include a free gift of a Raspberry Pi Zero W when you subscribe for twelve months.

And, as with all our Raspberry Pi Press publications, you can download the free PDF from our website.

The post Pi Commander | The MagPi 95 appeared first on Raspberry Pi.

Noticia Original