Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flooding of commands #126

Closed
MichaelMichaelMichaelMichaelMichael opened this issue Dec 8, 2020 · 4 comments
Closed

Flooding of commands #126

MichaelMichaelMichaelMichaelMichael opened this issue Dec 8, 2020 · 4 comments

Comments

@MichaelMichaelMichaelMichaelMichael

Describe The Bug:
If commands are being sent too quickly (for example a sequence of color changes), some sort of flood protection kicks in (in my case an LED stripe MSL320CHK) and the target device is no longer reachable until you stop the commands and then resume after a while.
So I've tried to capture some network packets using tshark with this command:
tshark -i wlan0 -T fields -e ip.addr -e mqtt.topic -E header=y -E separator=, > pcap_to_csv.csv
and one observation I was making:
Each time I've pressed my button, I got an entry with a valid src ip and dst ip between the raspberry pi and the Meross Device. However, when I operate the app and change properties on the Meross Device, I do not see anything in the network traffic that shows any contact from the iPhone to the Meross device directly.

To Reproduce:
Just fire commands quickly enough so that the Meross Device blocks you out.

Expected behavior:
No blocking occurs.

Logs:

2020-12-08T01:28:46.240Z mqttjs:client writable stream :: parsing buffer
2020-12-08T01:28:46.240Z mqtt-packet:parser parse: current state: _parseHeader
2020-12-08T01:28:46.241Z mqtt-packet:parser _parseHeader: packet: Packet { cmd: 'publish', retain: false, qos: 0, dup: false, length: -1, topic: null, payload: null }
2020-12-08T01:28:46.241Z mqtt-packet:parser parse: state complete. _stateCounter is now: 1
2020-12-08T01:28:46.241Z mqtt-packet:parser parse: packet.length: -1, buffer list length: 160
2020-12-08T01:28:46.242Z mqtt-packet:parser _parseVarByteNum
2020-12-08T01:28:46.242Z mqtt-packet:parser _parseVarByteNum: result: { bytes: 2, value: 158 }
2020-12-08T01:28:46.242Z mqtt-packet:parser _parseLength 158
2020-12-08T01:28:46.242Z mqtt-packet:parser parse: state complete. _stateCounter is now: 2
2020-12-08T01:28:46.243Z mqtt-packet:parser parse: packet.length: 158, buffer list length: 158
2020-12-08T01:28:46.251Z mqtt-packet:parser _parsePayload: payload BufferListStream {
  _bufs: [
    <Buffer 00 24 7a 69 67 62 65 65 32 6d 71 74 74 2f 4d 75 65 6c 6c 65 72 5f 4c 69 63 68 74 5f 43 6f 6e 74 72 6f 6c 6c 65 72 7b 22 61 63 74 69 6f 6e 22 3a 22 63 ... 108 more bytes>
  ],
  length: 158,
  _readableState: ReadableState {
    objectMode: false,
    highWaterMark: 16384,
    buffer: BufferList { head: null, tail: null, length: 0 },
    length: 0,
    pipes: null,
    pipesCount: 0,
    flowing: null,
    ended: false,
    endEmitted: false,
    reading: false,
    sync: true,
    needReadable: false,
    emittedReadable: false,
    readableListening: false,
    resumeScheduled: false,
    paused: true,
    emitClose: true,
    autoDestroy: false,
    destroyed: false,
    defaultEncoding: 'utf8',
    awaitDrain: 0,
    readingMore: false,
    decoder: null,
    encoding: null
  },
  readable: true,
  _events: [Object: null prototype] {},
  _eventsCount: 0,
  _maxListeners: undefined,
  _writableState: WritableState {
    objectMode: false,
    highWaterMark: 16384,
    finalCalled: false,
    needDrain: false,
    ending: false,
    ended: false,
    finished: false,
    destroyed: false,
    decodeStrings: true,
    defaultEncoding: 'utf8',
    length: 0,
    writing: false,
    corked: 0,
    sync: true,
    bufferProcessing: false,
    onwrite: [Function (anonymous)],
    writecb: null,
    writelen: 0,
    bufferedRequest: null,
    lastBufferedRequest: null,
    pendingcb: 0,
    prefinished: false,
    errorEmitted: false,
    emitClose: true,
    autoDestroy: false,
    bufferedRequestCount: 0,
    corkedRequestsFree: CorkedRequest {
      next: null,
      entry: null,
      finish: [Function (anonymous)]
    }
  },
  writable: true,
  allowHalfOpen: true,
  [Symbol(kCapture)]: false
}
2020-12-08T01:28:46.252Z mqtt-packet:parser _parsePublish
2020-12-08T01:28:46.252Z mqtt-packet:parser _parseNum: result: 36
2020-12-08T01:28:46.252Z mqtt-packet:parser _parseString: result: zigbee2mqtt/Mueller_Licht_Controller
2020-12-08T01:28:46.253Z mqtt-packet:parser _parsePublish: payload from buffer list: <Buffer 7b 22 61 63 74 69 6f 6e 22 3a 22 63 6f 6c 6f 72 5f 77 68 65 65 6c 22 2c 22 61 63 74 69 6f 6e 5f 63 6f 6c 6f 72 22 3a 7b 22 78 22 3a 30 2e 33 37 33 2c ... 70 more bytes>
2020-12-08T01:28:46.253Z mqtt-packet:parser _parsePayload complete result: true
2020-12-08T01:28:46.253Z mqtt-packet:parser parse: state complete. _stateCounter is now: 3
2020-12-08T01:28:46.253Z mqtt-packet:parser parse: packet.length: 158, buffer list length: 158
2020-12-08T01:28:46.253Z mqtt-packet:parser _newPacket
2020-12-08T01:28:46.254Z mqtt-packet:parser _newPacket: parser emit packet: packet.cmd: publish, packet.payload: {"action":"color_wheel","action_color":{"x":0.373,"y":0.589},"action_group":16389,"linkquality":115,"transition_time":0}, packet.length: 158
2020-12-08T01:28:46.254Z mqttjs:client parser :: on packet push to packets array.
2020-12-08T01:28:46.254Z mqtt-packet:parser _newPacket: new packet
2020-12-08T01:28:46.254Z mqtt-packet:parser parse: state complete. _stateCounter is now: 4
2020-12-08T01:28:46.254Z mqtt-packet:parser parse: packet.length: -1, buffer list length: 0
2020-12-08T01:28:46.254Z mqtt-packet:parser parse: exited while loop. packet: -1, buffer list length: 0
2020-12-08T01:28:46.254Z mqttjs:client work :: getting next packet in queue
2020-12-08T01:28:46.255Z mqttjs:client work :: packet pulled from queue
2020-12-08T01:28:46.255Z mqttjs:client _handlePacket :: emitting packetreceive
2020-12-08T01:28:46.255Z mqttjs:client _handlePublish: packet Packet { cmd: 'publish', retain: false, qos: 0, dup: false, length: 158, topic: 'zigbee2mqtt/Mueller_Licht_Controller', payload: <Buffer 7b 22 61 63 74 69 6f 6e 22 3a 22 63 6f 6c 6f 72 5f 77 68 65 65 6c 22 2c 22 61 63 74 69 6f 6e 5f 63 6f 6c 6f 72 22 3a 7b 22 78 22 3a 30 2e 33 37 33 2c ... 70 more bytes> }
2020-12-08T01:28:46.256Z mqttjs:client _handlePublish: qos 0
2020-12-08T01:28:46.276Z HAP-NodeJS:EventedHTTPServer [::ffff:192.168.homexxxx.bridgexxxxx] New connection from client at interface wlan0
2020-12-08T01:28:46.276Z HAP-NodeJS:EventedHTTPServer [::ffff:192.168.homexxxx.bridgexxxxx] HTTP server listening on port 37423

2020-12-08T01:28:46.281Z HAP-NodeJS:EventedHTTPServer [::ffff:192.168.homexxxx.bridgexxxxx] New connection from client at interface wlan0
2020-12-08T01:28:46.281Z HAP-NodeJS:EventedHTTPServer [::ffff:192.168.homexxxx.bridgexxxxx] HTTP server listening on port 34003
2020-12-08T01:28:46.287Z HAP-NodeJS:EventedHTTPServer [::ffff:192.168.homexxxx.bridgexxxxx] HTTP request: /characteristics
2020-12-08T01:28:46.287Z HAP-NodeJS:HAPServer [0E:11:CE:D1:F1:2F] HAP Request: PUT /characteristics
2020-12-08T01:28:46.288Z HAP-NodeJS:Accessory [Homebridge F6B1] Processing characteristic set: [{"aid":109,"iid":14,"value":true},{"aid":109,"iid":15,"value":null},{"aid":109,"iid":17,"value":null},{"aid":109,"iid":18,"value":null}]
2020-12-08T01:28:46.289Z HAP-NodeJS:Accessory [Homebridge F6B1] Setting Characteristic "On" to value true
2020-12-08T01:28:46.291Z HAP-NodeJS:Accessory [Homebridge F6B1] Setting Characteristic "Hue" to value null
2020-12-08T01:28:46.292Z HAP-NodeJS:Accessory [Homebridge F6B1] Setting Characteristic "Saturation" to value null
2020-12-08T01:28:46.294Z HAP-NodeJS:Accessory [Homebridge F6B1] Setting Characteristic "Brightness" to value null
2020-12-08T01:28:46.303Z HAP-NodeJS:EventedHTTPServer [::ffff:192.168.homexxxx.bridgexxxxx] HTTP request: /characteristics?id=109.14,109.15,109.16,109.17,109.18
2020-12-08T01:28:46.303Z HAP-NodeJS:HAPServer [0E:11:CE:D1:F1:2F] HAP Request: GET /characteristics?id=109.14,109.15,109.16,109.17,109.18
2020-12-08T01:28:46.305Z HAP-NodeJS:Accessory [Homebridge F6B1] Getting value for Characteristic "On"
2020-12-08T01:28:46.307Z HAP-NodeJS:Accessory [Homebridge F6B1] Getting value for Characteristic "Hue"
2020-12-08T01:28:46.309Z HAP-NodeJS:Accessory [Homebridge F6B1] Getting value for Characteristic "Color Temperature"
2020-12-08T01:28:46.311Z HAP-NodeJS:Accessory [Homebridge F6B1] Getting value for Characteristic "Saturation"
2020-12-08T01:28:46.313Z HAP-NodeJS:Accessory [Homebridge F6B1] Getting value for Characteristic "Brightness"

[08/12/2020, 02:28:46] [MSL320CHK] Failed to POST to the Meross Device MSL320CHK at 192.168.Merossxxxx.LEDstripexxxxx: Error: connect ECONNRESET 192.168.Merossxxxx.LEDstripexxxxx:80
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'connect',
  address: '192.168.Merossxxxx.LEDstripexxxxx',
  port: 80
}
[08/12/2020, 02:28:46] [MSL320CHK] Set failed: false
[08/12/2020, 02:28:46] [MSL320CHK] Failed to POST to the Meross Device MSL320CHK at 192.168.Merossxxxx.LEDstripexxxxx: Error: connect ECONNRESET 192.168.Merossxxxx.LEDstripexxxxx:80
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'connect',
  address: '192.168.Merossxxxx.LEDstripexxxxx',
  port: 80
}
[08/12/2020, 02:28:46] [MSL320CHK] Set failed: 0
[08/12/2020, 02:28:46] [MSL320CHK] Failed to POST to the Meross Device MSL320CHK at 192.168.Merossxxxx.LEDstripexxxxx: Error: connect ECONNRESET 192.168.Merossxxxx.LEDstripexxxxx:80
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'connect',
  address: '192.168.Merossxxxx.LEDstripexxxxx',
  port: 80
}
[08/12/2020, 02:28:46] [MSL320CHK] Set failed: 0
2020-12-08T01:28:46.335Z HAP-NodeJS:EventedHTTPServer [::ffff:192.168.homexxxx.bridgexxxxx] HTTP Response is finished
[08/12/2020, 02:28:46] [MSL320CHK] Failed to POST to the Meross Device MSL320CHK at 192.168.Merossxxxx.LEDstripexxxxx: Error: connect ECONNRESET 192.168.Merossxxxx.LEDstripexxxxx:80
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'connect',
  address: '192.168.Merossxxxx.LEDstripexxxxx',
  port: 80
}
2020-12-08T01:28:46.338Z HAP-NodeJS:Accessory [Homebridge F6B1] Got Characteristic "On" value: false
[08/12/2020, 02:28:46] [MSL320CHK] Failed to POST to the Meross Device MSL320CHK at 192.168.Merossxxxx.LEDstripexxxxx: Error: connect ECONNRESET 192.168.Merossxxxx.LEDstripexxxxx:80
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'connect',
  address: '192.168.Merossxxxx.LEDstripexxxxx',
  port: 80
}
2020-12-08T01:28:46.342Z HAP-NodeJS:Accessory [Homebridge F6B1] Got Characteristic "Hue" value: 16
[08/12/2020, 02:28:46] [MSL320CHK] Failed to POST to the Meross Device MSL320CHK at 192.168.Merossxxxx.LEDstripexxxxx: Error: connect ECONNRESET 192.168.Merossxxxx.LEDstripexxxxx:80
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'connect',
  address: '192.168.Merossxxxx.LEDstripexxxxx',
  port: 80
}
2020-12-08T01:28:46.345Z HAP-NodeJS:Accessory [Homebridge F6B1] Got Characteristic "Color Temperature" value: 140
[08/12/2020, 02:28:46] [MSL320CHK] Failed to POST to the Meross Device MSL320CHK at 192.168.Merossxxxx.LEDstripexxxxx: Error: connect ECONNRESET 192.168.Merossxxxx.LEDstripexxxxx:80
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'connect',
  address: '192.168.Merossxxxx.LEDstripexxxxx',
  port: 80
}
2020-12-08T01:28:46.348Z HAP-NodeJS:Accessory [Homebridge F6B1] Got Characteristic "Saturation" value: 0
[08/12/2020, 02:28:46] [MSL320CHK] Failed to POST to the Meross Device MSL320CHK at 192.168.Merossxxxx.LEDstripexxxxx: Error: connect ECONNRESET 192.168.Merossxxxx.LEDstripexxxxx:80
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'connect',
  address: '192.168.Merossxxxx.LEDstripexxxxx',
  port: 80
}
2020-12-08T01:28:46.351Z HAP-NodeJS:Accessory [Homebridge F6B1] Got Characteristic "Brightness" value: 0
2020-12-08T01:28:46.353Z HAP-NodeJS:EventedHTTPServer [::ffff:192.168.homexxxx.bridgexxxxx] HTTP Response is finished

2020-12-08T01:28:46.358Z HAP-NodeJS:EventedHTTPServer [::ffff:192.168.homexxxx.bridgexxxxx] Client connection closed
2020-12-08T01:28:46.359Z HAP-NodeJS:EventedHTTPServer [::ffff:192.168.homexxxx.bridgexxxxx] HTTP connection was closed
2020-12-08T01:28:46.360Z HAP-NodeJS:EventedHTTPServer [::ffff:192.168.homexxxx.bridgexxxxx] HTTP server was closed
2020-12-08T01:28:46.362Z HAP-NodeJS:EventedHTTPServer [::ffff:192.168.homexxxx.bridgexxxxx] Client connection closed
2020-12-08T01:28:46.364Z HAP-NodeJS:EventedHTTPServer [::ffff:192.168.homexxxx.bridgexxxxx] HTTP connection was closed
2020-12-08T01:28:46.365Z HAP-NodeJS:EventedHTTPServer [::ffff:192.168.homexxxx.bridgexxxxx] HTTP server was closed

Homebridge Config:

        {
            "accessory": "Meross",
            "name": "MSL320CHK",
            "deviceUrl": "192.168.Merossxxxx.LEDstripexxxxx",
            "model": "MSL320CHK",
            "channel": 0,
            "messageId": "xxxxxxxx",
            "timestamp": 99999999,
            "sign": "xxxxxxxx"
        }

Screenshots:

Environment:

  • Node.js Version: v14.15.1
  • NPM Version: 6.14.9
  • Homebridge Version: 1.1.6
  • Homebridge Meross Plugin Version: v3.4.0
  • Homebridge Config UI X Plugin Version: v4.35.0
  • Operating System: Raspbian GNU/Linux 10 (buster)
@johnmullaney
Copy link

I have encountered this error too
It only occurs for me when I add a second MSL-120 Bulb
With just one it works fine

Homebridge 1.2.4
homebridge-meross v3.4.1-beta.1

OS: Raspbian GNU/Linux Buster (10)
Hostname: homebridge

Node ver: v14.15.1
Npm ver: v6.14.8
Service Mode: Yes

Logs:

[16/12/2020, 20:57:40] [Office Light] Failed to POST to the Meross Device MSL-120 at 192.168.0.20: Error: socket hang up
at connResetException (internal/errors.js:617:14)
at Socket.socketOnEnd (_http_client.js:493:23)
at Socket.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'ECONNRESET'
}
[16/12/2020, 20:57:41] [Landing Light] Failed to POST to the Meross Device MSL-120 at 192.168.0.19: Error: socket hang up
at connResetException (internal/errors.js:617:14)
at Socket.socketOnEnd (_http_client.js:493:23)
at Socket.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'ECONNRESET'
}
[16/12/2020, 20:57:41] [Office Light] Failed to POST to the Meross Device MSL-120 at 192.168.0.20: Error: socket hang up
at connResetException (internal/errors.js:617:14)
at Socket.socketOnEnd (_http_client.js:493:23)
at Socket.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'ECONNRESET'
}
[16/12/2020, 20:57:41] [Landing Light] Failed to POST to the Meross Device MSL-120 at 192.168.0.19: Error: socket hang up
at connResetException (internal/errors.js:617:14)
at Socket.socketOnEnd (_http_client.js:493:23)
at Socket.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'ECONNRESET'
}
[16/12/2020, 20:57:41] [Office Light] Failed to POST to the Meross Device MSL-120 at 192.168.0.20: Error: socket hang up
at connResetException (internal/errors.js:617:14)
at Socket.socketOnEnd (_http_client.js:493:23)
at Socket.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'ECONNRESET'
}

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 26, 2020
@donavanbecker
Copy link
Collaborator

See #151

@github-actions
Copy link
Contributor

This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants