You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a W5500 module with new lwIP library included in core 3.0.0
I can't get a hostname to be assigned to the device.
Not a problem assigning a hostname with a wireless connection, but with a wired one the setHostname is always failing, everywhere i put it in the script, and obviously my router sees the device with just a "-" as hostname.
This is not a mDNS issue, i'm not looking for a name.local, i'm trying to give a name to the device that my router can resolve, like i'm doing with all my other wifi esp8266 devices.
As suggested by @d-a-v , i also tried explicitly enabling the wifi with enableWiFiAtBootTime(), with and without the WiFi.mode(WIFI_OFF)
It keeps failing and i don't know how to debug this further
Thanks
Originally posted by MassiPi June 16, 2021
Hello,
i searched both the open issues and the pull requests for setHostname() and i could not find anything, please excuse me if i lost something :)
i'm trying to change the hostname with a wired ethernet connection using the "new" W5500lwIP library.
I'm trying to use both the eth.setHostname() and the WiFi.setHostname() functions (that should be the very same and both based on the wifi_station_set_hostname())
I tried to change the hostname in various places, getting no result at all.
This is the sample code:
#include<ESP8266WiFi.h>
#include<SPI.h>
#include<W5500lwIP.h>
byte mac[] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02};
constchar hostname[] = "NAMETEST";
Wiznet5500lwIP eth(D1);
voidsetup() {
WiFi.mode(WIFI_OFF);
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
SPI.begin();
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE0);
SPI.setFrequency(4000000);
Serial.println("First: before setDefault");
Serial.println("eth.setHostname()");
eth.setHostname(hostname);
Serial.println("WiFi.setHostname()");
WiFi.setHostname(hostname);
eth.setDefault(); // use ethernet for default route
Serial.println("Second: before begin");
Serial.println("eth.setHostname()");
eth.setHostname(hostname);
Serial.println("WiFi.setHostname()");
WiFi.setHostname(hostname);
int present = eth.begin(mac);
if (!present) {
Serial.println("no ethernet hardware present");
while(1);
}
Serial.println("Third: before connected");
Serial.println("eth.setHostname()");
eth.setHostname(hostname);
Serial.println("WiFi.setHostname()");
WiFi.setHostname(hostname);
Serial.print("connecting ethernet");
while (!eth.connected()) {
Serial.print(".");
delay(100);
}
Serial.println("Connected");
Serial.println("Fourth: after connection");
Serial.println("eth.setHostname()");
eth.setHostname(hostname);
Serial.println("WiFi.setHostname()");
WiFi.setHostname(hostname);
}
voidloop() {
Serial.println("Fifth: in loop");
Serial.println("eth.setHostname()");
eth.setHostname(hostname);
Serial.println("WiFi.setHostname()");
WiFi.setHostname(hostname);
delay(5000);
}
This is what i get:
First: before setDefault
eth.setHostname()
WiFi.hostname(NAMETEST): wifi_station_set_hostname() failed
WiFi.setHostname()
WiFi.hostname(NAMETEST): wifi_station_set_hostname() failed
Second: before begin
eth.setHostname()
WiFi.hostname(NAMETEST): wifi_station_set_hostname() failed
WiFi.setHostname()
WiFi.hostname(NAMETEST): wifi_station_set_hostname() failed
Third: before connected
eth.setHostname()
WiFi.hostname(NAMETEST): wifi_station_set_hostname() failed
WiFi.setHostname()
WiFi.hostname(NAMETEST): wifi_station_set_hostname() failed
connecting ethernet.Connected
Fourth: after connection
eth.setHostname()
WiFi.hostname(NAMETEST): wifi_station_set_hostname() failed
WiFi.setHostname()
WiFi.hostname(NAMETEST): wifi_station_set_hostname() failed
Fifth: in loop
eth.setHostname()
WiFi.hostname(NAMETEST): wifi_station_set_hostname() failed
WiFi.setHostname()
WiFi.hostname(NAMETEST): wifi_station_set_hostname() failed
what am i missing?
is there a way to further debug this?
thanks!
The text was updated successfully, but these errors were encountered:
Hello, turning this into an issue since i could not find a way to get this working (it is, with a wifi connection)
Basic Infos
Platform
Settings in IDE
Problem Description
Using a W5500 module with new lwIP library included in core 3.0.0
I can't get a hostname to be assigned to the device.
Not a problem assigning a hostname with a wireless connection, but with a wired one the setHostname is always failing, everywhere i put it in the script, and obviously my router sees the device with just a "-" as hostname.
This is not a mDNS issue, i'm not looking for a name.local, i'm trying to give a name to the device that my router can resolve, like i'm doing with all my other wifi esp8266 devices.
As suggested by @d-a-v , i also tried explicitly enabling the wifi with enableWiFiAtBootTime(), with and without the WiFi.mode(WIFI_OFF)
It keeps failing and i don't know how to debug this further
Thanks
Discussed in #8129
Originally posted by MassiPi June 16, 2021
Hello,
i searched both the open issues and the pull requests for setHostname() and i could not find anything, please excuse me if i lost something :)
i'm trying to change the hostname with a wired ethernet connection using the "new" W5500lwIP library.
I'm trying to use both the eth.setHostname() and the WiFi.setHostname() functions (that should be the very same and both based on the wifi_station_set_hostname())
I tried to change the hostname in various places, getting no result at all.
This is the sample code:
This is what i get:
what am i missing?
is there a way to further debug this?
thanks!
The text was updated successfully, but these errors were encountered: