#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 El Bruno

Advertisements

#VSCode – Installing Visual Studio Code @code in a #RaspberryPi, run as root, fix black screen (Updated)

Buy Me A Coffee

Hi!

Now that I have my amazing Raspberry Pi 4 with 4GB RAM, it’s time to see how serious the device is. So, I decided to install and use some developers’ tools in the RPi. My dev list will be something like this

  • Python
  • Some ML and AI Python packages
  • GIT
  • Arduino
  • Visual Studio Code

It’s been a while since I installed VSCode in the device. The last time I did this, I needed to download the code from GitHub and compile the tool in the Raspberry Pi. As far as I remember this was a +25 min process.

Lucky for us the process can now be much simpler, thanks to Headmelted (see references). Now, we only need a single command to install VSCode:

. <( wget -O -
https://code.headmelted.com/installers/apt.sh )

Install process started! Or Maybe not because I found this amazing GPG error

python error installing visual studio code in raspberry pi
pi@rpidev3:~ $ curl -L https://code.headmelted.com/installers/apt.sh | sudo bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2349 0 2349 0 0 19739 0 --:--:-- --:--:-- --:--:-- 19906
Detecting architecture…
Ensuring curl is installed
Reading package lists… Done
Building dependency tree
Reading state information… Done
curl is already the newest version (7.64.0-4).
The following packages were automatically installed and are no longer required:
python3-pyperclip python3-thonny rpi.gpio-common
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Architecture detected as armv7l…
Retrieving GPG key headmelted
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
gpg: no valid OpenPGP data found.
Removing any previous entry to headmelted repository
Installing [headmelted] repository…
Updating APT cache…
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Get:3 https://packagecloud.io/headmelted/codebuilds/debian stretch InRelease [23.4 kB]
Err:3 https://packagecloud.io/headmelted/codebuilds/debian stretch InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0CC3FD642696BFC8
Reading package lists…
W: GPG error: https://packagecloud.io/headmelted/codebuilds/debian stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0CC3FD642696BFC8
E: The repository 'https://packagecloud.io/headmelted/codebuilds/debian stretch InRelease' is not signed.
Done!
Repository install complete.
Installing Visual Studio Code from [stretch]…
Reading package lists… Done
E: The value 'stretch' is invalid for APT::Default-Release as such a release is not available in the sources
Visual Studio Code install failed.

There a public GPG key used to verify the package and the SH script somehow does not download it (I think the ARM RPI version is still not defined). So, before the previous command, I need to run this command

wget https://packagecloud.io/headmelted/codebuilds/gpgkey -O
- | sudo apt-key add –

Then run this command

curl -L https://code.headmelted.com/installers/apt.sh | sudo bash

Now we have Visual Studio Code installed!

raspberry pi visual studio code installed

But, yes another but, you may note that the tool open and display a black window. Again, I need to go deeper on the details, but the latest version does not work well. There is some context information on GitHub (see references), and the proposed solution is to rollback to a previous version

sudo apt-get install code-oss=1.29.0-1539702286

And we also need to disable the automatic updates on this tool

sudo apt-mark hold code-oss

The following command will remove the hold for Visual Studio Code

sudo apt-mark unhold code-oss

And now, yes, we got a fully functional Visual Studio Code in our Raspberry Pi!

Another update, is a command to run VSCode as root

# open VSCode in default source code folder with root
sudo code-oss --user-data-dir=/home/pi/src/vsCodeUsrData

Of course this is not the best way to use VSCode, however something it helps 😀

Note: Due some Deep Neural Network and docker process, my device is starting to heat a lot, so I’ll try a next generation cooler like this one: Blink Blink ICE Tower CPU Cooling Fan for Raspberry Pi (Support Pi 4)

Happy Coding!

Greetings @ Toronto

El Bruno

References

My posts on El Bruno

#RaspberryPi – 6 commands to install #OpenCV for #Python in #RaspberryPi4

Hi !

Quick post to remind me the 6 commands to install OpenCV in my Raspberry Pi

sudo apt-get install libhdf5-dev libhdf5-serial-dev libhdf5-100 
sudo apt-get install libqtgui4 libqtwebkit4 libqt4-test
sudo apt-get install libatlas-base-dev
sudo apt-get install libjasper-dev
wget https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py
sudo pip3 install opencv-contrib-python

There is an optional command to update pip, which is always nice.

Happy Coding!

Greetings @ Burlington

El Bruno

References

My posts on El Bruno

#RaspberryPi – MultiMonitor support in #RaspberryPi4 rocks!

Buy Me A Coffee

Hi !

Another post in my path to use a Raspberry Pi 4 as a fully development device. And today, no code at all, just a showcase of the amazing new hardware: 2 video output. So let’s start with a working mode:

raspberry pi 4 multi monitor support with htop

In the previous image, in Screen 1 I’m using an instance of Visual Studio Code to do some Machine Learning with Python, and in Screen 2, I’m also browsing the history of one repo (I broke something …. as usual!).

In Screen 1, I also have Htop running, and it shows that I’m only using +780MBs of ram, that’s mean I still got 3GBs to use!

As a Windows user, I really appreciate that we had an visual interface to configure screen settings.

Raspberry Start > Preferences > Screen Configuration
raspberry pi 4 screen configuration

The [Screen Layout Editor] allows us to configure the following settings for HDMI 1 and HDMI 2 screens:

  • Resolution
  • Frequency
  • Orientation

As you can see in the following image, I got connected a HD monitor in HDMI 1 so my maximum available resolution is 1920×1080.

raspberry pi 4 screen configuration screens resolution

I haven’t connected a 4K monitor to the device, but I’ll get there 😀

Finally, you can also manage some additional screen configuration from the [Desktop Preferences] settings. I this section you can configure individual wall papers, icons to be displayed and more.

And this is also the section where you can DUPLICATE THE MONITORS ! [Show identical desktop on second monitor].

And, of course, I my demo device is ready for Caribbean Developer Conference 2019!

raspberry pi 4 multi monitor ready for Caribbean Developers Conference

Happy Coding!

Greetings @ Burlington

El Bruno

References

My posts on El Bruno

#VSCode – How to install #docker in a #RaspberryPi 4

Hi!

In my series of posts on how to create a development environment using a Raspberry Pi4, today is time to write about installing Docker. (see references)

I was user to download and build docker to be used on the device, however now we have an easier way to do this. Thanks to http://get.docker.com we can now install docker with a single command

curl -sSL
https://get.docker.com | sh

And then, a simple check for the docker version

raspberry pi docker version in terminal

Happy coding!

Greetings @ Toronto

El Bruno

References

#RaspberryPi – How to install #DotNetCore in a #RaspberryPi4 and test with #HelloWorld (of course!)

Hi!

During the next couple of months, I’ll be sharing some amazing experiences around AI. Some of these experiences includes IoT devices like a Raspberry Pi, and of course some Machine Learning.Net (ML.Net). Because ML.Net is built with .Net Core, it makes sense to share the 5 simple steps you need to do to install .Net Core in a Raspberry Pi.

Of course, my 1st try was to navigate to the official .Net page (see references), which automatically detect my Linux distro and proposes a set of x64 SDKs.

raspberry pi 4 .net tutorial page with linux distribution options

I’m completely sure that I’m working in a 32 bits environment, however I’ll double check this with the following commands

sudo apt-get install lshw
lshw

After installing lshw I confirm that I’m in a 32 bit environment

raspberry pi 4 lshw information on 32 bit environment

Bonus: lshw is a small tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines (PowerMac G4 is known to work).

Now I need to navigate to the download page to download the specific Linux 32-bit version (see references).

Once I got the image downloaded its time to extract the file on a specific folder. I’ve created a folder named “dotnet” with the following command

sudo mkdir -p dotnet

And to extract the image from the Downloads folder

sudo tar zxf dotnet-sdk-2.2.401-linux-arm.tar.gz -C
/home/pi/dotnet/

Let’s create a symbolic link to the extracted binaries

sudo ln -s /home/pi/dotnet/dotnet /usr/local/bin

And it’s done! Let’s invoke the .DotNet help command to test it

raspberry pi 4 .net core 2.2 installed and test dotnet help

Now we can follow the steps of [.NET Core on Raspberry Pi, see references] to create a Console Application and to test the device.

To create a new console App

dotnet new console
raspberry pi 4 .net core 2.2 create new console app

And test the app

sudo dotnet run
raspberry pi 4 .net core 2.2 console app run

We can publish the app for linux / raspberry pi

sudo dotnet publish -r linux-arm

And copy the generated folder to be used in another device

./bin/Debug/netcoreapp2.2/linux-arm/
raspberry pi 4 .net core 2.2 console app build and publish folder to reuse

So next steps will be some other tests with Raspberry Pi and .Net Core. And the following image is a big teaser of this

raspberry pi 4 .net core 2.2 console app edit in Visual Studio Code

Happy coding!

Greetings @ Toronto

El Bruno

References

#RaspberryPi – How To enable auto start with #HDMI safe mode

Hi!

A couple of days ago I wrote (a personal reminder post) about how to add automatic connect to Wi-Fi and SSH enabled in a bootable Raspbian image in a SD card (see references). I also explained that this was required for me because, by default Raspberry Pi 4 video ports were not starting with a 1920 x 1080p resolution.

Important: Remember that now, the 2 video ports supports 4K !

I was digging and reading about this, and I found another quick fix to solve this problem. Once you had a Raspbian image in a SD card, you can edit the file [config.txt] for some amazing cool tweaks! (Also, see references)

For me, my main change was in the [hdmi_safe] parameter. Setting hdmi_safe to 1 will lead to “safe mode” settings being used to try to boot with maximum HDMI compatibility.

# uncomment if you get no picture on HDMI for a default "safe" mode 
hdmi_safe=1

With this, the device will start automatically in a safe and standard mode. And, yes, it will work with my old and crappy test monitor!

Happy coding!

Greetings @ Toronto

El Bruno

References

#VSCode – Installing Visual Studio Code in a #RaspberryPi, a couple of lessons learned – @code

Hi!

Now that I have my amazing Raspberry Pi 4 with 4GB RAM, it’s time to see how serious the device is. So, I decided to install and use some developers’ tools in the RPi. My dev list will be something like this

  • Python
  • Some ML and AI Python packages
  • GIT
  • Arduino
  • Visual Studio Code

It’s been a while since I installed VSCode in the device. The last time I did this, I needed to download the code from GitHub and compile the tool in the Raspberry Pi. As far as I remember this was a +25 min process.

Lucky for us the process can now be much simpler, thanks to Headmelted (see references). Now, we only need a single command to install VSCode:

. <( wget -O -
https://code.headmelted.com/installers/apt.sh )

Install process started! Or Maybe not because I found this amazing GPG error

python error installing visual studio code in raspberry pi
pi@rpidev3:~ $ curl -L https://code.headmelted.com/installers/apt.sh | sudo bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2349 0 2349 0 0 19739 0 --:--:-- --:--:-- --:--:-- 19906
Detecting architecture…
Ensuring curl is installed
Reading package lists… Done
Building dependency tree
Reading state information… Done
curl is already the newest version (7.64.0-4).
The following packages were automatically installed and are no longer required:
python3-pyperclip python3-thonny rpi.gpio-common
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Architecture detected as armv7l…
Retrieving GPG key headmelted
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
gpg: no valid OpenPGP data found.
Removing any previous entry to headmelted repository
Installing [headmelted] repository…
Updating APT cache…
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Get:3 https://packagecloud.io/headmelted/codebuilds/debian stretch InRelease [23.4 kB]
Err:3 https://packagecloud.io/headmelted/codebuilds/debian stretch InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0CC3FD642696BFC8
Reading package lists…
W: GPG error: https://packagecloud.io/headmelted/codebuilds/debian stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0CC3FD642696BFC8
E: The repository 'https://packagecloud.io/headmelted/codebuilds/debian stretch InRelease' is not signed.
Done!
Repository install complete.
Installing Visual Studio Code from [stretch]…
Reading package lists… Done
E: The value 'stretch' is invalid for APT::Default-Release as such a release is not available in the sources
Visual Studio Code install failed.

There a public GPG key used to verify the package and the SH script somehow does not download it (I think the ARM RPI version is still not defined). So, before the previous command, I need to run this command

wget https://packagecloud.io/headmelted/codebuilds/gpgkey -O
- | sudo apt-key add –

Then run this command

curl -L https://code.headmelted.com/installers/apt.sh | sudo bash

Now we have Visual Studio Code installed!

raspberry pi visual studio code installed

But, yes another but, you may note that the tool open and display a black window. Again, I need to go deeper on the details, but the latest version does not work well. There is some context information on GitHub (see references), and the proposed solution is to rollback to a previous version

sudo apt-get install code-oss=1.29.0-1539702286

And we also need to disable the automatic updates on this tool

sudo apt-mark hold code-oss

And now, yes, we got a fully functional Visual Studio Code in our Raspberry Pi!

Happy Coding!

Greetings @ Toronto

El Bruno

References

#Python – Let’s use a #FaceRecognition demo app for a performance comparison between #RaspberryPi3 and #RaspberryPi4

Hi!

I started to do some tests with the new Raspberry Pi 4 and the results are amazing. I’m not a performance expert, so I decided to pick up some of the demos / apps I’ve creating for the Raspberry Pi and run them in both models: Raspberry Pi 3 B+ and Raspberry Pi 4.

I started with an amazing set of tutorials on how to perform Face Recognition from Adrian Rosebrock (see references). I’ve been using his Face Recognition python package for this scenarios and it’s an amazing one.

I added some code to a custom version of Adrian’s Face Recognition sample, and it looks great. The main idea was to track in real-time the current FPS (similar to the work I did with the Image AI and Hololens sample a couple of days ago, see references).

This sample load a file with 15 trained faces and analyze frame by frame to

  • Detect faces in the frame.
  • If a face is detected, draw a frame around it.
  • For each detected frame analyze if the face is a trained face.
  • If the face is part of the trained dataset, the app will add the name of the person on top of the frame.

I display in real-time the FPS processed with a USB camera in a Raspberry Pi 3 B+. Doing a lot of tweaks and getting the best performance in the device I could never process 1FPS. The average processing data were between 0.6 and 0.9 FPS in a Raspberry Pi 3B+.

python face recognition in raspberry py 3 with FPS live

IMHO, these results are great for a small device like a Raspberry Pi 3B+. But now it was time to test it in the new Raspberry Pi 4. And an important note here is to remark that even if I did this tests in a Raspberry Pi 4 with 4GB of Rams, the performance results are similar to a RPI4 with just 1 GB of ram. We have more memory, however the processor improvements are quite significant in the new version.

I installed all the necessary software in the Raspberry Pi 4 and I got 3X better results. I’ve even tun this in a 1080p resolution to get a sense of the real processing time. The average processing data were between 2.3 and 2.4 FPS in a Raspberry Pi 4.

python face recognition in raspberry py 4 with FPS live

Amazing! In this scenario the Raspberry Pi 4 is almost 3 times faster than the Raspberry Pi 3. And again, these are amazing times for a 50USD device.

The sample source code is https://github.com/elbruno/Blog/tree/master/20190819%20Rpi%203%20vs%20Rpi%204%20Face%20Recognition

I even have time for some BBQ time with family and friends!

Happy coding!

Greetings @ Toronto

El Bruno

References

#RaspberryPi – Using “please” instead of “sudo”, a very Canadian command line of work for #Linux

Hi!

I’ll write this down, so I don’t forget in the near future. I’m not a Linux user, and that’s amazing. Every day I learn something new, mostly while I’m working with Python, Visual Studio Code and Raspberry Pi.

So, I received a couple of brand new Raspberry Pi 4, and now it’s time to test them. And of course, most of this job is via SSH / command line. I’m not an expert (yet) on Raspberry Pi user permissions, however I started to realize when I need to use “sudo” to get things done.

If you search for sudo definition, you may find something similar to this one:

Sudo stands for either “substitute user do” or “super user do” (depending upon how you want to look at it)

https://www.lifewire.com/what-is-sudo-2197466

Today, I’ve learned the power of the “alias” command, and how it can be used to have a more polite conversation with my device. In example, I can create an alias for sudo, named “please” and then this happen.

alias please="sudo"

This is a very polite way to display my Raspberry Pi4 CPU information

raspbery pi 4 using please instead of sudo display cpu information

Or another polite way to display Disk information for the Raspberry Pi 4

raspbery pi 4 using please instead of sudo display disk information

You get the idea.

Happy Coding!

Greetings @ Toronto

El Bruno

Twitter source