Discovered this earlier it seems RPi dont like ipv6 and power saving, so you have to disable it unless you want to be stuck in the dark ages

Works on all Raspberry Pi's

wifi fix (put in /etc/sysctl.conf)

  • sudo echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
  • sudo echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf
  • sudo echo "net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf

realtek power save fix

  • cat /sys/module/8192cu/parameters/rtw_power_mgnt 0 is off, 1 is on
  • sudo echo "options 8192cu rtw_power_mgnt=0" >> /etc/modprobe.d/8192cu.conf

turn off stupid power saving (if you want proper performance, from 300 KB/s to +6 MB/s!)

  • cp /etc/network/interfaces /etc/network/interfaces.bak
  • echo "post-up iwconfig wlan0 power off" >> /etc/network/interfaces

set wifi permanently setup
put the below into /etc/network/interfaces

auto wlan0
iface wlan0 inet dhcp
wpa-ssid "mynetwork"
wpa-psk "networkpassword"

useful commands

  • ip link set dev wlan0 down (Link up)
  • ip link set dev wlan0 up (Link down)