erdose / xiaomi-mi-lywsd03mmc

Xiaomi Mi BLE Temperature & Humidity Sensor
MIT License
26 stars 7 forks source link

Failed to connect to peripheral #3

Closed eleutscher closed 3 years ago

eleutscher commented 3 years ago

Hai,

I did al the steps in described in your readme. No errors on my PI. Did the config in config.py

_DOMOTICZ_SERVER_IP = "127.0.0.1" DOMOTICZ_SERVER_PORT = "8080" DOMOTICZ_USERNAME = "" DOMOTICZ_PASSWORD = ""

sensors = { 1: {"MAC": "a4:c1:38:b9:07:19", "TH_IDX": 4516, "VOLTAGEIDX": -1},

But no connection to Domoticz. In the loginfo.log I see this error

_2020-12-19 16:01:03 INFO *** 2020-12-19 16:01:03 INFO Start script... 2020-12-19 16:01:03 INFO Input parameters: Domoticz Server IP: 127.0.0.1 Domoticz Server Port: 8080 Domoticz Server User: Domoticz Server Password: 2020-12-19 16:01:03 INFO THIDX:4516 2020-12-19 16:01:03 ERROR Failed to connect to peripheral a4:c1:38:b9:07:19, addr type: public

Do you know what could be wrong? Thx Best Regards, Erik

erdose commented 3 years ago

Hi, Did you check the device with hcitool lescan? Is it works? If it isn't work then try to switch down and up the BLE

eleutscher commented 3 years ago

After sudo hciconfig hci0 down sudo hciconfig hci0 up it seems to work

Thx

erdose commented 3 years ago

Please close the issue if it works well! Thanks!