{"id":13432696,"url":"https://github.com/abandonware/wireless-tools","last_synced_at":"2025-03-17T10:32:25.862Z","repository":{"id":29551074,"uuid":"33090236","full_name":"abandonware/wireless-tools","owner":"abandonware","description":"Wireless tools for Node.js","archived":false,"fork":false,"pushed_at":"2022-04-27T06:45:59.000Z","size":283,"stargazers_count":170,"open_issues_count":14,"forks_count":72,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-04-13T21:02:05.790Z","etag":null,"topics":["cli","hostapd","ifconfig","iw","iwconfig","iwlist","javascript","nodejs","supplicant","udhcpc","udhcpd","wifi","wireless","wpa"],"latest_commit_sha":null,"homepage":"https://mastodon.social/@rzr/106561111211779695#WirelessTools","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abandonware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-29T21:32:18.000Z","updated_at":"2024-03-30T21:32:56.000Z","dependencies_parsed_at":"2022-08-29T15:20:56.473Z","dependency_job_id":null,"html_url":"https://github.com/abandonware/wireless-tools","commit_stats":null,"previous_names":["bakerface/wireless-tools"],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abandonware%2Fwireless-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abandonware%2Fwireless-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abandonware%2Fwireless-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abandonware%2Fwireless-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abandonware","download_url":"https://codeload.github.com/abandonware/wireless-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244016798,"owners_count":20384207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","hostapd","ifconfig","iw","iwconfig","iwlist","javascript","nodejs","supplicant","udhcpc","udhcpd","wifi","wireless","wpa"],"created_at":"2024-07-31T02:01:15.352Z","updated_at":"2025-03-17T10:32:25.500Z","avatar_url":"https://github.com/abandonware.png","language":"JavaScript","readme":"# Wireless tools for Node.js\n[![npm version](https://badge.fury.io/js/wireless-tools.svg)](http://badge.fury.io/js/wireless-tools)\n[![release version](https://img.shields.io/badge/version-0.19.0-blue.svg)](https://github.com/bakerface/wireless-tools)\n[![build status](https://travis-ci.org/bakerface/wireless-tools.svg?branch=master)](https://travis-ci.org/bakerface/wireless-tools)\n[![code climate](https://codeclimate.com/github/bakerface/wireless-tools/badges/gpa.svg)](https://codeclimate.com/github/bakerface/wireless-tools)\n[![test coverage](https://codeclimate.com/github/bakerface/wireless-tools/badges/coverage.svg)](https://codeclimate.com/github/bakerface/wireless-tools/coverage)\n[![github issues](https://img.shields.io/github/issues/bakerface/wireless-tools.svg)](https://github.com/bakerface/wireless-tools/issues)\n[![dependencies](https://david-dm.org/bakerface/wireless-tools.svg)](https://david-dm.org/bakerface/wireless-tools)\n[![dev dependencies](https://david-dm.org/bakerface/wireless-tools/dev-status.svg)](https://david-dm.org/bakerface/wireless-tools#info=devDependencies)\n[![downloads](http://img.shields.io/npm/dm/wireless-tools.svg)](https://www.npmjs.com/package/wireless-tools)\n\n\n# Looking for a maintainer\nIf you are interested in becoming a maintainer for this project, please let me know. I created this project many years ago and no longer have time to dedicate to moving it forward. I will not be accepting pull requests or responding to issues, sorry for the inconvenience.\n\n\n## Table of Contents\n- [hostapd](#hostapd) - configure an access point\n  - [hostapd.enable(options, callback)](#hostapdenableoptions-callback) - host an access point\n  - [hostapd.disable(interface, callback)](#hostapddisableinterface-callback) - stop hosting an access point\n- [ifconfig](#ifconfig) - configure network interfaces\n  - [ifconfig.status(callback)](#ifconfigstatuscallback) - status of all network interfaces\n  - [ifconfig.status(interface, callback)](#ifconfigstatusinterface-callback) - status of a network interface\n  - [ifconfig.down(interface, callback)](#ifconfigdowninterface-callback) - take down a network interface\n  - [ifconfig.up(options, callback)](#ifconfigupoptions-callback) - bring up a network interface\n- [iwconfig](#iwconfig) - configure wireless network interfaces\n  - [iwconfig.status(callback)](#iwconfigstatuscallback) - status of all wireless network interfaces\n  - [iwconfig.status(interface, callback)](#iwconfigstatusinterface-callback) - status of a wireless network interface\n- [iwlist](#iwlist) - query wireless network interfaces\n  - [iwlist.scan(options, callback)](#iwlistscaninterface-callback) - scan for wireless networks\n- [udhcpc](#udhcpc) - configure a dhcp client\n  - [udhcpc.enable(options, callback)](#udhcpcenableoptions-callback) - start a dhcp client\n  - [udhcpc.disable(interface, callback)](#udhcpcdisableinterface-callback) - stop a dhcp client\n- [udhcpd](#udhcpd) - configure a dhcp server\n  - [udhcpd.enable(options, callback)](#udhcpdenableoptions-callback) - start a dhcp server\n  - [udhcpd.disable(interface, callback)](#udhcpddisableinterface-callback) - stop a dhcp server\n- [wpa_cli](#wpa_cli) - send commands to wpa_supplicant using wpa_cli\n  - [wpa_cli.status(interface, callback)](#wpa_clistatusinterface-callback) - get status of wpa\n  - [wpa_cli.bssid(interface, ap, ssid, callback)](#wpa_clibssidinterface-ap-ssid-callback) - set preferred bssid for ssid\n  - [wpa_cli.reassociate(interface, callback)](#wpa_clireassociateinterface-callback) - tell wpa_supplicant to reassociate to an access points\n  - [wpa_cli.set(interface, variable, value, callback)](#wpa_clisetinterface-variable-value-callback) - set variable to value\n  - [wpa_cli.add_network(interface, callback)](#wpa_cliadd_networkinterface-callback) - add network\n  - [wpa_cli.set_network(interface, id, variable, value, callback)](#wpa_cliset_networkinterface-id-variable-value-callback) - set network variables\n  - [wpa_cli.enable_network(interface, id, callback)](#wpa_clienable_networkinterface-id-callback) - enable network\n  - [wpa_cli.disable_network(interface, id, callback)](#wpa_clidisable_networkinterface-id-callback) - disable network\n  - [wpa_cli.remove_network(interface, id, callback)](#wpa_cliremove_networkinterface-id-callback) - remove network\n  - [wpa_cli.select_network(interface, id, callback)](#wpa_cliselect_networkinterface-id-callback) - select network\n  - [wpa_cli.scan(interface, callback)](#wpa_cliscaninterface-callback) - new BSS scan\n  - [wpa_cli.scan_results(interface, callback)](#wpa_cliscan_resultsinterface-callback) - results of latest BSS scan\n  - [wpa_cli.save_config(interface, callback)](#wpa_clisave_configinterface-callback) - saves the current configuration\n- [wpa_supplicant](#wpa_supplicant) - configure a wireless network connection\n  - [wpa_supplicant.enable(options, callback)](#wpa_supplicantenableoptions-callback) - connect to a wireless network\n  - [wpa_supplicant.disable(interface, callback)](#wpa_supplicantdisableinterface-callback) - disconnect from a wireless network\n  - [wpa_supplicant.manual(options, callback)](#wpa_supplicantmanualoptions-callback) - start wpa_supplicant in a way it can receive commands from wpa_cli\n- [iw](#iw) - get and set parameters using `iw`, the interface for nl80211 interfaces\n  - [iw.scan(options, callback)](#iwscaninterface-callback) - scan for wireless networks\n\n# hostapd\nThe **hostapd** command is used to configure wireless access points.\n\n## hostapd.enable(options, callback)\nThe **hostapd enable** command is used to host an access point on a specific wireless interface.\n\n``` javascript\nvar hostapd = require('wireless-tools/hostapd');\n\nvar options = {\n  channel: 6,\n  driver: 'rtl871xdrv',\n  hw_mode: 'g',\n  interface: 'wlan0',\n  ssid: 'RaspberryPi',\n  wpa: 2,\n  wpa_passphrase: 'raspberry'\n};\n\nhostapd.enable(options, function(err) {\n  // the access point was created\n});\n```\n\n## hostapd.disable(interface, callback)\nThe **hostapd disable** command is used to stop hosting an access point on a specific wireless interface.\n\n``` javascript\nvar hostapd = require('wireless-tools/hostapd');\n\nhostapd.disable('wlan0', function(err) {\n  // no longer hosting the access point\n});\n```\n\n# ifconfig\nThe **ifconfig** command is used to configure network interfaces.\n\n## ifconfig.status(callback)\nThe **ifconfig status** command is used to query the status of all configured interfaces.\n\n``` javascript\nvar ifconfig = require('wireless-tools/ifconfig');\n\nifconfig.status(function(err, status) {\n  console.log(status);\n});\n\n// =\u003e\n[\n  {\n    interface: 'eth0',\n    link: 'ethernet',\n    address: 'b8:27:eb:da:52:ad',\n    ipv4_address: '192.168.1.2',\n    ipv4_broadcast: '192.168.1.255',\n    ipv4_subnet_mask: '255.255.255.0',\n    up: true,\n    broadcast: true,\n    running: true,\n    multicast: true\n  },\n  {\n    interface: 'lo',\n    link: 'local',\n    ipv4_address: '127.0.0.1',\n    ipv4_subnet_mask: '255.0.0.0',\n    up: true,\n    running: true,\n    loopback: true\n  },\n  {\n    interface: 'wlan0',\n    link: 'ethernet',\n    address: '00:0b:81:95:12:21',\n    ipv4_address: '192.168.10.1',\n    ipv4_broadcast: '192.168.10.255',\n    ipv4_subnet_mask: '255.255.255.0',\n    up: true,\n    broadcast: true,\n    multicast: true\n  }\n]\n```\n\n## ifconfig.status(interface, callback)\nThe **ifconfig interface status** command is used to query the status of a specific interface.\n\n``` javascript\nvar ifconfig = require('wireless-tools/ifconfig');\n\nifconfig.status('eth0', function(err, status) {\n  console.log(status);\n});\n\n// =\u003e\n{\n  interface: 'eth0',\n  link: 'ethernet',\n  address: 'b8:27:eb:da:52:ad',\n  ipv4_address: '192.168.1.2',\n  ipv4_broadcast: '192.168.1.255',\n  ipv4_subnet_mask: '255.255.255.0',\n  up: true,\n  broadcast: true,\n  running: true,\n  multicast: true\n}\n```\n\n## ifconfig.down(interface, callback)\nThe **ifconfig down** command is used to take down an interface that is up.\n\n``` javascript\nvar ifconfig = require('wireless-tools/ifconfig');\n\nifconfig.down('wlan0', function(err) {\n  // the interface is down\n});\n```\n\n## ifconfig.up(options, callback)\nThe **ifconfig up** command is used to bring up an interface with the specified configuration.\n\n``` javascript\nvar ifconfig = require('wireless-tools/ifconfig');\n\nvar options = {\n  interface: 'wlan0',\n  ipv4_address: '192.168.10.1',\n  ipv4_broadcast: '192.168.10.255',\n  ipv4_subnet_mask: '255.255.255.0'\n};\n\nifconfig.up(options, function(err) {\n  // the interface is up\n});\n```\n\n# iwconfig\nThe **iwconfig** command is used to configure wireless network interfaces.\n\n## iwconfig.status(callback)\nThe **iwconfig status** command is used to query the status of all configured wireless interfaces.\n\n``` javascript\nvar iwconfig = require('wireless-tools/iwconfig');\n\niwconfig.status(function(err, status) {\n  console.log(status);\n});\n\n// =\u003e\n[\n  {\n    interface: 'wlan0',\n    access_point: '00:0b:81:95:12:21',\n    frequency: 2.437,\n    ieee: '802.11bg',\n    mode: 'master',\n    noise: 0,\n    quality: 77,\n    sensitivity: 0,\n    signal: 50,\n    ssid: 'RaspberryPi'\n  },\n  {\n    interface: 'wlan1',\n    frequency: 2.412,\n    mode: 'auto',\n    noise: 0,\n    quality: 0,\n    sensitivity: 0,\n    signal: 0,\n    unassociated: true\n  }\n]\n```\n\n## iwconfig.status(interface, callback)\nThe **iwconfig interface status** command is used to query the status of a specific wireless interface.\n\n``` javascript\nvar iwconfig = require('wireless-tools/iwconfig');\n\niwconfig.status('wlan0', function(err, status) {\n  console.log(status);\n});\n\n// =\u003e\n{\n  interface: 'wlan0',\n  access_point: '00:0b:81:95:12:21',\n  frequency: 2.437,\n  ieee: '802.11bg',\n  mode: 'master',\n  noise: 0,\n  quality: 77,\n  sensitivity: 0,\n  signal: 50,\n  ssid: 'RaspberryPi'\n}\n```\n\n# iwlist\nThe **iwlist** command is used to get detailed information from a wireless interface.\n\n## iwlist.scan(interface, callback)\nThe **iwlist scan** command is used to scan for wireless networks visible to a wireless interface. For convenience, the networks are sorted by signal strength.\n\n``` javascript\nvar iwlist = require('wireless-tools/iwlist');\n\niwlist.scan('wlan0', function(err, networks) {\n  console.log(networks);\n});\n\niwlist.scan({ iface : 'wlan0', show_hidden : true }, function(err, networks) {\n  console.log(networks);\n});\n\n// =\u003e\n[\n  {\n    address: '00:0b:81:ab:14:22',\n    ssid: 'BlueberryPi',\n    mode: 'master',\n    frequency: 2.437,\n    channel: 6,\n    security: 'wpa',\n    quality: 48,\n    signal: 87\n  },\n  {\n    address: '00:0b:81:95:12:21',\n    ssid: 'RaspberryPi',\n    mode: 'master',\n    frequency: 2.437,\n    channel: 6,\n    security: 'wpa2',\n    quality: 58,\n    signal: 83\n  },\n  {\n    address: '00:0b:81:cd:f2:04',\n    ssid: 'BlackberryPi',\n    mode: 'master',\n    frequency: 2.437,\n    channel: 6,\n    security: 'wep',\n    quality: 48,\n    signal: 80\n  },\n  {\n    address: '00:0b:81:fd:42:14',\n    ssid: 'CranberryPi',\n    mode: 'master',\n    frequency: 2.437,\n    channel: 6,\n    security: 'open',\n    quality: 32,\n    signal: 71\n  }\n]\n\n[\n  {\n    address: '00:0b:81:ab:14:22',\n    ssid: 'BlueberryPi',\n    mode: 'master',\n    frequency: 2.437,\n    channel: 6,\n    security: 'wpa',\n    quality: 48,\n    signal: 87\n  },\n  {\n    address: '00:0b:81:95:12:21',\n    ssid: 'RaspberryPi',\n    mode: 'master',\n    frequency: 2.437,\n    channel: 6,\n    security: 'wpa2',\n    quality: 58,\n    signal: 83\n  },\n  {\n    address: '00:0b:81:cd:f2:04',\n    ssid: 'BlackberryPi',\n    mode: 'master',\n    frequency: 2.437,\n    channel: 6,\n    security: 'wep',\n    quality: 48,\n    signal: 80\n  },\n  {\n    address: '00:0b:81:fd:42:14',\n    ssid: 'CranberryPi',\n    mode: 'master',\n    frequency: 2.437,\n    channel: 6,\n    security: 'open',\n    quality: 32,\n    signal: 71\n  },\n  {\n    address: '2c:c5:d3:02:ae:4c',\n    channel: 100,\n    frequency: 5.5,\n    mode: 'master',\n    quality: 66,\n    signal: -44,\n    security: 'wpa2'\n  }\n]\n```\n\n# udhcpc\nThe **udhcpc** command is used to configure a dhcp client for a network interface.\n\n## udhcpc.enable(options, callback)\nThe **udhcpc enable** command is used to start a dhcp client on a specific network interface.\n\n``` javascript\nvar udhcpc = require('wireless-tools/udhcpc');\n\nvar options = {\n  interface: 'wlan0'\n};\n\nudhcpc.enable(options, function(err) {\n  // the dhcp client was started\n});\n```\n\n## udhcpc.disable(interface, callback)\nThe **udhcpc disable** command is used to stop a dhcp client on a specific network interface.\n\n``` javascript\nvar udhcpc = require('wireless-tools/udhcpc');\n\nudhcpc.disable('wlan0', function(err) {\n  // the dhcp client was stopped\n});\n```\n\n# udhcpd\nThe **udhcpd** command is used to configure a dhcp server for a network interface.\n\n## udhcpd.enable(options, callback)\nThe **udhcpd enable** command is used to start a dhcp server on a specific network interface.\n\n``` javascript\nvar udhcpd = require('wireless-tools/udhcpd');\n\nvar options = {\n  interface: 'wlan0',\n  start: '192.168.10.100',\n  end: '192.168.10.200',\n  option: {\n    router: '192.168.10.1',\n    subnet: '255.255.255.0',\n    dns: [ '4.4.4.4', '8.8.8.8' ]\n  }\n};\n\nudhcpd.enable(options, function(err) {\n  // the dhcp server was started\n});\n```\n\n## udhcpd.disable(interface, callback)\nThe **udhcpd disable** command is used to stop a dhcp server on a specific network interface.\n\n``` javascript\nvar udhcpd = require('wireless-tools/udhcpd');\n\nudhcpd.disable('wlan0', function(err) {\n  // the dhcp server was stopped\n});\n```\n\n# wpa_cli\nThe **wpa_cli** command is used to setup what wpa_supplicant must do to connect to a wireless network connection for a network interface.\n\nMost of wpa_cli commands return either 'OK' or 'FAIL' (and the exit status is\nalways 0). Because of this, all 'FAIL' responses will return and callback with an error.\n\nResponses containing an 'OK' result only means than wpa_supplicant had received\nthe command. You must poll wpa_supplicant (or other commands like iwconfig) to be sure that the command was actually applied by wpa_supplicant.\n\n## wpa_cli.status(interface, callback)\nThe **wpa_cli status** command is used to get the current status of wpa_supplicant on a specific network interface.\n\n``` javascript\nvar wpa_cli = require('wireless-tools/wpa_cli');\n\nwpa_cli.status('wlan0', function(err, status) {\n    console.dir(status);\n});\n```\n\n``` javascript\n// =\u003e\n{\n    bssid: '2c:f5:d3:02:ea:d9',\n    frequency: 2412,\n    mode: 'station',\n    key_mgmt: 'wpa2-psk',\n    ssid: 'Fake-Wifi',\n    pairwise_cipher: 'CCMP',\n    group_cipher: 'CCMP',\n    p2p_device_address: 'e4:28:9c:a8:53:72',\n    wpa_state: 'COMPLETED',\n    ip: '10.34.141.168',\n    mac: 'e4:28:9c:a8:53:72',\n    uuid: 'e1cda789-8c88-53e8-ffff-31c304580c1e',\n    id: 0\n}\n```\n## wpa_cli.bssid(interface, ap, ssid, callback)\nThe **wpa_cli bssid** command is used to set the preferred access points for an specific ssid on a specific network interface.\n\n``` javascript\nvar wpa_cli = require('wireless-tools/wpa_cli');\n\nwpa_cli.bssid('wlan0', '2c:f5:d3:02:ea:dd', 'Fake-Wifi', function(err, data){\n    // this is correct usage\n    console.dir(data);\n});\n```\n## wpa_cli.reassociate(interface, callback)\nThe **wpa_cli reassociate** command is used to instruct wpa_supplicant to reassociate to access points for an SSID on a specific network interface.\n\n``` javascript\nvar wpa_cli = require('wireless-tools/wpa_cli');\n\nwpa_cli.bssid('wlan0', 'Fake-Wifi', '2c:f5:d3:02:ea:dd', function(err, data){\n      // our usage is wrong so an error is triggered\n      if (err) {\n        console.dir(err);\n        // attempt to reassociate\n        wpa_cli.reassociate('wlan0', function(err, data) {\n          console.dir(data);\n        });\n      }\n});\n```\n## wpa_cli.set(interface, variable, value, callback)\nThe **wpa_cli set** command is used to set wpa_supplicant parameters to a value on a specific network interface.\n\n## wpa_cli.add_network(interface, callback)\nThe **wpa_cli add_network** command is used to create a new network entry on a specific network interface.\nIt will return on success the id of the new network\n\n## wpa_cli.set_network(interface, id, variable, value, callback)\nThe **wpa_cli set_network** command is used to set variables for a network on a specific network interface.\n\n## wpa_cli.enable_network(interface, id, callback)\nThe **wpa_cli enable_network** command is used to enable a network on a specific network interface.\n\n## wpa_cli.disable_network(interface, id, callback)\nThe **wpa_cli disable_network** command is used to disable a network on a specific network interface.\n\n## wpa_cli.remove_network(interface, id, callback)\nThe **wpa_cli remove_network** command is used to remove a network on a specific network interface.\n\n## wpa_cli.select_network(interface, id, callback)\nThe **wpa_cli select_network** command is used to select a specific network on a specific network interface and\ndisable all others.\n\n``` javascript\nvar wpa_cli = require('wireless-tools/wpa_cli');\n\nwpa_cli.select_network('wlan0', 0, function(err, data){\n    if (err) {\n        // most likely the set values for the specified id are wrong\n        console.dir(err);\n    } else {\n        // successfully connected to the new network\n        console.dir(data);\n    }\n});\n```\n## wpa_cli.scan(interface, callback)\nThe **wpa_cli scan** is used to request a new BSS scan on a specific network interface.\n\n## wpa_cli.scan_results(interface, callback)\nThe **wpa_cli scan_results** is used to return the results of the latest BSS scan\n that was run on a specific network interface.\n \n``` javascript\nvar wpa_cli = require('wireless-tools/wpa_cli');\n \nwpa_cli.scan('wlan0', function(err, data){\n    wpa_cli.scan_results('wlan0', function(err, data) {\n       // returns the results of the BSS scan once it completes\n       console.dir(data);\n    }\n});\n```\n\n``` javascript\n=\u003e\n[\n {\n    bssid: '2c:f5:d3:02:ea:d9',\n    frequency: 2472,\n    signalLevel: -31,\n    flags: '[WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][ESS]',\n    ssid: 'FakeWifi'\n },\n {\n    bssid: '2c:f5:d3:02:ea:d9',\n    frequency: 2472,\n    signalLevel: -31,\n    flags: '[WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][ESS]',\n    ssid: 'FakeWifi2'\n }\n]\n```\n\n## wpa_cli.save_config(interface, callback)\nThe **wpa_cli save_config** command is used to save the current wpa_cli configuration for the specific network interface.\n\n``` javascript\nvar wpa_cli = require('wireless-tools/wpa_cli');\n \nwpa_cli.save_config('wlan0', function(err, data){\n    // current wpa_cli configuration is saved\n});\n```\n\n# wpa_supplicant\nThe **wpa_supplicant** command is used to configure a wireless network connection for a network interface.\n\n## wpa_supplicant.enable(options, callback)\nThe **wpa_supplicant enable** command is used to join a wireless network on a specific network interface.\n\n``` javascript\nvar wpa_supplicant = require('wireless-tools/wpa_supplicant');\n\nvar options = {\n  interface: 'wlan0',\n  ssid: 'RaspberryPi',\n  passphrase: 'raspberry',\n  driver: 'wext'\n};\n\nwpa_supplicant.enable(options, function(err) {\n  // connected to the wireless network\n});\n```\n\n## wpa_supplicant.disable(interface, callback)\nThe **wpa_supplicant disable** command is used to disconnect from a wireless network on a specific network interface.\n\n``` javascript\nvar wpa_supplicant = require('wireless-tools/wpa_supplicant');\n\nwpa_supplicant.disable('wlan0', function(err) {\n  // disconnected from wireless network\n});\n```\n\n## wpa_supplicant.manual(options, callback)\nThe **wpa_supplicant manual** command is used to launch wpa_supplicant on a specific network interface.\n\n``` javascript\nvar wpa_supplicant = require('wireless-tools/wpa_supplicant');\n\nvar options = {\n  interface: 'wlan0',\n  drivers: [ 'nl80211', 'wext' ]\n};\n\nwpa_supplicant.manual(options, function(err) {\n  // wpa_supplicant launched on wlan0 interface (can be setup using wpa_cli)\n});\n```\n\n# iw\nThe **iw** command is used to get and set detailed information from an nl80211 wireless interface.\n\n## iw.scan(interface, callback)\nThe **iw scan** command is used to scan for wireless networks visible to a wireless interface. For convenience, the networks are sorted by signal strength.\n\n``` javascript\nvar iw = require('wireless-tools/iw');\n\niw.scan('wlan0', function(err, networks) {\n  console.log(networks);\n});\n\niw.scan({ iface : 'wlan0', show_hidden : true }, function(err, networks) {\n  console.log(networks);\n});\n\n// =\u003e\n[\n  {\n    address: '00:0b:81:ab:14:22',\n    frequency: 2422,\n    signal: -80,\n    lastSeenMs: 0,\n    ssid: 'BlueberryPi',\n    channel: 3,\n    security: 'wpa'\n  },\n  {\n    address: '00:0b:81:95:12:21',\n    frequency: 5825,\n    signal: -83,\n    lastSeenMs: 2031,\n    ssid: 'RaspberryPi',\n    channel: 165,\n    security: 'wpa2'\n  },\n  {\n    address: '00:0b:81:cd:f2:04',\n    frequency: 2437,\n    signal: -88,\n    lastSeenMs: 0,\n    ssid: 'BlackberryPi',\n    channel: 6,\n    security: 'wep'\n  },\n  {\n    address: '00:0b:81:fd:42:14',\n    frequency: 2412,\n    signal: -92,\n    lastSeenMs: 0,\n    ssid: 'CranberryPi',\n    channel: 1,\n    security: 'open'\n  }\n]\n\n[\n  {\n    address: '00:0b:81:ab:14:22',\n    frequency: 2422,\n    signal: -80,\n    lastSeenMs: 0,\n    ssid: 'BlueberryPi',\n    channel: 3,\n    security: 'wpa'\n  },\n  {\n    address: '00:0b:81:95:12:21',\n    frequency: 5825,\n    signal: -83,\n    lastSeenMs: 2031,\n    ssid: 'RaspberryPi',\n    channel: 165,\n    security: 'wpa2'\n  },\n  {\n    address: '00:0b:81:cd:f2:04',\n    frequency: 2437,\n    signal: -88,\n    lastSeenMs: 0,\n    ssid: 'BlackberryPi',\n    channel: 6,\n    security: 'wep'\n  },\n  {\n    address: '00:0b:81:fd:42:14',\n    frequency: 2412,\n    signal: -92,\n    lastSeenMs: 0,\n    ssid: 'CranberryPi',\n    channel: 1,\n    security: 'open'\n  },\n  {\n    address: '00:0b:81:fd:42:01',\n    frequency: 2412,\n    signal: -94,\n    lastSeenMs: 1069,\n    channel: 1,\n    security: 'open'\n  }\n]\n```\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabandonware%2Fwireless-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabandonware%2Fwireless-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabandonware%2Fwireless-tools/lists"}