Raspberry Pi Pico Easily Connects Guests to Your Wi-Fi

Predrag Mijatovic's QR Wi-Fi projects
(Image credit: Predrag Mijatovic)

The $4 Raspberry Pi Pico, and its $6 Wi-Fi enabled sibling the Raspberry Pi Pico W have proven to be an excellent foundation for great projects and this QR code display project from Predrag Mijatovic is inspired. The simple aim of the project is to display a QR code that enables a device to connect to Wi-Fi. 

Mijatovic's project "qr_wifi" displays a QR code to enable guests to connect to a guest Wi-Fi network. The QR code stores the SSID, security (WEP/WPA) and password details for the network connection. All the user has to do is scan the code with their device's camera and their device will connect. 

What interests us the most is the approach taken which sees a Raspberry Pi Pico accessory, specifically Waveshare's Pico OLED 1.3 inch (64 x 128 pixels) screen display the QR code. All of the code for the project is written in MicroPython and in the video we can see Mijatovic generate the QR code using qrencode, a useful terminal command to generate QR codes from data. The QR code is written to a text file as ASCII text.

Predrag Mijatovic's QR Wi-Fi projects

(Image credit: Predrag Mijatovic)

The returned QR code is 50 columns wide and 25 rows tall, so Mijatovic cleverly uses sed and regular expressions to duplicate the rows to make everything square. This is essential as QR codes contain error checking, and an incorrectly sized code will prevent users connecting to Wi-Fi. A little more regular expression magic and the QR code is ready for the final MicroPython script.

Dropping the QR code into the MicroPython code (lines 160 and 161) of main.py will see the code run every time the Pico is powered up.

This awesome project is a credit to Mijatovic and it would be great to see it applied to other boards. For example both Pimoroni's Badger 2040 and Tufty 2040 would be excellent devices to reproduce this project.

For more details qr_wifi visit Mijatovic's GitHub repository.

Les Pounder

Les Pounder is an associate editor at Tom's Hardware. He is a creative technologist and for seven years has created projects to educate and inspire minds both young and old. He has worked with the Raspberry Pi Foundation to write and deliver their teacher training program "Picademy".

  • thisisaname
    Given the PR they are getting right now would you trust them to do it?
    Reply
  • DotNetMaster777
    QR code looks nice but is it secure ? ? ? ?
    Reply
  • Darkoverlordofdata
    I call B.S. on this - This article mentions a $6 Wi-Fi enabled sibling the Raspberry Pi Pico W. No mention is made of the cost of the remaining hardware - keyboard, lcd screen, I see a couple of docking containers. I bet the total price is over $100. I’ll let them connect s a guest on my existing router. It’s probably safer for both of us.
    Reply
  • bacon4bfast
    DotNetMaster777 said:
    QR code looks nice but is it secure ? ? ? ?
    The QR code is just storing the SSID and if you are using one the password. It's not something you want to paint on the side of your house.
    Reply
  • bacon4bfast
    The pi is just unneeded complexity. Just print it on a sheet of paper and hang it up... There are plenty of qr generators online. I 3D printed a QR code with my wifi credentials onto a coaster so new devices or friends just have to scan the coaster to get connected, works really well. I'm planning a second one that looks similar but will open the rickroll video on YouTube.
    Reply