Page 3 of 6

Re: Debugger for Z-Way JavaScript

Posted: 18 Jul 2014 22:46
by dylancaponi
Thx for quick reply. Node inspector loads at that address but is not populated. It's totally empty. There's nothing under console or sources and I've clicked around the tabs at the bottom as well. Cmd + O opens a blank window with nothing to choose.

Re: Debugger for Z-Way JavaScript

Posted: 18 Jul 2014 23:31
by kambis
Please check if your z-way-server file in /etc/init.d/ folder has the following entries:

Code: Select all

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/z-way-server/libs
export V8_DEBUG=yes
and don't forget to restart the z-way-server:

Code: Select all

/etc/init.d/z-way-server restart

Re: Debugger for Z-Way JavaScript

Posted: 19 Jul 2014 00:06
by dylancaponi
Upgraded zway to current version (woops):
wget -q -O - razberry.z-wave.me/install | sudo bash

Went back and changed z-way-server file again as you explained above. Restarted z-way-server and rebooted pi several times. The ssh tunnel seemed to have no effect on results.

Refreshed browser and get this in the main console:
"Page.getResourceTree failed.
ReferenceError: process is not defined"

There are now sources for all the modules, classes, etc. Does this seem right or should my resourcetree be loading?

Re: Debugger for Z-Way JavaScript

Posted: 19 Jul 2014 00:13
by kambis
It seems you are on the road. if you see sources of all modules in your browser, then you are done.
You may find some good hints for working if you go completely through this post:
viewtopic.php?f=3422&t=20387&start=10

Good luck. ;)

Re: Debugger for Z-Way JavaScript

Posted: 09 Sep 2014 18:55
by klirichek
I believe port must be NOT ALWAYS 8183, but your web-port + 100.

For example, for me it is more comfortable to have z-way on the standard 80 port (since my raspberry is used just to control z-way, so no reason to don't use 80-th port).

Look here:

Code: Select all

root@raspberrypi:/opt/home-automation# netstat -lptn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      8974/z-way-server
tcp        0      0 127.0.0.1:180           0.0.0.0:*               LISTEN      8974/z-way-server
tcp        0      0 0.0.0.0:8084            0.0.0.0:*               LISTEN      2012/mongoose   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2063/sshd       
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      4592/0          
tcp        0      0 127.0.0.1:6011          0.0.0.0:*               LISTEN      5113/1          
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      2012/mongoose   
tcp        0      0 127.0.0.1:6012          0.0.0.0:*               LISTEN      8907/4          
tcp        0      0 127.0.0.1:6013          0.0.0.0:*               LISTEN      8209/5
Do you see port 180? (80 + 100)?
And also, nothing about port 8183!

Re: Debugger for Z-Way JavaScript

Posted: 12 Jan 2015 04:57
by kozlow
Hi, I can't debug...

My config:
2.0.1-rc7
export V8_DEBUG=yes
<debug-port>8183</debug-port>

From my ssh terminal:
$ node-inspector --debug-port 8183
Node Inspector v0.8.1
Visit http://127.0.0.1:8080/debug?port=8183 to start debugging.

I soon I open my browser on http://my-pi-ip:8080/debug?port=8183, I have:
express deprecated res.sendfile: Use res.sendFile instead ../../usr/local/lib/node_modules/node-inspector/lib/debug-server.js:17:7

undefined:1
400 Bad Request
^
SyntaxError: Unexpected token B
at Object.parse (native)
at Protocol.execute (_debugger.js:131:43)
at Socket.emit (events.js:95:17)
at Socket.<anonymous> (_stream_readable.js:765:14)
at Socket.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:427:10)
at emitReadable (_stream_readable.js:423:5)
at readableAddChunk (_stream_readable.js:166:9)
at Socket.Readable.push (_stream_readable.js:128:10)
at TCP.onread (net.js:529:21)


No source file in browser debug interface... Any help? Thx.

Re: Debugger for Z-Way JavaScript

Posted: 13 Jan 2015 02:17
by PoltoS
Node inspector should run locally or you need to make ssh tunnel like shown on first page of this topic. Please read it carefully.

Re: Debugger for Z-Way JavaScript

Posted: 13 Jan 2015 21:35
by kozlow
OK, done, thanks, the sentence "Install Node Inspector on your PC or on Raspberry Pi" confused me.
++Mat

Re: Debugger for Z-Way JavaScript

Posted: 15 Mar 2015 17:10
by m_pete
I could not understand, how can I debug via ssh tunnel if z-way-server listens the local connection only.

Code: Select all

netstat -lptn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:8083            0.0.0.0:*               LISTEN      7077/z-way-server
tcp        0      0 0.0.0.0:8084            0.0.0.0:*               LISTEN      2180/mongoose
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2252/sshd
tcp        0      0 127.0.0.1:8183          0.0.0.0:*               LISTEN      7077/z-way-server
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      2180/mongoose
127.0.0.1:8183 - means - wait local connection?

Re: Debugger for Z-Way JavaScript

Posted: 28 Jun 2015 15:01
by Isaksson
Is there a way to verify if Z-Way is listening on 8183?

I have made all steps from the first post but it does not work, i need to find out if its the server or client i need to focus on.
I am running Node Inspector on windows and i create the ssh tunnel with putty.