Active Topics

 



Notices


Reply
Thread Tools
Posts: 10 | Thanked: 0 times | Joined on Mar 2010
#171
Slight bump here... If this isn't easy to work out, would it be possible to post some documentation on doing basic NAT through the USB connection? I tried simply reversing the host/cellphone instructions for the USB-->PC-->Internet wiki page, but if PC-->USB-->N900-->Internet would be available, that'd be grand as well.
 
Posts: 540 | Thanked: 288 times | Joined on Sep 2009
#172
Originally Posted by Kasperl View Post
Slight bump here... If this isn't easy to work out, would it be possible to post some documentation on doing basic NAT through the USB connection? I tried simply reversing the host/cellphone instructions for the USB-->PC-->Internet wiki page, but if PC-->USB-->N900-->Internet would be available, that'd be grand as well.
AFAIRecall connecting in pc-suite mode allows you to access the gsm modem via AT commands and "dial up" the GPRS connection as one would with bluetooth DUN. I have never tried this myself but on a friends ubuntu laptop it reportedly "just worked".

Also haven't tried the USB networking (in case you want to use the net at the same time from n900 and laptop) but in theory just by changing the wlan0 to usbnet0 (or whatever the interface is called) in what mobilehotspot backend outputs for dnsmasq and ifconfig should do the trick.
 
Posts: 540 | Thanked: 288 times | Joined on Sep 2009
#173
Originally Posted by Kasperl View Post
noth=both, I nearly hit the right keys.

Output attached.
Output looks ok, have you tried without WEP ?

You said manually configuring the ip address on laptop does not give you internet connection; but can you ping the N900 (10.72.83.1 in your case) or resolve the hw address of n900 from laptop (arp 10.72.83.1).

I don't really have good ideas what exactly would be the problem, I have seen this at times with my Mac laptop and never really figured out what caused it. You could try running wireshark on laptop and n900.
 
Posts: 17 | Thanked: 2 times | Joined on Apr 2010
#174
Hi there, this has been giving me problems since the install as it seems to work and my laptop can pick it up, but it just does not want to share the connection. It seems to connect but everything just times out, Joikuspot never worked either. I have titan's kernel and the install seemed fine, but yeah it just has been giving me a lot of trouble. To save anyone some time, here is a few outputs:

~ $ uname-a
Linux Nokia-N900-02-8 2.6.28.10power37 #1 PREEMPT Wed May 26 00:24:03 EEST 2010 armv71 unknown

~ $ /usr/sbin/mobilehotspot_backend start
DEBUG: executing uname -r
DEBUG-read_previous_state: setting state key 'gconf' to value: {'wlan_search_interval': 0}
DEBUG-read_previous_state: setting state key 'kernel' to value: {'loaded_modules': {'x_tables': False, 'nf_nat': True, 'nf_conntrack': True, 'ipt_MASQUERADE': True, 'nf_conntrack_ipv4': True, 'ip_tables': False, 'iptable_nat': True, 'nf_defrag_ipv4': True}}
DEBUG-read_previous_state: setting state key 'icd' to value: {}
DEBUG: executing lsmod
DEBUG: executing insmod /lib/modules/2.6.28.10power37/nf_conntrack.ko
DEBUG: Command output: sh: insmod: not found
Traceback (most recent call last):
File "/usr/sbin/mobilehotspot_backend", line 14, in <module>
sys.exit(backend.cli())
File "/opt/mobilehotspot/libs/backend.py", line 383, in cli
backend.start()
File "/opt/mobilehotspot/libs/backend.py", line 132, in start
self.start_insert_modules()
File "/opt/mobilehotspot/libs/backend.py", line 142, in start_insert_modules
self.state['kernel']['loaded_modules'][modulename] = self.test_insert_module(modulename)
File "/opt/mobilehotspot/libs/backend.py", line 359, in test_insert_module
helpers.exec_cmd('insmod ' + self.module_directory + '/' + module + '.ko')
File "/opt/mobilehotspot/libs/helpers.py", line 12, in exec_cmd
raise Exception("Command '" + cmd + "' returned with code " + str(return_code) + " (" + str(expect_code) + " expected)")
Exception: Command 'insmod /lib/modules/2.6.28.10power37/nf_conntrack.ko' returned with code 32512 (0 expected)
 
Posts: 42 | Thanked: 27 times | Joined on Jun 2010
#175
Hi all, first message on forums

I have been playing with my n900, trying to get it to work as an acces point.

I am using power kernel and iptables packages.

I've managed to make route to internet, with wifi on ad-hoc mode and wep key. Also, with usbip, but the first one is the problematic for me.

As I said, it already works, but there is just some thing that annoys me, I'll explain...

Code:
#!/bin/sh
         
GATEWAY="gprs0"
INTERFACE="wlan0"
IP="192.168.201.1"
KEY="1234567890123"
ESSID="test"       
IGNORE_INTERFACE="lo usb0"
                          
if [[ -f /tmp/dnsmasq.${INTERFACE}.pid ]]; then
        echo "dnsmasq pid found, killing it"
        kill $(cat /tmp/dnsmasq.${INTERFACE}.pid)
fi                                               
  
ifconfig ${INTERFACE} down
iwconfig ${INTERFACE} mode ad-hoc
iwconfig ${INTERFACE} channel auto
ifconfig ${INTERFACE} up          
ifconfig ${INTERFACE} ${IP}
iwconfig ${INTERFACE} key s:${KEY}
iwconfig ${INTERFACE} essid ${ESSID}
                                    
dnsmasq -a ${IP} -d -i ${INTERFACE} -z -C /etc/dnsmasq.${INTERFACE}.conf $(for i in ${IGNORE_INTERFACE}; d
                                                                                                         
iptables -t nat -A POSTROUTING -o ${GATEWAY} -j MASQUERADE                                               
                                                          
PID=${!}                                                  
echo ${PID} > /tmp/dnsmasq.${INTERFACE}.pid
When I launch this script (it puts wlan0 in adhoc, starts a dhcp server on it, and tells iptables to do the natting), I can go to the outside with my laptop, but there are some annoyances.

- with gprs0 down, when I launch the script, I can freely comunicate between laptop and n900.

- with gprs0 up, I can also go to the outside, but i cannot ping from my laptop to the n900, neither from n900 to its own wlan0 address. I can ssh to it, ask for dhcp, get routed... but cannot ping.

- for the script to work, I must first connect to gprs, otherwise, changing the connection status of gprs (from connected to disconnected, or from disconnected to connected) makes the wifi stop working on the n900, and so I must re-run the script to set it up.

I would be glad if somebody knows why some of these things happen, these things make this solution not completely automated.

If somebody wants to try this script, the clean and sure way to go with it is:

- turn wifi down, and up again (for example with wifi switcher)
- connect to gprs
- start the script

I've made something similar with usbip, which is easier, as connection does not get killed with grps connection changes.

Last edited by jormartr; 2010-06-13 at 03:52.
 
Posts: 540 | Thanked: 288 times | Joined on Sep 2009
#176
Originally Posted by kozij View Post
DEBUG: Command output: sh: insmod: not found
...
Exception: Command 'insmod /lib/modules/2.6.28.10power37/nf_conntrack.ko' returned with code 32512 (0 expected)
This is weird, how can insmod not be available/executable and the device still work acceptably ?

Unless of course! You are not root when running the backend script and you did not use sudo...

Try "sudo /usr/sbin/mobilehotspot_backend start", though the frontend should do exactly the same thing so there is some other underlying issue.
 
Posts: 17 | Thanked: 2 times | Joined on Apr 2010
#177
my mistake, wasn't under sudo... here is the output with heightened privileges

/home/user # /usr/sbin/mobilehotspot_backend start
DEBUG: executing uname -r
DEBUG-read_previous_state: setting state key 'gconf' to value: {'wlan_search_interval': 0}
DEBUG-read_previous_state: setting state key 'kernel' to value: {'loaded_modules': {'ip_tables': True, 'nf_nat': True, 'nf_conntrack': True, 'ipt_MASQUERADE': True, 'nf_conntrack_ipv4': True, 'x_tables': True, 'iptable_nat': True, 'nf_defrag_ipv4': True}}
DEBUG-read_previous_state: setting state key 'icd' to value: {'old_connection_type': 'WLAN_INFRA', 'old_connection_name': '07549e44-7336-4fbd-aa32-3541c1781a58'}
DEBUG: executing lsmod
DEBUG: executing lsmod
DEBUG: executing lsmod
DEBUG: executing lsmod
DEBUG: executing lsmod
DEBUG: executing lsmod
DEBUG: executing lsmod
DEBUG: executing lsmod
ERROR:dbus.proxies:Introspect error on :1.80:/com/nokia/icd2: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported: Unsupported interface or method
DEBUG: executing ifconfig wlan0 down
DEBUG: executing iwconfig wlan0 mode ad-hoc
DEBUG: executing ifconfig wlan0 up
DEBUG: executing iwconfig wlan0 essid "N900"
DEBUG: executing ifconfig wlan0 10.246.211.1 netmask 255.255.255.0 up
DEBUG: executing /usr/sbin/dnsmasq -i wlan0 -a 10.246.211.1 -I lo -z -x /var/run/dnsmasq.wlan0.pid --dhcp-range=10.246.211.10,10.246.211.100,6h --dhcp-option=3,10.246.211.1 --dhcp-option=6,10.246.211.1
DEBUG: Command output:
dnsmasq: failed to bind listening socket for fe80::ee9b:5bff:fe01:f6d3: Address already in use
Traceback (most recent call last):
File "/usr/sbin/mobilehotspot_backend", line 14, in &lt;module&gt;
sys.exit(backend.cli())
File "/opt/mobilehotspot/libs/backend.py", line 383, in cli
backend.start()
File "/opt/mobilehotspot/libs/backend.py", line 135, in start
self.start_run_dnsmasq()
File "/opt/mobilehotspot/libs/backend.py", line 249, in start_run_dnsmasq
helpers.exec_cmd(dnsmasq_command + dnsmasq_options)
File "/opt/mobilehotspot/libs/helpers.py", line 12, in exec_cmd
raise Exception("Command '" + cmd + "' returned with code " + str(return_code) + " (" + str(expect_code) + " expected)")
Exception: Command '/usr/sbin/dnsmasq -i wlan0 -a 10.246.211.1 -I lo -z -x /var/run/dnsmasq.wlan0.pid --dhcp-range=10.246.211.10,10.246.211.100,6h --dhcp-option=3,10.246.211.1 --dhcp-option=6,10.246.211.1' returned with code 512 (0 expected)
 
Posts: 540 | Thanked: 288 times | Joined on Sep 2009
#178
Originally Posted by kozij View Post
DEBUG: executing /usr/sbin/dnsmasq -i wlan0 -a 10.246.211.1 -I lo -z -x /var/run/dnsmasq.wlan0.pid --dhcp-range=10.246.211.10,10.246.211.100,6h --dhcp-option=3,10.246.211.1 --dhcp-option=6,10.246.211.1
DEBUG: Command output:
dnsmasq: failed to bind listening socket for fe80::ee9b:5bff:fe01:f6d3: Address already in use
...
Exception: Command '/usr/sbin/dnsmasq -i wlan0 -a 10.246.211.1 -I lo -z -x /var/run/dnsmasq.wlan0.pid --dhcp-range=10.246.211.10,10.246.211.100,6h --dhcp-option=3,10.246.211.1 --dhcp-option=6,10.246.211.1' returned with code 512 (0 expected)
I wonder if there is a timing issue here again, has the device switched to the GPRS connection by the time you get this error or are the network status indicators still blinking ?

I know I should wait for the real "connected" DBUS signal but it's pretty complex especially since there already is a signal listerner for the old connection and it seems there is no way to disconnect that one after it has outlived it's usefulness. I have spent some evenings trying to do this (4-6 weeks ago and could not make a usable solution), you could try increasing the sleep in /opt/mobilehotspot/libs/backend.py line 169
__________________
  • Live near Helsinki, Finland & interested in electronics ? Check this out.
  • Want anti-virus/firewall ? Read this (and follow the links, also: use the search, there are way too many threads asking the same questions over and over and over again).
  • I'm experimenting with BitCoins, if you want to tip me send some to: 1CAEy7PYptSasN67TiMYM74ELDVGZS6cCB
 
Posts: 17 | Thanked: 2 times | Joined on Apr 2010
#179
just checked and it is connected by the time it gives the error
 
Posts: 540 | Thanked: 288 times | Joined on Sep 2009
#180
Originally Posted by kozij View Post
just checked and it is connected by the time it gives the error
Then you need to figure out what process is keeping us from binding the to interface:

Try switching the connection first manually and then running the
"executing ..." commands manually (below the icd2 dbus error message [which is just complaint about the interface missing introspection data])

Then before the dnsmasq command see what processes are listening and where "netstat -lnp" should give a list, port 53 is the one we're mostly interested in.
__________________
  • Live near Helsinki, Finland & interested in electronics ? Check this out.
  • Want anti-virus/firewall ? Read this (and follow the links, also: use the search, there are way too many threads asking the same questions over and over and over again).
  • I'm experimenting with BitCoins, if you want to tip me send some to: 1CAEy7PYptSasN67TiMYM74ELDVGZS6cCB
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:58.