Open scotstan opened 3 years ago
There are other projects that have tried to do this for linux: https://github.com/kokoye2007/wifi-qr for example. This site has more of a description of what's involved in the process: https://qifi.org/
Got the code working after installing a few libraries:
sudo apt-get install libzbar0
pip3 install --user pyzbar imutils
And with this snippet:
from imutils.video import VideoStream
from pyzbar import pyzbar
import imutils
import time
import cv2
vs = VideoStream(usePiCamera=True).start() # For Pi Camera
time.sleep(0.25)
while True:
frame = vs.read()
frame = imutils.resize(frame, width=400)
barcodes = pyzbar.decode(frame)
for barcode in barcodes:
print("found one")
(x, y, w, h) = barcode.rect
cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 0, 255), 2)
barcodeData = barcode.data.decode("utf-8")
barcodeType = barcode.type
text = "{} ({})".format(barcodeData, barcodeType)
print(text)
vs.stop()
Data would go in /etc/wpa_supplicant/wpa_supplicant.conf
If you don't have an ethernet cable and you don't have an HDMI monitor + keyboard, there's no way to configure Moab (easily) to put it on your wifi network.
An idea came up where one could "show" Moab's camera a QR code with wifi details.