# WiFi MAC address changes when I power WiFi on and off.



## XDRDX

I have searched all over and have seen this issue posted a few time but have been unable to find a resolution. Due to this I thought I would submit to the experts.

I have tried numerous different roms (cm4dx and ssx 2.0 are the only 2 since GB release though) , but recently I was running stock 4.5.596 deodexed and I started having having an issue connecting to WiFi at work. I had assumed this was caused by an issue at my office until I realized that the reason I couldn't connect was because my mac address had change for the WiFi on my phone.

I thought to myself that's not possible that is burned into the WiFi module and is not changeable, but none the less it had changed. Then I realized it changed every time I turn WiFi on and off.

Due to this I figured it must be a bug so I did a factory reset, it still did the same thing. So I SBF'd back to froyo and used the CM4DX monster zip to roll back the baseband to .07. Then I SBF'd again to get back to stock and try again, still have the same issue. So I tried to do the 2 part update.zip to get to 4.5.596 rooted, issue still not fixed. Currently I am on Stock unrooted 2.3.340 and the .07 baseband hoping to find a resolution the the problem.

Any help or suggestions would be greatly appreciated.

The MAC address starts with 08, which seems to be the only consistent thing in the MAC addresses it has changed to, which is not what the MAC address started with when I got the phone.


----------



## SyNiK4L

my only guess would be...that it does actually have a mac address for the wifi radio and a mac address for the 3g radio...so that it doesnt create a conflict when swapping back and forth between the 2. but i could be wrong.


----------



## XDRDX

SyNiK4L said:


> my only guess would be...that it does actually have a mac address for the wifi radio and a mac address for the 3g radio...so that it doesnt create a conflict when swapping back and forth between the 2. but i could be wrong.


No, the wifi MAC address changes to something new every time. None of them are actually the one the phone came with because I recorded that one because it had to be put into my works MAC filter to allow access to our hidden WiFi.

Sent from my DROIDX using Tapatalk


----------



## SyNiK4L

oooooo i see....so its always random ur saying?


----------



## XDRDX

SyNiK4L said:


> oooooo i see....so its always random ur saying?


Correct, I believe it started when I used one of the 4.5.596 stock deodexed update.zips to return from CM4DX, not certain though. I had been running without any issue whatsoever until then. Now the MAC address of my WiFi adapter generates a new random MAC address every time I restart WiFi. The only thing that remains consistent is that the MAC address always starts with 08: the proper MAC address used to start with f8:. Not sure what could have caused this type of issue.


----------



## Droid_Junky

Did you ever resolve this problem? I'm having the same issue with my DroidX on CM7.


----------



## XDRDX

This was never resolved. I ended up going to froyo and taking the OTA. Then ordering a replacement Droid X.

Sent from my DROIDX using Tapatalk


----------



## dangerous

so, the only fix is to replace the unit?


----------



## aarioch

I've been having this problem on my droid x for a while now too. After digging around some, I traced the problem to what I suspect is file nvs_map.bin missing from /pds/wifi. If anyone else having their MAC change can check to see if that file is missing, I think this would be a good starting point for getting this problem fixed.


----------



## blackadept

You are half right, well half way too..... so I guess that means quarter right. This is one of many problems I have been looking into and working on. Am going to make a post later (tho tbh it will be a wall of text) if people are interested and don't mind the length. But will give a short and skinny here regarding the nvs.

You are correct that the nvs is missing from the /pds/wifi however that is not the real issue, just a sign of deeper ones. The nvs_map.bin is missing yes, however it is missive due to erroneous info in init files partially.

The nvs is is made thru the calibration procedure done by the tiwlan interface is being initialized during proc time. However it is called for inappropriately and mislabeled in the coding of the x. It should be located in the /system/etc/wifi directory. This brings up another issue ... this phase of initaization fails due to the firmware being absent or mislabeled. This is fine as far as the phone is concerned at first, done the road tho it causes errors as the calibration of the processi is not able to occur and therefore any upgrading isn't either. All of this now points to the init. folders, which call for the wrong files, locations, arguements etc.

I'll make a post later if folks want explaining this and other issues I have noticed and am working on for a personal rom I am seeing if I cab make work for the x, more of a proof of concept then anything really.

Regardless of whether or not folks want the wall or not I'll explain this and what to do to fix, or make it a little better at least (depending on other issues lol), later tonight after class. The short and skinny is finding the correct wireless driver to be used out of the 3 offered. Creation of the proper nvs_map.bin file thru commands on your phone ( not on PC .... or downloaded ... don't work as well I found ). Then relocation of all parts to proper area. Correct the erroneous strings in the affected init files. Reset proc order. Then initializing proper calibration. After that you should be gtg.

Btw the Mac address is made during part of noted process I just rambled about. However, since the files are not correct, or simply not there in some cases, the proc fails to complete, therefore continues to re-intit when called for, this cycle cause the Mac to change.

Again, this is sadly a short version and not thorough. If folks want I will make a post later explaining tthis and other issues I have noted and am working on. If not tho, I will atleast come back to this and explain it better as well as steps to fix or atleast make it better...

Sent from my DROIDX


----------



## SaurusX

I've never had this problem, but it sounds very frustrating. What causes it to appear almost spontaneously for some people? Is an SBF a possible "cure"? A fix, just in case, would be nice to have.


----------



## aarioch

This isn't something a SBF fixes (at least the .340 and .602 SBFs - I haven't tried others). I tried copying over a nvs_map.bin file that I generated from a TI dev board and it does cause wifi to come up with the MAC address specified in that file every time. The calibration data is for the wifi chip on the dev board though, so it's likely that the wifi chip isn't running optimally. I'd definitely be interested to hear more about what ytou're working on blackadept so that a correct fix can be found for the problem.


----------



## dangerous

cool, i'm looking for a fix.


----------



## dangerous

Cool. Dropped the nvs_map.bin from my 2nd DX into the one that has a problem and now they both have the SAME Mac Address.. Better than changing..

Thanks.Aarioch


----------



## dangerous

and i will say that CM4DX GB is where my phone lost the nvs_map.bin File. when CWR changed and borked a bunch of phones when VS 5 came out.

Edit: I guess i meant for VS to be Version.


----------



## dangerous

Oh. and even Sweeter. both Phones had the Same Mac address, so i edited the bad phone with the Replaced NVS file and changed last two of the mac address so i now have xx:xx:xx:xx:bc:40 on one phone and xx:xx:xx:xx:bc:41 on the other.


----------



## blackadept

http://rootzwiki.com/showthread.php...n-today....-*so-far-fixed-my-wireless-issues*

Just a side note for you.... the nvs controls more than just the MAC address when it comes to the X. This is why I mention in the above post that manually generating the file trumps downloading it. If it is made from the device FOR the device it will be better suited for it. When you use another nvs from another device, regardless of its origin, you are using the parameters of that device which can:

a) under power it/over power it;

b) call for things it is not capable of/unable to call for things it IS capable of;

54) cause it to not fully initialize/calibrate causing errors and reproc's;

Heffalump[SUP]2[/SUP]) and/or possibly turn it into a communist *ref needed*

Just to mention a few


----------



## dangerous

Ok. in simple terms, how do we create the nvs on the device?


----------



## blackadept

Lol I'll make a guide and post it later or tomorrow night, but honestly ... it wont be much simpler then that post lol. Just less words, more directions, and hopefully some of the extra stuff explained (tho doubt much of the extras as I'm still working on it lol).

Sent from my DROIDX


----------



## dangerous

I've read your other thread as well. Quite interesting shit there. I did paste some of the commands you posted through ADB shell, i guess that is not the way to approach that. In any case, i will be following your work as again, it is good stuff.


----------



## dangerous

oh, and i have 2 DX's that are not active so, these are just toys. 
I really want to find what "Hack" wiped my nvs in the first place. I have it narrowed down pretty close to a couple (one being something to do with a CM4DX install or the the other being something to do with booting into CWR where versions went from 4 to 5 and things happened.

I at lease have a copy of my nvs for one of the phones


----------



## blackadept

Yeah, has to be on the phone via terminal. Commands don't carry over thru adb shell too well, lol.

Oh and yeah, wiping the phone causes the loss of the nvs depending on from what to what. Basically, if it formats where its at, well ... it go bye bye. Also, changing drivers or versions, mapping, etc etc. will change it too.

Ps: I'm jealous lol, I want a dx I can hack and slash with dev-wise lmao. So much easier to take the leap on certain tests when you don't have to worry about borking the phone completely lmao.

Meh, maybe in a couple months if I get my new phone I can try flashing the boot stuff haha.

Sent from my DROIDX


----------



## jerkwad

"dangerous said:


> Oh. and even Sweeter. both Phones had the Same Mac address, so i edited the bad phone with the Replaced NVS file and changed last two of the mac address so i now have xx:xx:xx:xx:bc:40 on one phone and xx:xx:xx:xx:bc:41 on the other.


Hey man, glad to hear that you got it working with a new mac address. I assume that you have not actually calibrated your bad phone with a new nvs bin right? I would love to see how your nvs file looks. Mine is basically empty and contains no useful information within it. Is it possible for you to attach yiurs here and maybe just x out part of your mac for obvious reasons? At least others can use that as a baseline for what to expect if and when they try this. Thanks!!

I did mine from abd so that could be my problem but figured it couldn't hurt to ask 

Looking forward to that 'simpler' writeup by blackadept!


----------



## dangerous

jerkwad, let me see what i can do. i'm gonna remove my nvs and try and build a new one from terminal. but first i'm going to load cm4dx on it (again)

oh, and no, i did not calibrate.


----------



## jerkwad

dangerous said:


> jerkwad, let me see what i can do. i'm gonna remove my nvs and try and build a new one from terminal. but first i'm going to load cm4dx on it (again)
> 
> oh, and no, i did not calibrate.


Thanks man! Looking forward to what you have in that file. I've never had horrible wireless performance, but the mac address shiz really drives me NUTS. if there is an easy way to address that, i'd be happy (enough). Seeing what a properly configured nvs file looks like would be a huge step in knowing if i'm even on the right path.

i figure by the time this is all sorted out, blackadept will have some awesome-sauce bash script that we can all run that will solve our woes. (but i still like to mess around at the command line AND i'm impatient) ;-)


----------



## blackadept

Gonna look like a hex dump lol. 

I'll post the instructions soon as I unborkify my computer.

Sent from my DROIDX


----------



## jerkwad

blackadept said:


> Gonna look like a hex dump lol.
> 
> I'll post the instructions soon as I unborkify my computer.
> 
> Sent from my DROIDX


lol i figured as much! but when i look at mine, it is about 332 bytes in size and has about 4 funky characters in it. not what i would expect to see! ;-)


----------



## aarioch

Thanks for digging into the cause of this blackadept. If anyone else is interested, documentation for the wlan_cu command is at http://processors.wiki.ti.com/index...271_Command_Line_Interface_(CLI)_User's_Guide and TI's guide to performing calibration is at http://processors.wiki.ti.com/index.php/Android_wireless_build_and_porting_guide#WLAN_Calibration.


----------



## dangerous

jerkwad said:


> Thanks man! Looking forward to what you have in that file. I've never had horrible wireless performance, but the mac address shiz really drives me NUTS. if there is an easy way to address that, i'd be happy (enough). Seeing what a properly configured nvs file looks like would be a huge step in knowing if i'm even on the right path.
> 
> i figure by the time this is all sorted out, blackadept will have some awesome-sauce bash script that we can all run that will solve our woes. (but i still like to mess around at the command line AND i'm impatient) ;-)


I forgot to send to you. where do you want the file sent to? i can quickly change my mac or my last 4


----------



## dangerous

mine is 468bytes


----------



## blackadept

@jerkwad - haha yup, welcome to the world of android.... ELF/Java/.dex Java/ etc etc .... its fun for the familly! (Well manson's family anyways....)

@aarioch - hey NP bud. Wasn't an issue for me really .... I had actually been working on other projects. One of those is hostapd ... in the process I noticed this the other night and played around with it till it worked for me. Saw others were having issues so figured I'd share how I fixed mine in hopes it fixes theirs too. Of course now I have added more projects to the heap hahaha.

Great info there that you posted .... referenced it myself some. Just be careful you follow the right directions! Make sure its the right driver, right interface, right omap, right set-up, etc.. Otherwise, yeah its a great site. I have been using its tools to mess around with wifi myself and for referance too. Another good one to look at, again assuming you look up the right stuff, is omappedia or something or other. Good info there too.

Sent from my DROIDX


----------



## dangerous

Thanks Blackadept. when you rebuilt your nvs how many bytes did you get? and why do you think my other phone (not missing it's nvs) is 468bytes and the one that i built on the other phone is only 348(or around that) bytes?


----------



## blackadept

Ermmm, 332, but mine isn't the best to go against lmao. You have to remember that I'm usually in perpetual state of tweaking something, working or not hahaha. I only have one phone so only way to test some stuff is to put it in there (yes I know the emulators and all that, but personally I don't use em anymore unless I have too. We'll just say there were some "incidents" lmao). Hence why I haven't tried any of the bootloader ideas.... haha.

That said you should in my post I talked about some of what is used to create the nvs. Considering that, you can see why the sizes can differ to a degree. Each one is being made for the individual device used to make it, suiting itself to the characteristics/variances/hw/sw/configuration, stuff like that; hell, where you live and how you use your phone ultimately can seperate them. This is why I suggested making it on the phone as opposed to just downloading one or using another persons' even if they have the same build and phone.

Food for thought is the next step past the nvs ...

Remember the wlan_loader? It uses the tiwlan.ini, fw_wl1271.bin, and the nvs_map. If I use a different version of any of those my end result can be different than yours, even if the function isn't, if you see what I mean.

So just using a random one .... well, it could work NP, it could possibly even make it better, or it could make it worse.... or not work right at all. I dunno bud, I just assume make it myself.

But then again, like I said, ATM mine is 332 lol. Been higher and lower, but not drastically so.

Sent from my DROIDX


----------



## dangerous

well, then i could run all the same steps to create nvs on my phone that Still has one. How different should it be. i bet it will be more than 100 bytes different.

How is motorola creating the NVS files? and when are they doing it. they are not being recreated after we receive them....


----------



## blackadept

Motorola isn't making it really so I'd say they are making it pretty poorly, lol jp haha.

To answer the question about what is making it, well not gonna go crazy in depth here this late, so forgive the broad/generalized answer here...

The programming inside does, sorta.... remember the drivers license analogy? That file is made to lay down some of the more basic parameters or rules for the wl. As far as that goes, assuming the platform/hardware/software is all the same, not much changes. The other side of it tho is where you could see that as part of its creation is the initial calibrating of the wireless (as far as the new nvs is concerned), sort of a baseline to build off of. This *could* cause changes because part of what it is calibrating for are variances in certain values between calibration periods such as temperature, voltage, pogo stick riding skill, drunken extreme yo-yo mastery, and other causes for performance degradation.

Heh, sorry don't mean to make light, just tired. I'll try to make it a bit more clear tomorrow night. I just didn't want to leave yah hanging in case tomorrow turns into another fun filled non stop wee woo wee woo all over the city Friday night....

Guess simplest way to put it for now:

Its not what makes it so much as how it makes it.

Course, I coulda put it that way 10 posts and 479274 lines earlier... lmao

Sent from my DROIDX


----------



## dangerous

I'm still confused as to How it's made then. If you put your phone back to stock IE, SBF etc, this file is not recreated. and the only way to get this file back is to do what you posted (now 11 posts back), and the file is different when you recreate it than what actually comes with the phone.

Also, if the NVS does not exist, and you build it with the commands above, the MAC address that is stored in the NVS is a 08:xx:xx... (or 00:08, can remember). So, the Mac address is not HARD coded in some firmware on a chip. if it was, then it wouldn't change every time. 
Does Motorola Place the UNIQUE (being the MAC address in the file) NVS on each phone and use DEFAULT parameters for the rest?


----------



## blackadept

sweet baby jesus I'm gonna drop kick the hamster running my internet ....dangerous just wanted to let you know I haven't forgotten about you bud. having internet issues atm, have actually completely typed out 3 answers for you and all get eaten except for this here 2 liner...just wanted to let you know


----------



## dangerous

That really sux. you must be on COX internet.. although i pushed the right buttons with them and got some resolution. my speed and services is much more reliable..

http://www.speedtest.net/result/1511966260.png


----------



## ttavis323

http://rootzwiki.com/showthread.php...Creation-*AKA-How-I-fixed-my-wifi-MAC-issues*


----------

