Skip to content
This repository has been archived by the owner on Apr 17, 2020. It is now read-only.

mixxing up gateways when using multiple xiaomi aqara's #13

Closed
fliphess opened this issue May 28, 2018 · 2 comments
Closed

mixxing up gateways when using multiple xiaomi aqara's #13

fliphess opened this issue May 28, 2018 · 2 comments

Comments

@fliphess
Copy link

fliphess commented May 28, 2018

Hi

I'm not sure if it's even supported, but when i'm using multiple gateways, it looks like the traffic between gateways is getting mixed up.

I have 2 aqara gateways:

  • aqara1
  • aqara2

I have the node-xiaomi2mqtt bridge running on a raspberry pi:

  • bridge

I created a ngrep (tcpdump like tool) dump to see what is happening, and what it looks like the traffic for the aqara2 is send to aqara1:

U bridge:9898 -> 224.0.0.50:4321
  {"cmd": "whois"}
#
U aqara2:4321 -> bridge:9898
  {"cmd":"iam","port":"9898","sid":"34ce00fb7438","model":"gateway","ip":"aqara2"}
#
U aqara1:4321 -> bridge:9898
  {"cmd":"iam","port":"9898","sid":"7811dcb3a40b","model":"gateway","ip":"aqara1"}
#
U bridge:9898 -> aqara2:9898
  {"cmd": "get_id_list"}
#
U aqara2:9898 -> bridge:9898
  {"cmd":"get_id_list_ack","sid":"34ce00fb7438","token":"<TOKEN>","data":"[\"158d0001b1b8a1\",\"158d0001b1b7d4\",\"158d000200a532\",\"158d00022367d1\",\"158d0001e7b472\",\"158d000223670f\",\"158d00019df092\",\"158d00016bfc16\"
  ,\"158d0002286c6e\"]"}
#
U bridge:9898 -> aqara1:9898
  {"cmd": "read", "sid": "7811dcb3a40b"}
#
U bridge:9898 -> aqara1:9898
  {"cmd": "read", "sid": "158d0001b1b8a1"}
#
U bridge:9898 -> aqara1:9898
  {"cmd": "read", "sid": "158d0001b1b7d4"}
#
U bridge:9898 -> aqara1:9898
  {"cmd": "read", "sid": "158d000200a532"}
#
U bridge:9898 -> aqara1:9898
  {"cmd": "read", "sid": "158d00022367d1"}
#
U bridge:9898 -> aqara1:9898
  {"cmd": "read", "sid": "158d0001e7b472"}
#
U bridge:9898 -> aqara1:9898
  {"cmd": "read", "sid": "158d000223670f"}
#
U bridge:9898 -> aqara1:9898
  {"cmd": "read", "sid": "158d00019df092"}
#
U bridge:9898 -> aqara1:9898
  {"cmd": "read", "sid": "158d00016bfc16"}
#
U bridge:9898 -> aqara1:9898
  {"cmd": "read", "sid": "158d0002286c6e"}
#
U aqara1:9898 -> bridge:9898
  {"cmd":"read_ack","model":"gateway","sid":"7811dcb3a40b","short_id":0,"data":"{\"rgb\":1694433280,\"illumination\":804,\"proto_version\":\"1.0.9\"}"}
#
U aqara1:9898 -> bridge:9898
  {"cmd":"read_ack","sid":"158d0001b1b8a1","data":"{\"error\":\"No device\"}"}
#
U aqara1:9898 -> bridge:9898
  {"cmd":"read_ack","sid":"158d0001b1b7d4","data":"{\"error\":\"No device\"}"}
#
U aqara1:9898 -> bridge:9898
  {"cmd":"read_ack","sid":"158d000200a532","data":"{\"error\":\"No device\"}"}
#
U aqara1:9898 -> bridge:9898
  {"cmd":"read_ack","sid":"158d00022367d1","data":"{\"error\":\"No device\"}"}
#
U aqara1:9898 -> bridge:9898
  {"cmd":"read_ack","sid":"158d0001e7b472","data":"{\"error\":\"No device\"}"}
#
U aqara1:9898 -> bridge:9898
  {"cmd":"read_ack","sid":"158d000223670f","data":"{\"error\":\"No device\"}"}
#
U aqara1:9898 -> bridge:9898
  {"cmd":"read_ack","sid":"158d00019df092","data":"{\"error\":\"No device\"}"}
#
U aqara1:9898 -> bridge:9898
  {"cmd":"read_ack","sid":"158d00016bfc16","data":"{\"error\":\"No device\"}"}
#
U aqara1:9898 -> bridge:9898
  {"cmd":"read_ack","sid":"158d0002286c6e","data":"{\"error\":\"No device\"}"}
#

You can see the bridge requesting a get_id_list at the aqara2, which is responding with an array of id's. These id's are then queried at the aqara1 which is responding with the {"error":"No device"} read_ack.

Is this a bug in node-xiaomi2mqtt or in the liumi-aqara library?

(And thanks for this lovely tool.... Of dank je wel, als kaaskoppen onder elkaar)

@svrooij
Copy link
Owner

svrooij commented May 28, 2018

@fliphess I only have one gateway, so I cannot test this. See #8 for a bit more info.

This app isn’t designed for multiple gateways, it just responds to the gateway that it thinks it got. With a second gate this might be possible to tackle, but you’ll have to implement some kind of source ip filter to respond to different gateways.

@svrooij
Copy link
Owner

svrooij commented Apr 17, 2020

Closing before archive, see https://github.com/svrooij/node-xiaomi2mqtt#xiaomi2mqtt

@svrooij svrooij closed this as completed Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants