Hostname not recognized

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
PieterS
Normal user
Posts: 105
Joined: 27 Mar 2018, 17:18
Location: NL

Hostname not recognized

#1 Post by PieterS » 26 May 2024, 11:12

I was wondering why the hostname of ESP is not recognized in the list of devices. I thought the Unit Name in tab Config is used for that. https://espeasy.readthedocs.io/en/lates ... onfig.html
Is there something wrong in the config of my LAN, Router or Accesspoint? Some other devices are named correct. :(

Image

Has a relation with the config of hostname I suppose? Unit Name in tab Config is SDM630M_Teslalader

Image

What could be a solution?

TD-er
Core team member
Posts: 8851
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Hostname not recognized

#2 Post by TD-er » 26 May 2024, 11:27

Maybe there is something with this TP-link not accepting dashes or underscores in the name?

Do you use a static IP for ESPEasy?
Some routers only register the hostname if it was used for a DHCP request and for static IP config there is no such request.

PieterS
Normal user
Posts: 105
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Hostname not recognized

#3 Post by PieterS » 26 May 2024, 15:38

I made some changes and it can be a combination of router, accesspoint and maybe ESPeasy.. ;)

The ESP had a fixed IP in its config...
I made a reservation in the router (Netgear R7000)
I removed the fixed IP in ESP by wiping all fields about IP.
After a reboot the device got the same address and a hostname in the router and accesspoint but a difference in the hostname... In the router the underscore was changed in a dash...
So I removed the underscore in ESPeasy and in the list of reservations in the router..

Lesson learned:
After I removed the underscore in the hostname of the ESP the hostname shows up in the accesspoint.
The router is able to show both characters, dashes as well as underscores and spaces.. Not sure about the accesspoint of TP-Link. :shock:

This is the list of hostnames in the Netgear router:

Image

And this are now the connected devices:

Image

So this problem is solved.. Though not fully understood. :?

User avatar
Ath
Normal user
Posts: 3647
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Hostname not recognized

#4 Post by Ath » 26 May 2024, 21:22

PieterS wrote: 26 May 2024, 15:38 So this problem is solved.. Though not fully understood. :?
Well, TD-er already wrote a possible cause above; when using a fixed IP address, the ESP plainly connects to the router, claiming the configured IP-address, not sharing much other information except the (required) MAC address.
But when using DHCP, it has to do a formal request for an IP address, that does include more information like the hostname, so the router uses that.

According to RFC952, a hostname can only consist of characters a-z (case-insensitive), digits 0-9 and dash (-), and when sending out the hostname, ESPEasy replaces all not-allowed characters by a dash (though that doesn't show in your router-overview :o, but maybe you removed the underscore from the name, so there's nothing to replace ;)).
/Ton (PayPal.me)

PieterS
Normal user
Posts: 105
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Hostname not recognized

#5 Post by PieterS » 27 May 2024, 21:25

Thnx Ton for reflection,

I had an idea about usual characters but was not sure about underscore. That character is accepted in ESPeasy in the field of the name. But not allways in the router and the dhcp-server as far as I understand from your reply.

To be clear: yes, I removed the underscore in the name of the ESP. After that correction, the change was picked up in the accesspoint of TP-Link.
But it is still strange that I can use spaces in the reservation for Ip-address in the router.
And the charging station (Linux) can send a underscore in the hostname to both the Netgear router and TP-Link accesspoint... :shock: Despite the RFC952.

So conventions are not real rules. Never mind. :( ;)

User avatar
Ath
Normal user
Posts: 3647
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Hostname not recognized

#6 Post by Ath » 27 May 2024, 22:01

Pieter,

Thanks for the encouragement 8-)

It's ESPEasy that's removing any non-allowed characters from the hostname, and using DHCP is the reason the name is now picked up by the router.
As there are routers and other network devices that don't accept names that do not conform to RFC952, ESPEasy has to play by the rules, and despite any limitations only use allowed characters in the hostname.

That the router does allow spaces and other characters like underscores probably makes it more 'user friendly', but it's also outside of official specs. But that shouldn't be an issue, as it's only used for displaying the device name ;)
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8851
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Hostname not recognized

#7 Post by TD-er » 27 May 2024, 22:05

Well those RFCs are considered to be the standard and should be followed strictly, according to the purists (and I consider myself also a purist when someone else is not following those RFC's :) )
However "RFC" stands for "Request For Comments".
The first hit on Google does describe it well I think:
(Request For Comments) A document that describes the specifications for a recommended technology. Although the word "request" is in the title, if the specification is ratified, it becomes a standards document. Not all RFCs become standards; some are designated indefinitely with Informational or Experimental status.
Also some RFC's supersede older ones, which can also cause some conflicting definitions or specs.

TD-er
Core team member
Posts: 8851
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Hostname not recognized

#8 Post by TD-er » 27 May 2024, 22:07

Ath wrote: 27 May 2024, 22:01 [...] But that shouldn't be an issue, as it's only used for displaying the device name ;)
Most routers also act as local DNS server.
For example my Fritzbox does allow me to use "nuc" as hostname which will resolve to an IP-address as set in the Fritzbox.
(even ones with DHCP assigned IPs)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 0 guests