Sethostname: Use the Network Control Panel Applet to set hostname, hostname -s is not supported [Windows]


#1

What is the problem?

I'm seeing this pop up over and over: sethostname: Use the Network Control Panel Applet to set hostname, hostname -s is not supported

What did you already try to solve it?

Reboot?

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)

Octoprint Version: 1.3.9, Printer: Anet A8. octoprint (1).log (114.9 KB)


#2

Interestingly enough, I recently watched my Octopi-imaged OctoPrint server bootup the other day and was reading some of the console messages as it did so. I didn't realize this but there's a file that you can place in the /boot folder of the microSD so that it will update the hostname of the Raspi. Is this what you did?

/boot/octopi-hostname.txt

Reference


Alternately, if you used sudo raspi-config to change the hostname and you used an invalid string, it will behave as you've described. You might try remoting into the Raspi then running:

sudo nano /etc/hostname

Edit that to a valid hostname, save it, exit the nano session and reboot.


#3

Thanks! I'm running OctoPrint, not octopi, so I don't think that method will work. I think it might be a bug from an update?

Ricky


#4

OctoPi is just the image. It is OctoPrint... it's just packaged for the Pi. Is this loaded on a Raspberry Pi of some kind or not?


#5

My octoprint runs on a windows 10 machine, so sudo nano won't do too much for me I think. (I could be wrong) Maybe the octoprint hosts file is somewhere else?


#6

And... Windows doesn't want you trying to change the hostname and if it did, it would have you do so using some sort of "net whatever" command rather than a POSIX'y sort of way. I suppose it would have been good to know this from the initial post.

So now, it's necessary to tell OctoPrint not to try to change the hostname.


Behind-the-scenes in OctoPrint, there's a name-broadcasting service which reasonably is called Bonjour (Apple-based). The code indicates "Zeroconf/Bonjour/Avahi" as the discovery services.

If this is the cause, then in the ~/.octoprint/config.yaml file, there would be a name/hostname listed in the:

plugins:
  discovery:

...section. In theory, this might be the part which is trying to set the broadcastable name of the printer.

And then, perhaps @foosel knows what this is. But she's going to want you to try running in Safe Mode first to see if the problem goes away.


#7

Thanks! Here is my config.yaml file. I removed a couple of lines that had keys in them. I didn't know if it was super top secret or what.

accessControl:
salt: "Bunch of numbers and letters" <--(( I removed this
api:
key: "Bunch of numbers and letters" <--(( I removed this
appearance:
name: AnetA8 Octoprint
showFahrenheitAlso: true
plugins:
_disabled:

  • printer_safety_check
  • octolapse
    announcements:
    _config_version: 1
    channels:
    _blog:
    read_until: 1535991600
    _important:
    read_until: 1521111600
    _octopi:
    read_until: 1527588900
    _plugins:
    read_until: 1534809600
    _releases:
    read_until: 1532527200
    autocollapse:
    initialTimeout: 0
    cura:
    cura_engine: C:\Program Files (x86)\Cura_15.04.6\CuraEngine.exe
    discovery:
    upnpUuid: 5735939b-eba8-4d9c-af8d-49664d1949d9
    displayprogress:
    message: '{progress:>3} Pct Complete...'
    softwareupdate:
    _config_version: 6
    check_providers:
    anywhere: anywhere
    autocollapse: autocollapse
    detailedprogress: detailedprogress
    displayprogress: displayprogress
    navbartemp: navbartemp
    octolapse: octolapse
    simpleemergencystop: simpleemergencystop
    themeify: themeify
    webcamtab: webcamtab
    checks:
    octoprint:
    checkout_folder: C:\OctoPrint
    prerelease: false
    prerelease_channel: null
    notify_users: false
    printerProfiles:
    default: _default
    serial:
    autoconnect: true
    server:
    commands:
    serverRestartCommand: ''
    systemRestartCommand: shutdown -t 0 -r -f
    systemShutdownCommand: shutdown -t 0 -s -f
    firstRun: false
    onlineCheck:
    enabled: true
    pluginBlacklist:
    enabled: true
    secretKey: "Bunch of numbers and letters" <--(( I removed this
    seenWizards:
    anywhere: 4
    corewizard: 3
    cura: null
    softwareupdate: null
    slicing:
    defaultProfiles:
    cura: configuration_file_for_cura-15.04.6
    temperature:
    profiles:
  • bed: 100
    extruder: 210
    name: ABS
  • bed: 50
    extruder: 190
    name: PLA
    sendAutomatically: true
    webcam:
    ffmpeg: C:/Program Files/ffmpeg-win64/bin/ffmpeg.exe
    snapshot: http://192.168.0.111:2499/out.jpg
    stream: http://192.168.0.111:2500/video.mjpg
    streamRatio: '4:3'
    streamTimeout: 10
    timelapse:
    fps: 25
    options:
    interval: 5
    postRoll: 5
    type: timed
    watermark: false

Ricky


#8

Okay, so you don't have a different name listed under Discovery in your config.yaml. I'm fairly stumped.

sethostname isn't an internal Linux/Raspbian command but the name is out there in the help space as a script name as seen here.

You might try looking for it on your computer (as Administrator)

dir c:\sethostname.* /s

...to find out where it is. If it were me, I'd then just modify it in place or find out what's calling it, then change something.


#9

Looks like I found out my answer! https://github.com/kennethjiang/OctoPrint-Anywhere/issues/66

Thank you for your help!