Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Show a QR code to Moab to set wifi #12

Open
scotstan opened this issue Dec 11, 2020 · 4 comments
Open

Show a QR code to Moab to set wifi #12

scotstan opened this issue Dec 11, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@scotstan
Copy link
Contributor

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.

@scotstan scotstan added the enhancement New feature or request label Dec 11, 2020
@keenbrowne
Copy link

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/

@scotstan
Copy link
Contributor Author

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()

@scotstan
Copy link
Contributor Author

Data would go in /etc/wpa_supplicant/wpa_supplicant.conf

@scotstan
Copy link
Contributor Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants