Tutorials
Monday, 04 May 2015 20:00

Recover bricked TL-MR3020

If your TL-MR3020 router is bricked with the following symptoms, most likely you can use this method to recover it.

  1. Ping the router without problem
  2. Telnet connection failed
  3. SSH connection failed

 

Solution:

  1. Put the router switch to AP mode
  2. Turn on the router power
  3. Push and hold the "WPS" button
  4. When the WPS Led flash slowly, switch on AP mode to 3G mode. The LED should flash quicky.

Now, you can Telnet to router

 

Erase the root data

Login to the router via telnet and enter the following command. Most likely your router is now recovered. 

mtd -r erase rootfs_data

Continue following procedures if it is still not working.

 

Copy firmware to router

  • Login to router via telnet and change the password in order to enable SSH
passwd
  • Copy the OpenWRT firmware to the router /tmp folder. I personally like and use WinSCP.

 

Upload the firmware to router

SSH to router and write the firmware to router. Where code.bin is your OpenWRT firmware file. 

mtd -r write code.bin firmware

Reboot the router and your router should be working now. If all the above methods is not working for you, then you should go for Serial Console method to recover the bricked router.

Wednesday, 18 June 2014 23:34

Removing Applications from Raspberry Pi

You might want to remove some applications to free up some space on SD card. Use the following syntax to uninstall a program
sudo apt-get –purge remove APPNAME #replace APPNAME with the name of the app you want to remove
An example to remove Scratch program 
sudo apt-get remove scratch
Edit the crontab file
sudo su - #switch to supuer user
crontab -e #edit crontab file

Put this line at the end of the file. This will turn off display at 5.30PM and turn on display at 8.30AM

30 17 * * * tvservice -o

30 8 * * * tvservice -p; fbset -depth 8; fbset -depth 16

 
Crontab syntax:
*     *     *   *    *        command to be executed
-     -     -   -    -
|     |     |   |    |
|     |     |   |    +----- day of week (0-6) (Sunday=0)
|     |     |   +------- month (1-12)
|     |     +--------- day of month (1-31)
|     +----------- hour (0-23)
+------------- minute (0-59)
Wednesday, 21 May 2014 12:46

Raspberry Pi Schedule Reboot

Edit the crontab file
sudo su - #switch to supuer user
crontab -e #edit crontab file

Put this line at the end of the file. This will reboot the Raspberry Pi at 1.30PM every day.
30 13 * * * sudo reboot
 
Crontab syntax:
*     *     *   *    *        command to be executed
-     -     -   -    -
|     |     |   |    |
|     |     |   |    +----- day of week (0-6) (Sunday=0)
|     |     |   +------- month (1-12)
|     |     +--------- day of month (1-31)
|     +----------- hour (0-23)
+------------- minute (0-59)
Example Configuration
  • Raspberry IP: 192.168.0.123
  • Router IP (Gateway): 192.168.0.254
  • Subnet Mask: 255.255.255.0
  
List the network interface we currently have available:
cat /etc/network/interfaces
The output should look like this:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
The line iface eth0 inet dhcp shows that it is currently getting out IP address via DHCP. We need to change this line to iface eth0 inet static.

Edit /etc/network/interfaces
sudo nano /etc/network/interfaces
Change  iface eth0 inet dhcp to iface eth0 inet static and add the following settings just below it:
address 192.168.0.123
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.254
Here is an example:

auto lo

iface lo inet loopback
iface eth0 inet static
address 192.168.0.123
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.254

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Finally, reboot the Raspberry Pi.
 
 
Fixing DNS problems
DNS is the service that converts the website URL, i.e. www.goggle.com into the IP address (173.194.126.36) that is needed for actual communication. 
 
Check your DNS entrie
cat /etc/resolv.conf
 
Here is an example of the output
nameserver 192.168.0.254
The nameserver should same as your gateway (your modem IP). If the nameserver and the gateway is different, you should modify the /etc/resolv.conf file and change the nameserver to your gateway IP.
sudo nano  /etc/resolv.conf
 
 
Page 2 of 6