Tisham Dhar
Published © CC BY

UDOO Neo Wifi Scanner

Check wifi signal strength and available networks using external antenna on UDOO Neo.

IntermediateWork in progress1 hour1,462
UDOO Neo Wifi Scanner

Things used in this project

Hardware components

Adafruit SSD1306 OLED
×1
Wifi Antenna 9dBi
×1
Wifi Antenna 7dBi
×1
Wifi Antenna 5dBi
×1
UDOO NEO
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

UDOO Neo with OLED display shield

This shows the jumper wires required to allow access to the i2c bus
Img 20160225 001221

Code

Python wifi scanner with OLED display for UDOO NEO

Python
Install dependency libraries and launch from rc.local on reboot to keep scanning
#!/usr/bin/env python

# Ported from:
# https://github.com/adafruit/Adafruit_Python_SSD1306/blob/master/examples/shapes.py
# Also includes wifi scanning

from oled.device import ssd1306, sh1106
from oled.render import canvas
from PIL import ImageFont
import commands
import re

font = ImageFont.load_default()
device = ssd1306(port=1, address=0x3C)


if __name__=="__main__":
    scan_result = commands.getoutput("sudo /sbin/iw dev wlan0 scan")
    ssids = [x.group(0)[6:] for x in re.finditer("SSID:.*\n",scan_result)]
    signals = [x.group(0).lstrip("signal: ").rstrip(" dBm\n") for x in re.finditer("signal:.*\n",scan_result)]
    print ssids,signals
    with canvas(device) as draw:
        # Load default font.
        font = ImageFont.load_default()

        # Alternatively load a TTF font.
        # Some other nice fonts to try: http://www.dafont.com/bitmap.php
        # font = ImageFont.truetype('Minecraftia.ttf', 8)

        # Write all SSID's in brief
        y = 0
        for ssid,signal in zip(ssids,signals):
            draw.text((0, y), ssid[:10],  font=font, fill=255)
            draw.text((84, y), signal, font=font, fill=255)
            y += 10

Credits

Tisham Dhar

Tisham Dhar

10 projects • 32 followers
I am an Electronics Engineer who mostly works with aerial and space based remote sensing projects. I fiddle with home automation and renewable energy projects.
Contact

Comments

Add projectSign up / Login