Changing PineDio Gateway EUI

Feb 16, 2022

(note: this post is being refined, could update/change later on)

(updated: Added links and making more clear step by step examples)


Changing LoRa Gateway EUI


FIRST: What Is An EUI?

"Extended Unique Identifier (EUI-64)"

Each Gateway on a given network must carry/be assigned a universally unique EUI.

The EUI is used both in registration and relaying data to the LoRa/Mesh network.


There may come a time on a network where you come across an EUI conflict.

Scenarios:

  • Maybe you forgot to delete a gateway and are trying to re-register same EUI.

  • Gateway shares EUI with another


The above shows an EUI is being used already on TTN (TheThingsNetwork).

This is okay.

We can change Gateway EUI.

(SKIP TO SOLUTION SECTION TO SEE ANSWER)


The EUI is derived from the MAC address (see image below) of the network card inside our gateway.

Depending on your model, this could be ethernet, or WiFi mac address (used to create the EUI).

Some may share duplicate MAC addresses - but generally the mac address is an extremely unique "serial number" of sorts. Identifying individual devices.

The OUI (organizational unique identifier) identifies the manufacturer of a piece of hardware.


Wait.. What Is An OUI?

OUI: Organizationally Unique Identifier. Each manufacturer has a unique OUI, acting as the preface (first 3 octets) to the remaining MAC address.

Each brand will carry a unique set of OUI address identifiers. Many brands use many variances. The OUI makes it easy to identify what brand device you are seeing on a network (ie: Apple, Samsung, Dell, etc).

OUI makes up the first 3 octets ("sections") as shown below:


On the PineDio (and other Gateways), you can view the current EUI by running:

gateway-version

Example Screenshot:


Should We change MAC Address? Would this change EUI automatically?

You might assume because the EUI is known to be derived from the network card's MAC address, that changing this mac address directly would logically be enough to change to a new, unused EUI.

In actuality, within our setup, the EUI on our gateway comes directly from within a locally stored gateway configuration file created earlier (which can be edited directly).

This file stores the EUI.

In fact, at first I tried out changing mac alone for testing. This did not change the EUI in itself - but it's okay, we can edit the file.

We need to find where the EUI comes from... (continued)...

In tracing the gateway-version command/script:

We find the configuration file containing the current EUI resides at:

/opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/local_conf.json

The inside of this file looks something like this (first and last 3 octets blurred out for privacy):


SOLUTIONS FOR DUPLICATE EUI MSG ON SAME NETWORK

Change the value inside:
/opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/local_conf.json
using a commandline editor such as nano, or vi.

As shown in the above blurred image, adding FFFE in between the last, and first 3 octets (OUI) of the mac address is an easy way to create a new EUI.

In my case I decided to change the mac address to easily recognize, and relate back and forth between EUI and ethernet mac address (for my own needs).


Next: after editing file, restart your gateway ttn-gateway.service:

sudo systemctl restart ttn-gateway

At this point, your gateway should be using the edited local_conf.json identifier.

You should now be able to join the network again with the new EUI.


UPDATE: OPTIONAL 'gen-eui' COMMAND

You can run gen-eui to generate a new EUI for adding to the local_conf.json file. Created a small command for generating a new usable EUI for each run.

Screenshot example run:


OKAY. Even if optional, can we change ethernet mac address to keep it matching the EUI anyway?

Sure. Some might like to create a new unique MAC address for whatever reason
(including device/gateway local network privacy).


END OF CHANGE EUI SECTION : NEXT SECTION IS OPTIONAL:


MAC Address Boot: Option #1

Original plan was to use ethaddr= to change the mac: but decided to test something I was working on for working within known mac address lists:

You are free to try this documented method:

Adding ethaddr=MACaddresshere in:

/boot/uEnv.txt:


Option #2: ip Command

PineDio gateway ethernet DOES support changing of mac address using commands:

SIMPLE COMMAND SOLUTION FOR MAC (TEMP/FOR TESTING)

ip link set dev eth0 down
ip link set dev eth0 address NEWmacADDRESShere
ip link set dev eth0 up


OR

Automated, Easy To Implement Option:

I chose to use wipri to hold a single eth0 mac address in wipri.service systemd service. You can try changing in boot/kernel otherwise.


Option #3

(test script I was working on for various devices)

SCRIPT CAN SET NEW SYSTEMD "PERMANENT" MAC:

STEP 1.)
Download wipri

STEP 2.)
cd into directory, and run:

sudo bash install.sh

Answer 'yes' to install at boot (otherwise it installs command only).

It will ask what command you want to run at boot. You can choose from wipri flags
(specifying -d for device name), or wipri-list commands.

Or follow below's example.

For this case, one permanent mac flag answer to install.sh boot ques would be:

wipri -d eth0 -m YOURmacOfChoiceHere

And it will install that particular mac as a "permanent" of sorts inside a systemd service.


CONSIDERATION:
You can rerun wipri's sudo bash install.sh as many times as you like to change your wipri or wipri-list boot command installation.


(original wipri documentation here)

Changing the mac address should be largely optional for fixing the duplicate EUI (according to my own research into the matter: the config file is what mainly matters).


I was able to join TTN (successfully) after testing rejoining after editing the file mentioned earlier and changing the mac after installing new mac address service (optional) wipri.service. I have not tested editing the config file alone. This is why I decided to share wipri in this writeup- it's just what I personally chose to rely on in my test.

WiPri on Gitea Onion (use Tor Browser)

WiPri on github (as of this post: latest on Gitea onion)


If installed to run at boot, wipri/wipri-list keeps an eye to maintain the chosen mac address when installed as systemd service:


EARLIER: BEFORE (TTN EUI TEST)

I was testing duplicated mac address on TheThingsNetwork. I received the following message when I was sharing a mac address/EUI with another existing gateway:

I chose to correlate my EUI with my ethernet MAC address, to make it easier to remember, back and forth.

In this way I can always refer back between the current mac address my related EUI anytime.


UPDATE: AFTER (TTN EUI TESTS) [ * SUCCESS * ]

Restarting Concentrator/GPS Log:


After changing mac address and the local config file I was able to join successfully even where permanent mac addresses were shared:

JOIN GATEWAY SUCCESS SCREENSHOT (COMPARE TO PREVIOUS):


πŸ˜€ Help grow this by sharing the URL to help grow the community.


β˜‘οΈ Thanks for being a follower (it's FREE!). Followers get only the most important posts by email.


Thoughts, comments and any questions welcome below.

πŸ˜€ Thank you for Sharing this (Telegram/Social media)

Don't forget to follow at the links below.


RELATED LINKS:

Pine64 Forum Post (Hardware Progress Log)
Pine64 Main (Maker of PineDio)
Lup Yuen Lee (Dev/IoT/LoRa Documentation)
JF Coding Field (Dev/Documentation)


POLITICTECH TUTORIALS LINKS/SERVICES

----------------------------------------------------------------------
πŸ§…πŸ” GITEA SERVICE (.onion): Books, Code/Scripts, Wiki, more (make a repository)
πŸ§…πŸ” PASTEBIN (.onion): options- password protect, zk-256bit, "Burn After Reading" + more
----------------------------------------------------------------------
πŸ’– πŸ€— SUPPORT OPTIONS (If you like to)
🎁 EXTRAS: (bonus offers / support). Support here offers something in return.
πŸ€‘ πŸ’΅ CASHAPP: $HumanRightsTech
βœπŸ—’πŸŽž Politictech Membership (monthly supporter option + extra access)
πŸ’³ Politictech Main Page: (info + current links/addresses)
----------------------------------------------------------------------
FOLLOW:
βœπŸ—’MASTODON
🐦 TWITTER
πŸ“Ί 🎞 PEERTUBE
πŸ“Ί 🎞 BITCHUTE
πŸ“Ί 🎞 ODYSEE
πŸ“Ί 🎞 YOUTUBE
---------------------------------------------------------------------
βœ‰ CONTACT
-------------------------------------------------------------------------
THANK YOU for Sharing this, Liking, and Subscribing.
-------------------------------------------------------------------------
If you aren't registered for Odysee I'd love to see you over there.
Use my invite link: https://odysee.com/$invite/@RTP
--------------------------------------------------------------------------

Enjoy this post?

Buy πŸ₯· (RTP) Privacy Tech Tips πŸ“‘ a coffee

3 comments

More from πŸ₯· (RTP) Privacy Tech Tips πŸ“‘