zabumba
zabumba

Reputation: 12422

How can I get the list of surrounding wireless accessing points using node.js?

Environment

Goal

I'd like to be able to get the list of APs available / network names (SSIDs)

I may want to select a specific SSID.

My ultimate goal is to be able to check on wifi signal strength and quality in order to force re-association to another AP before it loses completely connectivity.

How do create a loop that retrieves and updates the list of surrounding APs using node.js?

Would node.js a good choice to accomplish this?

How do I get information from an AP i.e. signal strength and quality?

Upvotes: 5

Views: 7884

Answers (1)

Ricardo Stuven
Ricardo Stuven

Reputation: 4814

You can use the wireless-tools package.

Usage:

var iwlist = require('wireless-tools/iwlist');

iwlist.scan('wlan0', function(err, networks) {
  console.log(networks);
});

// => 
[
  {
    address: '00:0b:81:ab:14:22',
    ssid: 'BlueberryPi',
    mode: 'master',
    frequency: 2.437,
    channel: 6,
    security: 'wpa',
    quality: 48,
    signal: 87
  },
  // ...

Upvotes: 4

Related Questions