Skip to content

Conversation

@yenon
Copy link

@yenon yenon commented Apr 7, 2024

To allow for easier access via WIFI, the changing mac address of the goggle will result in different IP's every boot, thanks to the dhcp on the network not recognizing the device by it's MAC.
This PR introduces a (semi) permanent MAC that can be used as a fixed address, if so desired.
The first address of the device is generated randomly from system time and saved to the settings_ini.
Changing of the address is also supported by placing a file named macaddr.txt in the SD-card root.
Validation is in place, and only valid mac's will be accepted.

Please validate this a bit more cautiously, my C skills are rusty.

yenon added 3 commits April 7, 2024 00:39
Cleaned up error in comment, we want to avoid broadcast and multicast addresses.
@SumolX
Copy link
Contributor

SumolX commented Apr 22, 2024

Nice job! I would recommend not keeping both clientid and the option for random MAC address. Remove the clientid setting attribute and associated references, use the persistent Mac attribute instead. Simplify the code to always use the generate MAC address instead. I don't see a benefit for having the user switch between random and static MAC address and having extra UI options. While the file on the sd card is good for debugging and manually setting the Mac once you have verified this works is it necessary to keep the logic for loading a Mac from sd card? I would imagine most people won't know about this and probably just rely on the auto generation since you have solved the underlying dhcp ip reuse issue.

@yenon
Copy link
Author

yenon commented Apr 23, 2024

Before removing features, I'd like to know nobody actually uses them.
Secondly, what does clientid actually do? I cannot find a manpage for udhcpc that has the x flag, no idea what it does.
Removing random MAC completely might be bad for privacy in open networks, thanks to fingerprinting. (We are talking about a video goggle though.)

I see the point of not needing the MAC to be changed via SD card. Mostly just me wanting to set the default to what it used to be on my first try. Maybe in case of a settings file update?
I foresee no real changes to the way MAC addresses work in the wild, so the code would essentially remain untouched for a long time, so why not have it? How it works is actually described in the note at the bottom of the settings page.

@SumolX
Copy link
Contributor

SumolX commented Apr 23, 2024

clientid - https://techhub.hpe.com/eginfolib/networking/docs/switches/5130ei/5200-3942_l3-ip-svcs_cg/content/483572383.htm

So if you are going to keep random Mac for privacy reasons.... then the client id should be made random as well or it should be updated to use the MAC address as well regardless what mode the privacy is set to.

My argument for simplifying the MAC address handling was to minimize confusion and clutter within the UI and having an external text file used for overriding. The approach should be too keep it simple since at the end of the day this is not a full blown PC envirnoment. I know I don't use the googles to access the web for surfing.... ;)

Anyway those are my recommendations.... you can choose how to move forward.

@yenon
Copy link
Author

yenon commented Apr 26, 2024

Keeping the MAC static seems sane for me, especially with our usecase. The clientid can be the static mac address, just as a fallback in case of weird behavioured dhcp's. I'll drop the menu entry for changing it, that will already simplify a lot. I'd like to keep the mac changing by file, since we do not adhere to any reasonable standard for it's assignment and duplicates are unlikely, but not impossible. Sound good?

@yenon yenon force-pushed the wifi_mac_random branch from 2d5be50 to c021194 Compare April 26, 2024 16:00
@yenon
Copy link
Author

yenon commented Apr 26, 2024

Should be alright now.

@yenon yenon marked this pull request as draft April 26, 2024 17:05
@nerdCopter
Copy link
Contributor

nerdCopter commented Aug 30, 2024

April 26 comment makes 100% sense to me as someone in the IT industry. Maybe rebase on main and mark ready for review.

@yenon
Copy link
Author

yenon commented Aug 30, 2024

It would make sense, if the used wifi driver actually supported it properly. The current driver seems to offer better performance, but lacks any means of changing the mac address, if I remember correctly. Feel free to pull and build this, but it will not work.

@SumolX
Copy link
Contributor

SumolX commented Nov 18, 2024

I would close this PR if a new WiFi driver is not included since there is a driver limitation that prevents this PR from being successfully integrated.

@jwhammer
Copy link

A fixed MAC address in Wi-Fi client mode is required in order to assign a static IP address via DHCP on the router.
With random MACs this is not possible, which makes DHCP reservation unusable for the goggles.

Also, in the current firmware (9.5.1 Rev20250715) static IP mode without DHCP does not work,
so DHCP reservation is the only practical option – but this requires a stable MAC address.

Please consider merging or reviving this PR.

@SumolX
Copy link
Contributor

SumolX commented Aug 30, 2025

A fixed MAC address in Wi-Fi client mode is required in order to assign a static IP address via DHCP on the router. With random MACs this is not possible, which makes DHCP reservation unusable for the goggles.

Also, in the current firmware (9.5.1 Rev20250715) static IP mode without DHCP does not work, so DHCP reservation is the only practical option – but this requires a stable MAC address.

Please consider merging or reviving this PR.

Feel free to contact me via discord to discuss. As dhcp works fine for me with my router. The only caveat is when you update firmwares, I believe the client Id is reset.... which maybe the problem you are facing.

@yenon discovered in order to support fixed MAC address it would require a new kernel module for this driver. Maybe @ligenxxxx could contact the manufacturer to see if a newer driver is available as a blob or if they could provide the sources for xradio.

@jwhammer this is the only way that static addresses would be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants