WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Help with basic networking  (Read 4732 times)

Offline juan

  • Newbie
  • *
  • Posts: 8
Help with basic networking
« on: May 22, 2013, 01:52:38 AM »
I'm trying to connect an android tablet to a  laptop runing tinycore (acer aspire 3000)   using  an ad-hoc network

On the laptop I have

wlan0     IEEE 802.11bg  ESSID:"xxx1" 
          Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: Not-Associated   
          Tx-Power=20 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:0101-0101-01
          Power Management:on
 
wlan0     Link encap:Ethernet  HWaddr 00:0E:9B:B6:08:F7 
          inet addr:192.168.10.2  Bcast:192.168.10.255  Mask:255.255.255.0


The tablet can see the network xxx1. So, in the tablet I enter the password, select "ip settings - static" and put  192.168.10.1 as static address. Network prefix 24. Hit connect, and apparently it connects.  But when I ping 192.168.10.1 from the laptop I get nothing.

I would appreciate any hints as to how go about debugging this.
TIA!


Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Help with basic networking
« Reply #1 on: May 22, 2013, 02:55:33 AM »
For a start, I would turn off encryption and power management for debugging purposes.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline juan

  • Newbie
  • *
  • Posts: 8
Re: Help with basic networking
« Reply #2 on: May 22, 2013, 03:15:34 AM »
If I turn off encryption then android tries to connect automatically and doesn't give me the chance to set the address. Android expects a dhcp server to assign an address to it so it just keeps waiting and waiting ("obtaining IP address") ...

As to power management, how do I turn it off?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Help with basic networking
« Reply #3 on: May 22, 2013, 04:38:50 AM »
Relying on interference between encryption and dhcpc doesn't sound very sane to begin with...
Try turning encryption off at a later point then.

wifi PM might be hardware/driver dependent.
See manpages of iwconfig and iwpriv and possibly documetation of your driver and chipset.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Help with basic networking
« Reply #4 on: May 22, 2013, 06:28:41 AM »
I thought Android doesn't support ad-hoc networks? At least older versions didn't, I don't know of 4.x.

In this case, you can create a "proper" wifi network by making your laptop be an AP, using hostapd.
The only barriers that can stop you are the ones you create yourself.

Offline beerstein

  • Hero Member
  • *****
  • Posts: 530
Re: Help with basic networking
« Reply #5 on: May 22, 2013, 07:00:28 AM »
hello: Here is what I did and it may help you - i hope so-

On an Android 4.0 tablet (should work with phone also) I installed ssh droid from the google app store (playstore-silly)
Then start it on the Android. BTW the Android is connected via WLAN to an accesspont which is connected to my lan router. A desktop runnung ubuntu 11.10 is connected to the router so the Desktop sees the Android via 192.168.0.6 The ssh server is runnung on Android. Ubunto has a ssh client with basic installation - no ssh serverer.
Once you started ssh droid on your phone you may ping into it from your remote machine.
If there is a connection just
$ ssh root@192,168,0,6   (on my machine - plse use your IP)
then use the password "admin" and boom you are connected.

I use the nautilus FILE - CONNECT TO SERVER function to log into my tablet using a GUI.

Please try it and let me know what happened. I will try to answer questions. I have no idea whether there are security problems?
t(w)o be(ers) or not t(w)o be(ers) that is the question

Pseudoman

  • Guest
Re: Help with basic networking
« Reply #6 on: May 22, 2013, 01:02:36 PM »
I thinks that curaga is right, Android currently does not support Ad-hoc connections. Quite the bummer of a birthmark  :(

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Help with basic networking
« Reply #7 on: May 22, 2013, 02:38:45 PM »
Note that not all Linux drivers are supporting Ad-hoc or AP mode.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline juan

  • Newbie
  • *
  • Posts: 8
Re: Help with basic networking
« Reply #8 on: May 22, 2013, 02:51:34 PM »
Thanks Guys!

Quote
I thought Android doesn't support ad-hoc networks? At least older versions didn't, I don't know of 4.x.

Yes, I saw some comments to that effect 'on the net'. But, I'm using android 4.0.3 and it seems to have some kind of support for ad-hoc. I tried the same thing with my windows machine and I was able to ping the tablet from the windows machine (though admittedly the connection wasn't very reliable)

Quote
In this case, you can create a "proper" wifi network by making your laptop be an AP, using hostapd.

I tried hospapd, but I didn't mention it because I didn't fully read hostpapd's manual so I don't really know how hostpapd itself connects to the internet (my laptop is connected to the internet through ethernet via a small router).

This is what I get from hostapd

Code: [Select]
Using interface wlan0 with hwaddr 00:0e:9b:b6:08:f7 and ssid 'test'
wlan0: STA 00:5d:72:45:ed:2a IEEE 802.11: authenticated
wlan0: STA 00:5d:72:45:ed:2a IEEE 802.11: associated (aid 1)
wlan0: AP-STA-CONNECTED 00:5d:72:45:ed:2a
wlan0: STA 00:5d:72:45:ed:2a RADIUS: starting accounting session 519CE763-00000000
wlan0: AP-STA-DISCONNECTED 00:5d:72:45:ed:2a
wlan0: STA 00:5d:72:45:ed:2a IEEE 802.11: authenticated
wlan0: STA 00:5d:72:45:ed:2a IEEE 802.11: associated (aid 1)
wlan0: AP-STA-CONNECTED 00:5d:72:45:ed:2a
wlan0: STA 00:5d:72:45:ed:2a RADIUS: starting accounting session 519CE763-00000001
wlan0: AP-STA-DISCONNECTED 00:5d:72:45:ed:2a

And the tablet hangs at "obtaining IP address"  (I'm using hostapd's default config)


I think I'm going to get a proper HW router to rule out any HW problem - I'll reply to the rest of the messages later.  Thanks again!

Offline juan

  • Newbie
  • *
  • Posts: 8
Re: Help with basic networking
« Reply #9 on: May 23, 2013, 02:40:23 AM »
Quote
Note that not all Linux drivers are supporting Ad-hoc or AP mode.

In this case it's possible that ad-hoc is not working although iwconfig says  'Mode:Ad-Hoc " ?

Also, the network controller is BCM4318.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Help with basic networking
« Reply #10 on: May 23, 2013, 09:22:51 AM »
No, and I did not mean to imply so, after that had been obvious since OP.

My remark was meant to be of general nature, after all that has been said, to avoid an expectation that Ad-hoc or AP mode would just work with about every chipset/driver (under Linux).

As various cards could be used with more than driver it is not always clear to determine capabilities without knowing which driver is in use.

You can check the following sources:

http://wireless.kernel.org/en/users/Drivers
http://en.wikipedia.org/wiki/Comparison_of_open_source_wireless_drivers#Driver_capabilities
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline juan

  • Newbie
  • *
  • Posts: 8
Re: Help with basic networking
« Reply #11 on: May 26, 2013, 03:32:08 PM »
I got a wireless router and both the tablet and the laptop can connect to it flawlessly. I guess there must be somethign wrong with the software, most likely on the android side of things...