Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi not finding sensor #27

Open
ohmantics opened this issue Feb 2, 2023 · 9 comments
Open

Raspberry Pi not finding sensor #27

ohmantics opened this issue Feb 2, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@ohmantics
Copy link

I'm running Homebridge on a Raspberry Pi on Raspbian Bullseye (32-bit). The plugin always fails with "did not find any devices." I've increased the discovery timeout to 60s with no success.

Home Assistant running on the same device sees the sensor with no problems. The bluetoothDebug.js script does see the MAC of the sensor. bluetoothctl indicates that the device is paired.

  • Plugin Version: 0.0.3
  • Homebridge Version: 1.6.0
  • Node.js Version: v17.9.0
  • NPM Version: 8.5.5
  • Operating System: Raspbian GNU/Linux Bullseye (11) (w/hb-service)
@ohmantics ohmantics added the bug Something isn't working label Feb 2, 2023
@alcayaga
Copy link

I have the same issue on Raspbian Buster when I updated the firmware of the Aranet to v1.2.0 and the plugin to 0.0.3

[2/21/2023, 9:48:51 AM] [Aranet4 Platform] Initializing Aranet4 platform...
[2/21/2023, 9:48:51 AM] [Aranet4 Platform] Finished initializing platform: Aranet4 Platform
[2/21/2023, 9:48:51 AM] [Aranet4 Platform] Configs: {"name":"Aranet4 Platform","co2AlertThreshold":1400,"batteryAlertThreshold":10,"sensorDataRefreshInterval":300,"bluetoothReadyTimeout":60,"bluetoothDeviceSearchTimeout":60,"platform":"Aranet4"}
[2/21/2023, 9:48:52 AM] [Aranet4 Platform] Executed didFinishLaunching callback
[2/21/2023, 9:48:52 AM] [Aranet4 Platform] poweredOn
[2/21/2023, 9:48:52 AM] [Aranet4 Platform] Starting to scan...
[2/21/2023, 9:49:52 AM] [Aranet4 Platform] errored while getting devices:Error: Did not find any devices

@ParaAdBellum
Copy link

can you see if the following diff resolves your problem? it does for me:

in /var/lib/homebridge

--- ./node_modules/homebridge-aranet4/dist/aranet.js- 2022-11-05 10:52:28.866609648 -0700
+++ ./node_modules/homebridge-aranet4/dist/aranet.js 2023-05-20 10:36:14.530192577 -0700
@@ -18,7 +18,8 @@
exports.Aranet4Device = void 0;
const noble_1 = __importDefault(require("@abandonware/noble"));
const util_1 = require("util");
-const ARANET4_SERVICE = '0000fce0-0000-1000-8000-00805f9b34fb';
+const ARANET4_SERVICE = 'fce0';
+//const ARANET4_SERVICE = '0000fce0-0000-1000-8000-00805f9b34fb';
const ARANET4_CHARACTERISTICS = 'f0cd300195da4f4b9ac8aa55d312af0c';
const MANUFACTURER_NAME = { name: 'org.bluetooth.characteristic.manufacturer_name_string', id: '2a29' };
const MODEL_NUMBER = { name: 'org.bluetooth.characteristic.model_number_string', id: '2a24' };

@ohmantics
Copy link
Author

@ParaAdBellum Same error as before, although I'm now running Ubuntu Lunar Lobster.

@ParaAdBellum
Copy link

weird, does aranetctl @ https://github.com/Anrijs/Aranet4-Python
work for you?

aranetctl --scan

@ParaAdBellum
Copy link

also, which raspberry pi are you using? I've had issues with raspberry pi 3 in the past

@ohmantics
Copy link
Author

I've migrated to an 'Raspberry Pi Compute Module 4 Rev 1.1' and still have this problem. aranetctl --scan finds nothing, but my Home Assistant Yellow box (also CM4-based) is happily talking to the sensor.

@max-christian
Copy link

max-christian commented Nov 1, 2023

The patch above solved the "did not find any devices" error for me. N.B. You get zero readings for the first few minutes.

@max-christian
Copy link

max-christian commented Nov 18, 2023

I found scanning for the device eventually failed on Linux and Mac even after applying this patch. Took a week for it to fail on Mac, no idea why. Connecting to the device using the previously-scanned peripheral UUID still worked fine, as did scanning all devices and looking for 'Aranet4' but neither this plugin nor aranetctl could find it since they both search by service. So I rewrote the scanning code to grab all devices and look for the device by name instead of service. This seems to be working well so far.

@alcayaga
Copy link

I found scanning for the device eventually failed on Linux and Mac even after applying this patch. Took a week for it to fail on Mac, no idea why. Connecting to the device using the previously-scanned peripheral UUID still worked fine, as did scanning all devices and looking for 'Aranet4' but neither this plugin nor aranetctl could find it since they both search by service. So I rewrote the scanning code to grab all devices and look for the device by name instead of service. This seems to be working well so far.

Can you publish the changes in your repository? I am interested in testing this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants