Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

ios7 can't connect to wifi ad-hoc network

Hi,

I have a problem connecting my iPhone 4S to the ad-hoc wifi connection my macbook creates when "sharing" the ethernet internet connection through wifi, with iOS6 it worked flawlessy. I have no problems connecting in wifi to my router though.


Anyone experienced that? Could you try?


Thank you

iPhone 4S, iOS 7

Posted on Sep 21, 2013 1:42 AM

Reply
41 replies

Dec 8, 2013 11:33 AM in response to AlvarodeCampos

Hi
To be honest, I think if I can make this work too, you might have come up with a nice work around.


Not sure that you can attach the script - there may be an issue with the apple systems not allowing it. I may be wrong though.


The other way would be to Zip it and put it ina dropbox, or use something like mediafire or we transfer.


Failing that, you should be able to paste it into a comment.

J

Dec 8, 2013 2:08 PM in response to Disgraceland

OK, here you go.

As you can see there's a lot of delays and some steps are done twice. I found scripting wifi to be a bit of a pain, since the network preferences window can act in rather unpredictable ways, depending on the circumstances (how were you connected, how many known networks are in range, etc etc). So, it's a rather messy script.

There's a good chance this will need some tweaks to work (especially if you're on a different OS; I'm on Mountain Lion).


Good luck!

property NetworkName : "adhocnet"

property NetworkPassword : "7654321qwerty"

property StaticAddress : "192.168.100.1"

property SubMask : "255.255.255.0"



tell application "System Preferences"

activate

set current pane to pane id "com.apple.preference.network"

end tell


--this part to turn wifi on (if necessary) and select the wifi tab in the network window

tell application "System Events"

tell application process "System Preferences"


tell window "network"

repeat with theRow from 1 to 4

if name of static text of row theRow of table 1 of scroll area 1 is {"Wi-Fi, Off"} then

select row theRow of table 1 of scroll area 1

tell group 1

click button 1

delay 4.0

end tell

exit repeat

end if

if name of static text of row theRow of table 1 of scroll area 1 is {"Wi-Fi, Connected"} then

select row theRow of table 1 of scroll area 1

delay 2.0

exit repeat

end if

if name of static text of row theRow of table 1 of scroll area 1 is {"Wi-Fi, On"} then

select row theRow of table 1 of scroll area 1

delay 2.0

exit repeat

end if

end repeat


--this part to set manual IP address for wifi

click button "Advanced…"

delay 0.5

tell tab group 1 of sheet 1

click radio button "TCP/IP"

delay 0.5

click pop up button 1

delay 0.5

click menu item "Manually" of menu 1 of pop up button 1

delay 0.5

set value of text field 3 to SubMask

set value of text field 2 to StaticAddress

delay 1.0

end tell

tell sheet 1

click button "OK"

delay 0.5

end tell

click button "Apply"

delay 1.0

end tell


--this part to select wifi tab again (sometimes it gets deselected)

tell window "Network"

repeat with theRow from 1 to 4

if name of static text of row theRow of table 1 of scroll area 1 is {"Wi-Fi, Off"} then

select row theRow of table 1 of scroll area 1

tell group 1

click button 1

delay 1.0

end tell

exit repeat

end if

if name of static text of row theRow of table 1 of scroll area 1 is {"Wi-Fi, Connected"} then

select row theRow of table 1 of scroll area 1

delay 0.5

exit repeat

end if

if name of static text of row theRow of table 1 of scroll area 1 is {"Wi-Fi, On"} then

select row theRow of table 1 of scroll area 1

delay 0.5

exit repeat

end if

end repeat


--this part to create an ad-hoc network with 128 bit WEP encryption

tell group 1

click pop up button "Network Name:"

delay 1.0

key code 121

keystroke return

end tell

end tell

repeat until exists window 1

delay 0.5

end repeat

tell window 1

delay 1.0

click pop up button 2

delay 0.5

click menu item 4 of menu 1 of pop up button 2

delay 0.5

set value of text field 3 to NetworkPassword

set value of text field 2 to NetworkPassword

set value of text field 1 to NetworkName

click button "Create"

delay 4.0

end tell


--this part to again manually set IP address (in case it got changed back)

tell window "network"

click button "Advanced…"

delay 1.0

tell tab group 1 of sheet 1

click radio button "TCP/IP"

delay 0.5

click pop up button 1

delay 0.5

click menu item "Manually" of menu 1 of pop up button 1

delay 0.5

set value of text field 3 to SubMask

set value of text field 2 to StaticAddress

delay 1.0

end tell

tell sheet 1

click button "OK"

delay 0.5

end tell

click button "Apply"

delay 1.0

end tell

end tell

end tell


tell application "System Preferences"

quit

end tell



Mar 12, 2014 10:23 AM in response to thingo

Even though some time has passed, I would like to chime in because I had similar problems.


I tried to connect my iPad to Reflector running on my MBP to be able to show the iPad display during my lectures.

If I'm on my home network, this works like a charm, however in the class room I cannot use the university WLAN network because "Airplay/Bonjour"-essential channels are blocked.

To resolve this I used to use an ad-hoc WiFi network created on the MBP.

However, the simple solution stopped working after I upgraded to Mavericks.


After investing half a day's work I have found that this can still be made to work,

but only with the right number of voodoo incantations! ;-)


It seems essential to force the iPad to forget any "previous" version of the ad-hoc network!

(in "Wi-Fi", select info-i, then select "Forget the Network")


My workflow (that works for me right now)


1. create ad-hoc network on MBP (with WEP password)

2. go to the iPad, find the ad-hoc network (in WiFi) and make the iPad forget the network

3. join the network again and make sure that you have to re-type the password

4. start reflector on the MBP

5. check whether "Airplay" on the iPad shows the Reflector channel (wait at least 30 seconds)

6. start mirroring your iPad display


Cheers!

May 21, 2014 10:51 AM in response to thingo

To add to the mystery, I tried the following with the same ad-hoc WiFi connection and all with the most recent iOS:


ipad Air - Internet Connect error message, trying to stream video drops the connection, everything else works


iPad Mini (non retina) - Internet Connect error message, trying to stream video drops the connection, everything else works


iPhone 4s - Internet Connect error message but streaming and everything else works


iPad1 - everything works with ad-hoc WiFi


Ipad2 - everthing works with ad-hoc WiFi


iMac12 - everthing works with ad-hoc WiFi


iPad touch - everthing works with ad-hoc WiFi


There must be something about the new hardware!

May 21, 2014 3:35 PM in response to thingo

Upon connecting to the ad-hoc wireless network, the iPad4 gave me the message "WifiRouter" Is Not Connected to the Internet. Are you sure you want to use this network" (the same message as the mini and the iPad air). After choosing "Join Anyway" I am able to do anything on the internet except stream video. Once I stream video, I must shut off the WiFi and turn it back on before I can get another connection to the ad-hoc wireless. I am going to try a 2nd ad-hoc wifi from another source and see if I get the same results from the above iOS devices. This is all very strange.

ios7 can't connect to wifi ad-hoc network

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.