• 1
    Step 1

    Installing Required Packages

    We will need to have support for git, Python, and the Onion OLED Expansion Python Module.

    opkg update
    opkg install git git-http python-light python-codecs pyOledExp
  • 2
    Step 2

    Downloading the Code

    Now we need to download the Python code that actually does all the work:

    cd /root
    git clone https://github.com/OnionIoT/oledQrCodeGenerator.git
  • 3
    Step 3

    Running the Code

    Now we have to make some QR codes! Navigate into the repo directory:

    <span class="hljs-built_in">cd</span> oledQrCodeGenerator

    And run the program, the argument to the script is the text that will be encoded in the QR code pattern:

    root<span class="hljs-variable">@Omega-18C2:</span>~/oledQrCodeGenerator# python main.py <span class="hljs-string">&apos;Wow, my first QR Code&apos;</span>
    > Encoding <span class="hljs-number">21</span> characters<br>> Generated QR <span class="hljs-attribute">Code</span>: <span class="hljs-number">31</span>x31 pixels
    > Doubled QR Code <span class="hljs-attribute">size</span>: <span class="hljs-number">62</span>x62
    > Initializing display
    > Setting display mode to inverted
    > Writing buffer data to display

    This will encode the data and display the resulting QR code on the OLED Expansion: