set hostname using static IP



  • Hi,
    I'm new here, and I did not find any search feature, and I could no find anything with google in this topic.

    Hi, I have a lot of ESP32 devices with static IP. Is it possible to set hostname for them?
    I have a TP-Link DECO system, I see the devices but the hostname like this: "Device_29D0", and the MAC does not match to the give one (in MY_MAC_ADDRESS).

    I found this, but as I see it is only for DHCP.
    // Set the hostname for the WiFi Client. This is the hostname
    // it will pass to the DHCP server if not static.
    #define MY_HOSTNAME "my_custom_hostname"

    What did I wrong? 🙂
    Is this any possibility?

    Thanks,
    SH



  • @sandorhoffmann I hope there is someone that can answer your question.

    But, I really recommend using DHCP. In that way, you can control all of your IPaddresses in one place, your DHCP server (almost always, your router)

    The huge advantage of ESP devices over Arduino is the WiFi. You don't need a big library. The MAC address is hard coded at the factory. I'm not sure that you can change it, which you would want to do if a device failed and you need an EXACT replacement.

    The downside of ESP is also the WiFi. Most home routers can only handle 20-30 WiFi devices My Asus routers start dropping WiFi devices resulting in difficult reconnects. The network becomes unusable. Because I have many ESP devices, I employed a Ubiquity access point that can handle 300 WiFi devices. The routers can handle 254 (253?) IP assignments, though some only allow 64 DHCP assignments.

    There is a discussion on this forum someplace on the number of clients there can be in a MySensors network. In theory 254 (253?) is the max, though I am unaware if anyone has tested it. I use an RPi as my gateway and haven't had problems with too many devices. If one is considering a very large number I would recommend starting each sensors one at a time because the gateway way will assign the NodeID which gets written into location 0 of the EEPROM. Or burn a NodeID into the Arduino EEPROM before running the actual code.

    bottom line, you didn't do anything wrong, its the nature of the beast.



Suggested Topics

19
Online

11.7k
Users

11.2k
Topics

113.0k
Posts