How to put wireless into adhoc mode?

  • Thread starter Thread starter Guest
  • Start date Start date
@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!) 8-)

@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
It could be I've forgot it... I'll give it a try as soon as I'm at home.
Thanks a lot.
 
Thanks for the scripting info, I don't have to do all that manually anymore all the time. :)
 
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, 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

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.
 
@milesg

same behavior... a new file didn't help, and I had to remove the battery to connect again...
 
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?
 
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.
 
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 said:
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????

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...
 
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
 
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
 
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 :)
 
sgcheco said:
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

Are you doing the SU and logging on as superuser before running the commands?
 
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??
 
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

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

Bye.
 
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.
 
Back
Top