tlhunter / node-wireless Goto Github PK
View Code? Open in Web Editor NEWDEFUNCT: Node.js: WiFi Connection Management
Home Page: https://www.npmjs.org/package/wireless
DEFUNCT: Node.js: WiFi Connection Management
Home Page: https://www.npmjs.org/package/wireless
The settings object isn't merging as expecting; if one of the commands is missing from the passed in object, the one in the existing object doesn't survive the merge.
It's not common Node practice for event emitter calls to have error arguments. They instead emit error events.
FIXIT
Come up with a common naming convention and stick with it. Connect or Join? Disconnect or Leave?
Make it so that _.each() works with the list of networks. I think we'll need a normal array instead of an object where the keys are the mac addresses.
../node-wireless/app.js:97
console.log(("[JOIN]"+network.ssid+"["+network.address+"]")
I get the following error running on a Raspberry Pi, running node V0.10.16.
Before that error I get the following output:
[PROGRESS] Enabling wireless card...
[PROGRESS] Wireless card enabled.
[PROGRESS] Starting wireless scan...
[ COMMAND] sudo iwlist wlan0 scan
[ COMMAND] sudo iwconfig wlan0
[PROGRESS] Wireless scanning has commenced.
If I manually run the commands I get valid results. I am using an RTL8188CUS WLAN Adapter.
Make a connection to a WEP network.
Add underscore as a dependency in the package.json
Thomas--this is a great package. Do you have a license you can add to it (e.g. MIT, etc)?
Disconnects from the currently connected network.
Determine if an encrypted network is either a WPA or a WEP encrypted network. Currently we only know if it is encrypted or not.
The reason we need to know what kind of encryption it is is due to the different types of commands required to connect to the two networks.
# Connect to a WEP network
iwconfig INTERFACE essid "ESSID" key s:KEY
# Connect to a WPA network
wpa_passphrase myrouter mypassphrase > wpa.conf
wpa_supplicant -Dwext -iINTERFACE -cwpa.conf
Make a connection to a WPA encrypted network.
Make sure the application works under debian based distro's.
We'll eventually switch over to D-Bus, though I'm not sure it'll work with OS X.
Might have to keep the old method of executing binaries and parsing output, but instead of relying on wpa_supplicant
, instead rely on the following:
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
Enable dhcpcd on the interface, which will get us an IP address. This is an event which the app would probably execute once a connection to a network is made.
From a performance perspective it doesn't really matter, but it's the right thing to do!
Capture some wpa_supplicant data and create a test suite using said data for mocking.
Connect to an open network.
Works it for >Window 7?
Trigger an event when we disconnect from a network. Possibly send the details of the network we just disconnected from as well.
Need to fine-tune the requirements which trigger a network change event. Should it just be certain things that trigger it? Should a major change in signal strength cause a change event? Or, should there be a different event for signal strength changes?
Uncaught Error [ERR_UNHANDLED_ERROR]: Unhandled error. ('The interface wlan0 does not exist.')
electron+vue+nodejs
Hi,
I have just started using your module in my hobby project, and after running your sample code I notice strange behavior on my system. If I try to connect to a network with ssid XYZ, I don't get any errors and the wifi doesn't connect to that network. ir. the callback doesn't get executed.
Now after that if I manually try to connect to the same network using ubuntu's menu I cannot connect until I restart my laptop.
I tried
sudo service network-manager restart
sudo service networking restart
but that doesn't solve the problem.
I tried this code on MAC OS and I still had the same problem. is it a known issue?
Ubuntu: 16 04 LTS / 14 04 LTS
MacOSX El Capitan 10.11.6
Thanks and Regards
Nikhil
Hitting Ctrl+C can sometimes cause uncaught errors to be throw. We should instead catch and emit.
[ FATAL] Got some major errors from our scan command:Error: Command failed:
/home/tlhunter/Projects/node-wireless-test/node_modules/wireless/index.js:337
throw err;
^
Error: Command failed:
at ChildProcess.exithandler (child_process.js:647:15)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Socket.<anonymous> (child_process.js:968:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
Write code to enable and disable an interface, e.g. UP and DOWN commands.
Make sure the app works in RedHat based distributions.
Some callbacks (e.g. joining networks) have a success and failure callback, like this was jQuery or something.
Other times we don't pass error arguments to callbacks. Or sometimes we exit the process instead of failing a callback.
Fix dat shit, yo!
Need to trigger an event when we connect to a network. Should just be able to run iwconfig.
Also, should we trigger multiple events for different stages of connection?
This was my first node module IIRC. It's laid out stupidly.
The root of the github project should be the module, no dependencies should be committed, a simple sample app should exist in a sub directory and be documented in the readme.
Fire an event when a network disappears.
This isn't as easy as it sounds; we need to have a threshold. E.g., does a network disappear as soon as it isn't available in a listing, or does it actually disappear when it's been missing for a few scans. This threshold should be configurable.
In the Quality line, I've seen a couple of different formats, both which break the regex parser in Wireless.prototype._parseScan
(the first line breaks because it's a 3-digit number):
Quality=100/100 Signal level=47/100
Quality=66/100 Signal level=52/100
Quality=58/100 Signal level=80/100
Quality=61/100 Signal level=72/100
Quality:23 Signal level:0 Noise level:0
Quality:93 Signal level:0 Noise level:0
Quality:13 Signal level:0 Noise level:0
This was seen on Raspbian (Raspberry Pi):
Make sure the app works with different DHCP daemons. So far we've only tested with DHCPCD under Arch Linux.
The sample app should have some more features.
I'd like it to run, connect to any open network it finds, get an IP address, find out its public ip address, and log everything it found. Should also be able to check for GPS coordinates.
Ideally, one could drive around with this running on a machine in their car, and automatically connect and disconnect without any errors, which I feel would be a great example of the features of the project.
Get Public IP: http://ip.thomashunter.name
sometimes I scan and the quality line is (something like)
Quality=10/70 Signal level=-100 dBm
and the regex for signal level is
-?[0-9]{1,2} dBm
but it should be
-?[0-9]{1,3} dBm
to handle 3 digits
Currently, the module runs a bunch of commands over and over. This means we need to wait for the command to finish before we get the results. This can take many seconds, and then we send a "burst" of network found events, etc.
What we should do, is find a better way to talk to the hardware, and be able to trigger an event every single time the device sees a wireless packet.
I have absolutely no idea how to do this. Someone once said something about dmesg or something similar, but I'm still pretty lost.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.