How to put wireless into adhoc mode?

Discussion in 'Networking' started by Guest, Jul 16, 2008.

  1. Guest

    Guest Guest

    Hiya guys,

    anyone know how to get the Aspire Ones wireless card to look for adhoc networks not just APs?
    I use this way to connect to the Internet via my HSDPA enabled mobile, and hints would be appreciated.

    Thanks
     
    Guest, Jul 16, 2008
    #1
  2. Guest

    cabrinus

    Joined:
    Jul 16, 2008
    Messages:
    10
    Likes Received:
    0
    hi.. im quite new..

    but this script works for me

    /etc/rc.d/init.d/NetworkManager stop
    ifconfig ath0 down
    wlanconfig ath0 destroy
    wlanconfig ath0 create wlandev wifi0 wlanmode ad-hoc
    iwconfig ath0 channel YOURCHANNEL!!!
    iwconfig ath0 essid YOURESSID!!!
    ifconfig ath0 up
    dhclient ath0

    you only have to change the essid and the channel !! My channel for example is 11.
     
    cabrinus, Jul 16, 2008
    #2
  3. Guest

    Guest Guest

    For info, whats the process to put it back so it works with APs?

    Thanks
     
    Guest, Jul 17, 2008
    #3
  4. Guest

    cabrinus

    Joined:
    Jul 16, 2008
    Messages:
    10
    Likes Received:
    0
    reboot ;)

    okay.. i think this will work

    ifconfig ath0 down
    wlanconfig ath0 destroy
    wlanconfig ath0 create wlandev wifi0 wlanmode managed
    ifconfig ath0 up
    /etc/rc.d/init.d/NetworkManager start

    than u must turn your wlan switch off and on again.. (sorry for my bad english....)
     
    cabrinus, Jul 17, 2008
    #4
  5. Guest

    Guest Guest

    Thanks, I will have a look at this.
    Is it possible to create a script or something, than I can then just execute to do both of these tasks?

    I am a Linux Noob you see, so it would save some time.
     
    Guest, Jul 17, 2008
    #5
  6. Guest

    cabrinus

    Joined:
    Jul 16, 2008
    Messages:
    10
    Likes Received:
    0
    iam a noob too..

    okay thats my firtst script...

    you must start with

    #!/bin/sh
    /etc/rc.d/init.d/NetworkManager stop
    ifconfig ath0 down
    wlanconfig ath0 destroy
    wlanconfig ath0 create wlan........

    than u have to
    chmod 755 this. So that u can execute it.
     
    cabrinus, Jul 17, 2008
    #6
  7. Guest

    Guest Guest

    Thanks for the info. I put the info in manually and it worked a treat, I just need to work out how to make these autoscripts.
     
    Guest, Jul 17, 2008
    #7
  8. Guest

    Gobo

    Joined:
    Jul 23, 2008
    Messages:
    3
    Likes Received:
    0
    Hello.

    Sorry for my english...
    I try all the steps and it will work great.
    But... You can change the channel by "auto" and iwconfig ath0 essid YOURESSID!!! by "iwconfig ath0 ap auto". It's more easy.

    And another thing, you MUST connect first WMWifiRouter in your PPC and last, run the script.

    Thanks cabrinus
     
    Gobo, Jul 23, 2008
    #8
  9. Guest

    Kidorain

    Joined:
    Jul 24, 2008
    Messages:
    4
    Likes Received:
    0
    Hello,

    i understand you found a solution to make the one connect to ad-hoc hotspots, so you can use the one with a wifi-connection on a mobile-phone.

    I am an absolute beginner, and i don't seem to get it to work.

    Anyone care to give a step by step explanation how to make to scriptfiles to connect to ad-hoc hotspots and how to change it back to normal hotspots?

    Thanks!
     
    Kidorain, Jul 24, 2008
    #9
  10. Guest

    Gobo

    Joined:
    Jul 23, 2008
    Messages:
    3
    Likes Received:
    0
    I'm a beginner too, but its easy...

    Open terminal (alt+F2), and type bash. Select run in terminal

    Type su + enter
    password: the pass that you enter when first run.

    run WMWifiRouter in your phone wm6. Wait until is all connected.
    Enter all the commands that cabrinus wrote. You can change what i wrote in my post..

    And is all. You must run firefox and its OK
     
    Gobo, Jul 24, 2008
    #10
  11. Guest

    pdelacosta

    Joined:
    Jul 18, 2008
    Messages:
    8
    Likes Received:
    0
    Hi All,

    I'm trying to use my Nokia N93 phone as a hotspot with Joiku:

    http://www.joiku.com

    but it only works in ad-hoc mode. I followed the instructions by cabrinus and Gobo, but it didn't work. This is
    what I get when I enter the script in terminal as root:

    Internet Systems Consortium DHCP Client V3.0.6-Fedora
    Copyright 2004-2007 Internet Systems Consortium.
    All rights reserved.
    For info, please visit http://www.isc.org/sw/dhcp/
    wifi0: unknown hardware address type 801
    /sbin/dhclient-script: configuration for ath0 not found. Continuing with defaults.
    /etc/sysconfig/network-scripts/network-functions: line 78: ath0: No such file or directory
    wifi0: unknown hardware address type 801
    Listening on LPF/ath0/00:22:68:ab:4d:e1
    Sending on LPF/ath0/00:22:68:ab:4d:e1
    Sending on Socket/fallback
    DHCPREQUEST on ath0 to 255.255.255.255 port 67
    DHCPREQUEST on ath0 to 255.255.255.255 port 67
    DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 7
    DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 13
    DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 12
    DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 20
    DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 9
    No DHCPOFFERS received.
    Trying recorded lease 192.168.2.3
    /sbin/dhclient-script: configuration for ath0 not found. Continuing with defaults.
    /etc/sysconfig/network-scripts/network-functions: line 78: ath0: No such file or directory
    PING 192.168.2.1 (192.168.2.1) from 192.168.2.3 ath0: 56(84) bytes of data.

    --- 192.168.2.1 ping statistics ---
    3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2009ms
    , pipe 3
    No working leases in persistent database - sleeping.
    /sbin/dhclient-script: configuration for ath0 not found. Continuing with defaults.
    /etc/sysconfig/network-scripts/network-functions: line 78: ath0: No such file or directory

    I ran:
    sudo iwlist scan
    and found my phone:

    Cell 07 - Address: 02:24:44:0F:0E:0F
    ESSID:"JoikuSpot_pro_n93"
    Mode:Ad-Hoc
    Frequency:2.412 GHz (Channel 1)
    Quality=94/94 Signal level=-1 dBm Noise level=-95 dBm
    Encryption key:eek:n
    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
    Extra:bcn_int=100

    I would appreciate if anybody could help me. I'm a complete beginner in Linux. :?

    Thx,
    Petri
     
    pdelacosta, Jul 30, 2008
    #11
  12. Guest

    Iluvatar

    Joined:
    Jul 24, 2008
    Messages:
    8
    Likes Received:
    0
    I tried to get it working with my N95, but I get the same message in terminal as pdelacosta. Please help us! :)
     
    Iluvatar, Jul 31, 2008
    #12
  13. Guest

    R200

    Joined:
    Aug 6, 2008
    Messages:
    5
    Likes Received:
    0
    Location:
    Finland
    Finally got my Nokia N82 and JoikuSpot to work with One. Followed the instructions earlier in this thread, did some experiments and noticed that encryption must be turned off for it to work.
    Some guru could tell me how to enable encryption for use with all these iwconfig and ifconfig stuff. :)
     
    R200, Aug 6, 2008
    #13
  14. Guest

    pdelacosta

    Joined:
    Jul 18, 2008
    Messages:
    8
    Likes Received:
    0
    Congratulations! You're probably the first one on this site to get it working :) .
    Could you please let us know how you did it, step by step?

    Cheers.
     
    pdelacosta, Aug 6, 2008
    #14
  15. Guest

    R200

    Joined:
    Aug 6, 2008
    Messages:
    5
    Likes Received:
    0
    Location:
    Finland
    Start JoikuSpot without encryption on your phone
    Alt+F2 and type bash and hit enter
    type su and hit enter, and type your password

    Run these:
    /etc/rc.d/init.d/NetworkManager stop
    ifconfig ath0 down
    wlanconfig ath0 destroy
    wlanconfig ath0 create wlandev wifi0 wlanmode ad-hoc
    iwconfig ath0 channel 11 (set a channel in JoikuSpot settings and use that in this line, the auto stuff don't work)
    iwconfig ath0 essid JoikuSpot_N82 (or whatever your SSID is set to, the ap auto stuff don't work)
    ifconfig ath0 up

    This is where I do different, run only iwconfig and check if these parts are correct:
    ESSID: "JoikuSpot_N82" and Mode:AD-Hoc and Frequency:2.462 GHz (or some other frequency like that)
    Make sure there isn't a line with Channel:0, the Channel line changes to Frequency when really done right

    Finally run this:
    dhclient ath0

    DHCP should do it's job quickly and you're online.

    In case the connection breaks up and you need to reconnect, run: dhclient and it should say something like this:
    dhclient(22095) is already running - exiting.

    Then run this command: kill 22095
    The number is the process number and changes every time.
    After the process is killed you can run dhclient ath0 again to reconnect.
     
    R200, Aug 7, 2008
    #15
  16. Guest

    pdelacosta

    Joined:
    Jul 18, 2008
    Messages:
    8
    Likes Received:
    0
    Thanks R200 for those instructions. I'll try them when I get home tonight. Allthough I suspect there's something fishy with my
    dhclient, as you can see from my previous post. Even when I tried to set the channel and essid manually and started
    dhclient I got this:

    wifi0: unknown hardware address type 801
    /sbin/dhclient-script: configuration for ath0 not found. Continuing with defaults.
    /etc/sysconfig/network-scripts/network-functions: line 78: ath0: No such file or directory
    wifi0: unknown hardware address type 801

    But I'll try again with your instructions. :)
     
    pdelacosta, Aug 8, 2008
    #16
  17. Guest

    pdelacosta

    Joined:
    Jul 18, 2008
    Messages:
    8
    Likes Received:
    0
    Nope :( Didn't work. Still got the:

    Internet Systems Consortium DHCP Client V3.0.6-Fedora
    Copyright 2004-2007 Internet Systems Consortium.
    All rights reserved.
    For info, please visit http://www.isc.org/sw/dhcp/
    wifi0: unknown hardware address type 801
    /sbin/dhclient-script: configuration for ath0 not found. Continuing with defaults.
    /etc/sysconfig/network-scripts/network-functions: line 78: ath0: No such file or directory
    wifi0: unknown hardware address type 801
    Listening on LPF/ath0/00:22:68:ab:4d:e1
    Sending on LPF/ath0/00:22:68:ab:4d:e1
    Sending on Socket/fallback
    DHCPREQUEST on ath0 to 255.255.255.255 port 67
    DHCPREQUEST on ath0 to 255.255.255.255 port 67
    DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 7
    DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 13
    DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 12
    DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 20
    DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 9
    No DHCPOFFERS received.
    Trying recorded lease 192.168.2.3
    /sbin/dhclient-script: configuration for ath0 not found. Continuing with defaults.
    /etc/sysconfig/network-scripts/network-functions: line 78: ath0: No such file or directory
    PING 192.168.2.1 (192.168.2.1) from 192.168.2.3 ath0: 56(84) bytes of data.

    --- 192.168.2.1 ping statistics ---
    3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2009ms
    , pipe 3
    No working leases in persistent database - sleeping.
    /sbin/dhclient-script: configuration for ath0 not found. Continuing with defaults.
    /etc/sysconfig/network-scripts/network-functions: line 78: ath0: No such file or directory

    problem. I guess there's a messed dhclient in my Linpus...
    Well, it's a crappy OS anyway, maybe it's best to move on to Ubuntu...

    Thanks for all anyway!
     
    pdelacosta, Aug 8, 2008
    #17
  18. Guest

    R200

    Joined:
    Aug 6, 2008
    Messages:
    5
    Likes Received:
    0
    Location:
    Finland
    Could you show what iwconfig and iwlist scan tells you afterwards?
     
    R200, Aug 9, 2008
    #18
  19. Guest

    elsapo

    Joined:
    Jul 31, 2008
    Messages:
    21
    Likes Received:
    0
    Hi,

    same behavior here... but I'm really wondering why the first time I've tried it, everything worked as expected... strange, really strange.

    Thanks anyway.
    Cheers.
     
    elsapo, Aug 11, 2008
    #19
  20. Guest

    elsapo

    Joined:
    Jul 31, 2008
    Messages:
    21
    Likes Received:
    0
    @R200

    The trick is working fine... Thanks a lot. It had to be some kind of mistake I've made.

    Is there any way to execute the commands in a script? I've tried to save the commands in a file, named adhoc.sh, but using "sh adhoc.sh" does not work, throwing many errors.
    Can you please suggest me the correct way to do it?

    Thanks in advance.
     
    elsapo, Aug 14, 2008
    #20
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.