Search found 13 matches

by injecteer
17 Feb 2017 14:52
Forum: Discussions in English
Topic: wss: Secure Websocket leads to out of memory
Replies: 6
Views: 7271

Re: wss: Secure Websocket leads to out of memory

The flow is:
* send http.request() to "ping" the server, and if it's accessible
* open the websocket via wss

Then, if the websocket connection breaks (e.g. the server restarts) the flow starts over again and the http ping throws the out of memory.
by injecteer
16 Feb 2017 13:59
Forum: Discussions in English
Topic: wss: Secure Websocket leads to out of memory
Replies: 6
Views: 7271

wss: Secure Websocket leads to out of memory

Recently I switched my server over to wss:// protocol and upon re-connection I get "Out of memory" errors. Just before connecting to a ws(s) endpoint, a short http-ping request is made to ensure server's accessibility. The code looks like: function connect() { var self = this; http.request...
by injecteer
31 Jan 2017 02:00
Forum: Discussions in English
Topic: websocket client
Replies: 33
Views: 39080

Re: websocket client

rgr, thats what I thought ;)
by injecteer
30 Jan 2017 17:54
Forum: Discussions in English
Topic: websocket client
Replies: 33
Views: 39080

Re: websocket client

I just discovered, that the

Code: Select all

  new sockets.websocket( self.wsUrl );
sends no ping's. That leads to the connection termination by Nginx after a timeout.

Is there any way to send WS-pings out of the box?
by injecteer
04 Nov 2016 18:08
Forum: Discussions in English
Topic: Handling inclusuion / removal event
Replies: 1
Views: 2942

Handling inclusuion / removal event

I have a callback for device state change controller.devices.get( 'ZWayVDev_zway_' + someId ).on( 'change:metrics:level', self.stateChangeHandler ); and it's working just fine. Now I want to listen to other events like device adding or removal. How can I do it? I searched the ref-doc, but found no g...
by injecteer
04 Nov 2016 17:14
Forum: Discussions in English
Topic: websocket client
Replies: 33
Views: 39080

Re: websocket client

Then how can I call it and how can it work like charm?

Code: Select all

this.ws = new sockets.websocket( wsUrl );
this.ws.send( s );
:o :shock:

Update:
`ws.push()` is undefined as of 2.2.2
by injecteer
26 Oct 2016 14:42
Forum: Discussions in English
Topic: How to set a color?
Replies: 2
Views: 3892

Re: How to set a color?

Thanks, Patrick, your code works perfectly. There is some inconsistency in the API though (ver. 11.04.2016 v2.2.2). I tried the performCommand() before: dev.performCommand( 'exact', {"r":123,"b":255,"g":41} ); but was scared off with the not-a-number error: [2016-10-26 ...
by injecteer
25 Oct 2016 17:20
Forum: Discussions in English
Topic: How to set a color?
Replies: 2
Views: 3892

How to set a color?

I have a switchRGBW ligtht bulb and I'm trying to change it's color like so: var dev = controller.devices.get( 'ZWayVDev_zway_' + k ); dev.set( 'metrics:color', {"r":11,"g":22,"b":33} ); but it doesn't work. I mean, the "metrics:color" value gets changed, but ...
by injecteer
25 Oct 2016 14:23
Forum: Discussions in English
Topic: websocket client
Replies: 33
Views: 39080

Re: websocket client

What's the difference between `ws.push()` and `ws.send()`?
by injecteer
04 Oct 2016 01:48
Forum: RaZberry
Topic: Getting MAC-address or alike in JS
Replies: 2
Views: 3460

Re: Getting MAC-address or alike in JS

Thanks, you pointed me to the right direction!
I ended up using this:

Code: Select all

var mac = system( 'cat /sys/class/net/eth0/address' )[ 1 ].trim();
As soon as `cat` was not registered in `.syscommands`, I put it in and it worked like charm