Posts tagged ‘wifi’
Turning your computer into a wireless router – easy-to-run code.
The following script adapted from this post https://exain.wordpress.com/2011/03/31/making-a-wifi-hotspot-access-point-using-linux-wifi-lan-cardusb-adapter/ will an ubuntu linux laptop with a wireless dongle into a wireless router:
https://github.com/argandgahandapandpa/computer-router
You need to run sudo bash start.sh and sudo bash stop.sh to start and stop the script, and create a local settings file to store your configuration.
Debugging Wifi on Ubuntu Linux
To actually get ubuntu to give you some logging when connecting to wifi (you know so that you can act according to some information rather than at random):
- Become superuser
- Run killall NetworkManager
- Run NetworkManager –no-daemon
This will then give you output for every stage of the connection process.
Network manager is (I believe) the tool that handles the overall process of opening a wifi connection using different processes (iwlist, iwconfig, wpa_supplicant etc) to do the actual connection.
Notes
Messages of the form “supplication connection state change number -> number” are (i think) from wpa_supplicant. Someone who isn’t me should change NetworkManager so that these are written in english. For now note that the states mean the following:
0 – WPA is disconnected
1 – WPA is inactive (no enabled connections and wpa isn’t trying to connect
2 – WPA is scanning
3 – WPA is associating (a loose-form of connection)
4 – WPA is associated
5 – WPA 4-way hand shake
6 – WPA group handshake
7 – WPA completed
I was seeing a lot of 3 -> 0 state changes when I was debugging. [This was taken from the wpa_supplicant source code in src/common/defs.h]