Hypfer / Cybele

BLE to MQTT Gateway for Smarthome and IoT Devices
Apache License 2.0
112 stars 16 forks source link

Not receiving any date via Cybele #18

Closed jcwren closed 3 years ago

jcwren commented 3 years ago

After starting Cybele and it connecting to the MQTT server, no data is being received. I have 4 of the Xiaomi Mijia LYWSD03MMC Bluetooth 4.2 Temperature Humidity sensor sensors. I most likely have something configured wrong, but I can't see what it might be. Any ideas?

jcw@xyzzy:~/Cybele $ sudo node app.js
Connected to MQTT Broker
Startup complete
[nothing ever happens]

I'm seeing beacons from them using bluetoothctl.

[CHG] Device A4:C1:38:10:10:5D RSSI: -59
[CHG] Device A4:C1:38:10:10:5D ServiceData Key: 0000181a-0000-1000-8000-00805f9b34fb
[CHG] Device A4:C1:38:10:10:5D ServiceData Value:
  a4 c1 38 10 10 5d 00 e2 20 55 0b 98 83           ..8..].. U...
[bluetooth]# info A4:C1:38:E0:CB:5E
Device A4:C1:38:E0:CB:5E (public)
        Name: ATC_E0CB5E
        Alias: ATC_E0CB5E
        Paired: no
        Trusted: no
        Blocked: no
        Connected: no
        LegacyPairing: no
        ServiceData Key: 0000181a-0000-1000-8000-00805f9b34fb
        ServiceData Value:
  a4 c1 38 e0 cb 5e 00 ff 1c 57 0b af 37           ..8..^...W..7
        RSSI: -38
[CHG] Device A4:C1:38:E0:CB:5E RSSI: -38
[CHG] Device A4:C1:38:E0:CB:5E ServiceData Key: 0000181a-0000-1000-8000-00805f9b34fb
[CHG] Device A4:C1:38:E0:CB:5E ServiceData Value:
  a4 c1 38 e0 cb 5e 00 ff 1c 57 0b b0 38           ..8..^...W..8
[CHG] Device A4:C1:38:E1:72:4D RSSI: -57
[CHG] Device A4:C1:38:E1:72:4D ServiceData Key: 0000181a-0000-1000-8000-00805f9b34fb
[CHG] Device A4:C1:38:E1:72:4D ServiceData Value:
  a4 c1 38 e1 72 4d 00 e3 20 54 0b 92 84           ..8.rM.. T...
[CHG] Device A4:C1:38:60:37:23 RSSI: -62
[CHG] Device A4:C1:38:60:37:23 ServiceData Key: 0000181a-0000-1000-8000-00805f9b34fb
[CHG] Device A4:C1:38:60:37:23 ServiceData Value:
  a4 c1 38 60 37 23 00 e6 1f 57 0b a9 8a           ..8`7#...W...

I see that the service data key matches that in lib/devices/MiLYWSD03MMCDevice.js

This is on a Raspberry Pi 3 running Buster, with Node v12.21.0.

config.json looks like this:

{
  "mqtt": {
    "url": "mqtt://mqtt.xyzzy.com"
  },
  "dongles": [
    {
      "hciDevice": "hci0",
      "mode": "le",
      "services": [],
      "devices": [
        {
          "type": "MiLYWSD03MMCDevice",
          "friendlyName": "Temperature sensor #1",
          "mac": "A4:C1:38:E1:72:4D"
        },{
          "type": "MiLYWSD03MMCDevice",
          "friendlyName": "Temperature sensor #2",
          "mac": "A4:C1:38:10:10:5D"
        },{
          "type": "MiLYWSD03MMCDevice",
          "friendlyName": "Temperature sensor #3",
          "mac": "A4:C1:38:60:37:23"
        },{
          "type": "MiLYWSD03MMCDevice",
          "friendlyName": "Temperature sensor #4",
          "mac": "A4:C1:38:E0:CB:5E"
        }
      ]
    }
  ]
}
jcwren commented 3 years ago

D'oh! I wasn't checking the MQTT server, and was expecting at least a little bit of output from the console to indicate it was working.

Sorry about that.