Author Topic: Firmware causes wifi mac address change on reboot  (Read 6138 times)

Vincent

  • Newbie
  • *
  • Posts: 5
    • View Profile
Firmware causes wifi mac address change on reboot
« on: June 12, 2019, 04:26:20 pm »
Beginning 2019 i flashed the Gemini to dual boot for Sailfish and Android 7.1. There were no issues then. Recently Android 8.1 came available, and because i have the dual boot the OTA did not work and i had to reflash the dual boot together with Android 8.1. Everything seemed fine, until i found out that ever since (10-06-2019) the wifi mac address changed its number 4 and 5 hex digit at every reboot.

I tested rebooting in Sailfish and Android, and both show the wifi mac address change. Therefore i think it happens in the Gemini firmware that enables dual boot.

This is rather a problem, because some servers i connect to rely on my mac address. Does anyone else notice this wifi mac address changing at reboot with a dual boot flashed Gemini since the Android 8.1 came available? If so, does anyone know how to stop this wifi mac address changing at reboot?

flotsam

  • Newbie
  • *
  • Posts: 18
    • View Profile
Firmware causes wifi mac address change on reboot
« Reply #1 on: June 13, 2019, 07:41:02 am »
Quote from: Vincent
If so, does anyone know how to stop this wifi mac address changing at reboot?
See this thread. It has a kludge that helps somewhat. The results that I have (using the fix) are that sailfish keeps the correct mac address, but android changes it. Someone else reported it working with android also.

Vincent

  • Newbie
  • *
  • Posts: 5
    • View Profile
Firmware causes wifi mac address change on reboot
« Reply #2 on: June 13, 2019, 01:20:54 pm »
Did the chattr thing in Sailfish and rebooted in Sailfish. Still a different wifi mac address.

flotsam

  • Newbie
  • *
  • Posts: 18
    • View Profile
Firmware causes wifi mac address change on reboot
« Reply #3 on: June 17, 2019, 09:09:02 am »
Quote from: Vincent
Did the chattr thing in Sailfish and rebooted in Sailfish. Still a different wifi mac address.
Did you do the "chattr" first thing after a full flash (i.e. "firmware upgrade"), and before booting Android? I don't know of a way to restore the contents of that file  other than a full flash, once it has been trashed, which is what Android seems to do to it. Maybe someone more knowledgable than myself can tell us how to generate the NVDATA and NVCFG partitions from the data in the NVRAM partition.

Vincent

  • Newbie
  • *
  • Posts: 5
    • View Profile
Firmware causes wifi mac address change on reboot
« Reply #4 on: June 18, 2019, 03:05:45 pm »
Ok, i have got it done for Sailfish without a full reflash. I do not want to lose any settings that may reside in userdata. Android is still swapping the mac address. But i could not care less about that.

What i did is:
1) hexedit /nvdata/APCFG/APRDEB/WIFI and set the mac address in bytes 04-09 (mind that the base is 0, so it starts at the 5th byte) of the first row (0).
2) set the i attr on the file

Originally bytes 04-09 contained zeros, so i suppose that causes the system to generate a fake mac address.

There is lots of talk about it on the internet by Android people. Search something like "hex edit nvram wifi mac address". Note that the Android people talk about nvram instead of nvdata. They have a similar file in /data/nvram/...
« Last Edit: June 18, 2019, 03:40:30 pm by Vincent »

pbek

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • http://https://www.qownnotes.org
Firmware causes wifi mac address change on reboot
« Reply #5 on: July 23, 2019, 08:46:32 am »
Thanks a lot for the instructions and explanations. They worked great for my Gemini Wifi.

I've updated DebianTP3 Wiki and other wiki entries.

Neil Sands

  • Newbie
  • *
  • Posts: 4
    • View Profile
Firmware causes wifi mac address change on reboot
« Reply #6 on: January 05, 2020, 07:58:34 pm »
I wonder if I can ask for some clarification about this. I'm finding my Gemini is forgetting my wifi settings on Debian between sessions, and I understand from what I read here that it is caused by the Gemini's boot firmware resetting the mac address. I have dual boot Android 8 and Debian.

I have got hold of hexedit and done this:

Quote from: Vincent
What i did is:
1) hexedit /nvdata/APCFG/APRDEB/WIFI and set the mac address in bytes 04-09 (mind that the base is 0, so it starts at the 5th byte) of the first row (0).

When I run that command I see a grid of numbers, which I assume is right. But I don't understand how to set the mac address using that tool, so if anyone can fill in the blanks I'd be very grateful. Also, any hints about what I should set it to would be gratefully received.

I only roughly know what a mac address is, and I've never had to get involved with one before. I have used a hex editor before but it was a long time ago and I can''t remember why!

Sorry to be so needy but some spoonfeeding would be appreciated. Thanks.

mifritscher

  • Newbie
  • *
  • Posts: 23
    • View Profile
Firmware causes wifi mac address change on reboot
« Reply #7 on: January 10, 2020, 07:01:47 am »
Just change the 5th bytes onwards from the 00  to your current mac (use e.g. ifconfig for this), than press ctrl+c to save and exit.

Neil Sands

  • Newbie
  • *
  • Posts: 4
    • View Profile
Firmware causes wifi mac address change on reboot
« Reply #8 on: January 10, 2020, 07:44:21 pm »
Thanks very much, that's given me enough clues to have worked it out.

ifconfig gave me a big dump of stuff which contained a fair few mac address candidates. The one I picked to try was the bottom one, in the wlan0 section of the output but next to the word 'ether' or 'ethernet', which confused me a bit.

It didn't work the first few times I tried it. That's normal for me. After a while though I checked and found the WIFI file wasn't retaining my mac address. Each time I tried afresh I had to chattr -i unlock it, and then +i lock it again afterwards. Then I had the idea to check the file immediately after editing it, and lo and behold it wasn't retaining my changes at all. So I dug further and found that ctrl C on hexedit cancels the changes. To actually save them is ctrl X.

So it's done, and thanks for your help. I'm hopefully a bit more clued up now, but I do find this sort of thing terribly arcane. And it's not because I'm thick because I'm a competent Java programmer.

Quote from: mifritscher
Just change the 5th bytes onwards from the 00  to your current mac (use e.g. ifconfig for this), than press ctrl+c to save and exit.