How to put wireless into adhoc mode?

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

  1. Guest

    milesg

    Joined:
    Aug 11, 2008
    Messages:
    30
    Likes Received:
    0
    Location:
    UK
    @R200 - thanks a million for your info on this, I now have a Joiku connection to my N95 working with my Aspire One and can use from it anywhere (nearly!) :cool:

    @elsapo - Have you run the "su" command and entered the correct password before you run your script? I too am a Linux newbie, I dumped the commands into a file called adhoc.sh in my home dir (/home/user) and tried to run it using sh adhoc.sh. I got a bunch of error messages until I remembered to do the "su" first and then "sh adhoc.sh"... that works for me!
     
    milesg, Aug 14, 2008
    #21
  2. Guest

    elsapo

    Joined:
    Jul 31, 2008
    Messages:
    21
    Likes Received:
    0
    @milesg
    It could be I've forgot it... I'll give it a try as soon as I'm at home.
    Thanks a lot.
     
    elsapo, Aug 14, 2008
    #22
  3. Guest

    R200

    Joined:
    Aug 6, 2008
    Messages:
    5
    Likes Received:
    0
    Location:
    Finland
    Thanks for the scripting info, I don't have to do all that manually anymore all the time. :)
     
    R200, Aug 14, 2008
    #23
  4. Guest

    elsapo

    Joined:
    Jul 31, 2008
    Messages:
    21
    Likes Received:
    0
    It does not work for me... The script is correct, since when doing it manually, I'm coping the lines from that file, one by one, pasting them in the command window. I'm not a Linux expert but I've used Unix on AIX for years and "a script is a script", or at least that's what I thought...

    That's what I'm doing:

    1) Alt+F2, flag on <Run in terminal>, type in "bash", <Run>.
    2) type in "su"
    3) type in the pw
    4) type in "sh adhoc.sh"

    It looks like not even the first line is correct since it returns the "usage" description, that usually comes when the command is not properly used! I have to remove the battery or the "line by line" process will not work anymore!
    I think I need a Linux expert to solve this problem... Or I'm simply doing something stupid without even knowing it???

    :(

    That's my script:

    /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
    iwconfig ath0 essid JoikuSpot_1
    ifconfig ath0 up
    dhclient ath0
     
    elsapo, Aug 14, 2008
    #24
  5. Guest

    milesg

    Joined:
    Aug 11, 2008
    Messages:
    30
    Likes Received:
    0
    Location:
    UK
    @elsapo, I'm stumped. Are you running the script from the same directory as you were running the commands line-by-line?

    One other thing I would do is delete and re-create the script, just in case of some random corruption or a dodgy character in the file.
     
    milesg, Aug 14, 2008
    #25
  6. Guest

    elsapo

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

    yes, same directory... permissions on script have been set using chmod 777.
    I will try to delete and re-create the file.

    Strange, isn't it?

    Thanks for your help.
    Cheers.
     
    elsapo, Aug 14, 2008
    #26
  7. Guest

    elsapo

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

    same behavior... a new file didn't help, and I had to remove the battery to connect again...
     
    elsapo, Aug 14, 2008
    #27
  8. Guest

    elsapo

    Joined:
    Jul 31, 2008
    Messages:
    21
    Likes Received:
    0
    Now I got it... But it still looks a bit strange to me...


    What I was doing, that didn't work:

    1) Alt+F2, bash in terminal window (starting directory is "home/user")
    2) su, than pw
    3) sh adhoc.sh


    What I'm doing, that works:

    1) Open a terminal window using File Manager (starting directory is "mnt/home")
    2) Change working directory to "home/user"
    3) su, than pw
    4) sh adhoc.sh

    Paying attention to the differences between the two ways to run the script, you will notice that the working directory, where the shell script is executed, is actually the same... So why the first one does not work?

    I'm astonished... What does the "bash" command actually do?
     
    elsapo, Aug 15, 2008
    #28
  9. Guest

    milesg

    Joined:
    Aug 11, 2008
    Messages:
    30
    Likes Received:
    0
    Location:
    UK
    This explains it - I always open a terminal window by right-clicking on the desktop and using "terminal" so that's why mine worked and yours didn't. I guess by just running bash you must end up with a slightly different config... odd.
     
    milesg, Aug 15, 2008
    #29
  10. Guest

    iikkis

    Joined:
    Aug 18, 2008
    Messages:
    3
    Likes Received:
    0
    HEEELP!

    That script.. I did it, i did it several times, no working.

    Then without any "warning", i was connected. Good. BUT after weekend and One closed... It does not work.

    I do the script and do it again... not working????
     
    iikkis, Aug 18, 2008
    #30
  11. Guest

    milesg

    Joined:
    Aug 11, 2008
    Messages:
    30
    Likes Received:
    0
    Location:
    UK
    Did you reboot the One? I don't know if the effects of the script will continue to work after it comes out of standby mode...
     
    milesg, Aug 18, 2008
    #31
  12. Guest

    iikkis

    Joined:
    Aug 18, 2008
    Messages:
    3
    Likes Received:
    0
    Yes, I did reboot the One.

    And after that i did the script from start, but it does not work.

    It says (among lots of other things) ...configuration for ath0 not found
     
    iikkis, Aug 18, 2008
    #32
  13. Guest

    elsapo

    Joined:
    Jul 31, 2008
    Messages:
    21
    Likes Received:
    0
    @iikkis
    did you try to remove the battery?
     
    elsapo, Aug 18, 2008
    #33
  14. Guest

    sgcheco

    Joined:
    Aug 15, 2008
    Messages:
    18
    Likes Received:
    0
    Hi! I have the same problem it just connected one time by "miracle" Afterwards I haven't been able to connect. I even tried taken out the battery.
    Someboy have an Idea??

    Still with the problems:
    wifi0: unknown hardware address type 801
    ath0: No such file or directory
     
    sgcheco, Aug 18, 2008
    #34
  15. Guest

    saymyname

    Joined:
    Jul 28, 2008
    Messages:
    13
    Likes Received:
    0
    thank you thank you thank you :mrgreen: i was really disappointed coz of the linux :( but now am happy coz i got this great help from you guys ;)

    wish you all luck in your life :)
     
    saymyname, Aug 18, 2008
    #35
  16. Guest

    milesg

    Joined:
    Aug 11, 2008
    Messages:
    30
    Likes Received:
    0
    Location:
    UK
    Are you doing the SU and logging on as superuser before running the commands?
     
    milesg, Aug 18, 2008
    #36
  17. Guest

    sgcheco

    Joined:
    Aug 15, 2008
    Messages:
    18
    Likes Received:
    0
    I'm logging as SU

    I tried
    Run(alt +f2) sudo terminal
    command lines

    Also
    Run(alt +f2) Terminal
    sudo
    PWD
    then the commands lines

    also from the File manager run the terminal the log as SU.

    I have notice the small difference logging as SU form different parts, but I haven't make it work

    Any other advice??
     
    sgcheco, Aug 18, 2008
    #37
  18. Guest

    sgcheco

    Joined:
    Aug 15, 2008
    Messages:
    18
    Likes Received:
    0
    I got it working. And works great. Thanks. Here it is my solution.

    I changed the the settings in JoikuSpot in my N95:
    Channel 6
    Essid JoikuSpot_001
    GPS positioning no
    Encription no

    and run the script from
    <alt +f2> Terminal
    su
    pwd
    sh adhoc.sh
     
    sgcheco, Aug 19, 2008
    #38
  19. Guest

    elsapo

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

    It was stated somewhere that the encription must be turned off... The other options are not relevant, I'm using channel 11.

    Bye.
     
    elsapo, Aug 20, 2008
    #39
  20. Guest

    rebuilder

    Joined:
    Aug 20, 2008
    Messages:
    55
    Likes Received:
    0
    Thanks, I got it working as well, without encryption. I also tried with encryption, but no luck, although I believe I did manage to find out how iwconfig should be used to set the key. I looked through the man pages, and basically this command is supposed to do it:

    iwconfig ath0 key [hex key]

    If you want to use an ascii key, then you'd need to place "s:" before the key:

    iwconfig ath0 key s:[ascii key]

    No brackets in the actual command, of course.
    After running that and the other commands outlined in previous posts, I got as far as getting iwconfig to show the proper info for the accesspoint, showing the right encryption key being used etc., but dhclient won't do its job. Can't get an IP from the accespoint when encryption is used.
     
    rebuilder, Aug 22, 2008
    #40
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.