BrewNinja / RadonEye-ESP32

15 stars 2 forks source link

BLEDevice.h dependency on hassio #2

Open fregattegh opened 3 years ago

fregattegh commented 3 years ago

Hi, I am on the latest home assistant (2021.10.6) on linux / hassio.

The integration was running smoothly the last 2 years or so.

Since some time I can`t update / compile RadonEye-ESP32.

"In file included from src/main.cpp:26:0: src/my_custom_sensor.h:2:23: fatal error: BLEDevice.h: No such file or directory


Does RadonEye-ESP32 needed to be adapted to the new home assistant ESP32 "ble_client" "ble_sensor" functionality or do you have any idea how to solve otherwise?

tnx

darkkatarsis commented 2 years ago

I have this same issue. Ane chance to add this dependency to esphome ?

3mta3 commented 2 years ago

Same - banging my head on this one.

BrewNinja commented 2 years ago

Looks like they moved BLE directly into arduino code instead of requiring a library. Will have to look into re-writing this with the new functions.

3mta3 commented 2 years ago

Thanks @BrewNinja - I took a run at using the embedded ble client with elements of your radoneye_rd200_sensor file but was quickly outclassed. I'll need more education to get there, may take another run at it later this week. It can't be that hard to swap the BLEDevice.h call with the embedded ble stack if you know what you're doing..

BrewNinja commented 2 years ago

I was able to add the new bledevice.h back in. However, something in ESPHome changed with how it handles globals. I need to look into that. After that, it should work.

3mta3 commented 2 years ago

rockstar, thanks - in the meanwhile, I found the right external library call - a functional workaround, at least until that git archive disappears. Posted on Discord, cross-posting here jic you didn't see it:

After much poking around, I found the archived ESP32_BLE_Arduino github repository, and then ESPHome instructions on linking to external libraries. Adding the following libraries call worked for me (using @BrewNinja’s original custom sensor):

esphome:
  name: radon1
  platform: ESP32
  board: featheresp32
  libraries:
  - esp32_ble_tracker=https://github.com/nkolban/ESP32_BLE_Arduino.git
  includes:
  - radoneye_rd200_sensor.h
fregattegh commented 2 years ago

thank you all so far for looking into this and already finding an interims solution. Would be great if BrewNinja would be able to finalise the porting to the new platform so that there is a long term solution. I would like to have your knowledge in this field so that I can contribute more myself.

wettermann32 commented 2 years ago

Hi, i am trying to use bletracker for this. It can read a value but in order to get updates from the sensor you need to write a value to a second characteristic to radoneye. Still searching for a solution, keep you updated. ANyhow find attached a yaml to read the latest value.

Best Michi

`esphome: name: radonbt platform: ESP32 board: nodemcu-32s

wifi: ssid: "YOURSSID" password: "yoursecrect"

api:

logger:

ota:

esp32_ble_tracker:

ble_client:

sensor:

ZachPL commented 2 years ago

thanks adding that library allowed me to compile again for now, i got that same error when I originally tried to install this on an esp that didnt have bluetooth, so when it started happening again I was confused and just ignored it since it was still working lol

boc-tothefuture commented 2 years ago

rockstar, thanks - in the meanwhile, I found the right external library call - a functional workaround, at least until that git archive disappears. Posted on Discord, cross-posting here jic you didn't see it:

After much poking around, I found the archived ESP32_BLE_Arduino github repository, and then ESPHome instructions on linking to external libraries. Adding the following libraries call worked for me (using @BrewNinja’s original custom sensor):

esphome:
  name: radon1
  platform: ESP32
  board: featheresp32
  libraries:
  - esp32_ble_tracker=https://github.com/nkolban/ESP32_BLE_Arduino.git
  includes:
  - radoneye_rd200_sensor.h

Did you have to change anything else? That fixed the first problem for me, but now I get: src/radoneye.h:6:8: error: 'String' does not name a type

wettermann32 commented 2 years ago

hi,

i have just recompiled my sensor with no issues. So no other changes are needed. Can you past your line 6.

boc-tothefuture commented 2 years ago

Someone has put in a PR to ESPHome for a native RadonEye component. This link has instructions on how to use it right now, which worked for me.

ZachPL commented 2 years ago

The new esphome update today has it built in now, working great for me. Thanks guys.

AndreCox commented 2 years ago

Hey everyone I have a fix for this as it seems like it's still not working on raspberry PI, I'll make a pull request to fix this but to fix it add this to your .yaml config file.

  libraries:
  - esp32_ble_tracker=https://github.com/nkolban/ESP32_BLE_Arduino.git