You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if the Sniffer receives more than one code in a short time period the module crashs with a Syntax error:
_{"code": 1361, "pulseLength": 310}{"code": 1361, "pulseLength": 310}{"code": 1361, "pulseLength": 311}
^
SyntaxError: Unexpected token { in JSON at position 34
at JSON.parse ()
at Sniffer.onData (/usr/local/lib/node_modules/homebridge-rc433-motion-sensor/node_modules/rpi-433/Sniffer.js:61:26)
at Socket. (/usr/local/lib/node_modules/homebridge-rc433-motion-sensor/node_modules/underscore/underscore.js:841:23)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:178:18)
at Socket.Readable.push (stream_readable.js:136:10)
at Pipe.onread (net.js:560:20)
That is because the onData method tries to parse multiple JSON Strings: {"code": 1361, "pulseLength": 310}{"code": 1361, "pulseLength": 310}{"code": 1361, "pulseLength": 311}.
To solve this problem I suggest something like this:
Hi,
if the Sniffer receives more than one code in a short time period the module crashs with a Syntax error:
That is because the onData method tries to parse multiple JSON Strings:
{"code": 1361, "pulseLength": 310}{"code": 1361, "pulseLength": 310}{"code": 1361, "pulseLength": 311}
.To solve this problem I suggest something like this:
The text was updated successfully, but these errors were encountered: