Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

License Supported Python versions Development Status https://travis-ci.org/infincia/pyairview.svg?branch=master

PyAirview is a library for the Ubiquiti Airview2 2.4GHz spectrum analyzer, which has an undocumented device API.

PyAirview allows the Airview device to be used by 3rd party applications rather than only with the original Java application.

The library works pretty well for the intended purpose :)

Once I have the basics written and documented I may port it to C for use in other languages and so that there is a common low level library available, but it’s simple enough that even a high level port to Ruby or C# would probably take no more than a day.

Device API documentation

See the DEVICE_API.md file included in this repository

Usage

from __future__ import print_function
from time import sleep

import pyairview

# open the proper serial port
pyairview.connect(port="/dev/ttyACM0")

# retrieve device-specific information like RF frequency range and channel size
device_info = pyairview.get_device_info()
print('Device info: %s', device_info)

"""
    start RSSI scanning in a background thread. callback should take a parameter
    named 'rssi_list', which will be a list of rssi values. Use information
    obtained in device_info to interpret the RSSI values and pair them with
    exact frequencies.

"""
def scan_callback(rssi_list):
    print('Received %d RSSI level readings: %s', len(rssi_list), rssi_list)

pyairview.start_scan(callback=scan_callback)

some_condition = False
while pyairview.is_scanning():
    sleep(0.1) # or do something else, change some_condition, etc
    if some_condition == True:
        pyairview.stop_scan()

Airview2 hardware

The Airview2 devices were very cheap ($29-39) and originally came with a Java app for visualizing usage of that frequency band, for Wi-Fi network planning, discovering rogue hotspots, diagnosing Bluetooth issues, etc.

Inside, the device is basically just a simple microcontroller (A CC2011) with an integrated 2.4GHz radio and a USB interface. It uses the standard USB CDC-ACM serial interface to connect to a PC.

The firmware running on the device is likely custom built by Ubiquiti Networks, I don’t possess a copy of it outside my own Airview2 device, even in dumped binary form, so I don’t know much about it but it seems to be a simple command/response loop coupled with a function to use the native RSSI power level scanning provided by the chip.

Library development and reverse engineering

This library was created after hours and hours of manual testing with gtkterm and screen, guessing the proper commands to use the device API. None of the information used to create this library came from decompiling the device firmware or the original Java application.

DO NOT create github issues containing, or send me the following things:

  • Dumped firmware from the device

  • Decompiled firmware or code derived from it

  • Decompiled versions of the original software or code derived from it

  • API related code of any kind (aside from documented ‘clean room’ efforts)

  • Etc.

I have not seen those things, and I do not want to see them as it would prevent me from being able to write code for this library anymore.

I’m not even sure how to go about using clean room documentation properly, if someone were to provide it to me, so while it would probably help and I would appreciate the help of course, please don’t post or send documentation either without discussing it with me first.

If you want to help, feel free to review the code for flaws, or open a terminal connected to your Airview device and guess some commands as I have done :)

Changelog

Release 0.1a2

  • Single-file Python 2.7 and 3.2+ compatibility

Release 0.1a1

  • Rename libairview module to pyairview to match project name (same for test app)

  • Automatic testing with Travis-CI. Just tests importing the pyairview module for now, but that is enough to discover certain simple bugs. Code to simulate a serial connection to an actual Airview device will be added soon, which is necessary in order to actually test anything in the library itself

  • Make start_scan() command non-blocking, caller is expected to handle managing the library as part of a runloop etc.

  • Add disconnect() command to close the serial port if needed

  • Allow calling code to safely start and stop scanning whenever needed

  • Handle situations where partial responses are left in the serial buffer

  • Add support for newly discovered ‘es’ command to instruct Airview to end the current scan

  • Add automatic parsing of device info from ‘gdi’ command, each element is put into a dictionary with public module constants provided for each key

Release 0.1a0

  • Support for Python 2.7 only for now, 3.2+ is being worked on

  • Initial alpha release

Release files for pyairview 0.1a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyairview 0.1a2
File Size Uploaded
pyairview-0.1a2.tar.gz 12.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyairview 0.1a2
File Interpreter ABI Platform
pyairview-0.1a2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 25.5 kB

Release files / pyairview-0.1a2.tar.gz

Download URL pyairview-0.1a2.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e99f3a6de101b8a4bd421d19fd9bd0348b6ea546b3ace72a1b1db43e8790fde7
BLAKE2b-256 checksum
How to use checksums
49f6ddff7dc2ab1496b873bd6d2358bb6e8d7b7eb929abbf2332f1fc9d94914d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pyairview-0.1a2-py2.py3-none-any.whl

Download URL pyairview-0.1a2-py2.py3-none-any.whl
Size 12.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
50467c196449a8e97131ceb23bad50a3a1c13fcd8fe6004ccfdc08b4998df390
BLAKE2b-256 checksum
How to use checksums
ce591f96d9469415c4b55272acc43831f89ec2dbfc6e5e024d4594ce6c227ca2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1a2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page