Friday, April 17, 2026

Using a VPN with Raspberry Pi

For an index to all my stories click this text.

In a previous story I explained what a VPN is and how to install that service when your computer runs Kubuntu (Linux)

This story explains what a VPN is and how to install it on Your Raspberry Pi.
The VPN I am going to discuss here is a different one from the previous story. However this one runs on Raspberry Pi as well on a PC with Kubuntu.

What is a VPN

For those that have no idea what a VPN is and why you could use one I'll give a brief explanation.

Normally when you visit a website with your browser you have a direct connection to that website.

A VPN is a bridge in between. So you send the request for the website to the server of the VPN provider. The connection between your browser and the VPN server is encrypted and their server is a secure server. The VPN then contacts the website, gets the information and sends it encrypted back to you.
That way you do not have direct contact with the website you want to visit. This keeps you safe in countries where free speech is at stake. But it also makes it impossible for the website you are visiting to track you down.

Another advantage is that you can access sites that are geo-restricted. This means that the website you are contacting believes that you are in a different country then where you really are.
For a long time this was popular by people in Europe that wanted to watch certain US restricted TV-shows. Without a VPN the US media server saw that you were in Europe and blocked viewing. If you contacted these media through a VPN you could trick them in thinking you were in the US.

A VPN is secure for both UDP and TCP communication. Therefore you can also mask your IOT communication this way.

Free or paid VPN's

There are free and paid VPN services.
The restriction of a free VPN service is that you have less VPN servers to chose from, the service might not always be available and it may be slower.

I have been using the free VPN service from RiseUp for a while, on my Raspberry, and they were always available and I did not notice any significant speed limitations. RiseUp has no paid services and runs on donations. So if you need to use their serices on a frequent base consider making a donation. That can be done at their webpage: 

https://riseup.net/en/vpn

RiseUp has a no-log policy. That means that they do not keep a log of your activities. That is an extra safety measure that makes sure that no one can see what sites or services you have been using.

Next to the VPN service they also supply a safe email service, and an email-list service.

Install RiseUp VPN

To use a VPN you'll need to install a small software package. This package intercepts all your network communication and sends it to the VPN server.

Installing the RiseUp VPN software on your Raspberry is easy.


Just open Discover from your Application Launcher and search for VPN.

This may look awkward to (maybe) most of you. But I am using the KDE desktop on my Raspberry Pi with Trixie as it is far more convenient then the Raspberry Desktop. And it is fully compatible. 

I really urge you to install the KDE desktop on your Raspberry PI as it is so much better as the Raspberry standard desktop. Installing is easy. You can read my story where I explain the installation here: 
https://lucstechblog.blogspot.com/2025/10/raspberry-trixie-with-kde-plasma.html


Click Install and you're done.
No need to make an account or fill in your email address. Just click and install.

Using the RiseUp VPN


After downloading and installing RiseUp VPN you will find the software in the internet section of the Application Launcher.


Starting the program opens a window that immediately shows that it already has made a secured connection.
The bottom of the window shows to what server you are connected. In this example you can see I was connected to a server in Amsterdam.


If you click on that connection name you'll get a list of available servers. You can chose another server from the list if that makes you more comfortable.

Next to the server there is a small graph that shows if the server is available. A green graph (like in this example) shows that the server is available.

Click on the server of your choice. Then click on the left arrow at the top of the screen. This brings you back to the start-screen.


Click on the Turn ON button ad a new connection is made.
Be aware that switching from VPN server to another server might take some time.


After a short while you will see that the new connection has been made.

That is all.

You can now open your browser and visit any website you want without anybody being able to trace your internet tracks.

Connection status.


At the bottom of your desktop on the right side there are some icons. Like said before: this is the Raspberry Pi running the KDE desktop.
This example shows a small green shield which means that your VPN connection is up and running.

This shield can have several colours.


Well this explains all.

Does it work.

Here is a quick and simple test to see if the VPN works.

Start with disconnecting the VPN server in the RiseUp VPN software by simply pressing the Turn Off button.
Then open your internet browser and visit the following site:

https://www.whatsmyip.org/


The website shows your normal IP address.

Now activate the RiseUp server and choose any server anywhere in the world to your liking. Then again visit https://www.whatsmyip.org/


And look at that: a totally different IP address.

And here is a different prove.


If you open your web browser and visit the Google search or Youtube or whatever Google service, you are greeted in a different language. Here I was greeted in French. Meaning that Google thinks my location is somewhere in France !!

Extra safety

Those of you who have worked with a TOR browser know that a TOR browser connects to a TOR server, that connects to another TOR server and that again connects to yet another TOR server. And that last server connects to the website you wanted to have a look at. For safety all these connections are encrypted.

This way you can not easily be traced.

For extra safety you can use your TOR browser with the VPN.

Just make sure to start the VPN connection first and then start your TOR browser. That way your TOR browser connects to a TOR server through your VPN connection which gives you an encrypted communication line upon an encrypted line. So a double encrypted and untraceable connection.

So if you, for example, want to see a tv show or series that is only available for US citizens within the US connect to a VPN server in the US. And if you connect through a TOR browser make sure the last server in the range is also a US TOR server.

Safe surfing
till next time
have fun


Luc Volders

Friday, April 10, 2026

To MIP or not to MIP : installing libraries in MicroPython

For an index to all my stories click this text.

The world changes, and so does the MicroPython language.
In the latest versions of MicroPython a new method to install libraries was introduced : MIP And it is supposed to make life less complicated.

How I use(d) to install libraries.

When I need a display in a MicroPython project I often use a TM1637 quad 7 segment display. To be able to use this display you'll need a library.

THE place to find libraries for MicroPython is Mike Causers repo at Github:
https://github.com/mcauser/awesome-micropython


Scrolling through this huge list of libraries the TM1637 library is in the LED Segment section (about half way down the page).

Clicking micropython-tm1637 brings you to the github page that contains the driver.


At that page I click on the drivers entry being tm1637.py


This is the MicroPython driver for the TM1637. As you can see it is actually just a MicroPython program.


I copy the complete code and paste it into Thonny.


Then I save this in the lib folder using the exact name the library has. In this case tm1637.py


And there it is, in the Pico's memory, in the lib folder, ready to use.

Using MIP

Now let's see how the new method works. MIP is supposed to make this all less complicated. Well let's have a look.

First step is to know where the library is located.
So we need to look at the same library list mentioned above.
Then we need to scroll downwards to the LED Segment section.
Like above described we need to click on the drivers entry in the list.
And then click on the actual driver.

So until now everything is the same.
But we now have the exact URL where the driver is located:
https://github.com/mcauser/micropython-tm1637/tm1637.py

We can use that with MIP.
MIP knows Github so we can leave https://github.com/ out and just use github: like this:

mip.install("github:mcauser/micropython-tm1637/tm1637.py")

But first we need to install MIP.


So these are the lines that are needed:

import mip

mip.install("github:mcauser/micropython-tm1637/tm1637.py")



And this is the output I got.
It did not work.

Of course it did not work !!!  MIP gets the driver from the internet, so you have to activate Wifi first.........

import network
import time

ssid = "Ziggo2903181"
pw = "ptzbB2ohKbgs7agp"

print("Connecting to wifi...")

# wifi connection
wifi = network.WLAN(network.STA_IF)
wifi.active(True)
wifi.connect(ssid, pw)
print('Waiting for connection.',end="")
while wifi.isconnected() == False:
    time.sleep(1)
    print('', end='.')
print("")

ip = wifi.ifconfig()[0]

print("Connected with IP adress : "+ip)

import mip

mip.install("github:mcauser/micropython-tm1637/tm1637.py")



And now it works.


The library is automatically downloaded and placed in the /lib folder.

Conclusion:

Actually it is a lot of hassle.
The first steps are the same as in my original method. Then you have to make sure you got the URL right and then write a small program in MicroPython that activates the Wifi.
To be frank: by that time I have already copied and pasted and saved the library by hand.

Mip comes from the land of Python. And Python runs mostly on desktop computers and notebooks. These machines have an internet connection standard activated and then it is a lot less hassle.
On our microcontrollers Wifi is not standard activated.

Looking at the start of this story:
The world changes and MicroPython changes to.
But not all changes are for the better. Luckily the old method still works.

Till next time
have fun

Luc Volders

Friday, April 3, 2026

Trolling google with a Pico

For an index to all my stories click this text.

In some previous stories on this weblog I showed how the Raspberry Pi Pico could produce audio. And not just plain audio but really decent audio.

And then when I was goofing around I had this weird idea.
How about the Raspberry Pi Pico activating my Google Home mini..........

If you want to try this and Troll your own Google you need the following setup:

- A raspberry Pi Pico with audio like described in this story:
https://lucstechblog.blogspot.com/2024/10/pico-audio-part-3.html
- A small active speaker (like a computer speaker)
- Preferably an SD card attached to the Raspberry Pi Pico like this story showed:
https://lucstechblog.blogspot.com/2025/01/pico-sdcard-part-1-hardware.html
And this story for the software:
https://lucstechblog.blogspot.com/2025/01/pico-sd-card-part-2-software.html

Next to that you will need the Audacity software to record your own voice saying ok google ...... and converting it into an 8K wav file. Audacity is free and available on Linux and Windows. I wrote a story on how to use audacity especially for this purpose which you can read here:
https://lucstechblog.blogspot.com/2024/10/audacity-pico-audio-part-1.html

The breadboard setup

I used my audio setup from the previous stories. This includes 3 buttons and an SD-card.



For the example presented here you only need the two buttons attached to GP18 and GP19. And you do not need the oled screen.
You could even do without the SD-card as both files together take less than 200k. However working with an SD card is so easy and convenient that I highly recommend it for many projects, but certainly for audio projects.

For all the details on this setup read this story:
https://lucstechblog.blogspot.com/2025/02/raspberry-pi-pico-audio-player.html

Record the "Ok-Google" sentence.

First thing you need to do is to record some sentences that you want your Google Home (or nest) to react on. I used Audacity to record two sentences and convert them to an 8K WAV file. The sentences I used are:

- OK Google, is it going to rain in Amsterdam today
- OK Google, what is the time.

Make sure you pause for a second or so after OK Google and before speaking the rest. Your Google home needs some time to wake up.

If you are not sure how to record the sentences and convert them to an 8K wav file please read this story:
https://lucstechblog.blogspot.com/2024/10/audacity-pico-audio-part-1.html

Transfer the recorded sentences to the SD card.

Next step is of course to transfer the recorded sentences to your SD card. You can do that physically by attaching the SD card to your computer with an SD-card reader.
Another option is to use Thonny to transfer the recorded sounds to the SD=card if that is still attached to your Pico.

I put the sounds in "/sd/Sounds2" and named them okgoogletime.wav and okgooglerain.wav.
You can of course put these in any directory you want and name them as you like. Just make sure to adjust the upocoming program to your own settings.

The program

The program is easy to follow. It just constantly tests whether one of the buttons is pressed and if so it speaks out the recorded sentences.

import os
from machine import SPI, Pin
import sdcard

spi = SPI(1,sck=Pin(14), mosi=Pin(15), miso=Pin(12))
cs = Pin(13)
sd = sdcard.SDCard(spi, cs)

os.mount(sd, '/sd')

but01=machine.Pin(18, machine.Pin.IN)
but02=machine.Pin(19, machine.Pin.IN)

from wavePlayer import wavePlayer
import time

player = wavePlayer()

while True:
    if (but01.value()==0) :
        player.play('sd/Sounds2/okgooglerain.wav')
          
    if (but02.value()==0) :
        player.play('sd/Sounds2/okgoogletime.wav')

        
That is all. The program is based on my previous stories about playing audio and attaching an SD-card to the Pico. In these stories you will also find the links to the required libraries.

That's all.

Now just press one of the buttons and hear your voice speaking the sentences. And then just wait a moment and your Google Home will react.

The video that demonstrates it



The only thing now to do is to find a practical purpose for this. But for now it is fun to troll your google assistant a bit.

Till next time
have fun

Luc Volders