prusa3d / Prusa-ESP-Nic-FW

ESP8266 as generic network interface over UART
14 stars 10 forks source link

[FEATURE] Ability to change mac / hostname #13

Open CommanderRedYT opened 11 months ago

CommanderRedYT commented 11 months ago

I am guessing this is the firmware running on the wifi modules for the Prusa MK4. Would it be possible to be able to configure the mac address or the hostname for this? I can understand that custom mac addresses are limited, but at least changing the hostname to something prusa-related would be nice to have

danopernis commented 11 months ago

Can you please elaborate on what problem are you trying to solve with changing MAC address? Are you experiencing collisions in MAC addresses on your network segment?

Also, what exactly do you mean by changing the hostname? This NIC driver only connects to the WiFi in station mode and transmits/receives network packets. If I understand it correctly, hostnames are governed by DNS and neither this NIC driver nor printer itself is capable of being a DNS server.

CommanderRedYT commented 11 months ago

No, I meant that the MAC Addresses from the same blocks as for the MK4 printers could be used. But also what I meant was if I could change the hostname so it says something like "Prusa MK4" instead of "ESP-xxxxxx"

danopernis commented 10 months ago

I think I finally understand now. You want the ESP MAC address to be allocated from the Prusa pool of MAC addresses. Which makes a lot of sense, but unfortunately is not that easy to implement. You see, MAC address of the printer is part of the one-time programmable memory and is assigned when the board is manufactured.

There are some possibilities for working around this, and I have opened an internal ticket (BFW-4270), but I can't promise anything.

Hostname is probably generated by your WiFi router. As a workaround, you can try to configure the router to assign your preferred hostname to the given MAC address, if the router supports that.

CommanderRedYT commented 10 months ago

Hi, thanks for considering the MAC-Address idea. Hostname is configured by the device connecting to a network, in that case, the ESP module. There should be some function (at least in esp-idf, I don't know about AT-commands) to call that can change the default hostname to something prusa related

CommanderRedYT commented 7 months ago

Hi, btw, in theory the implementation could just be to take the ETH Mac and add 1 to it. The only time this would break is when printers with neighboring mac addresses would be in the same network. This is also how its implemented most of the time for devices, they just use one MAC Address and increase it by one for every interface