3D Printed WIFI QR Codes
Sometimes you just want to 3D print a QR code without stuffing round with Fusion 360 or whatever. This is useful because a paper QR code stuck to the wall with blu tack will eventually soak up the oil and become un-scannable, so its just as well to do things properly.
In my case, I want to 3D print a WIFI QR code, mostly from the commandline on linux.
Step 1 - Generate QR code for WIFI
If you want a scan-to-join WIFI code, there is a special payload to use for your QR code, replce THESSID and THEPASSWORD for your own network:
WIFI:T:WPA2;S:THESSID;P:THEPASSWORD;;
Now generate your QR code as an SVG:
# apt install qrencode
qrencode -t SVG -o guest_wifi.svg "WIFI:T:WPA2;S:THESSID;P:THEPASSWORD;;"
Step 2 - Make it look pretty
Open inkscape, import the QR code SVG, add boxes and text to your hearts content, then export as a new SVG file.
Step 3 - Convert SVG to STL
I found a handy tool svg2stl to convert the pretty SVG from inkscape to an STL file, like this:
./svg2stl-linux --thickness 1.0 --pixel_size 0.025 ../guest_wifi_badge.svg
It worked perfectly for me, first time!
Step 4 - Slice it
The STL file generated above is just the black parts of the SVG. It needs to go on a base to print nicely. There’s probably an easier way to do this but the steps I needed in the Prusaslicer were:
- Import the STL
- Right click, add part, box
- Scale and translate box to cover the QR code badge
- Position the QR code above the box
- Add a layer change and assign black colour
- Make sure to print it big so the lines are clear - mine was about 12cm x 15cm
- Check the slicing result with the layer slider to check everything looks good
Don’t forget to test-scan your code from the slicer app with your phone before printing.
Update: after printing, removing the QR code from the base caused all the bits of QR code to turn into projectiles and fly across the room, making a horrendous mess - make sure to not mix plastics and/or making the base thicker to reduce flexing 😂