binsentsu / am43-ctrl

Node Util for controlling an AM43 Blinds Drive Cover, either over MQTT or via a HTTP API
44 stars 25 forks source link

skip scanning devices #16

Closed lutierigb closed 4 years ago

lutierigb commented 4 years ago

I don't know why if it's some time of deep sleep mode or other devices are already connected to the am43 blinds but sometimes the scanning can't find the device and I'm sure about the MAC address. I used to experience this when I had a python script so I just skipped scanning altogether and every time it needs to connect to the device it just takes the MAC address and tries to establish a connection.

just wondering if it really needs to scan the devices in the beginning. since it has the MAC address already scanning seems unnecessary, but I could be wrong.

docker run  --net=host --privileged 6b05856664be                                                                                                              3:01PM
2020-05-21T05:01:12.193Z am43* scanning for 1 device(s) [ '025964f227b3' ]
2020-05-21T05:01:12.466Z am43 Found 02c9051179b3 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:12.575Z am43 Found c0288ddd2364 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:12.692Z am43 Found 007c2d2e5ffb but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:12.729Z am43 Found 4f33533b4ee1 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:12.772Z am43 Found 54bd79d4b9d1 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:12.832Z am43 Found 6690250b0b77 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:13.059Z am43 Found 4fbb93a6b10a but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:14.471Z am43 Found 707781370e46 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:14.864Z am43 Found 612757372771 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:02:18.111Z am43 Found 2979ffaa3680 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:02:44.006Z am43 Found 41a10abe52a6 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:03:57.133Z am43 Found e6c695db110e but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:06:29.395Z am43 Found 0149beb0e1c1 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]

<stuck here forever>
binsentsu commented 4 years ago

Hi. To obtain the Peripheral from the Noble library, scanning is necessary, which returns the Peripheral.

lutierigb commented 4 years ago

okay. fair enough.