The $4 Raspberry Pi Pico, and its $6 Wi-Fi enabled sibling the Raspberry Pi Pico W have confirmed to be a superb basis for excellent tasks and this QR code show undertaking from Predrag Mijatovic is impressed. The straightforward purpose of the undertaking is to show a QR code that permits a tool to connect with Wi-Fi.
Mijatovic’s undertaking “qr_wifi” shows a QR code to allow company to connect with a visitor Wi-Fi community. The QR code shops the SSID, safety (WEP/WPA) and password particulars for the community connection. All of the person has to do is scan the code with their system’s digital camera and their system will join.
What pursuits us essentially the most is the strategy taken which sees a Raspberry Pi Pico accent, particularly Waveshare’s Pico OLED 1.3 inch (64 x 128 pixels) display show the QR code. All the code for the undertaking is written in MicroPython and within the video we are able to see Mijatovic generate the QR code utilizing qrencode, a helpful terminal command to generate QR codes from knowledge. The QR code is written to a textual content file as ASCII textual content.
The returned QR code is 50 columns large and 25 rows tall, so Mijatovic cleverly makes use of sed and common expressions to duplicate the rows to make the whole lot sq.. That is important as QR codes include error checking, and an incorrectly sized code will forestall customers connecting to Wi-Fi. Somewhat extra common expression magic and the QR code is prepared for the ultimate MicroPython script.
Dropping the QR code into the MicroPython code (strains 160 and 161) of important.py will see the code run each time the Pico is powered up.
This superior undertaking is a credit score to Mijatovic and it could be nice to see it utilized to different boards. For instance each Pimoroni’s Badger 2040 and Tufty 2040 can be glorious gadgets to breed this undertaking.
For extra particulars qr_wifi go to Mijatovic’s GitHub repository.