Upgrade to Python 3.7 and make it the default version in any Linux Ubuntu based distributions

Upgrade to Python 3.7 and make it the default version in any Linux Ubuntu based distributions

Recently I wanted to upgrade my version of Python from 3.6 to 3.7 on one of my Linux system, so I decided to document my steps as I will be doing it on a couple more units.

Before you install it, you will need to add the repository first, then do an update:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update

After that you can install version 3.7:

sudo apt-get install build-essential libpq-dev libssl-dev openssl libffi-dev zlib1g-dev
sudo apt-get install python3-pip python3-dev
sudo apt-get install python3.7

Once it is finished installing it, you can verifying it by just typing python3.7 at the command prompt:

neo@matrix:~$ python3.7
Python 3.7.1 (default, Oct 21 2018, 04:01:51)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

Now you can proceed to make it your default version.

If you type sudo update-alternatives –config python and you see an error message such as update-alternatives: error: no alternatives for python3  you will need to update your update-alternatives first, then you will be able to set your default python version (don’t forget the 1 at the end):

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1

After that, run this to set it as the default. :

sudo update-alternatives --config python

As an alternative you can use the following command to set python3.7 as default:

sudo update-alternatives  --set python /usr/bin/python3.7

I will update this post as I do the upgrades on more systems.




CHIP Rover – Gathering Parts

CHIP Rover – Gathering Parts

The image below show the parts I used; keep in mind this is a second rover I will build (yes I have that many spare parts) so the tank/track system is not the Zumo Chassis Kit with no motors; this one comes from a toy set of two remote control tanks that you could shoot each other via infrared beams. I purchased the set a few years ago on clearance for $10, talk about a steal for stocking my already overflowing junk box, but hey… here I am using one of them!


Here is the basic BOM for getting the rover moving, the other items are for the “nice to have” options like amplifier/speakers, camera and a mini Arduino to drive a set of RGB lights and sensors:

BRAINS: 1 CHIP – The $9 Computer
CHASSIS: 1 Zumo Chassis Kit (No Motors)
MOTORS: 2 Micro Metal Gearmotor (I Chose the medium speed 75:1)
MOTOR CONTROLLER: 1 TB6612FNG Dual Motor Driver Carrier
BATTERY: 1 Lithium Ion Polymer Battery – 3.7v 2500mAh
WIRES : 1 Breadboarding wire bundle
HEADERS: 2 40-Pin Break-apart Male Headers – 2mm Pitch
HEADERS: 2 Stacking Header – 2×20 Extra Tall Header
POWER: 1 5V 2A Micro USB Charger Power Adapter
CABLES: 1 Micro USB  (For accessing CHIP via computer)

The fun part of course is getting it done with whatever parts you have on hand.

Custom Shield

I made this custom shield to double the pins from the CHIP. It basically is a set of male headers soldered in parallel to the stacking heads. I used male pins to give me connection options as I have a well stocked box of wires with different end connectors.

This is a decent amount of soldering, 40 pins on each side for a total of 80 which are in a tight formation. Best advice I kept repeating to myself while doing it is “take your time and don’t rush it”.

This is what it looks like once stacked:


On my next post I will start with the wiring of the motor controller.

FYI: I will not go into details on how to physically mount the parts together as every build is unique, therefore I will leave the hardware “MacGyver-ing” up to you.

CHIP – The $9 Computer – ROVER Plans

CHIP – The $9 Computer – ROVER Plans

I have built and destroyed a few rovers in the past. Most of them I didn’t make any plans ahead, I just “MacGyver-ed” something from spare parts. It was fun and still is. It started several years ago with a unit that I built from Meccano parts which had tracks and two small Arduinos all connected via serial ports. Then went to a smaller unit using an ATtiny2313 and a Bluetooth module controlled by an Android app I created myself. The most recent dismantled victim was using a WRTnode module which was streaming a USB camera connected to it, my first true “rover”.  This one I used to run small cables underneath big greasy equipment at work, so it was actually a workhorse, well more like a “work-pony”.

Were are they all now? Hopefully in Robot heaven with only memories of their existence. l did keep the “brains” of the Bluetooth ATtiny2313 unit, it is still all mounted on a small breadboard. There is something special about this one that makes me keep it around. Maybe the fact that the ATtiny2313 only has 2K of memory and I made a rover out of it, maybe because I actually had a plan in action when I built this one instead of just winging it.

ATtiny “brains” with LED lights still intact on the original breadboard


After building several different rovers I came up with a list of my basic requirements:

  • It has to be controllable via WiFi in order to get decent range.
  • It has to have a live streaming camera to see where it is going.
  • It has to have a rechargeable battery.
  • It has to have lights to see in the dark.
  • It has to have adjustable speed for better control.
  • It has to have tracks instead of wheels for better traction.

The nice things to have would be:

  • Controllable colored lights (RGB Leds).
  • Speaker/Amplifier to speak or play sounds .
  • A variety of sensors such as battery status, wall and proximity sensors and/or environment sensors.
  • Docking station for recharging the battery.

Really cool things to have:

  • Being able to be autonomous.
  • Some kind of vision system.
  • Speech recognition.

I always  start with the basic and build up to the nice things before attempting the cool stuff, however the basic build  has to take in account for future upgrades as well.

This is how I put together my CHIP Rover. I started with the basics and added a couple of nice features later; I am still tinkering with it, currently planning on sensing stairs or void ahead to avoid an ugly demise.

For the basic setup I used the following material:

BRAINS: 1 CHIP – The $9 Computer
CHASSIS: 1 Zumo Chassis Kit (No Motors)
MOTORS: 2 Micro Metal Gearmotor (I Chose the medium speed 75:1)
MOTOR CONTROLLER: 1 TB6612FNG Dual Motor Driver Carrier
BATTERY: 1 Lithium Ion Polymer Battery – 3.7v 2500mAh
WIRES : 1 Breadboarding wire bundle
HEADERS: 2 40-Pin Break-apart Male Headers – 2mm Pitch
HEADERS: 2 Stacking Header – 2×20 Extra Tall Header
POWER: 1 5V 2A Micro USB Charger Power Adapter
CABLES: 1 Micro USB  (For accessing CHIP via computer)

I forgot to list a USB camera above but that’s probably because the first goal is to get it moving. I will have a dedicated post just for the camera.

The links in the BOM are for reference, you can obtain any parts from your preferred supplier. I chose each component after dry fitting several different part together until I found the right combination. This took several weeks as I had to wait for some parts to arrive.

In the following posts I will document how it came together.

Ciao for now.

CHIP – The $9 Computer – SETUP

CHIP – The $9 Computer – SETUP

After I unboxed this little mighty computer and connected to it through a Linux shell I realized I wanted to upgrade the operating system from the 4.3 kernel to 4.4.

They have different images and versions, I chose the Headless 4.4 Kernel for my new experimental rover.

I’m not going to duplicate the instructions because their website does a decent job, here is the link on how to do so; I found the easier way is through their Chrome browser plugin.

CHIP with jumper wire attached

Once I installed the Headless 4.4 Kernel image the first thing I did is software updates but I needed to establish a WiFi connection first, however the image being headless, I only have a command line interface available… No problem, their web site had the info, here are the instructions I followed; they are simple and detailed, the wireless configuration worked successfully on the first try.

Once I established a successful WiFi connection I ran the standard update/upgrade commands:

chip@chip:~$ sudo apt update

chip@chip:~$ sudo apt upgrade

It might take a few minutes to complete both but when it’s done you have your basic building block for a neat rover or whatever you want it to be.

In a nutshell:

So now the CHIP is ready for whatever you have planned for it.

Stay tuned for more post regarding this little wonder, including a rover I built using it.

CHIP – The $9 Computer – The Basics

CHIP – The $9 Computer – The Basics

When I first read about this little board I was intrigued:

  • WiFi B/G/N Built-in
  • 1GHz Processor
  • 4GB of High-speed Storage
  • 512MB of RAM
  • Bluetooth 4.0

All this for $9!

It sounded too good to be true. After researching and waiting a bit I decided to take a gamble and ordered four of them. A gamble because after reading some of the horror stories of crowdfunding I was reluctant to say the least but I had a good feeling about this one and decided to risk $40+ on them.

The good feelings payed off, although it took a while before I received the boards. I submitted my order on December 3rd 2015 and totally forgot about them; I received an email in May 2016 that they were getting ready to ship and received them shortly after that in June.

When I opened up the first box I was pleasantly surprised by the small size, approximately 60mm by 40mm or 2-1/2″ by 1-1/2″. That makes it smaller than a Raspberry Pi 2 or 3.

C.H.I.P. - The World's First $9 Computer (credit Richard Reininger)

Smaller and they are packed with nice features for $9: no need for a micro SD card, no need for a WiFi or Bluetooth dongle, built-in serial through the micro USB port and a built-in LiPo charger!

No wonder the Raspberry Pi Zero W for $10 came out after the CHIP hit the market. The main differences between the CHIP and the Raspberry Pi Zero W are the following:

  • Display output: the CHIP has a composite output while the PI Zero has and HDMI output.  You can purchase an add on VGA or HDMI interfaces for the CHIP.
  • Storage: the CHIP has built-in 4GB of High-speed Storage while you will need to purchase a micro SD card for any Raspberry Pi . You cannot upgrade the built-in storage on the CHIP.
  • GPIO: the CHIP has two 40 pin GPIO interfaces versus one for any Raspberry Pi.
  • The CHIP has a built-in LiPo battery charger and you can monitor it through Linux or Python. The Raspberry Pi does not. You can purchase add-on LiPo chargers for the Pi, but none of them offer monitoring features yet.
  • The CHIP has a built-in serial interface through the micro USB port. You will need to use a FTDI serial interface and cable for any Raspberry Pi .
A comparison between CHIP and the Raspberry Pi Zero W


Maybe I am coming across as bashing the Raspberry Pi, but I’m not: I am just pointing out the differences. So you know, I have 4 CHIP boards and 7 different Raspberry Pis. I do like the Raspberry Pi. Both have their strength and weakness. I like to use the CHIP in headless projects like a rover, while the Raspberry Pi  are best suited for multimedia tasks. Chose the best one for your project.

Of course being the new kid on the block, the CHIP only has a fraction of the support and resources available to the Raspberry Pi,  but hey, I like to tinker, and after all, how bad could it be if it runs Linux?

I have been playing with the CHIP on and off for a year now; one of them is dedicated to a remote control rover, however, my sporadic approach to my projects makes it challenging to remember what I did and sometimes why. This is the reason I decided to start documenting my work and share it as well via this Blog.

The CHIP is made by a company named Next Thing Co. and they offer a few different products on their website. The $9 CHIP is getting an upgraded CPU at this time so you cannot order one until the upgraded model will become available. They also offer a CHIP Pro which is much smaller and sells for $16, I might give a couple a try soon. I did place an order for their new Voder which I should receive next year, can’t wait to put it in my wife’s Fiat 500…

Now you are probably wondering how did I set one up after unboxing it? Look for that on my next post coming soon…

FYI, their documentation page is good and they have an active forum as well so you can get information quite easy.

Ciao for now.










My simple Virtual Window using a Raspberry PI

My simple Virtual Window using a Raspberry PI

I was the recipient of a couple of 21″ 1080p LCD monitors that were slated for the recycle bin at work. These were originally used for display in the hallway showing looped videos about the company. They had some kind of proprietary multimedia board inside with an SD card slot to store the media. After a few years of being on 24 hours a day they became unreliable and they decided to get rid of them. I took a couple as I liked the custom frame that made them look like a picture instead of a TV or monitor. They sat in my office for a few months before I could find some time to play with them. The multimedia board was just plain, it could loop through pictures or videos but were not stable anymore even with new SD cards installed. I had a Raspberry PI 3 in my tool box  and proceeded to connect it to see how well it worked.  I was pleasantly surprised with the quality of the picture so I replaced the proprietary multimedia board with the Raspberry PI 3 using Velcro strips, the image below shows what the inner parts look like right now.

IMG_20171010_130557 (1)

The monitor has a USB port on one side, I connected it to the PI to allow us to upload new videos through USB sticks. We also have a wireless keyboard connected to one of the PI’s USB ports. I disconnected the speakers as we don’t want any sounds from the videos leaking through by accident, we play our own music in the office.

I found it easier to run a separate power supply for the Raspberry PI rather than converting the existing 12V adapter that was used for the proprietary multimedia board. But, hey, this is Version 1.0 so there is room for improvements down the road.

So what do I do with this now? Watching movies or playing video games at work is frowned upon. Then I remembered I saw a virtual window called Winscape that was kind of cool, it has tracking via a Kinect™ sensor for proper perspective presentation, although it only works with one person in the room. I didn’t want anything that sophisticated, my office is a medium room for 3 employees but it is busy with people coming in and out constantly; my thought is that the Kinect™ sensor perspective would be more of a distraction and would freak out multiple people in the office because it can track only one person.

Decided to do something more simple. At first I played live streams of the ISS full screen, it was kind of cool, some people would comment how they don’t have a window in their office and we have one that looked into space!

That worked fine for some time, until one day I couldn’t get a steady connection anymore, found out it was due to some changes made to our WiFi guest network in my building. Tried moving the unit but no luck, it kept dropping connections sporadically. Unfortunately I do not manage the network at my work so I couldn’t choose a different WiFi channel which, in my experience, fixes 90% of issues like this one. Also a LAN connection is out of the question because it is a secure network so the guest Wifi is the only option we have for non company issued equipment. I could get around all this but it is not worth the reprimand nor my job.

So, now I have this nice virtual window that can’t connect to the internet, just sad really. For this reason I decided to enable the screensaver, at least it did something, rolling through the nice pictures of the built in screen saver.

One day I stumbled upon TranquilGeo, a YouTube channel that has relaxing videos; because I can’t get a stable connection anymore, this time I ask myself: “how could I get these videos to play on the ‘Wall-pi’ ?”. Could I download them without breaking any hearts or laws? Well there are many ways you can download YouTube videos and that’s all I will say on the matter.

My buddy Dale who is a photographer, was wondering why I asked him to record several videos of water streams on our last camping trip at Barron Canyon, a very beautiful place by the way.

So now that I have a collection of videos, how do I loop them on the Raspberry PI?

An important note is that on a Raspberry PI you have to use omxplayer for videos as it specifically made for the Raspberry Pi’s GPU. VLC and other players might work for audio only, but they do not work for video.

That meant that I had to create some kind of script as omxplayer is command line based; I didn’t want to edit this script every time I added a new video to the folder, so after googling a bit, I found one that did somewhat similar, I just modified it for my need. I modified it to play any mp4 files in that folder and waits 2 seconds before playing the next one. Once it finishes going through all the files in the folder, it calls itself again to start over. I named the script window.sh:

!# /bin/bash

for file in *.mp4
# do something on “$file”
omxplayer “$file”
sleep 2


Why the 2 second delay? Because I want to be able to stop the script; without the delay it just skips to the next video. This gives me enough time to do two <CTRL><C> in a row if I want to stop it.

If we want to skip to the next video all we need to do is press <CTRL><C> once.

One thing I had to do is upgrade the micro-SD card from 8GB to 64GB. The 8GB worked fine when we had a steady WiFi connection, but as we loaded high def videos we ran out of space really fast, we are up to 24GB now…

So there you have it, a recycled monitor that became a morale booster in a windowless office. It must be working because I am getting request for specific videos like Moraine Lake in Banff.

The beauty of this setup is its simplicity. Just add any videos through the USB port on the side of the screen and it will play it the next time the script restarts. We have over 35 videos since this post, each varies in length from 5 minutes to two hours, so the chance of seeing the same video during the work day are small, unless it is one of the two hours long ones, and if we want to skip it, we just press <CTRL><C> on our wireless keyboard.

We are now considering other themes, like aquariums or recorded stream from the ISS to add to the playlist.

I will try to take a steady video of it in action, until then the picture below is what it looks like mounted on our wall. This is one of the videos in our playlist just to give you an idea (with no sound in our case).




  • Raspberry PI 3 (PI 2 might be good enough for this also)
  • 64GB micro SD card
  • 5V, 2A, power supply for Raspberry PI with micro USB connector
  • HDMI cable
  • LCD monitor with HDMI input
  • Wireless Keyboard

How to make a Linux Sudo user without a password

How to make a Linux Sudo user without a password

I enjoy using Linux because I am a tinkerer by nature, however the extra security that comes with it can be rather cumbersome at times, especially when running scripts.

One of the peeve I have is being asked for admin password whenever I make changes or run custom scripts, and I do a lot of both.

Before proceeding, this is the only warning I will give you:

This is a dangerous practice as you may inadvertently delete or change system files. After all, this is one of the features that makes Linux safer. I have done it. Let me tell you it’s no fun reinstalling from scratch. One thing I have learned from making this mistake is to make backups of all your important stuff and the best way to approach this is to ask yourself: “If I lost my Linux computer today, what would I miss the most?” Back that shit up!

Well, that goes with any computer system actually. 

Remember this quote: “Jesus saves but everyone else has to do backups.

So, now that you have been warned, here is how to create a Linux user without being asked for a Sudo password. We simply need to edit one file, it is located here: /etc/sudoers.  Before you get carried away and open it with your preferred text editor, there is a special tool to do this, it’s called ‘visudo‘, so you just type:

sudo visudo

After you enter your Sudo password for the last time, all you need to do is scroll to the end of the file and enter the following text:

# Uncomment to allow members of group sudo to not need a password

Again, this may not be the most safe or secure way of doing things, but if you are OK with the risks, all you have to do is reboot and voilà! No more password to enter when running scheduled software updates scripts!