Difference between revisions of "IMote2Howto"

From University of Washington - Ubicomp Research Page
Jump to: navigation, search
m
m
Line 3: Line 3:
  
 
Typically this just says "Imote2"; however, if there are 6 iMote2's around this is somewhat annoying since you need to then figure out the mac address since Windows and the phones typically don't show the MAC address by default. To make this a bit easier we use the following:
 
Typically this just says "Imote2"; however, if there are 6 iMote2's around this is somewhat annoying since you need to then figure out the mac address since Windows and the phones typically don't show the MAC address by default. To make this a bit easier we use the following:
 +
<bash>sed -i -e 's/name \".*/name \"iMote2-'`hcitool dev | grep hci0 | cut -f 3| cut -f 5-6 -d ":"`'\"/g' /etc/bluetooth/hcid.conf</bash>
 +
 +
 +
 +
=== Old Method ===
 +
<ul>
 
<bash>hcitool dev | grep hci | awk '{printf "sed -i -e \"s/\"Imote2\"/iMote2 - "$2"/g\" /etc/bluetooth/hcid.conf "}'</bash>
 
<bash>hcitool dev | grep hci | awk '{printf "sed -i -e \"s/\"Imote2\"/iMote2 - "$2"/g\" /etc/bluetooth/hcid.conf "}'</bash>
  
Line 18: Line 24:
 
     fi
 
     fi
 
fi</bash>
 
fi</bash>
 
+
</ul>
  
 
== Useful mknod commands ==
 
== Useful mknod commands ==

Revision as of 01:17, 1 March 2007

Change the Bluetooth name

The name that shows up during discovery is stored in /etc/bluetooth/hcid.conf

Typically this just says "Imote2"; however, if there are 6 iMote2's around this is somewhat annoying since you need to then figure out the mac address since Windows and the phones typically don't show the MAC address by default. To make this a bit easier we use the following: <bash>sed -i -e 's/name \".*/name \"iMote2-'`hcitool dev | grep hci0 | cut -f 3| cut -f 5-6 -d ":"`'\"/g' /etc/bluetooth/hcid.conf</bash>


Old Method

    <bash>hcitool dev | grep hci | awk '{printf "sed -i -e \"s/\"Imote2\"/iMote2 - "$2"/g\" /etc/bluetooth/hcid.conf "}'</bash> If hcitool doesn't return a dev this should output anything, and if it returns something unexpected the name should still at least say iMote2 - "something". Since I'm not sure of how to make the shell execute this directly we'll just cat it to a file and execute it: <bash># If our btMACAddress file doesn't exist create one and set the mac: if [ ! -f /etc/btMACAddress ]; then rm -f /tmp/btAddrCmd echo "Setting Bluetooth hostname" hcitool dev | grep hci | awk '{printf "sed -i -e \"s/name \\\".*/name \\\"iMote2 - "$2"\\\"/g\" /etc/bluetooth/hcid.conf "}' > /tmp/btAddrCmd hcitool dev | grep hci > /etc/btMACAddress # if the file exists execute, and remove it if [ -e /tmp/btAddrCmd ]; then sh /tmp/btAddrCmd rm -f /tmp/btAddrCmd fi fi</bash>

Useful mknod commands

<bash>mknod /dev/ppp c 108 0 mknod /dev/mtdblock0 b 31 0 mknod /dev/mtdblock1 b 31 1 mknod /dev/mtdblock2 b 31 2 mknod /dev/rfcomm0 c 216 0 mknod /dev/rfcomm1 c 216 1 mknod /dev/rfcomm2 c 216 2 mknod /dev/rfcomm3 c 216 3</bash>


Copy the jffs2 image from a running system

<bash>mknod /dev/mtdblock2 b 31 2 dd if=/dev/mtdblock2 of=/mnt/mmc/fs.img bs=131072</bash>