All Projects → mehdichaouch → YAWAC

mehdichaouch / YAWAC

Licence: MIT license
Yet Another Wifi Auto Connect (YAWAC) is a shell script to connect to a dataset of wireless connection and free hotspot like FreeWifi. It's works on OpenWrt.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to YAWAC

Portmapper
A tool for managing port forwardings via UPnP
Stars: ✭ 416 (+1790.91%)
Mutual labels:  router, internet
Xunleikuainiaoinshell
[ 迅雷快鸟 Shell 版 ] A Shell Implementation of Kuainiao, Xunlei
Stars: ✭ 102 (+363.64%)
Mutual labels:  router, openwrt
Xunlei Fastdick
迅雷快鸟 Xunlei Network Accelerator For Router
Stars: ✭ 789 (+3486.36%)
Mutual labels:  router, openwrt
openwrt
OpenWrt Stable 1907 with lean's package
Stars: ✭ 55 (+150%)
Mutual labels:  router, openwrt
Familycloudspeederinshell
[ 天翼家庭云/天翼云盘提速 Shell 版 ] A Shell Implementation of FamilyCloudSpeeder, ESurfing
Stars: ✭ 154 (+600%)
Mutual labels:  router, openwrt
Asuswrt Merlin Transparent Proxy
transparent proxy base on ss, v2ray, ipset, iptables, chinadns on asuswrt merlin.
Stars: ✭ 367 (+1568.18%)
Mutual labels:  router, openwrt
Fast Path Lede Openwrt
PLEASE GO TO NEW OPENWRT TRUNK BASED SFE FIRMWARE ->
Stars: ✭ 96 (+336.36%)
Mutual labels:  router, openwrt
Actions Openwrt K2p
Use Github Actions to automatically compile Lean's Modified Lede source for K2P
Stars: ✭ 67 (+204.55%)
Mutual labels:  router, openwrt
Dowse
The Awareness Hub for the Internet of Things
Stars: ✭ 139 (+531.82%)
Mutual labels:  router, internet
Ansible Openwisp2 Imagegenerator
Automatically build several openwisp2 firmware images for different organizations while keeping track of their differences
Stars: ✭ 122 (+454.55%)
Mutual labels:  router, openwrt
TG799VAC-XTREME-17.2-MINT
My personal unique wiki for hacking the router firmware used by (Telia)TG799vac Xtream v17.2-MINT delivered from Technicolor
Stars: ✭ 71 (+222.73%)
Mutual labels:  router, openwrt
SmoothWAN
Internet bonding router with seamless failover using Speedify
Stars: ✭ 199 (+804.55%)
Mutual labels:  internet, openwrt
slim-wrt
Armor for Openwrt
Stars: ✭ 66 (+200%)
Mutual labels:  router, openwrt
Openwrtinvasion
Root shell exploit for several Xiaomi routers: 4A Gigabit, 4A 100M, 4, 4C, 3Gv2, 4Q, miWifi 3C...
Stars: ✭ 366 (+1563.64%)
Mutual labels:  router, openwrt
Docker Openwrt
OpenWrt running in Docker
Stars: ✭ 107 (+386.36%)
Mutual labels:  router, openwrt
Luci Wrtbwmon
Bandwidth tracker for OpenWRT that uses wrtbwmon
Stars: ✭ 201 (+813.64%)
Mutual labels:  router, openwrt
simetbox-openwrt-feed
SIMETBox package feed for OpenWRT (comece aqui/start here!)
Stars: ✭ 72 (+227.27%)
Mutual labels:  internet, openwrt
ansible-nnxx
Ansible configurations for the nnxx infrastructure
Stars: ✭ 11 (-50%)
Mutual labels:  openwrt
ucode
JavaScript-like language with optional templating
Stars: ✭ 27 (+22.73%)
Mutual labels:  openwrt
NanoPi-R2C-Plus
基于lean和immortalwrt编译第三方固件,每天自动更新插件和内核,Fusion编译法
Stars: ✭ 89 (+304.55%)
Mutual labels:  openwrt

Yet Another Wifi Auto Connect (YAWAC)

This script allow you to configure a dataset of wireless connection and automatically connect on with your OpenWrt as reapeter.

It work's with all types of secure/none secure wifi, and also some free hotspot like FreeWifi.

Last but least, YAWAC is made for OpenWrt router (like my old Netgear WGT634U), but it can be adapt for you own usage.

Installation

Copy all the files in the router with the same folders tree and apply the right permissions.

cp -R ./yawac/* /
chmod 644 /etc/config/yawac
chmod 755 /etc/init.d/yawac /usr/bin/yawac.sh

Enable YAWAC, to start on boot and run it.

/etc/init.d/yawac enable
/etc/init.d/yawac start

Remove

Stop YAWAC, disable the start on boot, and remove files.

/etc/init.d/yawac stop
/etc/init.d/yawac disable
rm -f /etc/config/yawac /etc/init.d/yawac /usr/bin/yawac.sh

How it works

YAWAC will start at boot, and check the network availability every 60 seconds, by issuing several pings to google.com. If all fail, it will trigger the network scan and reconfigure the network.

You should edit the file

/etc/config/yawac

The order in that file makes a difference: YAWAC will parse the file and configure the first network found. That means that "net1" has preference over "net2", and so on.

The config file needs three variables for each network:

net1_ssid="WIFI1"
net1_encrypt="psk2"
net1_key="Wifi12345678"

To create new networks, just create new "net2", "net3" and so on:

net2_ssid="WIFI2"
net2_encrypt="psk"
net2_key="Wifi2pass"

net3_ssid="WIFI3"
net3_encrypt="wep"
net3_key="qwerty1234"

net4_ssid="WIFI4"
net4_encrypt="none"
net4_key=""

IMPORTANT NOTE:

Remeber to PUT dashes ("") and DO NOT put spaces between the variable name, the "=" and the variable value. Examples of what NOT TO DO:

net1_ssid=WIFI1
net1_ssid ="WIFI1"
net1_ssid = "WIFI1"
net1_ssid= "WIFI1"

YAWAC would work in an impredictable way if you don't respect the format.

There is a limit of 99 networks, YAWAC will stop searching if it reaches the "net99", then return to the network check loop. I don't think anybody has 99 wifi networks seen on his home!

SOME NOTES:

When YAWAC finds a wireless network, it configures the interface and restarts the networking system. After 20 seconds, it checks for internet availability even if the network was found. If it fails, it discards the changes and continues searching from the point it left before. Example: It finds "net1", but "net1" has no internet. Then it returns to the networks search, but looking for "net2".

In the case that a "netX" ssid variable is blank or doesn't exist, it assumes that it's the end of the file and the search is cancelled. However, YAWAC will keep running, so after 30 seconds it will check the network again.

You can edit the checking intervals by editing the variables inside the config file:

# Background internet connection checking interval
ConnCheckTimer=60
# After new network is set, time to wait for network to establish, before checking if it's working
NewConnCheckTimer=25

Also, you can set a random wlan MAC on each boot by changing the line:

randMac="0"

to

randMac="1"

At any moment, you can force a network scan (ex. your preferred network came back). Just type:

yawac.sh --force

It will scan and search the available networks and put the first available that it finds inside of the config file.

Also, you can force a scan and try to connect to a specific network:

yawac.sh --force 5

It will try to connect to the network correspoding to "net5_ssid"

It will output the result: if it wasn't found, if it failed to connect, or it sucessfully connected.

Also, if you have set a FreeWifi and want to pass only one time the cretendials you can do like this:

yawac.sh --freewifi mylogin mypassword

Is it working?

Ensure that it's running in the background:

Run "ps -aux". You should see YAWAC running:

25718 root      1520 S    {yawac.sh} /bin/sh /usr/bin/yawac.sh

Run "logread -f" to see the script output. It should be like this:

Jan  24 15:13:12 OpenWrt user.notice root: YAWAC: Checking network...
Jan  24 15:13:16 OpenWrt user.notice root: YAWAC: Network OK
Jan  24 15:13:46 OpenWrt user.notice root: YAWAC: Checking network...
Jan  24 15:13:50 OpenWrt user.notice root: YAWAC: Network OK

If the network came unavailable, it should output this:

Jan  24 15:14:20 OpenWrt user.notice root: YAWAC: Checking network...
Jan  24 15:14:20 OpenWrt user.notice root: YAWAC: Network failed. Starting network change...
Jan  24 15:14:20 OpenWrt user.notice root: YAWAC: Performing network scan...
#...
#(Various messages about network initialization / setup)
#...
Jan  24 15:14:21 OpenWrt user.notice root: YAWAC: Searching available networks...
Jan  24 15:14:21 OpenWrt user.notice root: YAWAC: WLAN1662 network found. Applying settings..
#...
#(Various messages about network initialization / setup)
#...
Jan  24 15:14:41 OpenWrt user.notice root: YAWAC: Checking connectivity...
Jan  24 15:14:45 OpenWrt user.notice root: YAWAC: Internet working! Searching ended

If the FreeWifi credentials are not valid you will see

Jan  24 15:15:21 OpenWrt user.notice root: YAWAC: FreeWifi credentials sent...
Jan  24 15:15:36 OpenWrt user.notice root: YAWAC: FreeWifi credentials was not accepted

Todo

  • Test the connection speed and change if it's not quick enough
  • Get some credentials for those french mobile free hotspot to implement them; idem for some others
    • Bouygues Telecom Wi-Fi
    • SFR WiFi FON
    • SFR WiFi Mobile
    • Orange
  • Add a graphic interface in LuCi backoffice

Thanks to

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].