Shell script that will check if there is connectivity to a defined website every 60 seconds and switch ON/OFF the led :
#!/bin/sh
while [ true ]; do
/usr/bin/wget -q --tries=2 --spider http://google.com
if [ $? -eq 0 ]; then
#echo "Connected ! LED RED OFF. LED GREEN ON."
echo "none" > /sys/class/leds/gl-ar150:orange:wlan/trigger
echo "default-on" > /sys/class/leds/gl-ar150:green:wan/trigger
else
#echo "Not connected ! LED RED ON. LED GREEN OFF."
echo "default-on" > /sys/class/leds/gl-ar150:orange:wlan/trigger
echo "none" > /sys/class/leds/gl-ar150:green:wan/trigger
fi
sleep 60
done
Schell script to autostart the above script :
#!/bin/sh /etc/rc.common
START=99
STOP=1
start(){
/usr/bin/WANLED &
}
stop(){
killall -9 WANLED
}
Now let's make these script executable and started at startup:
# chmod +x /usr/bin/WANLED
# chmod +x /etc/init.d/WANLED
# /etc/init.d/WANLED enable
# /etc/init.d/WANLED start
Now the orange LED should be ON when there is no connectivity to Google.
FYI OpenWRT in use was : OpenWrt 19.07.2, r10947-65030d81f3
Source: LED, Start script at startup, LED on when Internet is available
Transmission
-
opkg update
-
opkg install transmission-daemon-openssl transmission-web luci-app-transmission
-
opkg install nano
-
nano /etc/config/transmission
-
chmod -R 777 /tmp/USB_KEY
It is necessary to make a swap file on AR150 otherwise you cannot access the web interface...
-
cd /path/where/we/will/make/swap-file
- Create a 64MB swap-file:
dd if=/dev/zero of=swap-file bs=1M count=64
-
mkswap swap-file
-
swapon swap-file
- Then go to LuCI to specify the swap file in System > Mount points to have it mounted at next router reboot.
For worldwide access add a rule in LEDE firewall:
Any tcp, udp
From any host in wan
To any router IP at port 9091 on this device
Source
Bandwidth Monitor (nlbw)
opkg install luci-app-nlbwmon
Aussi :
https://github.com/Kiougar/luci-wrtbwmon
How to upgrade GL-AR150 to Stock OpenWRT
- Connect to router using SSH
-
# cd /tmp
- Check what is the last available release for GL-AR150 here.
-
# wget http://downloads.lede-project.org/releases/17.01.4/targets/ar71xx/generic/lede-17.01.4-ar71xx-generic-gl-ar150-squashfs-sysupgrade.bin
-
# sysupgrade lede-17.01.4-ar71xx-generic-gl-ar150-squashfs-sysupgrade.bin
Source
I installed this version: LEDE Reboot (17.01.4, r3560-79f57e422d).
How to upgrade all packets
opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
Sources 1, 2
Enabling remote SSH access on LEDE/OpenWRT
Configure Dropbear
- Go to the System / Administration page.
- Under “SSH Access”, for the default “Dropbear instance”, set “Interface” to “unspecified”.
This will cause dropbear to accept connections on all interfaces.
Open port 22 (or other)
- Go to the Network / Firewall / Traffic Rules.
- Scroll down to the “Open ports on router” section.
- Enter a name for this rule, e.g. “Allow-SSH-WAN”.
- Set “Protocol” to “TCP”.
- Enter “22” as the “External Port”.
- Click “Add”.
- Click “Save and Apply”.
Source
Using USB storage devices and FAT32&NTFS filesystems
- Connect to router using SSH
-
# opkg update
-
# opkg install kmod-usb-storage
-
# opkg install usbutils
-
# lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M
- To add support of FAT32 and NTFS (not tested yet) usb flash/disk drives:
# opkg install kmod-fs-vfat ntfs-3g
- Then go to the LuCI administration page, System > Mount points, and configure :

Sources 1, 2, 3, 4, 5
Using the Huawei E3372 Hi-Link LTE Dongle with OpenWRT
Huawei E3372 and AR-150 have 192.168.8.1/24 IPv4 networks, change the LAN IP of AR-150.
-
# opkg update && opkg install kmod-usb-net-rndis usb-modeswitch
Of course, an internet connection is needed through Ethernet or Wifi for this step. :(
- Then go to the LuCI administration page, Network > Interfaces > Add new interface...:

- In my case interface "eth2" is now available to configure:

- In tab Firewall Settings, add this new interface in the wan firewall-zone:

- Click on Connect of the new network 4G_LTE:

- Done, you even have access to the USB dongle administration page 192.168.8.1.
Source Nouvelle source (2020-02)
DDNS
-
# opkg install luci-app-ddns
- Go to LuCI administration interface > Services > Dynamic DNS.
- I used a Free DNS provider named freedns.afraid.org.
Source
Samba network share
-
# opkg install luci-app-samba
- Go to LuCI administration interface > Services > Network Shares.
- Add shared directories:
- Name: samba
- Path: /Path/to/mounted/usb/key
- Allowed user: empty
- Create mask: 777
- Directory mask: 777
Source
SFTP server
-
# opkg update && opkg install openssh-sftp-server
- Use Filezilla or other to connect to sftp server.
Source