Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Environment

  • Linux Ubuntu
  • node.js v0.6.12

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?

like image 305
zabumba Avatar asked Sep 30 '22 17:09

zabumba


1 Answers

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
  },
  // ...
like image 146
Ricardo Stuven Avatar answered Oct 03 '22 01:10

Ricardo Stuven