miscale2garmin: Missing BT device when scanning stopped.

First of all amazing project.

Some feedback after testing it. I had to recompile bodycomposition because I’m using RPi with arm64. I can provide the 64-bit version if you would wish to add it. I also had some problems with BLE scanning. Turns out when the scanning was manually stopped (instead of the timeout) it wouldn’t add the last device detected (which in that case would be the MiScale). For now I just removed that line from the code and reduced scanning time to 20sec. Not sure why that happens…

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

I couldn’t compile it against 1.0.4, some errors around WiFiUdp.h. Had more luck with 1.0.5 and 1.0.6 but with both had weird BT behaviour. It would scan the same devices multiple times and in the end it would still show 0 devices found. So for me the only working version is 2.0.0 but luckily I found out that adding 200ms delay between ::getScan() and ::stop() solves the problem of that last detected device not being on the list.

if (advertisedDevice.getAddress().toString() == scale_mac_addr) {
        Serial.println(" <= target device");
        BLEScan *pBLEScan = BLEDevice::getScan(); // found what we want, stop now
        delay(200);
        pBLEScan->stop();
      }