maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Is it possible for N900 to use another phone as a 3G modem over bluetooth? (https://talk.maemo.org/showthread.php?t=37198)

Matan 2009-12-14 20:11

Is it possible for N900 to use another phone as a 3G modem over bluetooth? Answer: Yes, it is.
 
I want to connect the N900 to another phone in the same way as I do with the N810. Is it possible? How?

(Note to moderators: please don't merge this thread with irrelevant threads).

Matan 2009-12-19 15:42

Re: Is it possible for N900 to use another phone as a 3G modem over bluetooth?
 
The answer is yes, but it is not easy to setup. Nokia introduced a bug to the kernel that causes the kernel to OOPS when ppp over rfcomm is started. Maybe this is why they did not include this very basic feature?
  • To connect to a phone you need the ppp modules which are not included in the kernel. They can be downloaded here:
    http://my.arava.co.il/~matan/770/n90...mantle1.tar.gz
    Open this file under /lib/modules/current and run (as root) depmod -a . After that the modules will be loaded automatically when needed. Only ppp_async is different from the modules by fanoush: http://talk.maemo.org/showpost.php?p=414731&postcount=5
  • Install pppd package from the above link.
  • After pairing the phone from the GUI, you need to setup rfcomm. Create a file /etc/bluetooth/rfcomm with contents similar to
    Code:

    rfcomm2 {
            bind no;
            device 00:1E:A4:4F:0E:34;
            channel 2;
    }

    replace the address with the BT address of your phone.
  • Setup PPP for GPRS: You need the following files:
    /etc/ppp/peers/gprs:
    Code:

    /dev/rfcomm2
    connect "/usr/sbin/chat -s -v -f /etc/ppp/chat/gprs"
    nocrtscts
    defaultroute
    usepeerdns

    /etc/ppp/chat/gprs:
    Code:

    ABORT  'BUSY'
    ABORT  'NO CARRIER'
    ABORT  'ERROR'
    ''      AT
    OK      AT+CGDCONT=1,"IP","uinternet"
    OK      ATDT*99***1#
    CONNECT

    replace uinternet with the correct APN for your connection.
    /etc/ppp/ip-up.d:
    Code:

    echo nameserver $DNS1 > /tmp/resolv.conf.ppp0
    echo nameserver $DNS2 >> /tmp/resolv.conf.ppp0

    Make this file executable by running chmod a+x /etc/ppp/ip-up.d
  • For maemo applications to know of the connection, you need dummy connections. Install the package (see here: http://talk.maemo.org/showpost.php?p=433821&postcount=2 ). and run the commands:
    Code:

    gconftool-2 -s -t string /system/osso/connectivity/IAP/orange/type DUMMY
    gconftool-2 -s -t string /system/osso/connectivity/IAP/orange/name 'orange'

    You can replace the name orange with any name.
  • To connect run the commands:
    Code:

    rfcomm bind 2
    dbus-send --type=method_call --system --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:orange uint32:0
    pppd call gprs

    (The first command is only needed once per boot.)
  • To disconnect, run the commands
    Code:

    dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true
    killall pppd


fanoush 2009-12-19 19:54

Re: Is it possible for N900 to use another phone as a 3G modem over bluetooth?
 
Quote:

Originally Posted by Matan (Post 434448)
Only ppp_async is different from the modules by fanoush: http://talk.maemo.org/showpost.php?p=414731&postcount=5

People who tried those modules said they were not working. Updated ones are here http://talk.maemo.org/showthread.php...735#post423735

But still ppp_async is probably still broken there, what did you fix in ppp_async code?

Matan 2009-12-19 20:48

Re: Is it possible for N900 to use another phone as a 3G modem over bluetooth?
 
In short, tty_ldisc_ops.receive_buf was changed from void to int (and the return value is used somewhere), but in ppp_async.c, the function was not changed from void.

Code:

--- ppp_async.c.org        2009-12-19 17:45:28.000000000 +0200
+++ ppp_async.c        2009-12-19 14:32:23.000000000 +0200
@@ -346,22 +346,30 @@
  * This can now be called from hard interrupt level as well
  * as soft interrupt level or mainline.
  */
-static void
+static int
 ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf,
                  char *cflags, int count)
 {
        struct asyncppp *ap = ap_get(tty);
        unsigned long flags;
 
-        if (!ap)
-                return;
+        if (!ap) {
+                return 0;
+        }
        spin_lock_irqsave(&ap->recv_lock, flags);
        ppp_async_input(ap, buf, cflags, count);
        spin_unlock_irqrestore(&ap->recv_lock, flags);
        if (!skb_queue_empty(&ap->rqueue))
                tasklet_schedule(&ap->tsk);
        ap_put(ap);
        tty_unthrottle(tty);
+        return count;
 }
 
 static void


Matan 2010-01-14 17:56

Re: Is it possible for N900 to use another phone as a 3G modem over bluetooth?
 
Update for PR1.1: DNS resolver change. you need to change in the file /etc/ppp/ip-up.d/dns the two occurrences of tmp to var/log for DNS to work.

PTzero 2010-01-16 13:35

Re: Is it possible for N900 to use another phone as a 3G modem over bluetooth?
 
Hi Matan,
Thanks for your tutorial. I followed the instructions but still can't connect. I added the section for /etc/bluetooth/rfcomm but the command "rfcomm bind 2" wouldn't work until I renamed the file /etc/bluetooth/rfcomm.conf.

Also, on my N900, /etc/ppp/ip-up.d is an existing directory. I renamed the directory and created a text file with the commands and chmod. Is that the correct thing to do?

Finally, when I try to connect I get the following error:

Nokia-N900-42-11:/etc/bluetooth# pppd call gprs
pppd: The remote system is required to authenticate itself
pppd: but I couldn't find any suitable secret (password) for it to use to do so.

Searching on the web I found hints to add "noauth" to the script, so I added it to /etc/ppp/peers/gprs. Doing this got rid of the error message but I'm still unable to connect. Can you help me? Thanks.

-Pete

new004lagmaster 2010-01-16 21:33

Re: Is it possible for N900 to use another phone as a 3G modem over bluetooth?
 
OK i am a little closer to getiing this working but i have no idea what i need to name the files in the /etc/ppp/xxxx/gprs.

new004lagmaster 2010-01-19 12:50

Re: Is it possible for N900 to use another phone as a 3G modem over bluetooth?
 
Quote:

Originally Posted by PTzero (Post 476135)
Hi Matan,
Thanks for your tutorial. I followed the instructions but still can't connect. I added the section for /etc/bluetooth/rfcomm but the command "rfcomm bind 2" wouldn't work until I renamed the file /etc/bluetooth/rfcomm.conf.

Also, on my N900, /etc/ppp/ip-up.d is an existing directory. I renamed the directory and created a text file with the commands and chmod. Is that the correct thing to do?

Finally, when I try to connect I get the following error:

Nokia-N900-42-11:/etc/bluetooth# pppd call gprs
pppd: The remote system is required to authenticate itself
pppd: but I couldn't find any suitable secret (password) for it to use to do so.

Searching on the web I found hints to add "noauth" to the script, so I added it to /etc/ppp/peers/gprs. Doing this got rid of the error message but I'm still unable to connect. Can you help me? Thanks.

-Pete

OK i am having the same problem and when i run the script after rfcomm bind 2 i get this:

must use org.mydomain.intertface.method notation, no dot in "string:orange"

Thanks in advance.

Matan 2010-01-19 12:59

Re: Is it possible for N900 to use another phone as a 3G modem over bluetooth?
 
There are some mistakes in my instructions:

/etc/bluetooth/rfcomm indeed needs to be /etc/bluetooth/rfcomm.conf

The ...nameserver... script should be called /etc/ppp/ip-up.d/dns, so /etc/ppp/ip-up.d/ should still be a directory. Note that there is an update later in the thread for PR1.1.

About the rfcomm bind problem - can you post the content of your rfcomm.conf file?

new004lagmaster 2010-01-20 04:16

Re: Is it possible for N900 to use another phone as a 3G modem over bluetooth?
 
Quote:

#
# RFCOMM configuration file.
#

#rfcomm0 {
# # Automatically bind the device at startup
# bind no;
#
# # Bluetooth address of the device
# device 11:22:33:44:55:66;
#
# # RFCOMM channel for the connection
# channel 1;
#
# # Description of the connection
# comment "Example Bluetooth device";
#}

rfcomm2 {
bind no;
device 00:21:06:28:91:33;
channel 2;
}
is my rfcomm.conf file. I guess i should say that i updated before i started this hack if that has any thing to do with this. I have redone the up-ip.d file and folder so that is taken care of.

Thanks again for your help


All times are GMT. The time now is 23:47.

vBulletin® Version 3.8.8