This was a very nice weekend project that I highly recommend that was created by the folks over at the PiHut. I have the working video above showing you how it works, the AsciiCast to show you how to set this up via the command just below this text.
As a bonus, I have another video at the extreme bottom that will show you how to do this from the GUI on a Raspberry Pi. So many ways to set this up to cater to all of the different people out there. 🙂
The easiest way to control your 3D Christmas board is with Thonny. This is pre-installed in Raspbian Stretch.
So you can click on the Raspberry icon > Programming > Thonny.
Once Thonny is open paste the following code into it and then click on “Run”
from gpiozero import LEDBoard from gpiozero.tools import random_values from signal import pause tree = LEDBoard(*range(2,28),pwm=True) for led in tree: led.source_delay = 0.25 led.source = random_values() pause()
Once you have done that it will prompt you to give the code you just pasted a file name (e.g. xmas.py).
It will save the code as that file name and it will then run the code. You can then start and stop the code as you wish.
There is a great Raspberry Pi tutorial where you will learn to secure your Raspberry Pi. You will also learn to implement and enable the security features to make the Pi secure. This article is an excerpt from the book, Internet of Things with Raspberry Pi 3, written by Maneesh Rao. I give credit where it is due and this is what I wanted to share with all of you. Worth the time to read.
My Raspberry Pi Zero W is now a Raspberry Pi Zero WH. Here are all of the parts before the were cobbled together. This created a USB dongle for me that allows me to log into the Pi and have a Linux based environment to work in at any time. I am no expert and with this simple how to build anyone can do this project.
The first step is to solder the USB connector to the SparcFun Pi Zero USB Stem (pictured).
Once you have the main grounding legs soldered to the Stem, flip it over and solder the actual USB data and power connections. As you can see I am not using a fine tipped soldering tip but if your careful and have a steady hand you can do this fairly easy.
Once I had that all soldered together it was getting fairly warm so I set that off to the side and then started to work on soldering the header. This takes a little time to solder all of the connections and it also required some patience. This allows you to practice your soldering skills.
About 15 minutes later I had the header all soldered on and I used some Isopropyl alcohol to clean it all up. Since the Stem was now cool I fastened that to the board with the parts provided.
There is a good tutorial over at SparcFun showing how to solder castellated holes (or castellations). This might come in handy if you need to solder a module or PCB to another PCB. These castellations are becoming popular with integrated WiFi and Bluetooth modules.
Here is the finished soldered and assembled project. A Raspberry Pi Zero WH dongle. Now time for the final test. Will it power up?
Success! As you can see in the picture the new Raspberry Pi Zero WH powered up and booted with no problems. I immediately had to log in and run quick test or two.
This has been a fun project! I hope I have shown you a few things that have piqued your interest. This reason I started with the Raspberry Pi Zero WH is that out of all of the Raspberry Pi versions that are available this is what I would consider the base model. Everything I have show you so far can be, and will be used on higher models of the Raspberry Pi and other Single-Board computers. I’ll see you in the next post!
Today I wanted to share how I am setting up my test bench for those that are curious. I have decided to use the DINr plates from the folks over at http://www.dinrplate.com/ since their design and implementation are second to none in my humble opinion.
As you can see from the photo below the board is securely fastened to the plate and then that plate is secured to the rail. All of the cables are zip tied to the plate which makes sure that the connections to your Single-Board Computer are not stressed out. The left micro-usb is power, the center micro-usb is for the WiFi dongle and the right is the micro-hdmi to hdmi converter.
I highly recommend this setup if your going to be testing with your boards like I am since I have not found anything that is even close to the features and stability of this since I worked at Kodak. Amazon link to the setup I am using – DIN Rail Mount for Raspberry Pi Zero
Today’s test is with “stress-ng” – Bogo Ops
Stress-ng measures a stress test “throughput” using “bogus operations per second“. The size of a bogo op depends on the stressor being run, and are not comparable between different stressors. They give some rough notion of performance but should not be used as an accurate bench marking figure. They are useful to see if performance changes between kernel versions or different compiler versions used to build stress-ng. One can also use them to get a notional rough comparison of performance between different systems.
NOTE: They are NOT intended to be a scientifically accurate bench marking metric.
To install this program copy and paste:
sudo apt install stress-ng
To learn more about the program you can read the options:
The idea behind these benchmarks is for you to see what the default setting provide you and then, if you want/need to, you can overclock your Single-Board Computer. Overclocking I will cover in later blogs.
So what’s next?
I have started with the command line testing with the RaspBerry Pi Zero W since that is where we can get the basic testing out of the way. The desktop environment on the RaspBerry Pi Zero is not very good for any kind of Internet testing. We will save that for the RaspBerry Pi 3. I will do all of the same tests on the RPi 3 so we can compare them against the RPi Zero W.
I has also planned on making this RaspBerry Pi Zero W into a USB dongle and I am also going to be adding the GPIO header to it.
I would like to establish a SOP (standard operating procedure) or “methodology” going forward so all of you can create your own results. In order for this to be a fair test the following criteria were observed.
All CPU and memory tests conducted using Sysbench and/or command line.
All Single-Board computers were not contained in a case and used “bare”.
All tests using the latest version of that specific systems preferred software.
All tests were at ambient temperature before testing began.
I accessed the Single-Board computers over an SSH connection.
No desktop / X session started unless the tests required the desktop.
All test results are a combination of the tests being run 3 times and the mean average was used for the final result.
What is Sysbench
Sysbench is a benchmark suite which allows you to quickly get an impression about system performance which is important if you plan to run a database under intensive load. I will explain how to benchmark your CPU with Sysbench. Installing Sysbench From a terminal screen on Debian/Ubuntu/Mint/Raspbian, Sysbench can be installed as follows: sudo apt-get install sysbench If you want to learn more about the program you can look at the manual for Sysbench to learn more about its parameters.
You can benchmark your CPU performance as follows:
If you have a single core processor, like a Raspberry Pi Zero, you can use this command:
sysbench –test=cpu –cpu-max-prime=20000 run
If you have a multicore cpu you can use this command:
sysbench –test=cpu –cpu-max-prime=20000 run –num-threads=4
sysbench –test=memory –memory-block-size=1M –memory-total-size=10G run
Terminal command line benchmark testing
Integer calculation performance test with one-line command
time $(i=0; while (( i < 1234567 )); do (( i ++ )); done)
This will return the the time required to crunch the integers between 0 to 1234567.
RAM speed testing
There is no direct method to benchmark a RAM and generally RAM speed denotes RAM clock speed. It is unnecessary and not conclusive to do this test but this may be considered as an experiment. As you can benchmark this data with changes you do to your system or compared to other systems.
tmpfs is a RAM based super fast file system, something like a ramdisk, so by doing a read write speed test on a tmpfs mounted folder will give a rough idea about RAM speed. So, let’s have a look at commands below.
mkdir RAM_test # mount the tmpfs filesystem sudo mount tmpfs -t tmpfs RAM_test/ cd RAM_test # write to RAM test dd if=/dev/zero of=data_tmp bs=1M count=512 # read to RAM test dd if=data_tmp of=/dev/null bs=1M count=512
Here are the results for the Raspberry Pi Zero W. I achieved around 35 MB/s write speed and 79 MB/s read speed with a 512MB of DDR2 SDRAM.
On my main PC look at the result ! It’s incredibly fast ! I achieved around 4.6 GB/s write speed and 8.0 GB/s read speed with a 16GB 2400MHz DDR4 RAM.
Time to clean up what you just did.
cd .. # umount the tmpfs filesystem sudo umount tmpfs -t tmpfs RAM_test/ # delete the directory you created rm -r RAM_test
NOTE: My main computer is an I5 with 16GB DDR 4 ram at 2400MHz
It is a dual boot with Win 10 and Linux Mint