I’ve been looking to use the amazing Intel Neural Stick 2 for a while, and one of the 1st ideas that I have was to check how fast my Raspberry Pi 4 can run using this device.
The Intel team released a nice step by step process installation for Raspberry Pi. And it works great, there are a couple of minor glitches that you need to figure out, like the latest package version, everything else works great.
Once installed, the 1st python sample is a face recognition one. This sample analyzes a image file using OpenCV to detect faces, and creates a new output file with the detected images. As I said, is very straight forward.
So, I decided to create a new python sample to run live face detection using the camera feed and also display the FPS. This is the output code:
# perform face detection
# display detected face frame
# display FPS info in webcam video feed
# This is the official sample demo file desribed in the installer documentation
The code is very straight forward and the main matters are
It uses 2 models from the Intel Zoo to perform the face detection: face-detection-adas-0001.xml and face-detection-adas-0001.bin
Lines 22 and 23 are key to define that OpenCV will load and use the models in the Intel device
I use imutils to resize the image to 640×480. Feel free to use any other library for this, even OpenCV
Also, it works also with smaller resolutions, however 640×480 is good for this demo
And the final app running analyzing almost 8 frames per second (8 FPS).
Which is almost 10 times faster that the 0.7 FPS without Intel NCS2
And, I already wrote about running Visual Studio Code in the Raspberry Pi (see references) is an amazing experience. I did all my Python in VSCode coding remote accesing my device via VNC. Python runs like a charm!
When I wrote about the latest version of Visual Studio Code working on the Raspberry Pi, I realize that I used a couple of commands to find an installed application.
The following command will list all the installed apps
sudo apt list --installed
Which is great, but hard to read in bash mode. So that’s why I use grep to filter for the app I want.
sudo apt list --installed | grep -i code-oss
So far, so good. The command did the trick, and I got my result: app name, version and details. However, as a long time Windows user, I was wondering if Linux users have a visual interface for this. And then I found: Synaptic.
The command to install Synaptic is maybe the last command we will use to install or uninstall an app
sudo apt install synaptic -y
And then we can launch the app using this command, and it’s need to be with sudo permissions (learned in the hard way)
At this moment, I can browse in the all list of apps. And I can quickly perform a search for my installed Visual Studio Code.
I get the result, with details, version and more.
And if you are wondering what’s the main difference with the bash command? So, I didn’t need to search and learn a command, the universal visual clue of the magnifier, or the search button were good enough for me.
Playing around with the app, I found I can display much more information for each installed app. Which is great, because I start to understand the idea and concepts of dependencies, where Linux install software, etc.
The Raspberry Pi 4 is an amazing device, and if you have been tracking the different usage scenarios for the device, you probably noticed that heat is an issue. I’ve using some Aluminum Heatsink, however still in some heavy scenarios the device temperature can be up to 70C or more.
I found out that when the device get’s to certain temperature (>80C), the device lowers its operational speed to prevent damage.
Officially, the Raspberry Pi Foundation recommends that the temperature of your Raspberry Pi device should be below 85 degrees Celsius for it to work properly. That’s the maximum limit. But it would start throttling at 82 degrees Celsius.
This fan is massive and amazing. Look at these photos, to have a sense of the size of the fan.
And, because I’m a programmer, I decided to test the device temperature with a long heavy process, to see how this affect the temperature.
Initially I was planning to share a machine learning training model process, but then I realized that there is something else that we can do which is very resource consuming: Compile OpenCV.
And, I know, you can install OpenCV with a simple pip install command, but let’s built it. Is much more fun. As usual, I’ll rely on one of the amazing Adrian Rosebrock Tutorials: Install OpenCV 4 on Raspberry Pi 4 and Raspbian Buster (see references)
Build OpenCV using 4 cores with a bare naked Raspberry Pi: >75C
In this 1st scenario, I built OpenCV using the 4 cores with a bare-naked Raspberry Pi. This process took almost an hour, and as you can see in the following animation:
The 4 cores where working at 100%
The temperature was around 75 degrees all the time
And, of course, this animation is at 300X speed.
Build OpenCV using 4 cores with ICE Tower Cooler fan in a Raspberry Pi: <40C
In the 2nd scenario, I built OpenCV using 4 cores with the ICE Tower Cooler fan in the Raspberry Pi. As the previous one, this process also took almost an hour, and as you can see in the following animation:
The 4 cores where also working at 100%
The temperature was less than 40C degrees all the time
Again, this animation is at 300X speed.
Differences running an App: Face Recognition
My next question was how about a normal process, like some face recognition demos. I used and changed some of Adrian Rosebrock’s face recognition demos, and here are the results.
Face Recognition app in a Raspberry Pi bare-naked, runs at 67C degrees
Face Recognition app in a Raspberry Pi with ICE Tower Cooler fan, runs at 38C degrees
If you are concerned about the temperature of your device, this is my top 1 option. And, if you are wondering if the fan is noisy? not at all! I have it right next to me, and I don’t even notice the fan.
Seeed is the IoT hardware enabler providing services over 10 years that empower makers to realize their projects and products. Seeed offers a wide array of hardware platforms and sensor modules ready to be integrated with existing IoT platforms and one-stop PCB fabrication and PCB assembly service. Seeed Studio provides a wide selection of electronic parts including ArduinoRaspberry Pi and many different development board platforms Especially the Grove Sytsem help engineers and makers to avoid jumper wires problems. Seeed Studio has developed more than 280 Grove modules covering a wide range of applications that can fulfill a variety of needs.
Bonus: this video also analyzes the cooler in other scenarios.
So, after writing my posts on how to install dotnet core 3.1 on a Raspberry Pi 4, I found that after I reboot my device, the dotnet command stop working. When I run dotnet from bash I get the following message
~bash: dotnet: command not found
The problem, is that the export steps of the installation process were lost after the reboot. And, as reminder of what is the export command.
Linux export command is use to set export attribute for shell variables on Linux system. The Linux export command is one of bash shell built in command.
In order to fix this, we can add the commands into our [~/.bashrc] file. First we need to edit our file with the command
Quick post today, to leave this as a public note. And, disclaimer, I’m not a Linux expert, just a normal user; I’m sure there are plenty of better ways to do this. Any advice will be appreciated.
Context: I’m working with Git and .Net Core 3.1. Just cloned a repository and ready to run my 2 favourite commands
However, I found this error
/home/pi/dotnet/sdk/3.1.100/NuGet.targets(123,5): error : Access to the path '/<path>.csproj.nuget.dgspec.json' is denied. [/<path>..csproj]
/home/pi/dotnet/sdk/3.1.100/NuGet.targets(123,5): error : Permission denied
I’m running dotnet under the user pi, and I haven’t found a way to automatically grant permissions to new folders for this user. So everytime I clone a repo I need to grant permissions with the command.
A couple of weeks ago, Microsoft released a preview version of Microsoft Teams for Linux (see references). Since that day, I was hoping to have a chance to play around with this version, mostly in a Raspberry Pi.
Those days I also had this conversation with my best half (who is a very smart person):
Why do you need to do this? You already have a very powerful MacBook, an amazing Dell laptop and a gaming PC. So, why do you need to install Microsoft Teams in a not so powerful device at home?
There is no logic answer for this, however I learned a lot in the process. Let me share, because it all start with the official download page for Microsoft Teams.
Microsoft Teams Versions
Besides the official download page for Microsoft Teams, there is an interesting page which describes all the possible client scenarios for Desktop, Web, and Mobile. And for Desktop it includes, Windows, Linux and Mac: Get clients for Microsoft Teams (see references).
In the Linux section, we have the option to review the packages DEB and RPM repositories
This is also interesting, because browsing the repositories, you may find the Release and the Insiders versions.
Raspberry Pi 4 64-bits kernel
The Raspberry Pi 4 has a 64 bits kernel, however the current Raspbian distro are not using the 64-bit kernel capabilities of the device. There is an entry on the RaspberryPi forums which explains how to enable the 64-bit kernel: Pi4 64-bit Raspbian kernel for testing – Focus on Pi4 (see references)
Add to config.txt
And done, in a NON OFFICIAL or NON SUPPORTED way, my device is running on X64.
This process took some time, at least 10 minutes.
Note: I’m 99% sure that this is not supported. So, all of this is mostly a testing and learning experience.
Add AMD64 architecture to Raspberry Pi.
Back to Microsoft Teams. After checking the available versions, I realized that AMD64 is the only supported architecture in Linux. The Raspberry Pi uses an ARM CPU, which uses the ARM instruction set. That is a different instruction set than that used by i386 and x86-64/amd64. So, there is no way to install an AMD64 package on a Raspberry Pi 4
However, I found an interesting command: dpkg –add-architecture
And I started to read about the command (some links in references).
dpkg –add-architecture is meant for CPUs that support multiple instruction sets. I think it was mainly introduced for x86-64 (i.e. 64bit) CPUs, which also support i386 (i.e. 32bit) instructions. This allows you to install packages compiled for i386 on a system that otherwise uses x86-64 packages.
So, even if it won’t work, I tried to add AMD64 in my RPi 4 with the following command:
As a Windows User, I was never happy with the out-of-the-box File Explorer, that’s why I’m a big fan of Total Commander. The 2 panels mode to move or copy files between the panels, or the quick access keys, ftp connections and more, makes Total Commander a #MustHave tool in my Windows 10 Station.
I started to look for something similar for Raspberry Pi, and after a couple of tests my choose is: Double Commander (see references).
It’s easy to install, just this command
sudo apt-get install doublecmd-qt
And it will appear on the Accessories menu.
So far, Double Commander, is part of my setup list of tools to be installed on Raspbian for my Raspberry Pi 4 developer station!