ESPHome Bluetooth Proxies - help

Hi all
I am trying to set up a ESP32 though this site, ESPHome Bluetooth Proxy . I think everything is ok because HA discovered it

BUT esphome can not adopt it.

I have set it - through my router to a static ip - 162.168.1.80 which seems fine

What could be the problem, and mainly how can I confirm that the device is working?

these are the logs

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6660
load:0x40078000,len:14944
ho 0 tail 12 room 4
load:0x40080400,len:3816
entry 0x40080698
I (28) boot: ESP-IDF 4.4.4 2nd stage bootloader
I (28) boot: compile time 21:43:30
I (29) boot: chip revision: v1.0
I (31) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (38) boot.esp32: SPI Speed      : 40MHz
I (43) boot.esp32: SPI Mode       : DIO
I (48) boot.esp32: SPI Flash Size : 4MB
I (52) boot: Enabling RNG early entropy source...
I (58) boot: Partition Table:
I (61) boot: ## Label            Usage          Type ST Offset   Length
I (68) boot:  0 otadata          OTA data         01 00 00009000 00002000
I (76) boot:  1 phy_init         RF data          01 01 0000b000 00001000
I (83) boot:  2 app0             OTA app          00 10 00010000 001c0000
I (91) boot:  3 app1             OTA app          00 11 001d0000 001c0000
I (98) boot:  4 nvs              WiFi data        01 02 00390000 0006d000
I (106) boot: End of partition table
I (110) boot_comm: chip revision: 1, min. application chip revision: 0
I (117) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=2bd68h (179560) map
I (191) esp_image: segment 1: paddr=0003bd90 vaddr=3ffbdb60 size=04288h ( 17032) load
I (198) esp_image: segment 2: paddr=00040020 vaddr=400d0020 size=d5500h (873728) map
I (514) esp_image: segment 3: paddr=00115528 vaddr=3ffc1de8 size=010d0h (  4304) load
I (516) esp_image: segment 4: paddr=00116600 vaddr=40080000 size=1d29ch (119452) load
I (583) boot: Loaded app from partition at offset 0x10000
I (583) boot: Disabling RNG early entropy source...
I (595) cpu_start: Pro cpu up.
I (595) cpu_start: Starting app cpu, entry point is 0x40082210
I (0) cpu_start: App cpu up.
I (611) cpu_start: Pro cpu start user code
I (611) cpu_start: cpu freq: 160000000
I (611) cpu_start: Application information:
I (616) cpu_start: Project name:     esp32-bluetooth-proxy
I (622) cpu_start: App version:      2023.7.0
I (627) cpu_start: Compile time:     Jul 25 2023 21:41:21
I (633) cpu_start: ELF file SHA256:  73f3a4792e512320...
I (639) cpu_start: ESP-IDF:          4.4.4
I (644) heap_init: Initializing. RAM available for dynamic allocation:
I (651) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (657) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (663) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (669) heap_init: At 3FFCA708 len 000158F8 (86 KiB): DRAM
I (676) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (682) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (688) heap_init: At 4009D29C len 00002D64 (11 KiB): IRAM
I (696) spi_flash: detected chip: generic
I (699) spi_flash: flash io: dio
I (705) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.

hi man

can you add the config of the esp32 module?
go to:
esphome (from side panel) —> Edit (on the card of your BT proxy), copy and paste the config here.
you can adopt it if you haven’t already.
this is not my “forte”, but i have some proxies scattered around my house.
i can take a look, compare it to my own, and see if i can help.

cheers

I don’t have this option.
image

Unless I understood something wrong from what you suggest.

  • the good thing is that my xiaomi ble sensors have been discovered…

adopt it first, and you will have the “edit” option.
but as you said, it seems to be working now, and that is what’s important
:slightly_smiling_face:

so is there any way that I could adopt it? because I can not find a way to edit it

Just click the “adopt” button on the card and follow the process. Unless I misunderstood you somehow and that is not something you can do, for some reason.

I don’t have this option. It is grayed and I can not click it. That is my problem

What I don’t understand is why those pre-cooked firmwares are promoted, instead of just adding your esp32 the normal way and configuring the bluetooth proxy in yaml, as you would any other integration.

That’s how I did it and it is not that complicated. Just look at the sample yaml provided for specific chipsets. If you adopt a pre-cooked firmware, and a firmware update is rolled out, you’ll have your own built firmware anyway.

1 Like

Well, I am not that good so I couldn’t do it alone for sure. Even now I don’t know if there is a way to intervene with the esp, to change it’s code. However since it is working I am not sure I want to mess further with it.

As this comes up more often in the last days, I’ll write a short guide on how to adopt these “externally” flashed devices into ESPHome. I’ll post a link here, when I’m done. :slight_smile:

1 Like

hi @Makis_Antypas, sorry for not understanding that. from the picture you add it seems very green and click-able
cheers

1 Like

Maybe a miss, but… are spaces allowed in the name? Try without them…

I have already tried. That’s not the problem.

Here you go:

1 Like

Hi
thanks for the guide. I just show the logs and I am getting the following. I do have 2 networks in my home and their ssid and passwords are correct in the secrets yaml. What else could be the problem? Shouli delete one of them? I have some devices connected to the first one and some others in the second. Would there be a problem if I delete one of the ssid?

    raise EsphomeError(exc) from exc
esphome.core.EsphomeError: Duplicate key "wifi_ssid"
  in "/config/esphome/secrets.yaml", line 5, column 1:
    wifi_ssid: "mkDev"
    ^
NOTE: Previous declaration here:
  in "/config/esphome/secrets.yaml", line 2, column 1:
    wifi_ssid: "COSCBA6C4"

2023-08-01 10:06:01,085 ERROR 500 GET /secret_keys (0.0.0.0) 4.05ms
2023-08-01 10:06:03,958 INFO 304 GET /devices (0.0.0.0) 4.57ms
2023-08-01 10:06:08,958 INFO 304 GET /devices (0.0.0.0) 4.31ms
2023-08-01 10:06:15,054 INFO 304 GET /devices (0.0.0.0) 3.89ms
2023-08-01 10:06:20,411 INFO 304 GET /devices (0.0.0.0) 3.50ms
2023-08-01 10:06:26,411 INFO 304 GET /devices (0.0.0.0) 8.68ms
2023-08-01 10:06:31,440 INFO 304 GET /devices (0.0.0.0) 1.53ms

edit: I found out that the secrets yaml was completely wrong. I fix it and it accepted to adopt the device.

in the begging I got the following in the logs

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
esphome 2023.7.0 requires click==8.1.3, but you have click 8.1.6 which is incompatible.
esphome 2023.7.0 requires pyparsing>=3.0, but you have pyparsing 2.3.1 which is incompatible.

in the end I got


======================== [SUCCESS] Took 214.47 seconds ========================

********************************************************************************
We found 395.41MB of unnecessary PlatformIO system data (temporary files, unnecessary packages, etc.).
Use `pio system prune --dry-run` to list them or `pio system prune` to save disk space.
INFO Successfully compiled program.
INFO Resolving IP address of esp32-bluetooth-proxy-9caa58.local
INFO  -> 192.168.1.80
INFO Uploading /data/esp32-bluetooth-proxy-9caa58/.pioenvs/esp32-bluetooth-proxy-9caa58/firmware.bin (1262720 bytes)
Uploading: [============================================================] 100% Done...

INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from esp32-bluetooth-proxy-9caa58.local using esphome API
INFO Successfully connected to esp32-bluetooth-proxy-9caa58.local
[10:52:06][I][app:102]: ESPHome version 2023.7.0 compiled on Aug  1 2023, 10:48:46
[10:52:06][I][app:104]: Project esphome.bluetooth-proxy version 1.0
[10:52:06][C][wifi:543]: WiFi:
[10:52:06][C][wifi:379]:   Local MAC: 30:AE:A4:9C:AA:58
[10:52:06][C][wifi:380]:   SSID: [redacted]
[10:52:06][C][wifi:381]:   IP Address: 192.168.1.80
[10:52:06][C][wifi:383]:   BSSID: [redacted]
[10:52:06][C][wifi:384]:   Hostname: 'esp32-bluetooth-proxy-9caa58'
[10:52:06][C][wifi:386]:   Signal strength: -69 dB ▂▄▆█
[10:52:06][C][wifi:390]:   Channel: 9
[10:52:06][C][wifi:391]:   Subnet: 255.255.255.0
[10:52:06][C][wifi:392]:   Gateway: 192.168.1.1
[10:52:06][C][wifi:393]:   DNS1: 192.168.1.1
[10:52:06][C][wifi:394]:   DNS2: 0.0.0.0
[10:52:06][C][logger:301]: Logger:
[10:52:06][C][logger:302]:   Level: DEBUG
[10:52:06][C][logger:303]:   Log Baud Rate: 115200
[10:52:06][C][logger:305]:   Hardware UART: UART0
[10:52:06][C][bluetooth_proxy:088]: Bluetooth Proxy:
[10:52:06][C][bluetooth_proxy:089]:   Active: YES
[10:52:06][C][safe_mode.button:022]: Safe Mode Button 'Safe Mode Boot'
[10:52:06][C][safe_mode.button:022]:   Icon: 'mdi:restart-alert'
[10:52:06][C][esp32_ble:238]: ESP32 BLE:
[10:52:06][C][esp32_ble:240]:   MAC address: 30:AE:A4:9C:AA:5A
[10:52:06][C][esp32_ble:241]:   IO Capability: none
[10:52:06][C][esp32_ble_tracker:616]: BLE Tracker:
[10:52:06][C][esp32_ble_tracker:617]:   Scan Duration: 300 s
[10:52:06][C][esp32_ble_tracker:618]:   Scan Interval: 320.0 ms
[10:52:06][C][esp32_ble_tracker:619]:   Scan Window: 30.0 ms
[10:52:06][C][esp32_ble_tracker:620]:   Scan Type: ACTIVE
[10:52:06][C][esp32_ble_tracker:621]:   Continuous Scanning: True
[10:52:06][C][mdns:112]: mDNS:
[10:52:06][C][mdns:113]:   Hostname: esp32-bluetooth-proxy-9caa58
[10:52:06][D][api.connection:1031]: Home Assistant 2023.7.3 (192.168.1.15): Connected successfully
[10:52:07][D][api:102]: Accepted 192.168.1.15
[10:52:07][D][api.connection:171]: Home Assistant 2023.7.3 (192.168.1.15) requested disconnected
[10:52:07][W][api.connection:095]: aioesphomeapi (192.168.1.15): Connection closed
[10:52:07][D][api:102]: Accepted 192.168.1.15
[10:52:08][D][api.connection:1031]: Home Assistant 2023.7.3 (192.168.1.15): Connected successfully

and now the device is adopted. !

Should I have to do something regarding the

ERROR: pip's dependency resolver... ???

or with the following or is it ok?

We found 395.41MB of unnecessary PlatformIO system data (temporary files, unnecessary packages, etc.).
Use `pio system prune --dry-run` to list them or `pio system prune` to save disk space.

Thanks!

Great to hear you got it working! :+1:

  1. You found that yourself, if there are duplicate entries in secrets.yaml, it will not work. :slight_smile:
  2. This is just a cosmetic message, it should nevertheless compile without a problem. There is already a long time running issue on Github, see here:
    Esphome 2023.5.0 pyparsing version incompatible ¡ Issue #4517 ¡ esphome/issues ¡ GitHub
    No worries, just ignore it (yep, I do ignore it by myself :rofl: )
  3. This is just like a “clean your room” message from your parents in your childhood days. :rofl: :rofl: You can get older, but when your mum comes to you, you clean up before she arrives… :rofl: No worries as well, this will be taken care of during one of the next updates of ESPHome Add-on. :slight_smile:

Well, you got your device adopted! Congrats! :partying_face: Now you can start looking for other cool devices, you can flash with ESPHome. :+1:

1 Like