View source for Bt-net-script

From Openmoko

Jump to: navigation, search

You do not have permission to edit this page, for the following reasons:

  • The action you have requested is limited to users in the group: Administrators.
  • You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page:

Return to Bt-net-script.

Personal tools

Just copy the block below into a script called bt-net, and run bt-net to initiate IP over bluetooth.

Don't forget to change XX:XX:XX:XX:XX:XX out for the bluetooth interface on your PC, as found by executing "hcitool scan" on your neo.

#!/bin/sh
echo '1' > /sys/bus/platform/devices/gta01-pm-bt.0/power_on 

#!!! change XX... to your correct PC bluetooth interface id (use "hcitool scan" to find it) !!!
export PC_BT_ID=XX:XX:XX:XX:XX:XX
sleep 1

#Winders stuff
#pand -c $1 -r PANU -d NAP -e bnep0 -A -E -S
#pand -n -c $1 -r PANU -d NAP -e bnep0 -A -E -S

pand -c $PC_BT_ID --service NAP --autozap

#wait for main pc to set up route
while ! pand -l | grep bnep0
do
  echo waiting to connect
  pand -c $PC_BT_ID --service NAP --autozap
  sleep 1
done


ip a add 10.0.0.2/24 dev bnep0
ip r del default
ip r add default via 10.0.0.1