PDA

View Full Version : Restoring Wi-Fi settings after hard reset: WM6 Wizard


JoelC
1st June 2007, 11:35 AM
Hi all,

I've used a Wizard ROM kitchen to build a (WM6) ROM the way I like it - it installs fine, then customises my Today theme and personal registry settings from the Extended ROM... all well and good.

One niggling problem though... I would love to restore my WiFi settings from a hard reset.

I can configure the setup manually with no problem; I use WEP (KeyIndex 1), key not provided automatically, do not use 802.11x authentication... my SSID is hidden, but I don't mind going into the connection dialog after the hard reset and checking the "this is a hidden network" box - that's the least of the problems (as you will see)...

I am aware that I need to use XML to do this, and have tried it using Cuccureddu's tips from this thread http://forum.xda-developers.com/showthread.php?p=1227587 (using provxml) and also tried from _setup.xml in a CAB file: I've not tried this from the ExtRom yet, as whenever I run the CAB using File Explorer (with no WiFi network info set up) I receive an error saying "Installation of wifi.cab was unsuccessful".

I've tried this with Wifi enabled and Wifi disabled, btw...

How I did it:

- Created a file in Notepad with all my settings, as follows - I went to the MSDN pages as mentioned in cuccureddu's post, as my network uses WEP:

<wap-provisioningdoc>
<characteristic type="CM_WiFiEntries">
<characteristic type="MySSID">
<parm name="DestID" value="{436EF144-B4FB-4863-A041-8F905A62C572}"/>
</characteristic>
</characteristic>

<characteristic type="Wi-Fi">
<characteristic type="access-point">
<characteristic type="MySSID">
<parm name="DestId" value="{436EF144-B4FB-4863-A041-8F905A62C572}"/>
<parm name="Encryption" value="0"/>
<parm name="Authentication" value="0"/>
<parm name="NetworkKey" value="myNetworkKey"/>
<parm name="KeyIndex" value="1"/>
<parm name="KeyProvided" value="0"/>
<parm name="Use8021x" value="0"/>
</characteristic>
</characteristic>
</characteristic>
</wap-provisioningdoc>

OK? For Parameters "KeyProvided" and "Use8021x" the MSDN pages say to use Boolean operators, so I've tried it with "true" and "false", then with "1" and "0"...

Made the cab in the following ways:

1. As stated in the linked post, using .provxml.xml and the MakeCab.exe from Windows XP (with .provxml.xml saved as UTF-8, then Unicode - as another post indicated it should be saved as UTF-8(?!?)).
2. As above, saving .provxml.xml both as UTF-8 and then Unicode, but using the MakeCab.exe from the WM5 SDK.

3. Then tried adding the XML to one of my registry settings cabs using WinCE Cab Mgr (v2.0); put it in the Provisioning XML (post). The CAB ran as usual, injected the registry keys that were there before but did nada to the WiFi settings.

4. Then renamed the .provxml.xml to wifi_setup.xml and tried both Makecabs (again, tried saving the XML as UTF-8 and then as Unicode) as follows:

Makecab.exe /D COMPRESS=OFF wifi_setup.xml wifi.cab

... in the hope that this would inject the XML as _setup.xml...

Note: I transferred the file in all above cases over ActiveSync to my Storage Card, which is where it was run from.

5. Finally, I redid the file as per cuccureddu's instructions (saved as Unicode), Makecabbed it using WM5 SDK Makecab exactly per instructions, then ZIPPED the CAB and Activesynced it to my Storage Card. Ran it. "Installation of wifi.cab was unsuccessful".

Hmmm...

So, I'm a little stuck... does anybody have any ideas, or want further info?

TIA for any help you can give...

Joel

JoelC
1st June 2007, 11:38 AM
I guess the ideal solution would be like you often see in operator's Extended ROMs - WifiTempON is run, then a CAB file runs to set up e.g T-Mobile hotspot SSIDs, then WifiTempOFF is run...

Hope somebody can help, I'm starting to go round the bend here ;)

JoelC
26th June 2007, 01:09 AM
Bump...! Any ideas anyone?

lennysh
3rd November 2007, 03:00 PM
this been done yet??

jarod_73
15th November 2007, 10:50 PM
I succesfully use this script in a cab file after every hard reset on my TyTn,
it sets also wan parameters and hidden ssid chekbox. The cab was created
with makecab standard command.
Hope it works for you also.



<wap-provisioningdoc>
<characteristic type="CM_WiFiEntries">
<characteristic type="My_SSID"> (do not change this value and delete this comment)
<parm name="DestID" value="{A1182988-0D73-439e-87AD-2A5B369F808B}"/>
</characteristic>
</characteristic>

<characteristic type="Wi-Fi">
<characteristic type="access-point">
<characteristic type="YourSSID to insert">
<parm name="DestId" value="{A1182988-0D73-439e-87AD-2A5B369F808B}"/>
<parm name="Encryption" value="0"/>
<parm name="Authentication" value="0"/>
<parm name="hidden" value="1"/>
<parm name="KeyProvided" value="0"/>
<parm name="NetworkKey" value="yourPWD to insert"/>
<parm name="KeyIndex" value="1"/>
<parm name="Use8021x" value="0"/>
</characteristic>
</characteristic>
</characteristic>

<characteristic type="Registry">
<characteristic type="HKLM\Comm\TIACXWLN1\Parms\TCPIP">
<parm name="EnableDHCP" value="0" datatype="integer"/>
<parm name="AutoCfg" value="1" datatype="integer"/>
<parm name="WINS" value="" datatype="multiplestring"/>
<parm name="DNS" value="Your one" datatype="multiplestring"/>
<parm name="DefaultGateway" value="Your one" datatype="multiplestring"/>
<parm name="Subnetmask" value="Your one" datatype="multiplestring"/>
<parm name="IpAddress" value="Your one" datatype="multiplestring"/>
</characteristic>
</characteristic>

</wap-provisioningdoc>

Best regards J.

OzDruiD
17th November 2007, 08:35 AM
Awesome idea. I am trying to adapt it for use in this situation.
http://forum.xda-developers.com/showthread.php?p=1671601#post1671601

Multiple WIFI networks, setup multiple CAB files that you can just run depending upon your WIFI location and it will adjust your network card settings (eg DHCP \ Fixed IP), but also your SSID and WEP keys etc.

I have created my XML file and CAB files but it doesnt seem to function correctly. In fact, it appears not to have made any change at all to the network card settings yet it appers to have executed without errors.

jarod_73
17th November 2007, 06:46 PM
did not tryed this way, but a soft-reset should be needed after every
change of your net settings. Ok, I'm shure you tried it yet..
I use it after an hard reset and at the end the phone reboots naturally.
Everyway you can use a reg editor wich allows you to dump your
ppc registry and look for changes in it, that's the way I've found some
of that reg-keys.
It's also usefull to discover if a key is really changed or not..

bye J.

OzDruiD
18th November 2007, 02:56 AM
Yup - thanks, I use registry workshop from my PC and hit F5 (refresh) after i run the cab file, watch it change instantly on the mobile registry. The network settings, eg IP etc and even now the WIFI network now function perfectly.

I am trying to get the "restart" working after a cab install, the network settings work fine, but if you switch it to DHCP (from fixed) it needs a reboot of the WLAN NIC Card obviously to activate DHCP address.

You can either soft-restart the phone, or just use comms manager to deactive-reactivate the WIFI. I am trying to find a (via cab file provisioning) cleaner way to restart the WIFI service.

Must say, thanks heaps for your code and links, helped me heaps in the early days.

jarod_73
22nd November 2007, 02:18 PM
Mhhmmm I see you're using a Shap's rom... you could try to invoke
shap's advanced config with his parameter to reset the device
eg. I use a shortcut to it with this line inside:
\Extended_ROM\AdvancedConfig.exe /reset

I didn't tested if it could be invoked from a cab file

Bye J.

edit: sorry I've missread your topic... but if a soft reset is not a big problem.. ;)

OzDruiD
22nd November 2007, 02:21 PM
Mhhmmm I see you're using a Shap's rom... you could try to invoke
shap's advanced config with his parameter to reset the device
eg. I use a shortcut to it with this line inside:
\Extended_ROM\AdvancedConfig.exe /reset

I didn't tested if it could be invoked from a cab file

Bye J.

edit: sorry I've missread your topic... but if a soft reset is not a big problem.. ;)


Top tip .. thanks!