HOW-TO force intel 4965AGN in ad-hoc mode (for JOIKUSPOT)

Post Reply
Message
Author
stefan21
Posts: 34
Joined: Fri 12 Apr 2013, 23:45

HOW-TO force intel 4965AGN in ad-hoc mode (for JOIKUSPOT)

#1 Post by stefan21 »

First script should be placed in Startup folder:

#!/bin/sh
# Prepare puppy slacko 5.5 for wifi ad-hoc access for intel 4965agn card.
# This script has to be in the Startup folder. The script has to be 0755.
# The script works together with the script ad-hoc.sh. I named this script clear-if.sh.
# Firewall should be enabled after receiving the IP. When the card changes
# during a session in another mode as ad-hoc, the PC *must* be rebooted to
# force the card back in ad-hoc mode. Tested with a lenovo, aka ThinkPad, T61.
#
# All settings have to match the specific wlan information. This works with
# JoikuSpot 2012 Edition with Hex key setting. I assume it works also with
# other ad-hoc wifi spots.
#
ifconfig wlan0 down
ifconfig eth0 down
killall dhcpcd
sleep 6
rm -f /etc/network-wizard/wireless/wpa_profiles/*.WPA.conf
rm -f /etc/network-wizard/wireless/profiles/*.WPA.conf
rm -f /var/lib/dhcpcd/*.info
rm -f /var/run/*.pid
rm -f /var/run/dhcpcd/resolv.conf/wlan0
rm -f /var/run/wpa_supplicant/wlan0
rm -f /var/db/dhcpcd*.lease


Here's the second script :

#!/bin/sh
# Prepare puppy slacko 5.5 for wifi ad-hoc access for intel 4965agn card.
# This script can be run from everywhere. The script has to be 0755.
# The script works together with the script clear-if.sh. I named this scipt ad-hoc.sh.
# Firewall should be enabled after receiving the IP. When the card changes during
# a session in another mode as ad-hoc, the PC *must* be rebooted to force
# the card back in ad-hoc mode. Tested with a lenovo, aka ThinkPad, T61.
#
# All settings have to match the specific wlan information. This works with
# JoikuSpot 2012 Edition with Hex key setting. I assume it works also with
# other ad-hoc wifi spots.
#
rmmod iwl4965
rmmod iwl_legacy
rmmod mac80211
rmmod cfg80211
sleep 6
modprobe iwl4965
ifconfig wlan0 up
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 channel auto
iwconfig wlan0 essid YOURESSID
iwconfig wlan0 key YOURKEY open
dhcpcd -I '' -t 30 -h YOURPUPPYHOSTNAME -d wlan0
sleep 10
ifconfig eth0 up

RUNNING THE FIRST SCRIPT DELETES ALL STORED PROFILES. MAKE SURE, THAT YOU HAVE ALL INFORMATION ABOUT YOUR STORED WLAN-PROFILES. ATTACHING PREVIOUSLY KNOWN WLANS AGAIN MEANS, YOU HAVE TO RE-ENTER ALL INFORMATION YOU'VE STORED BEFORE. IF YOU DON'T RUN THE SECOND SCRIPT, YOU HAVE TO BRING UP WLAN0 MANUALLY, MEANS IFCONFIG WLAN0 UP. IF YOU USE DHCP YOU SHOULD ALSO START THE DEAMON MANUALLY.

I couldn't find a way to prevent puppy to run the network-scripts while booting. The problem with this card seems to be, that once in another mode, I found no other way to force this card in ad-hoc mode.

dr1bble
Posts: 3
Joined: Thu 05 Sep 2013, 14:29

Re: HOW-TO force intel 4965AGN in ad-hoc mode (for JOIKUSPOT)

#2 Post by dr1bble »

stefan21 wrote:First script should be placed in Startup folder:

#!/bin/sh
# Prepare puppy slacko 5.5 for wifi ad-hoc access for intel 4965agn card.
# This script has to be in the Startup folder. The script has to be 0755.
# The script works together with the script ad-hoc.sh. I named this script clear-if.sh.
# Firewall should be enabled after receiving the IP. When the card changes
# during a session in another mode as ad-hoc, the PC *must* be rebooted to
# force the card back in ad-hoc mode. Tested with a lenovo, aka ThinkPad, T61.
#
# All settings have to match the specific wlan information. This works with
# JoikuSpot 2012 Edition with Hex key setting. I assume it works also with
# other ad-hoc wifi spots.
#
ifconfig wlan0 down
ifconfig eth0 down
killall dhcpcd
sleep 6
rm -f /etc/network-wizard/wireless/wpa_profiles/*.WPA.conf
rm -f /etc/network-wizard/wireless/profiles/*.WPA.conf
rm -f /var/lib/dhcpcd/*.info
rm -f /var/run/*.pid
rm -f /var/run/dhcpcd/resolv.conf/wlan0
rm -f /var/run/wpa_supplicant/wlan0
rm -f /var/db/dhcpcd*.lease


Here's the second script :

#!/bin/sh
# Prepare puppy slacko 5.5 for wifi ad-hoc access for intel 4965agn card.
# This script can be run from everywhere. The script has to be 0755.
# The script works together with the script clear-if.sh. I named this scipt ad-hoc.sh.
# Firewall should be enabled after receiving the IP. When the card changes during
# a session in another mode as ad-hoc, the PC *must* be rebooted to force
# the card back in ad-hoc mode. Tested with a lenovo, aka ThinkPad, T61.
#
# All settings have to match the specific wlan information. This works with
# JoikuSpot 2012 Edition with Hex key setting. I assume it works also with
# other ad-hoc wifi spots.
#
rmmod iwl4965
rmmod iwl_legacy
rmmod mac80211
rmmod cfg80211
sleep 6
modprobe iwl4965
ifconfig wlan0 up
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 channel auto
iwconfig wlan0 essid YOURESSID
iwconfig wlan0 key YOURKEY open
dhcpcd -I '' -t 30 -h YOURPUPPYHOSTNAME -d wlan0
sleep 10
ifconfig eth0 up

RUNNING THE FIRST SCRIPT DELETES ALL STORED PROFILES. MAKE SURE, THAT YOU HAVE ALL INFORMATION ABOUT YOUR STORED WLAN-PROFILES. ATTACHING PREVIOUSLY KNOWN WLANS AGAIN MEANS, YOU HAVE TO RE-ENTER ALL INFORMATION YOU'VE STORED BEFORE. IF YOU DON'T RUN THE SECOND SCRIPT, YOU HAVE TO BRING UP WLAN0 MANUALLY, MEANS IFCONFIG WLAN0 UP. IF YOU USE DHCP YOU SHOULD ALSO START THE DEAMON MANUALLY.

I couldn't find a way to prevent puppy to run the network-scripts while booting. The problem with this card seems to be, that once in another mode, I found no other way to force this card in ad-hoc mode.
This was very helpful in helping me fix my problems with connecting to Ad-hoc AP ...appreciated :)

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#3 Post by amigo »

"rm -f /var/run/*.pid"
This is a baddie, mate. /var/run is a public directory where many programs maintain pid (or other) files. Probably should be more specific with the filename globbing.

stefan21
Posts: 34
Joined: Fri 12 Apr 2013, 23:45

#4 Post by stefan21 »

@amigo
"rm -f /var/run/*.pid"
This is a baddie, mate. /var/run is a public directory where many programs maintain pid (or other) files. Probably should be more specific with the filename globbing.
Next time I'll use my hotspot I'll take a closer look. Thank you for pointing this out.

stefan21
Posts: 34
Joined: Fri 12 Apr 2013, 23:45

#5 Post by stefan21 »

Currently I'm running my puppy on slacko 5.6. The scripts above are working to force the card in ad-hoc to connect to my joiku-spot.

BUT - I'm not able to get the card back in the managed modus. It is possible to force the card manually to connect in managed wpa networks. But I found no way to have this done during the boot sequence.

I re-installed puppy (frugal) and copied the old save file on my usb-stick. This leads to nowhere. Without the save file the card is in the managed mode and connects without any problems to any wifi-network. With the save-file on the stick, the network does nothing automatically.

I compared a frugal installation without a save-file with the other one. I copied all relevant (may be, I forgot something or do not know, where else information about networking is stored) information/configuration files, to the puppy with the save-file. No success. After booting the laptop, the network has to be invoked manually.

Don't know what to do. Anybody any idea?
stefan

Post Reply