Comments (15)
Whooohooo the first Windows user and thanks for the feedback! ;)
Okay this one might be a tough one to debug because I have no machine with Windows around but I'll try my best.
Could you please try to use forward-slashes in the file-paths?
E.g.:
"log": "C:/Users/Username/output.log"
or
"log": "C:\\Users\Username\output.log"
Does one of these work?
from homebridge-server.
Hey! Yea man! Its been a fun project to tackle with the setup and I'm looking forward to doing all the cool things with it up and running completely!
So I tried the first suggestion "log": "C:/Users/HomeBridge/output.log". The service starts correctly but when trying to view the log it crashes and gives this error , see below.
C:\Users\HomeBridge\AppData\Roaming\npm\node_modules\homebridge\bin>Node Homebridge
[1/19/2017, 12:00:41 AM] Loaded plugin: homebridge-http
[1/19/2017, 12:00:41 AM] Registering accessory 'homebridge-http.Http'
[1/19/2017, 12:00:41 AM] ---
[1/19/2017, 12:00:41 AM] Loaded plugin: homebridge-server
[1/19/2017, 12:00:41 AM] Registering platform 'homebridge-server.Server'
[1/19/2017, 12:00:41 AM] ---
[1/19/2017, 12:00:41 AM] Loaded config.json with 0 accessories and 1 platforms.
[1/19/2017, 12:00:41 AM] ---
[1/19/2017, 12:00:41 AM] Loading 1 platforms...
[1/19/2017, 12:00:41 AM] [Homebridge Server] Initializing Server platform...
[1/19/2017, 12:00:41 AM] Loading 0 accessories...
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:
┌────────────┐
│ 031-45-154 │
└────────────┘
[1/19/2017, 12:00:41 AM] [Homebridge Server] is listening on: http://192.168.86.130:8765
[1/19/2017, 12:00:42 AM] Homebridge is running on port 51826.
C:\Users\HomeBridge\AppData\Roaming\npm\node_modules\homebridge-server\index.js:453
return log(err);
^
TypeError: log is not a function
at ReadFileContext.callback (C:\Users\HomeBridge\AppData\Roaming\npm\node_modules\homebridge-server\index.js:453:34)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:324:13)
The second suggestion "log": "C:\Users\HomeBridge\output.log" Does not allow the service to start and throws the following error.
C:\Users\HomeBridge\AppData\Roaming\npm\node_modules\homebridge\bin>Node Homebridge
[1/18/2017, 11:57:58 PM] Loaded plugin: homebridge-http
[1/18/2017, 11:57:58 PM] Registering accessory 'homebridge-http.Http'
[1/18/2017, 11:57:58 PM] ---
[1/18/2017, 11:57:58 PM] Loaded plugin: homebridge-server
[1/18/2017, 11:57:58 PM] Registering platform 'homebridge-server.Server'
[1/18/2017, 11:57:58 PM] ---
[1/18/2017, 11:57:58 PM] There was a problem reading your config.json file.
[1/18/2017, 11:57:58 PM] Please try pasting your config.json file here to validate it: http://jsonlint.com
[1/18/2017, 11:57:58 PM]
C:\Users\HomeBridge\AppData\Roaming\npm\node_modules\homebridge\lib\server.js:197
throw err;
^
SyntaxError: Unexpected token H
at Object.parse (native)
at Server._loadConfig (C:\Users\HomeBridge\AppData\Roaming\npm\node_modules\homebridge\lib\server.js:191:19)
at new Server (C:\Users\HomeBridge\AppData\Roaming\npm\node_modules\homebridge\lib\server.js:52:38)
at module.exports (C:\Users\HomeBridge\AppData\Roaming\npm\node_modules\homebridge\lib\cli.js:26:16)
at Object. (C:\Users\HomeBridge\AppData\Roaming\npm\node_modules\homebridge\bin\Homebridge:17:22)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:457:10)
from homebridge-server.
Okay lets try some hacking together:
First stick in your config with the path:
"log": "C:/Users/HomeBridge/output.log"
and then please open the file C:\Users\HomeBridge\AppData\Roaming\npm\node_modules\homebridge-server\index.js
in a text editor like notepad
or alike and search for the following part:
logFile.readFile(config.log, 'utf8', function(err, log) {
replace it with:
logFile.readFile(path.normalize(config.log), 'utf8', function(err, log) {
Then save the file restart your homebridge and report back. 🙏
from homebridge-server.
Ok did exactly as you said, Restarted Homebridge, It started fine. Went to open the log again and it crashed with the following:
C:\Users\HomeBridge\AppData\Roaming\npm\node_modules\homebridge-server\index.js:451
logFile.readFile(path.normalize(config.log), 'utf8', function(err, log) {
^
ReferenceError: path is not defined
at Server.handleRequest (C:\Users\HomeBridge\AppData\Roaming\npm\node_modules\homebridge-server\index.js:451:36)
at emitTwo (events.js:87:13)
at Server.emit (events.js:172:7)
at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:527:12)
at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
from homebridge-server.
Grrrr.... yeah for sure I forgot something -.- sorry for that.
In the same file search for:
var http = require('http');
and add below:
var path = require('path');
It now should look like:
var http = require('http');
var path = require('path');
Then restart the service.
from homebridge-server.
Hmm maybe now I can try another syntax for the log path?
This is the error with those changes
C:\Users\HomeBridge\AppData\Roaming\npm\node_modules\homebridge-server\index.js:454
return log(err);
^
TypeError: log is not a function
at ReadFileContext.callback (C:\Users\HomeBridge\AppData\Roaming\npm\node_modules\homebridge-server\index.js:454:34)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:324:13)
from homebridge-server.
Okay I'll try to setup a Windows VM for testing and I'll get back to you as soon as I can.
Sorry for the inconvenience :(
Otherwise if you get it up and running with a different path it would be perfect if you could drop me a message - thanks!
from homebridge-server.
Awesome!
Thanks for the suggestions once more, but the same keeps happening as before. So for now I just have to not click the Log tab and all is good!
from homebridge-server.
Hey @Dirtrunner702!,
Sorry for the delay on the update - last weekend I tried to setup Homebridge on Windows which wasn't as easy as thought.
Until now I am not quite sure if this solves the problem but indeed, could you please try another log-path as:
"log": "C:\Users\Username\output.log"
And if you still have the adaptions in the index.js
-file then you're good to go, otherwise please reapply them first.
If this doesn't work as well, try:
"log": "C:\\Users\\Username\\output.log"
Thanks!
P.S.: Paths and alike are sadly the most difficult part in these cross-platform-projects
from homebridge-server.
Thank you for all the help and good communication!
Unfortunately both of those methods don't allow homebridge to run. The only methods that keep homebridge working but still do not output the log are the following
"log": "C://Users/HomeBridge/output.log",
"log": "C:/Users/HomeBridge/output.log",
Its not a huge problem as long as I do not click the Log tab!
Thank you!
I can send you a vmdk of my VM running win10 and Homebridge I can drop box it for you but its about 40GB. If it will help with development id be happy to help!
from homebridge-server.
Oh this would indeed be a great help - could you squeeze it somehow and upload it? Feel free to write me an email and I'll try to fix it asap. Thanks!
from homebridge-server.
Hello,
I read the post and looks like we still trying to fix the path I'm able to use Homebridge-Server on windows its run but the logs are never been written there..
I can test few recommendations if you want, just let me know.
Cheers,
from homebridge-server.
Hm.. is there a happy Windows ending?
I'm using \\ in log path just fine, but the log file is neither created nor written to.
When created manually, empty log is displayed in config-ui-x without errors though.
Using just homebridge.log as a full path doesn't help too - still no writes.
from homebridge-server.
did anyone ever get any traction on this? I'm experiencing the same issue and cannot get anything to write to a log file.
from homebridge-server.
I am sorry but at the moment I can't provide a windows-setup - I'd be really thankful if someone with windows and some interest in node could support me! # #
from homebridge-server.
Related Issues (20)
- Confirmation window before removing HOT 1
- Log page HOT 1
- Does not work with journalctl and sudo HOT 2
- can get it to work right HOT 3
- Reboot issue on MacOS HOT 5
- Platform not loading HOT 2
- Trying to install homebridge-server HOT 8
- npm install|uninstall not working HOT 1
- try the 'Log' page then throw this HOT 3
- Possibility to define the "system" log name HOT 1
- Platform does not load HOT 1
- Understanding the installation process HOT 2
- Can make it to work - please assist HOT 2
- Installing Error HOT 10
- log - use of journalctl requires sudo HOT 3
- Graphics changed? HOT 8
- Cannot read property HOT 2
- restart not working (Mac launchd) HOT 3
- Server working, but the site closes upon trying to make a change. HOT 1
- Nobee needs help! What is my problem? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebridge-server.