View Single Post
Posts: 415 | Thanked: 1,124 times | Joined on Feb 2014 @ Germany
#192
I stumbled upon this post on TJC about wifi tethering on Xperia X. After some testing and modyfing of the script by joschobart, i think we finally got working wifi tethering on the Nexus 5.

For any one willing to try download or grab the attachment and remove the txt extension.

Do not copy and paste the script from the code box!
It's just there so that you can see what you get

Code:
#!/bin/bash

##Original script by joschobart can be found here: https://together.jolla.com/question/170006/xperia-x-wlan-sharing-not-working/ ##

if [ "$EUID" -ne 0 ]
  then echo "Please run as root (type devel-su first)"
  exit 1
fi

if [[ $1 == "off" ]]; then
  echo "Switch Tethering off..."
  /bin/dbus-send --print-reply --type=method_call --system --dest=net.connman /net/connman/technology/wifi net.connman.Technology.SetProperty string:Powered variant:boolean:false > /dev/null 2>&1
  sleep 1
  echo 0 > /sys/module/bcmdhd/parameters/op_mode
  /bin/dbus-send --print-reply --type=method_call --system --dest=net.connman /net/connman/technology/wifi net.connman.Technology.SetProperty string:Powered variant:boolean:true > /dev/null 2>&1
  sleep 1
  ifconfig wlan0 down
  ifconfig wlan0 up
  systemctl restart connman
  echo "...Tethering should be turned off now"
  exit 0
elif [[ $1 == "on" ]]; then
  echo "Switch Tethering ON.."
  /bin/dbus-send --print-reply --type=method_call --system --dest=net.connman /net/connman/technology/wifi net.connman.Technology.SetProperty string:Powered variant:boolean:false > /dev/null 2>&1
  sleep 1
  echo 2 > /sys/module/bcmdhd/parameters/op_mode
  sleep 1
  echo "Now enable hotspot (\"Settings > Internet sharing\")"
  read -p "Done with the instruction above? Then press [Enter] to continue..."
  ip link set dev wlan0 master tether
  sleep 1
  echo "Enjoy tethering on your Nexus5 ;)"
  exit 0
else
  echo "USAGE: $0 <on><off>"
  exit 1
fi
then make the file executable:
Code:
chmod +x hotspot.sh
.

To turn on tethering run
Code:
devel-su ./hotspot.sh on
and follow the instructions. Please wait until the Hotspot enable button stops blinking until you proceed.

To stop tethering
Code:
devel-su ./hotspot.sh off
should be enough.
Attached Files
File Type: txt hotspot.sh.txt (1.5 KB, 9 views)

Last edited by mautz; 2017-11-30 at 07:22.
 

The Following 7 Users Say Thank You to mautz For This Useful Post: