October-14th-2020, 10:52 PM
Well I would do it differently.
You need to know that the MAC address of a Raspberry Pi is starting always with B8:27:EB which is the vendor ID of the Raspberry Pi organization followed by the 6 last digits (3 bytes) of the serial number of Raspberry Pi CPU. This adds to 6 bytes
So with this knowledge you could easily build the MAC address your own without reading it across the web-UI.
This code below should help you to extract the CPU's serial number which should also work in a container I guess
Thx
Armin
You need to know that the MAC address of a Raspberry Pi is starting always with B8:27:EB which is the vendor ID of the Raspberry Pi organization followed by the 6 last digits (3 bytes) of the serial number of Raspberry Pi CPU. This adds to 6 bytes
So with this knowledge you could easily build the MAC address your own without reading it across the web-UI.
This code below should help you to extract the CPU's serial number which should also work in a container I guess
Code:
cat /proc/cpuinfo |grep Serial|cut -d' ' -f2
Thx
Armin
„You never fail until you stop trying.“, Albert Einstein (1879 - 1955)