Closed lollo0296 closed 7 years ago
I figured it out myself. For reference to user which may have the same issue, sshpass is the right way to go.
I just checked the readme.md from @AlexGustafsson and found the flag i was missing. I could swear it was not there last week =´) I am talking about -oStrictHostKeyChecking=no
Here the whole sintax: "sshpass -p 'yourAccountPassword' ssh -oStrictHostKeyChecking=no yourRemoteSshAccount@ipAddress shutdown -s -t 00"
Of course you can change "shutdown -s -t 00" with any other Windows-compatible Cmd command, for example to let the computer sleep, reboot, hibernate etc.. instead of shutting it down. Definitely DON´T go with "format C:" =D
Hi together,
i am trying to control my pc with WoL and Homebrige. My computer has some know issues with WoL, which is sometimes working and sometimes no, but this is another story. The plugin sends the WoL packet just fine. The ping function to check wehter the pc is on or off works as well. Just having some issues to shutdown over SSH on Win 10.
When i run the same ssh command from terminal works perfect, but it default asks for password of user pi (which i added in Win 10 with blank password and necessary permissions) and i just have to press enter. I guessed that could have been the problem, so I installed sshpass and tried to change config.json with "sshpass -p '' ssh 192.168.131.31 shutdown -s"but nothing changed. Again it works from terminal on the very same Pi. I also tried sshpass with my admin credentials like this: "sshpass -p 'myAdminPassword' ssh 192.168.131.11 -U myPc/myAdminAccount shutdown -s" (also tried without domain). Everything works on terminal nothing works on homebridge.
Some ideas? Thank you =)
Environment
Raspberry Pi 3 @ Noob Everything at the latest version.
Config.json
{ "accessory": "NetworkDevice", "name": "AsusFX8", "mac": "60-AC-4C-32-C1-C5", "ip": "192.168.131.11", "pingInterval": 45, "wakeGraceTime": 90, "shutdownGraceTime": 15, "shutdownCommand": "ssh 192.168.131.31 shutdown -s" }
Log
[...] Loaded plugin: homebridge-wol Registering accessory 'homebridge-wol.NetworkDevice'
Loaded config.json with 7 accessories and 0 platforms. Loading 7 accessories... [...] [AsusFX8] Initializing NetworkDevice accessory... [AsusFX8] Stopping pinger [AsusFX8] Starting pinger at an interval of 45000 milli seconds [...] [AsusFX8] NetworkDevice shutdown cycle started for "AsusFX8" (192.168.131.31) [AsusFX8] Stopping pinger [AsusFX8] Starting pinger again in 15000 milli seconds [AsusFX8] Attempting to shut down "AsusFX8" (192.168.131.31) using "ssh 192.168.131.31 shut [AsusFX8] NetworkDevice "AsusFX8" (192.168.131.31) went from status "Online" to "Shutting D Nov 17 19:16:47 raspberrypi homebridge[434]: Fri, 17 Nov 2017 18:16:47 GMT EventedHTTPServer [::ffff:192.168.131.242] Sending HTTP event '7.10' with data: {"c Nov 17 19:16:47 raspberrypi homebridge[434]: Fri, 17 Nov 2017 18:16:47 GMT EventedHTTPServer [::ffff:192.168.131.190] Sending HTTP event '7.10' with data: {"c Nov 17 19:16:47 raspberrypi homebridge[434]: Fri, 17 Nov 2017 18:16:47 GMT EventedHTTPServer [::ffff:192.168.131.190] HTTP Response is finished Nov 17 19:16:47 raspberrypi homebridge[434]: Fri, 17 Nov 2017 18:16:47 GMT EventedHTTPServer [::ffff:192.168.131.190] Writing pending HTTP event data [AsusFX8] An error occured while trying to shut down "AsusFX8" (192.168.131.31): Error: Com Nov 17 19:16:47 raspberrypi homebridge[434]: Host key verification failed. [AsusFX8] Stopping pinger [AsusFX8] Starting pinger at an interval of 45000 milli seconds [...]
Notes
Is maybe something going on with Host Key verification??