Notes from trying to connect IPAQ running familiar 0.7 Linux with Ericsson T68i mobile phone GPRS over bluetooth in order to run ppp for internet. I have used my Pocket PC IPAQ only to read email and bbc news (only news site I know with a text only version). So The hope was thet with linux my IPAQ would do more (but still read email and news via bluetooth and GPRS) Henrik Bjorkman www.eit.se/hb --------------------------------------------------------------------------- 2003-07-29 Familiar 0.7 pre on IPAQ 3970 Doing backup of wince image failed. Dont know why, perhaps some possibility to save the file elsewhere than internal memory could have helped. Went ahead anyway. At least the boot immage was possible to save and pocketPC was not that much to loose anyway. It took time to figure out that to get a keyboard its icon needs to be added to the bottom list. Would have been helpfull it it was active by default. Then bluetooth manager was added same way as keyboard. So now radio could be turned on and it found my other bluetooth devices. But still some configuration is needed for Setting up ppp over bluetooth. Don't know how to do that. Found this guide: http://www.handhelds.org/z/wiki/BluetoothHowto Acording to that guide a file /etc/init.d/bluez is needed. Logged in via serial port in order to check that. First thing needed was an editor. Did not know how to use vi. Did some searching on google. http://docs.freebsd.org/44doc/usd/12.vi/paper.html With that at least I managed to close vi... I think the BluetoothHowto is not up to date in this matter anyway. Since the Bluetooth modules needed are now already installed. Trying familiar 0.7 stable OPIE http://familiar.handhelds.org/familiar/releases/v0.7/install/download.html Note that the bootldr now expects ymodem by default, not xmodem as in earlier versions. If you are unable to use ymodem for some reason, you can revert to xmodem operation with the command set ymodem 0 OPIE was installed. Could not figure out how to start bluetooth though. Trying familiar 0.7 stable GPE /etc/bluetooth # hcid /etc/bluetooth # hcitool scan Scanning ... 00:80:37:E9:25:B5 Henriks T68i 00:50:F2:7D:53:95 ORION20 /etc/bluetooth # 12ping 00:80:37:E9:25:B5 12ping: No such file or directory /etc/bluetooth # changed pin code in /etc/bluetooth/pin reboot IPAQ. Used the bluetooth icon in the taskbar to start radio Now it was possible do pairing initiated from telephone http://dnsv6.iihe.ac.be/iPAQGPRSv6/BtConfig.html Now need to do hciattach or hciconfig Dont know how. ~ # hciattach -l any 0x0000,0x0000 ericsson 0x0000,0x0000 digi 0x0000,0x0000 texas 0x0000,0x0000 bcsp 0x0000,0x0000 xircom 0x0105,0x080a csr 0x0000,0x0000 bboxes 0x0160,0x0002 swave 0x0000,0x0000 picocard 0x025e,0x1000 inventel 0x0000,0x0000 comone 0xffff,0x0101 ~ # hciconfig hci0: Type: UART BD Address: 00:02:C7:11:0B:69 ACL MTU: 128:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX bytes:1335 acl:1 sco:0 events:43 errors:0 TX bytes:1167 acl:1 sco:0 commands:29 errors:0 ~ # Searched more on google. http://www.holtmann.org/linux/bluetooth/devices.html hci_uart http://handhelds.org/pipermail/ipaq/2003-January/016527.html Redirect boot messages to serial port. Found this at: handhelds.org/pipermail/ipaq/2003-January/016527.html Use following option to boot the kernel and watch all boot messages on serial port: ---------------------------------------- cat > /boot/params << EOF set kernel_filename "boot/zImage-2.4.19-rmk6-pxa1-hh13" set linuxargs "noinitrd root=/dev/mtdblock1 init=/linuxrc console=tty0 console=ttyS0,115200n8" EOF ---------------------------------------- Perhaps you need to change kernel_filename to what you have. But I did not get this to work anyway. --------------------------------------------------------------------------- 2003-07-30 Just a check to see what bluetooth stuff came with familiar 0.7-gpe: -------------------------------------------------- /etc # ipkg list | grep blue blueprobe - Bluetooth hardware detection utility bluetooth-bluecard-modules - bluetooth-bluecard modules for kernel 2.4.19-rmk6-pxa1-hh13 bluetooth-bluecard-modules - bluetooth-bluecard modules for kernel 2.4.19-rmk6-pxa1-hh13 bluetooth-bt3c-modules - bluetooth-bt3c modules for kernel 2.4.19-rmk6-pxa1-hh13bluetooth-bt3c-modules - bluetooth-bt3c modules for kernel 2.4.19-rmk6-pxa1-hh13bluetooth-btuart-modules - bluetooth-btuart modules for kernel 2.4.19-rmk6-pxa1-hh13 bluetooth-btuart-modules - bluetooth-btuart modules for kernel 2.4.19-rmk6-pxa1-hh13 bluetooth-control - Bluetooth Control script allows controling the basic BT Radio functionality bluetooth-dtl1-modules - bluetooth-dtl1 modules fore kernel 2.4.19-mk6-pxa1-hh13bluetooth-dtl1-modules - bluetooth-dtl1 modules for kernel 2.4.19-rmk6-pxa1-hh13bluetooth-modules - bluetooth modules for kernel 2.4.19-rmk6-pxa1-hh13 bluetooth-modules - bluetooth modules for kernel 2.4.19-rmk6-pxa1-hh13 bluetooth-uart-modules - bluetooth-uart modules for kernel 2.4.19-rmk6-pxa1-hh13bluetooth-uart-modules - bluetooth-uart modules for kernel 2.4.19-rmk6-pxa1-hh13bluez-dun - BlueZ DUN bluez-hcidump - BlueZ 2.0 debugging tool bluez-libs - BlueZ 2.0 client libraries bluez-pan - BlueZ PAN bluez-pin - Bluetooth PIN helper bluez-pin2 - Bluetooth PIN helper bluez-rfcomm - rfcomm client implementation bluez-sdp - Service Discovery Protocol server and client tool bluez-utils - BlueZ utilities gpe-bluetooth - GPE Bluetooth manager pskey - PSKey utility to configure CSR bluetooth modules in BCSP mode task-bluez - The suite of BlueZ tools -------------------------------------------------- At http://www.oliverw.net/archive/000590.html I found a link to a bluez howto. http://www.hanscees.com/bluezhowto.html Try like this changed pin code in /etc/bluetooth/pin echo "123456" > /etc/bluetooth/pin rebooted ipaq for this to take effect (probly there is a faster way than reboot). Then one should start radio. I wish I knew how to do it from command line: Somehow something done with hciattach but I dont know how. Have tried: hciattach /dev/ttySB0 csr hciattach /dev/hci0 csr hciattach /dev/tts/0 csr hciattach /dev/ttyS0 csr 115200 flow hciattach /dev/tts/0 csr 115200 flow The bluetooth should be started hcid -f /etc/bluetooth/hcid.conf I get no message when doing this. After that the blue lamp should start flashing in IPAQ But I dont know how to do it from command line instead I start using the bluetooth icon on the panel. It should be possible to check that it is up with: hciconfig hci0 up But I get noting from that command. Get own bd address (I guess bd stands for bluetoothdevice or something): -------------------------------------------------- /etc # hcitool dev Devices: hci0 00:02:C7:11:0B:69 -------------------------------------------------- Then it is possible to discover other bluetooth units etc with hcitool. Ofcourse telephone etc must be set to be discoverable: -------------------------------------------------- /etc # hcitool scan Scanning ... 00:80:37:E9:25:B5 Henriks T68i 00:50:F2:7D:53:95 ORION20 -------------------------------------------------- paring initiated from the telephone worked. It should be possible to do from IPAQ side also, Wish I knew how. Check if the device offer DUN (dial up networking) -------------------------------------------------- /etc # sdptool search --bdaddr 00:80:37:E9:25:B5 DUN Searching for DUN on 00:80:37:E9:25:B5 ... Service Name: Dial-up Networking Service RecHandle: 0x10000 Service Class ID List: "Dialup Networking" (0x1103) "Generic Networking" (0x1201) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 1 Profile Descriptor List: "Dialup Networking" (0x1103) Version: 0x0100 -------------------------------------------------- Read http://www.hanscees.com/bluezhowto.html chapter 6.3 You have a mobile phone and you want to dial into your isp Now bind a TTY port to your phone and use dialup utilities that you use with serial ports. In my case: -------------------------------------------------- rfcomm bind 0 00:80:37:E9:25:B5 1 -------------------------------------------------- That gives nothing back at the prompt, but according to the howto a line should apear in /var/log/messages saying BlueZ RFCOMM ver 0.4 But I found no file called /var/log/messages on my IPAQ. On the IPAQ screen under settings there is an ICON "show logfile". The output is found there. /dev/rfcomm0 did not exist either, the howto say that then it should be created. It say that all from 0 to 255 should be created by doing: -------------------------------------------------- for i in `seq 0 255` do if [ ! -c /dev/rfcomm$i ]; then mknod -m 666 /dev/rfcomm$i c 216 $i fi done -------------------------------------------------- That did not work for fom me on my IPAQ. Trying to create a few one by one: mknod -m 666 /dev/rfcomm0 c 216 0 mknod -m 666 /dev/rfcomm1 c 216 1 mknod -m 666 /dev/rfcomm2 c 216 2 mknod -m 666 /dev/rfcomm3 c 216 3 mknod -m 666 /dev/rfcomm4 c 216 4 mknod -m 666 /dev/rfcomm5 c 216 5 mknod -m 666 /dev/rfcomm6 c 216 6 mknod -m 666 /dev/rfcomm7 c 216 7 So now I have some. Should I try "rfcomm bind..." again? I guess so. -------------------------------------------------- /dev # rfcomm bind 0 00:80:37:E9:25:B5 1 Can't create device: Address already in use -------------------------------------------------- nope that was not right. Did: ln -s /dev/rfcomm0 /dev/modem hciconfig should show something now. -------------------------------------------------- /dev # hciconfig hci0: Type: UART BD Address: 00:02:C7:11:0B:69 ACL MTU: 128:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX bytes:2537 acl:9 sco:0 events:58 errors:0 TX bytes:1991 acl:5 sco:0 commands:40 errors:0 -------------------------------------------------- now simply do kppp: -------------------------------------------------- /dev # kppp kppp: No such file or directory -------------------------------------------------- That did not work, probably kppp is kde something... Try to figure out if we have some other ppp ipkg list | grep ppp -------------------------------------------------- /dev # ipkg list | grep ppp ppp - Point-to-Point Protocol (PPP) Daemon ppp-modules - ppp modules for kernel 2.4.19-rmk6-pxa1-hh13 ppp-modules - ppp modules for kernel 2.4.19-rmk6-pxa1-hh13 -------------------------------------------------- I dont know how to initiate a dialup ppp from linux so I wish to test if I at all have conntact with the modem in the phone befor doing any work on that. To test I need a terminal program... --------------------------------------------------------------------------- 2003-07-31 Decided to set up ppp over serial line first: http://www.handhelds.org/z/wiki/PPPHowto as root on destop gave command: /usr/sbin/pppd /dev/ttyS0 115200 192.168.0.1:192.168.0.2 nodetach local noauth nocrtscts lock user ppp connect "/usr/sbin/chat -v -t3 ogin--ogin: ppp" then ssh root@192.168.0.2 It worked! That was easy. --------------------------------------------------------------------------- 2003-08-02 Downloaded minicom_2.00.0_arm.ipk from: http://ipkgfind.handhelds.org/details.phtml?package=minicom&official=&format= used scp to copy it to IPAQ installed with ipkg -offline /root install minicom_2.00.0_arm.ipk minicom needed some other packages. Perhapps better to get full internet on the IPAQ first. --------------------------------------------------------------------------- 2003-08-03 See the Iptables and MASQUERADING -mini-HOWTO http://www.wbglinks.net/pages/reads/chainstables/iptablesmasq.html In that instructionen changed 192.168.0.1 for 192.168.0.0/255.255.255.0. Gave command: echo 1 > /proc/sys/net/ipv4/ip_forward Now IPAQ could ping ip adresses on the internet but nameserver needed also. Copy /etc/resolv.conf from desktop to IPAQ wit scp. scp /etc/resolv.conf root@192.168.0.2:/etc Now IPAQ can reach internet. That was not too hard. Now it was easy to install minicom ipkg install minicom minicom said no such device when configured to use /dev/rfcomm0 well I have done much experimenting so rebooted IPAQ. Starting pppd service on the desktop needs to be done each time IPAQ is rebooted. /usr/sbin/pppd /dev/ttyS0 115200 192.168.0.1:192.168.0.2 nodetach local noauth nocrtscts lock user ppp connect "/usr/sbin/chat -v -t3 ogin--ogin: ppp" Started bluetooth things again same as I did 2003-07-30. Yes now IPAQ do speek with the AT commands in the T68i phone! I could make it dial my home number with ATD. All remaining should be a question of setting up ppp dialup as on any linux box. If I only knew how... § Some googleing found this site. http://www.faqs.org/docs/Linux-mini/BTI-PPP.html#AEN123 I wish to use GPRS so most of that was irellevant. But perhaps I need a chatscript. cat > /etc/ppp/chatscript << EOF "" "ATZ" # The next two lines should be left commented out until # the script works. # "OK" "ATL0" # "OK" "ATM0" SAY "Dialing modem...\n" "OK" "ATDT*99#" ABORT "NO CARRIER" ABORT "NO DIALTONE" ABORT "ERROR" ABORT "NO ANSWER" ABORT BUSY ABORT "Username/Password Incorrect" TIMEOUT 60 CONNECT \c EOF Testing link pppd /dev/rfcomm0 connect '/usr/sbin/chat -v -f /etc/ppp/chatscript' updetach debug pppd /dev/rfcomm0 connect '-v -f /etc/ppp/chatscript' updetach debug I have no /usr/sbin/chat so this did not work. Nothing works time to reboot again. 1) Start ppp service on desktop: /usr/sbin/pppd /dev/ttyS0 115200 192.168.0.1:192.168.0.2 nodetach local noauth nocrtscts lock user ppp connect "/usr/sbin/chat -v -t3 ogin--ogin: ppp" 2) Loggin on the iPAQ screen. 3) Switch radio on from the bluetooth icon on the lower rigth of the iPAQ screen 4) Loggin using ssh from the desktop ssh root@192.168.0.2 5) Just check some things again (not really needed if you are sure) pin code: cat /etc/bluetooth/pin Should give a number something like 123456 hcitool dev Devices: hci0 00:02:C7:11:0B:69 Make phone discoverable. Scan for other bluetooth units hcitool scan Scanning ... 00:80:37:E9:25:B5 Henriks T68i 00:50:F2:7D:53:95 ORION20 Check if phone give DUN service: sdptool search --bdaddr 00:80:37:E9:25:B5 DUN Searching for DUN on 00:80:37:E9:25:B5 ... Service Name: Dial-up Networking Service RecHandle: 0x10000 Service Class ID List: "Dialup Networking" (0x1103) "Generic Networking" (0x1201) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 1 Profile Descriptor List: "Dialup Networking" (0x1103) Version: 0x0100 It did on channel 1 and bd address is still 00:80:37:E9:25:B5. This numbers will be used with rfcomm 6) Bind telephones DUN service to /dev/rfcomm0 rfcomm bind 0 00:80:37:E9:25:B5 1 mknod -m 666 /dev/rfcomm0 c 216 0 7) Just some more check (not really needed if you are sure) hciconfig hci0: Type: UART BD Address: 00:02:C7:11:0B:69 ACL MTU: 128:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX bytes:893 acl:0 sco:0 events:21 errors:0 TX bytes:540 acl:0 sco:0 commands:15 errors:0 8) At this point it was possible to give commands to the phone with minicom. Will skip that this time. Now we need to make pppd initiate a connection using a chat script. I still have no /usr/sbin/chat. --------------------------------------------------------------------------- 2003-08-03 More googling, this time found: http://www.hanscees.com/bluezhowto.html But not much new, that howto use kppp which I dont have on my iPAQ. More googling, this time found: http://www.connecteduser.com/a006.php Looks like a very ambitious instruction on how to use some GUI tools not yet in the stable release. Looks promising. But I have started doing things from command line I wish to try that a little more first. More googling found this page http://www.lysator.liu.se/~torkel/computer/ipaq/irda_cellphone_ppp.html#atcomm Perhaps I need a pap secrets although GPRS dont need password? cat > /etc/ppp/pap-secrets << EOF # Secrets for authentication using PAP # client server secret IP addresses foo * bar EOF no that was not needed I think. At this site: http://ols.vsb.cz/2002-10-29/ipaq/prezentace/ipaq.pdf I saw that the 12ping I tried some days ago was not 12ping but l2ping. On my linux box I can not see any difference between 1 and l. Grr, fonts have never been good on Linux. Microsoft is better on that. Further I now see that I do have a /usr/sbin/chat already. How could I missed it. cat > /etc/ppp/peers/gprsbt << EOF file /etc/ppp/options.gprs connect "/usr/sbin/chat -f /etc/ppp/chat.gprs" EOF cat > /etc/ppp/options.gprs << EOF # pppd shall not propose IP address to other peer. noipdefault # Accept peers idea of address ipcp-accept-local # Add default route defaultroute EOF cat > /etc/ppp/chat.gprs << EOF ABORT "BUSY" "" "\d" SAY "reseting modem\n" "" "atz" SAY "echo on\n" "" "ate1" SAY "dialing\n" OK "atdt*99***1#" TIMEOUT 60 CONNECT \c SAY "connected\n" EOF pppd /dev/rfcomm0 call gprsbt pppd /dev/rfcomm0 connect '/usr/sbin/chat -v -f /etc/ppp/chat.gprs' /etc/ppp # pppd /dev/rfcomm0 call gprsbt reseting modem echo on dialing connected Serial connection established. Using interface ppp1 Connect: ppp1 <--> /dev/rfcomm0 Warning - secret file /etc/ppp/pap-secrets has world and/or group access LCP: Rcvd Code-Reject for code 9, id 0 not replacing existing default route to ppp0 [192.168.0.1] local IP address 10.16.133.181 remote IP address 10.16.133.180 primary DNS address 217.174.65.61 secondary DNS address 217.174.65.62 LCP: Rcvd Code-Reject for code 9, id 1 LCP: Rcvd Code-Reject for code 9, id 2 No response to 3 echo-requests Serial link appears to be disconnected. Connection terminated. Connect time 0.3 minutes. Sent 96 bytes, received 64 bytes. /etc/ppp # Trying like this: cat > /etc/ppp/peers/gprsbt << EOF /dev/rfcomm0 115200 crtscts connect "/usr/sbin/chat -v -f /etc/ppp/chat.gprs" noauth EOF pppd call gprsbt No still dont work. Trying this: cat > /etc/ppp/chat.gprs << EOF ABORT "BUSY" "" "\d" SAY "reseting modem\n" "" "atz" SAY "echo on\n" "" "ate1" SAY "connecting\n" OK 'AT+CGDATA="PPP",1' SAY "dialing\n" CONNECT "atdt*99***1#" TIMEOUT 60 SAY "connected\n" EOF No same result. Decided to see if google will find "LCP: Rcvd Code-Reject for code 9, id 2" It did: http://lists.debian.org/debian-user-polish/2003/debian-user-polish-200307/msg00256.html but in polish. Read some articles http://l2tpd.graffl.net/msg00955.html http://l2tpd.graffl.net/msg00956.html echo problem os silent option? Dont know which echo probably not the phone echo but will try just in case. cat > /etc/ppp/chat.gprs << EOF ABORT "BUSY" "" "\d" SAY "reseting modem\n" "" "atz" SAY "connecting\n" OK 'AT+CGDATA="PPP",1' SAY "dialing\n" CONNECT "atdt*99***1#" TIMEOUT 60 SAY "connected\n" EOF No no change. trying: pppd silent call gprsbt No then it hangs during connection. reading pppd man pages. should perhaps try with: lcp‐echo‐interval pppd lcp-echo-interval 0 call gprsbt YES!!!! It works! I can now disconnect the serial cable and surf the internet over bluetooth/GPRS! I wrote a short version. It should be here: http://www.eit.se/hb/misc/text/ipaq_gprs_bluetooth.txt 2003-07-07 Add wanted to have the bind_dun script run automaticaly at each boot. I read the Debian referece guide: http://www.debian.org/doc/manuals/reference/reference.en.html chapter "2.4.3 Customizing the boot process" but could not get that to work. ln -s /etc/init.d/bind_dun /etc/rc3.d/S90bind_dun ln -s /etc/init.d/bind_dun /etc/rc4.d/S90bind_dun ln -s /etc/init.d/bind_dun /etc/rc5.d/S90bind_dun 2003-08-17 I have a 512MB CF card. It seems to be possible to format the entire CF to be ext3 but then I cant exchange files with a Windows laptop. A loopback device seems like a better idea. http://www.handhelds.org/z/wiki/FamiliarLoopbackHowto That howto is for ext2. I dont know if it is just an old howto or if ext3 is not a good idea here but I will try. ipkg install loopback-modules ext3-modules e2fsprogs dd if=/dev/zero of=/mnt/hda/loopfs bs=1M count=256 mkfs.ext3 /mnt/hda/loopfs mkdir /mnt/loop insmod loop mount /mnt/hda/loopfs /mnt/loop -t ext3 -o loop No ext3 did not work (not that way at least) ipkg install loopback-modules ext2-modules e2fsprogs dd if=/dev/zero of=/mnt/hda/loopfs bs=1M count=256 mkfs.ext2 /mnt/hda/loopfs mkdir /mnt/loop insmod loop mount /mnt/hda/loopfs /mnt/loop -t ext2 -o loop That worked Until I moved /usr to the loop filesystem and rebooted. It did not bring up X or ssh, it was still possible to log in via serial port though. Probably the files needed to operate the loop device is now on that loop device :(. Or perhaps I forgot that I must do mount /mnt/loop first. I reinstalled everything so I dont know what went wrong.