#RaspberryPi – 2GB Raspberry Pi 4 now only $35

Buy Me A Coffee

Hi !

After some windy vacations, I’m still behind on my drone posts. However, this is an amazing news:

TL;DR: it’s our eighth birthday, and falling RAM prices have allowed us to cut the price of the 2GB Raspberry Pi 4 to $35. You can buy one here.

Official Raspberry Pi Blog, https://www.raspberrypi.org/blog/new-price-raspberry-pi-4-2gb/

So great !

raspberry pi with massive fan

Happy coding!

Greetings

El Bruno

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#RaspberryPi – Performance differences in #FaceRecognition using #OpenVino (code with @code!)

Buy Me A Coffee

Hi !

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.

Note: I downloaded my openvino toolkit from here (https://download.01.org/opencv/2019/openvinotoolkit/R3/), and the downloaded file is (l_openvino_toolkit_runtime_raspbian_p_2019.3.334.tgz).

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:

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!

You can download the code from https://github.com/elbruno/rpiopenvino/tree/master/facedetection

References

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#RaspberryPi – How to install #docker (Updated 2020-01-24)

Buy Me A Coffee

Hi

I wrote a couple of times about this, however this is the updated version on how to install docker in a Raspberry Pi. Updated to Jan 24 2020.

The information is available from the Official Docker Documentation

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

And then, a simple check for the docker version with the command

docker version

And that’s it ! Docker installed in the device 😀

Happy coding!

Greetings

El Bruno

References

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#RaspberryPi – Where is my Add/Remove programs? let’s use Synaptic

Buy Me A Coffee

Hi!

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)

sudo synaptic

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.

Happy coding!

Greetings

El Bruno

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#RaspberryPi – Visual Studio Code blank screen is fixed on version 1.42. Thanks @headmelted! @code

Buy Me A Coffee

Hi!

When I wrote about how to install Visual Studio Code on a Raspberry Pi, there was an error on the app running on the device: the tool opened and display a black window.

We needed to manually go back to version 1.29 to avoid this problem. And we also forgot to apply any updates, each new version still have the black window error.

I was following the issue on GitHub, and I was happy when a few days ago, it was solved by headmelted (link https://github.com/headmelted/codebuilds/issues/67#issuecomment-563335451).

I’ve updated the app to the latest version (1.42.0), and it was working fine.

raspberry pi 4 visual studio code version 1.42 running fine

If we check the apt list, we can find a specific detail of the running version with the command

sudo apt list --installed | grep -i code-oss
raspberry pi 4 apt list for code -oss return 1.42

So, please go and thank headmelted by the amazing work he is doing!

Happy coding!

Greetings

El Bruno

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#RaspberryPi – Ice Tower: The best cooler for your device! From 70C to <40C in a 60 minutes process running at 100% in all 4 cores

Buy Me A Coffee

Hi!

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.

Raspberry Pi Temperature Monitor

While I was digging on this topic, the SeeedStudio team approached me to suggest me to test one of the best fans for Raspberri Pi 4: Blink Blink ICE Tower CPU Cooling Fan for Raspberry Pi (Support Pi 4).

This fan is massive and amazing. Look at these photos, to have a sense of the size of the fan.

raspberry pi 4 massive fan 1
raspberry pi 4 massive fan side by side with a raspberry pi

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.

Build OpenCV

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 on raspberry pi 4 no fan 300x

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.
build opencv on raspberry pi 4 with Ice tower fan

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

Conclusion

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.

About Seeed Studio

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 Arduino  Raspberry 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.

Happy coding!

Greetings @ Burlington

El Bruno

References

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#RaspberryPi – How to solve #dotnet core not recognized after reboot

Buy Me A Coffee

Hi!

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

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

sudo nano ~/.bashrc

And add the lines

export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
export PATH="$PATH:/home/pi/.dotnet/tools"
raspberry pi 4 edit bashrc to add dotnet core wrapper

Now we need to reload the [~/.bashrc] file with the command

source ~/.bashrc
dotnet command working after reload bash file

And that’s it ! if the command is not recognized, just reload the bashrc file.

Happy coding!

Greetings @ Burlington

El Bruno

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#HowTo – Grant permissions to a folder after #Git clone, to perform #dotnet restore on a #RaspberryPi #dotnetcore

Buy Me A Coffee

Hi !

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

dotnet restore
dotnet run

However, I found this error

raspberry pi dotnet restore access denied 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.

# sudo chmod -R 757 '<path>'
sudo chmod -R 757 '/home/pi/srcebgit/testsGit/20191227MLNet/myMLApp/consumeModelApp'

And now, it’s working

raspberry pi dotnet restore working after grant user permissions

Of course, I still need to deal with other permissions issues because this project has some copy files actions on the build. Now I know the way!

raspberry pi dotnet restore working error on run

Happy coding!

Greetings @ Burlington

El Bruno

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#RaspberryPi – Microsoft Teams in RPi 4? Mmm, not yet, but it’s an interesting learning journey to start the New Year 2020

Buy Me A Coffee

Hi!

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?
  • Because …

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

raspberry pi 4 download microsoft teams

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.

Microsoft package repository with release and insider version of MS Teams

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

arm_64bit=1

and Run

sudo rpi-update

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:

#sudo dpkg --add-architecture {architecture name} && sudo apt-get update
sudo dpkg --add-architecture amd64 && sudo apt-get update
raspberry pi 4 lscpu

So, after this, I have the AMD64 architecture instructions installed. They are not going to work, but I can install an AMD64 package now.

Installing Teams

If you are running your Raspberry Pi with a desktop interface, just double clicking on the file: teams_1.2.00.32451_amd64.deb. This will start the installation. And, of course, it will fail!

raspberry pi 4 install microsoft teams.png

So, it was time to read and learn, and I found an alternative and amazing tool to install DEB files: GDebi (see references)

Gdebi is a tiny little app that helps you install deb files more effectively by handling dependencies. Learn how to use Gdebi and make it the default application for installing deb packages.

It’s very easy to install, just 2 commands

sudo apt-get install gdebi-core
sudo apt-get install gdebi

Note: It should work with the 2nd command, however, I needed to add the core option 1st.

raspberry pi 4 open gdebi.png

Now I got GDebi, and I can open the package with the tool, and I got a dependency problem with the libasound2 library.

raspberry pi 4 gdebi error on dependencies libasound2

Even so, I can start the installation with the command

sudo gdebi teams_1.2.00.32451_amd64.deb

and, the app won’t work, but I’ll see the shortcut access in the [Sound & Video] folder

Again, the app won’t launch, but in the personal side, I spend some good time here learning a lot about Linux, processor architectures and more. So, I’m 100% cool now!

Happy coding and Happy New Year!

Greetings @ Burlington

El Bruno

References

My Posts

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#RaspberryPi – Double Commander on #RaspberryPi4, because files are important!

Buy Me A Coffee

Hi !

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!

Happy Coding!

Greetings @ Burlington

El Bruno

References

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware