User avatar
FoxSays
Posts: 9
Joined: Sat May 16, 2020 8:29 am

[RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Sat May 16, 2020 12:40 pm

Hello,
I'm running the Pi model 3B for over a year to capture humidity logs and as unbound DNS server.
Yesterday an update made my Pi not be accessible anymore, because the IP had changed unnoticed.
Inside my router I could see this was because the MAC itself changed and DHCP assumed a new device.
New MAC = new device, and thus DHCP changes to a new IP, obviously

After May 14th it has been showing this behaviour
old correct raspberry pi foundation MAC: b8:27:eb:af:f3:f4
new MACs: all random, not even real vendors

See attachment:
Each consecutive reboot on the Pi would change the MAC once more, flooding the router with new raspis.
Now my router is getting flooded with clones of one of my raspberries.
Even going back to the current old stock rasbian buster will not fix this behaviour.

Naturally I brought the Pi down, removed all entries from the router and installed the stock buster image of raspbian.
Changing SD cards, formatting and using the proper stock image cannot fix it.
The error must persist outside of the SD card and the operating system.

Other tests:
Static MACs in
/boot/cmdline.txt
/boot/config.txt
Both do nothing at all.
A static MAC in network interfaces doesn't revert the error.

All my other raspberries and ODROIDs work fine. Same Debian 10.4 and a good 5.4.y kernel.
Debian 10.4 + 5.4.y was running since a few days with several reboots in between. It was stable and reliable.
Why is just this single raspberry broken? The problem since persists as if the error resides in some other storage than the SD card itself.
I am out of ideas, and the device is sadly unusable like this :|

Other people experience this issue as well:
https://unix.stackexchange.com/question ... berry-pi-3

Code: Select all

May 14 23:53:28 raspberrypi kernel: [    1.383803] usbcore: registered new interface driver smsc95xx
May 14 23:53:28 raspberrypi kernel: [    4.234341] smsc95xx v1.0.6
May 14 23:53:28 raspberrypi kernel: [    4.331806] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:af:f3:f4
May 14 23:53:29 raspberrypi kernel: [   12.761063] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 14 23:53:30 raspberrypi kernel: [   14.308477] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 15 07:32:19 raspberrypi kernel: [    1.383694] usbcore: registered new interface driver smsc95xx
May 15 07:32:19 raspberrypi kernel: [    4.244294] smsc95xx v1.0.6
May 15 07:32:19 raspberrypi kernel: [    4.341748] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:af:f3:f4
May 15 07:32:20 raspberrypi kernel: [   12.852984] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 15 07:32:21 raspberrypi kernel: [   14.416414] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 15 23:43:17 raspberrypi kernel: [    1.406684] usbcore: registered new interface driver smsc95xx
May 15 23:43:17 raspberrypi kernel: [    3.934275] smsc95xx v1.0.6
May 15 23:43:17 raspberrypi kernel: [    4.031511] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, be:b8:2d:47:47:04
May 15 23:43:18 raspberrypi kernel: [   12.379286] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 15 23:43:19 raspberrypi kernel: [   13.894849] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 15 23:46:20 raspberrypi kernel: [    1.406894] usbcore: registered new interface driver smsc95xx
May 15 23:46:20 raspberrypi kernel: [    4.264015] smsc95xx v1.0.6
May 15 23:46:20 raspberrypi kernel: [    4.361513] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, 3e:98:d6:4f:98:b3
May 15 23:46:20 raspberrypi kernel: [   12.802282] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 15 23:46:22 raspberrypi kernel: [   14.318142] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 15 23:50:14 raspberrypi kernel: [    1.407496] usbcore: registered new interface driver smsc95xx
May 15 23:50:14 raspberrypi kernel: [    4.264004] smsc95xx v1.0.6
May 15 23:50:14 raspberrypi kernel: [    4.361484] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, 6a:6a:a1:30:8f:a0
May 15 23:50:15 raspberrypi kernel: [   12.799748] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 15 23:50:16 raspberrypi kernel: [   14.332175] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 16 00:09:01 raspberrypi kernel: [    1.406118] usbcore: registered new interface driver smsc95xx
May 16 00:09:01 raspberrypi kernel: [    4.263973] smsc95xx v1.0.6
May 16 00:09:01 raspberrypi kernel: [    4.361470] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, c6:7a:61:7d:16:6e
May 16 00:09:01 raspberrypi kernel: [   12.868383] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 16 00:09:03 raspberrypi kernel: [   14.385202] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 16 00:28:08 raspberrypi kernel: [    1.406856] usbcore: registered new interface driver smsc95xx
May 16 00:28:08 raspberrypi kernel: [    3.934309] smsc95xx v1.0.6
May 16 00:28:08 raspberrypi kernel: [    4.031522] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, 32:46:fb:5f:6c:33
May 16 00:28:09 raspberrypi kernel: [   12.639549] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 16 00:28:10 raspberrypi kernel: [   14.171464] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 16 00:31:50 raspberrypi kernel: [    1.407659] usbcore: registered new interface driver smsc95xx
May 16 00:31:50 raspberrypi kernel: [    4.564396] smsc95xx v1.0.6
May 16 00:31:50 raspberrypi kernel: [    4.661929] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b2:6f:ff:38:14:41
May 16 00:31:51 raspberrypi kernel: [   13.320163] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 16 00:31:52 raspberrypi kernel: [   14.851613] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 16 00:36:58 raspberrypi kernel: [    1.408163] usbcore: registered new interface driver smsc95xx
May 16 00:36:58 raspberrypi kernel: [    4.564400] smsc95xx v1.0.6
May 16 00:36:58 raspberrypi kernel: [    4.661926] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, 5a:59:a1:5f:8a:a3
May 16 00:36:59 raspberrypi kernel: [   13.159629] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 16 00:37:00 raspberrypi kernel: [   14.691619] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 16 00:40:29 raspberrypi kernel: [    1.407796] usbcore: registered new interface driver smsc95xx
May 16 00:40:29 raspberrypi kernel: [    4.564441] smsc95xx v1.0.6
May 16 00:40:29 raspberrypi kernel: [    4.662016] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, 5e:4a:b9:bc:0a:2b
May 16 00:40:30 raspberrypi kernel: [   13.232515] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 16 00:40:31 raspberrypi kernel: [   14.868652] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 16 00:43:26 raspberrypi kernel: [    1.407998] usbcore: registered new interface driver smsc95xx
May 16 00:43:26 raspberrypi kernel: [    4.564398] smsc95xx v1.0.6
May 16 00:43:26 raspberrypi kernel: [    4.661921] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, 1a:b7:d1:52:a9:ed
May 16 00:43:26 raspberrypi kernel: [   13.200078] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 16 00:43:28 raspberrypi kernel: [   14.747624] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 16 00:56:00 raspberrypi kernel: [    1.408142] usbcore: registered new interface driver smsc95xx
May 16 00:56:00 raspberrypi kernel: [    4.564364] smsc95xx v1.0.6
May 16 00:56:00 raspberrypi kernel: [    4.661921] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, 96:38:3e:0f:df:e2
May 16 00:56:01 raspberrypi kernel: [   13.291661] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 16 00:56:02 raspberrypi kernel: [   14.952250] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 16 00:59:04 raspberrypi kernel: [    1.407319] usbcore: registered new interface driver smsc95xx
May 16 00:59:04 raspberrypi kernel: [    4.564368] smsc95xx v1.0.6
May 16 00:59:04 raspberrypi kernel: [    4.661902] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, ae:34:16:b8:bd:8e
May 16 00:59:04 raspberrypi kernel: [   13.292014] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 16 00:59:06 raspberrypi kernel: [   14.811340] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 16 14:26:23 raspberrypi kernel: [    1.407872] usbcore: registered new interface driver smsc95xx
May 16 14:26:23 raspberrypi kernel: [    4.564401] smsc95xx v1.0.6
May 16 14:26:23 raspberrypi kernel: [    4.661914] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, fa:1e:d9:03:ed:06
May 16 14:26:24 raspberrypi kernel: [   13.160805] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 16 14:26:25 raspberrypi kernel: [   14.796568] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
May 16 14:31:13 raspberrypi kernel: [    1.408309] usbcore: registered new interface driver smsc95xx
May 16 14:31:13 raspberrypi kernel: [    4.564450] smsc95xx v1.0.6
May 16 14:31:13 raspberrypi kernel: [    4.662005] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, 9a:14:17:2b:38:da
May 16 14:31:14 raspberrypi kernel: [   13.169997] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 16 14:31:15 raspberrypi kernel: [   14.717645] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1

User avatar
DougieLawson
Posts: 42177
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Sat May 16, 2020 4:09 pm

I found that Docker did that when I tried it out. It was fixed (for me) by removing every last trace of Docker.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

User avatar
FoxSays
Posts: 9
Joined: Sat May 16, 2020 8:29 am

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Sat May 16, 2020 4:49 pm

I appreciate your help, but I formatted and removed the entire OS. Is this somehow a defect in EEPROM? I cannot explain its persistence.

My other pi received updates and upgrades in the same way and it is doing fine. I advise friends how to do distro and kernel upgrades in the same way and their raspberries work too.

It's just this single one that cannot be fixed anymore, no matter how much I scrub that card clean and reinstall everything. I just want to know if it was my mistake and how to fix or avoid this. I fear to become frustrated with SBCs if I cannot recover this piece of hardware, but cannot imagine a life without them either.

epoch1970
Posts: 7857
Joined: Thu May 05, 2016 9:33 am
Location: France

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Sat May 16, 2020 5:55 pm

This is more than bizarre if you're using a vanilla copy of Raspbian.
Perhaps you could put that Pi in another network and see if its MAC keeps dancing?
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

bls
Posts: 2406
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Sat May 16, 2020 6:41 pm

If Network Manager is installed, it seems to like to change the MAC address by default. You can disable this frequently incorrect default. See viewtopic.php?f=28&t=237623&p=1625034&h ... n#p1625034
Pi tools:
Quickly and easily build customized exactly as-you-want SSDs/SD Cards: https://github.com/gitbls/sdm
Easily run and manage your network's DHCP/DNS servers on a Pi: https://github.com/gitbls/ndm
Easy and secure IPSEC/IKEV2 VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo

User avatar
FoxSays
Posts: 9
Joined: Sat May 16, 2020 8:29 am

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Sat May 16, 2020 7:41 pm

@epoch1970
I tried on a spare TL-WR710N as alternate router, problem persists with other routers.

@bls

Though familiar with the package, but never installed it on this affected raspberry. Checked regardless if it snuck on silently, not found:

Code: Select all

pi@raspberrypi:~ $ sudo apt-get remove network-manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'network-manager' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

trejan
Posts: 4557
Joined: Tue Jul 02, 2019 2:28 pm

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Sat May 16, 2020 7:49 pm

What does "dmesg | grep macaddr" say? Do you see smsc95xx.macaddr in the output?

You using NOOBS or U-boot?

User avatar
FoxSays
Posts: 9
Joined: Sat May 16, 2020 8:29 am

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Sat May 16, 2020 8:10 pm

@trejan

Running grep finds no such entry, but the kern.log is in the OP.

Code: Select all

pi@raspberrypi:~ $ dmesg | grep macaddr
pi@raspberrypi:~ $
No NOOBS or any other modifications, it really is a pure vanilla stock raspbian:
https://www.raspberrypi.org/downloads/raspbian/

ciekawy
Posts: 1
Joined: Sun May 17, 2020 2:19 pm

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Sun May 17, 2020 2:24 pm

I am facing same issue and in my case I use docker on my rpi. I also saw some rpi unrelated threads mentioning docker and mac address changes - will try to investigate that direction

User avatar
FoxSays
Posts: 9
Joined: Sat May 16, 2020 8:29 am

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Mon May 18, 2020 8:27 am

Is there really no way to stop this behaviour myself? I tried this method already based on a post in a different topic:
dom wrote:
Mon Feb 11, 2013 1:29 pm
If you include
smsc95xx.macaddr=B8:27:EB:59:EB:25
in your own cmdline.txt then start.elf won't set the default one.
Why can't I "pin" my MAC to something static until I figure out what causes the random changes, despite formatting the SD and reinstalling.

Just wish my real B8:27:EB:AF:F3:F4 MAC to return, not something random and ever changing.

User avatar
jojopi
Posts: 3628
Joined: Tue Oct 11, 2011 8:38 pm

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Mon May 18, 2020 4:12 pm

Look at "cat /proc/cmdline". On my Pi:

Code: Select all

coherent_pool=1M bcm2708_fb.fbwidth=1280 bcm2708_fb.fbheight=1024 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:05:40:1C vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=afa18b40-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
The first seven arguments, including "smsc95xx.macaddr" are not coming from /boot/cmdline.txt, but are constructed by the firmware at boot time.

In your case, is the smsc95xx.macaddr argument missing, or is it present but ignored by the driver? Now, if you add your own smsc95xx.macaddr setting to /boot/config.txt and reboot, does that then appear in /proc/cmdline, and is it then effective? (And, if you had already tried adding the argument yourself, repeat the first test after removing it.)

User avatar
FoxSays
Posts: 9
Joined: Sat May 16, 2020 8:29 am

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Wed Jul 22, 2020 4:25 pm

Deleted my last post, detailing that I tried all suggestions of other users.This feels pointless after months.
I have a broken raspberry and despite clean installs on new SD cards the MAC changes each reboot.
Even if I take it to my coworkers place and test on their router.

Just lock the thread, it's broken.

User avatar
jojopi
Posts: 3628
Joined: Tue Oct 11, 2011 8:38 pm

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Wed Jul 22, 2020 5:54 pm

In the deleted post you confirmed that smsc95xx.macaddr= was not appearing in /proc/cmdline by default, nor when specified explicitly in /boot/cmdline.txt. That would be a firmware bug, or some other configuration problem within /boot, before Linux starts.

Regarding your suggestion of a bricked board, the only thing I can think to check are the one-time-programmable registers, which you can read with vcgencmd otp_dump. In particular, number 28 is the serial number (should be xxaff3f4, according to the MAC you reported). Number 29 should be its exact one's complement. Number 30 should be the correct revision code for your board.

Did you actually try swapping the problem Pi with one of the others, using the same card?

User avatar
FoxSays
Posts: 9
Joined: Sat May 16, 2020 8:29 am

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Mon Jul 27, 2020 2:55 pm

jojopi wrote:
Wed Jul 22, 2020 5:54 pm
one-time-programmable registers, which you can read with vcgencmd otp_dump. In particular, number 28 is the serial number (should be xxaff3f4, according to the MAC you reported). Number 29 should be its exact one's complement. Number 30 should be the correct revision code for your board.

Code: Select all

08:00000000
09:00000000
10:00000000
11:00000000
12:00000000
13:00000000
14:00000000
15:00000000
16:00280000
17:3020000a
18:3020000a
19:ffffffff
20:ffffffff
21:ffffffff
22:ffffffff
23:ffffffff
24:ffffffff
25:ffffffff
26:ffffffff
27:00002727
28:2baff3f4
29:d4500c0b
30:00a02082
31:00000000
32:00000000
33:00000000
34:00000000
35:00000000
36:00000000
37:00000000
38:00000000
39:00000000
40:00000000
41:00000000
42:00000000
43:00000000
44:00000000
45:00000000
46:00000000
47:00000000
48:00000000
49:00000000
50:00000000
51:00000000
52:00000000
53:00000000
54:00000000
55:00000000
56:00000000
57:00000000
58:00000000
59:00000000
60:00000000
61:00000000
62:00000000
63:00000000
64:00000000
65:01009daa
66:01009daa
Thanks for the helpful reply. I can confirm that something altered my OTP fuses? Since I only ran the same update command on both raspberries but I guess on different days, cannot backtrace this why one Pi is fine and this one not. This limits my hopes and explains how a new freshly formatted SD card with latest stock rasbian could not fix it.
Only the revision is correct, register 28 and 29 differ.

Edit:
I can only give a static IP by modifying my
/etc/dhcpcd.conf
But every reboot still changes MAC and creates unused device entries in my router per new MAC.
Please give me a way to pin my MAC address by means of a configuration file :(

User avatar
jojopi
Posts: 3628
Joined: Tue Oct 11, 2011 8:38 pm

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Mon Jul 27, 2020 4:43 pm

Your OTP serial is okay; registers 28 and 29 xor/add together to give 0xffffffff. The idea is that you might be able to blow a fuse from 0 to 1, but cannot unblow from 1 to 0. So storing the serial number and its complement ensures that, if you could change any of the bits, you would never be able to make the other copy match again. I am not sure if a mismatch would even matter for MAC purposes. The main thing is to prevent sharing codec licenses between boards.

Your register 65 differs from my Pi3, where it is zero. 66 is documented as "advanced boot register", and the value seems plausible, but 65 is supposed to be part of "64/65 – MAC address; if set, system will use this in preference to the automatically generated address based on the serial number". If the documentation is correct, it makes no sense to have 65 and 66 equal. How does this compare with your working boards?

Anyway, I have tried adding this to /etc/rc.local, just above the existing "exit 0":

Code: Select all

ip link set dev eth0 down
ip link set dev eth0 address b8:27:eb:af:f3:f4
ip link set dev eth0 up
This seems to work. It sets my MAC address to the one you want. It is a bit dirty in that the network first comes up with the wrong MAC, then goes down and comes back with the right one, and gets a different IP. That does not cause any issue in my network, so I think it is worth trying.

User avatar
FoxSays
Posts: 9
Joined: Sat May 16, 2020 8:29 am

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Mon Jul 27, 2020 6:28 pm

Code: Select all

08:00000000
09:00000000
10:00000000
11:00000000
12:00000000
13:00000000
14:00000000
15:00000000
16:00280000
17:1020000a
18:1020000a
19:ffffffff
20:ffffffff
21:ffffffff
22:ffffffff
23:ffffffff
24:ffffffff
25:ffffffff
26:ffffffff
27:00002727
28:36f7d9ac
29:c9082653
30:00a02082
31:00000000
32:00000000
33:00000000
34:00000000
35:00000000
36:00000000
37:00000000
38:00000000
39:00000000
40:00000000
41:00000000
42:00000000
43:00000000
44:00000000
45:00000000
46:00000000
47:00000000
48:00000000
49:00000000
50:00000000
51:00000000
52:00000000
53:00000000
54:00000000
55:00000000
56:00000000
57:00000000
58:00000000
59:00000000
60:00000000
61:00000000
62:00000000
63:00000000
64:00000000
65:00000000
66:00000000
^ from the 2nd working Rpi3
jojopi wrote:
Mon Jul 27, 2020 4:43 pm
but 65 is supposed to be part of "64/65 – MAC address; if set, system will use this in preference to the automatically generated address based on the serial number". If the documentation is correct, it makes no sense to have 65 and 66 equal. How does this compare with your working boards?
This might be the easiest to answer first. Yes you are correct, it also differs from the correctly operating Pi3 .
https://www.textcompare.org/index.html? ... 00173414f2

jojopi wrote:
Mon Jul 27, 2020 4:43 pm
Your OTP serial is okay; registers 28 and 29 xor/add together to give 0xffffffff. The idea is that you might be able to blow a fuse from 0 to 1, but cannot unblow from 1 to 0. So storing the serial number and its complement ensures that, if you could change any of the bits, you would never be able to make the other copy match again. I am not sure if a mismatch would even matter for MAC purposes. The main thing is to prevent sharing codec licenses between boards.
Licensing, makes sense, good that MPEG-LA soon is dust with AV1. /rant
About my OTP registers, only ever added this to the end of /boot/config.txt
program_usb_boot_mode=1
To enable the USB boot mode, which worked fine for years. So all changes ever done were handled by the OS / bootmanger itself, that is register #17.


The changes to register 64/65 – MAC address make no sense, but explain the problem.

Help me out: According to your logic
"registers 28 and 29 xor/add together to give 0xffffffff"

This would apply to register 64/65 too?
But since mine are
64:00000000
65:01009daa
= 0x01009daa

The firmware messes up? So would
64:feff6255
65:01009daa
= 0xffffffff

Fix this mess again? I assume the confusion arises that the XOR operation produces not the expected result, thus the MAC "floats" or however you would call it correctly. It just randomizes each boot. Can only guess this is the reason for the observed behaviour.
Can we think this through if the error can be corrected by giving register 64 a value that produces with register 65 a XOR value of 0xffffffff?
jojopi wrote:
Mon Jul 27, 2020 4:43 pm
Anyway, I have tried adding this to /etc/rc.local, just above the existing "exit 0":

Code: Select all

ip link set dev eth0 down
ip link set dev eth0 address b8:27:eb:af:f3:f4
ip link set dev eth0 up
This seems to work. It sets my MAC address to the one you want. It is a bit dirty in that the network first comes up with the wrong MAC, then goes down and comes back with the right one, and gets a different IP. That does not cause any issue in my network, so I think it is worth trying.
That is nice and semi-useful, but as explained my router will create a new device entry for every unique MAC it registers even by a single packet send to it. It would have to be determined pre device initialization.

Edit:

I now know "who" destroyed my registers.
the setting "program_usb_timeout=1" can be used in config.txt to tell the Pi to wait 5 seconds (instead of 2) for USB devices to become ready
I used this, it is meant to only write to register 66 (for advanced boot) according to:
viewtopic.php?p=1312952#p1312952

But since the firmware is botched, whoever coded it also killed my register 65 (for MAC) with exactly the same value that only ever should appear in register 66 (for advanced boot).

Code: Select all

64:00000000
65:01009daa
66:01009daa
I am NOT pointing with fingers here at an unknown developer, but this error fried my board.
I recommend people not to use the command until the bug is fixed in raspbian :(

This breaks my heart, I only used supposedly safe and correct ways to allow USB HDD booting with a delay as according to documentation.
Last edited by FoxSays on Mon Jul 27, 2020 8:08 pm, edited 3 times in total.

User avatar
jojopi
Posts: 3628
Joined: Tue Oct 11, 2011 8:38 pm

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Mon Jul 27, 2020 7:41 pm

The MAC needs two registers because it is six bytes long. For the MAC you want, I think the byte order would be:

Code: Select all

64:f3f40000
65:b827ebaf
I did not find any documentation about setting this, but running strings /boot/start.elf I see references to force_mac_address and program_mac_address. Try in /boot/config.txt:

Code: Select all

force_mac_address=b8:27:eb:af:f3:f4
That seems the force the MAC without changing OTP. Given that the smsc95xx.macaddr method is not working for you, I am not sure if this will either. If it does work, it is the best solution.

In my testing with force_mac_address, it seems to reject MACs that are not assigned to RPF/T (b8:27:eb::: or dc:a6:32:::). Given that your OTP is already half programmed, and has bits set in register 65 that conflict with both of those ranges, I cannot see program_mac_address being a solution.

The smsc95xx is compiled into the kernel, not as a module, so if you cannot get the firmware to pass a fixed address to the driver on the kernel cmdline, a custom kernel might be only other way to set it early enough.

cleverca22
Posts: 6047
Joined: Sat Aug 18, 2012 2:33 pm

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Mon Jul 27, 2020 7:44 pm

jojopi wrote:
Mon Jul 27, 2020 7:41 pm
The MAC needs two registers because it is six bytes long. For the MAC you want, I think the byte order would be:

Code: Select all

64:f3f40000
65:b827ebaf
I did not find any documentation about setting this, but running strings /boot/start.elf I see references to force_mac_address and program_mac_address. Try in /boot/config.txt:

Code: Select all

force_mac_address=b8:27:eb:af:f3:f4
That seems the force the MAC without changing OTP. Given that the smsc95xx.macaddr method is not working for you, I am not sure if this will either. If it does work, it is the best solution.

In my testing with force_mac_address, it seems to reject MACs that are not assigned to RPF/T (b8:27:eb::: or dc:a6:32:::). Given that your OTP is already half programmed, and has bits set in register 65 that conflict with both of those ranges, I cannot see program_mac_address being a solution.

The smsc95xx is compiled into the kernel, not as a module, so if you cannot get the firmware to pass a fixed address to the driver on the kernel cmdline, a custom kernel might be only other way to set it early enough.
i have looked into it before, and force_mac_address behaves similar to the fuses, but without permanent changes
it will cause the firmware to act like the mac has always been the given value, and it will pass it on to linux as normal

User avatar
FoxSays
Posts: 9
Joined: Sat May 16, 2020 8:29 am

Re: [RPi 3B, Raspbian] Kernel log shows changing MAC address each reboot

Mon Jul 27, 2020 7:55 pm

jojopi wrote:
Mon Jul 27, 2020 7:41 pm
In my testing with force_mac_address, it seems to reject MACs that are not assigned to RPF/T (b8:27:eb::: or dc:a6:32:::). Given that your OTP is already half programmed, and has bits set in register 65 that conflict with both of those ranges, I cannot see program_mac_address being a solution.
Yes it is half botched besides I wouldn't know how to program OTP at all, since I never edited these on my own :lol:

jojopi wrote:
Mon Jul 27, 2020 7:41 pm
Try in /boot/config.txt:

Code: Select all

force_mac_address=b8:27:eb:af:f3:f4
That seems the force the MAC without changing OTP. Given that the smsc95xx.macaddr method is not working for you, I am not sure if this will either. If it does work, it is the best solution.

Code: Select all

pi@raspberrypi:~ $ dmesg | grep smsc95xx
[    1.406374] usbcore: registered new interface driver smsc95xx
[    3.569396] smsc95xx v1.0.6
[    3.660709] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:af:f3:f4
[    9.957662] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   11.722814] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
Cautiously optimistic there, but I think you did it! If you want me to donate something over paypal be my guest. In either case thank you so much!
And if you've seen my edit above where I commented what mal-programmed that OTP register, we figured even that out.
I'm just happy the Pi is working again and I can use it to program my Cypress F-RAM chips.

Return to “Troubleshooting”