New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

Recognising Pis by MAC address and bulk-adding them via CSV

Recognising Pis by MAC address and bulk-adding them via CSV

Solved 6 5

Translated from Türkçe by AI ·

We are setting up home automation for the flats in a friend’s building, one Pi per flat (a mix: a few 3B+, mostly Pi 4, and two Pi 5). They all boot from the same image and connect to the same local network. To find out which IP belongs to which Pi, I am checking the DHCP list on the modem, but the list also includes printers, TVs and phones.My idea: pick out the Pis from the list using the first three bytes of the MAC address (the OUI), build a CSV from them, and use that CSV to add the devices in Hermetry, with the flat number as the name and the MAC next to it. I have been working with electronics for 19 years, but I have never fully known the OUI list for Pis. Which prefixes exist? And does Hermetry’s import store the MAC address?

♥ 0

Translated from Türkçe by AI ·

As far as I know, B8:27:EB and DC:A6:32. Both are Raspberry Pi.

♥ 0

Translated from Türkçe by AI ·

Will you use the MAC as the device name or as a separate field? It won’t be very readable as a name.

Kayıtta yoksa olmamıştır.
♥ 0

Translated from Türkçe by AI ·

Be careful, the Wi-Fi and Ethernet MAC of the Pi are different. If the Pi’s connect over Wi-Fi, you will see the wlan0 MAC in the DHCP list.

♥ 0

Translated from Türkçe by AI ·

The name will be the apartment number (like d-12), I want it to stay next to the MAC. They are all connected via Wi-Fi, good thing you mentioned it Derya.

♥ 1

Translated from Türkçe by AI ·

Last term, while compiling an inventory of the Pis in the lab, I had searched for this same list.Prefixes I know: B8:27:EB for older Pis (including Pi 3), DC:A6:32, E4:5F:01, 28:CD:C1, D8:3A:DD and 2C:CF:67 for newer models. A new prefix may have been added, so look up the manufacturer in the IEEE’s public OUI list to check. As Derya said, the Ethernet and Wi-Fi MACs of the same Pi differ, but both usually share the same prefix.A more reliable approach is to have the Pi report its MAC itself: cat /sys/class/net/wlan0/address. If a script prints this somewhere on first boot, you won’t need to guess.On the Hermetry side, the import accepts a mac column and stores it in the device’s extra information. Example:

name,label,profile,mac,attr:daire
d-01,Daire 1,Ev Pi,dc:a6:32:1a:2b:3c,1
d-02,Daire 2,Ev Pi,e4:5f:01:4d:5e:6f,2

Never put a token in the file; it already rejects columns that look like secrets. The import runs a check first and then applies. The access tokens of new devices are provided in a single file, which can be downloaded only once, within 15 minutes after the import. If you miss it, get a new one from the device page with Rotate secret.Bulk importing devices

Accepted solution♥ 5

Translated from Türkçe by AI ·

I collected each Pi’s wlan0 MAC and apartment number with the first-boot script, uploaded the CSV, and the check step said 25 rows are ready. I downloaded the token file right away; I had just copied the wrong token to one Pi, and I fixed it with Rotate secret. The MAC of two Pi 5s starts with 2C:CF:67, I noted the list too.

♥ 0
Viewing 7 posts – 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Join the conversation

Sign in to ask and answer, like helpful posts and mark the reply that solved your problem. Every contribution earns points and levels.

Share