npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mt7688-wiscan

v0.8.3

Published

A wifi access points scanning tool for MediaTek Linkit Smart 7688

Downloads

14

Readme

mt7688-wiscan

Table of Contents

  1. Overiew
  2. Installation
  3. Usage

1. Overview

mt7688-wiscan is a wifi access points scanning tool which is running with node.js on MediaTek Linkit Smart 7688. This tool provides three APIs lqi(), scan(), and scanByEssid() that help you with getting link quality indicator (LQI) to an specific AP, scanning neighbor wifi APs, and scanning a specific AP with its essid.

I am using this tool on machine nodes in my LWM2M IoT project. On each machine, there is a panel to show some information about the machine and to show LQI between machine and its router as well.

2. Installation

$ npm install mt7688-wiscan --save

3. Usage

Require the module

var wiscan = require('mt7688-wiscan');

.lqi([intf,] essid, callback)

Query the LQI (link quality indicator) between your Linkit Smart 7688(in station mode) and its router(AP).

Arguments:

  1. intf (String, optional): A default value of 'ra0' will be used if not given.
  2. essid (String): The ESSID of the AP to scan for.
  3. callback (Function): function(err, result) { ... }. The result is a number between 0 and 100 to indicate the relative link quality between the station and access point. The value is bigger to show better link quality. If given 'essid' is not found after scan, result will be null.

[Note]

  • It takes around 5 seconds to accomplish a single scan.
  • If you've changed the name of radio interface with OpenWrt configuration tool, you should give this method with the correct interface name, for example, 'myradio'.
  • You can also try this tool on other platforms, but be aware of that the radio interface name is subject to platforms. Use iwconfig command at console to get some hints.

Returns:

  • none

Examples:

// scan with deafult radio interface, just give it an essid to scan for
wiscan.lqi('my_office_ap', function (err, result) {
  if (err) console.log(err); // null
  else console.log(result); // 78
});

// if an AP with given essid is not around (result is nothing after scan)
wiscan.lqi('ap_not_found', function (err, result) {
  if (err) console.log(err); // null
  else console.log(result); // null
});

// scan with the given radio interface and essid
wiscan.lqi('ra0', 'my_office_ap', function (err, result) {
  if (err) console.log(err); // null
  else console.log(result); // 82
});

// scan with the given radio interface, e.g. 'bad_ra', that doesn't exist
wiscan.lqi('bad_ra', 'my_office_ap', function (err, result) {
  if (err) console.log(err); // [Error: No such wireless device: bad_ra]
});

.scan([intf,] callback)

Scan neighbor wifi access points.

Arguments:

  1. intf (String, optional): A default value of 'ra0' will be used if not given.
  2. callback (Function): function(err, result) { ... }. The result is an array of scanned report objects. Each report object has the following format:
{
    address: 'D8:FE:E3:E5:9F:3B',    // String. MAC address of the found AP
    essid: 'sivann',                 // String
    mode: 'Master',                  // String
    channel: 1,                      // Number
    frequency: '2.412 GHz',          // Number
    signal: -256,                    // Number. It seems MTK's driver does not report this value. Don't use it.
    quality: 78,                     // Number. Valued from 0 ~ 100, bigger is better.
    encryption: 'WPA2 PSK (AES-OCB)' // String
}

Returns:

  • none

Examples:

// scan with deafult radio interface
wiscan.scan(function (err, result) {
  console.log(result);

  // [
  //     { address: 'D8:FE:E3:E5:9F:3B',  essid: 'sivann', ...   },
  //     { address: '20:0C:C8:01:1D:98',  essid: 'delta_01', ... },
  //     { address: '9C:D6:43:01:7E:C7',  essid: 'AVIS', ...     },
  //     ...
  // ]
});

// scan with given radio interface
wiscan.scan('ra0', function (err, result) {
  console.log(result);
});

// given radio interface is not valid
wiscan.scan('foo', function (err, result) {
  console.log(err); // [Error: No such wireless device: foo]
});

.scanByEssid([intf,] essid, callback)

Scan for a specific AP with its essid.

Arguments:

  1. intf (String, optional): A default value of 'ra0' will be used if not given.
  2. essid (String): The ESSID of the AP to scan for.
  3. callback (Function): function(err, result) { ... }. The result is a report object, otherwise null if not found.

Returns:

  • none

Examples:

wiscan.scanByEssid('sivann', function (err, result) {
  console.log(result);

  // {
  //     address: 'D8:FE:E3:E5:9F:3B',
  //     essid: 'sivann',
  //     mode: 'Master',
  //     channel: 1,
  //     frequency: '2.412 GHz',
  //     signal: -256,
  //     quality: 68,
  //     encryption: 'WPA2 PSK (AES-OCB)' // String
  // }
});

// AP not found
wiscan.scanByEssid('no_such_ap', function (err, result) {
  console.log(result); // null
});

License

MIT