Trouble flashing the GL-S10 bluetooth gateway

So, just got the gateway in today. It’s a v2.1 and wanted to flash it to ESPhome using Blakadders method.

The flashing seems to work, but after the initial reboot nothing happens. I don’t see any output in the console (other than >). Reflashed several times, but the same result every time…

The only thing I noticed is that there is an ESP32-DOWD CPU in the box. But not sure if that’s new.

Then tried compiling the source in the HA ESPHome addon, but got stuck on downloading the esp-edif framework. Is there any reason this framework is used and not the default Arduino?

Help is much appreciated!

Got a little further… Removed the framework definition in the yaml file. Now it successfully compiles. But no idea what effects this has.

Then flashed the fresh firmware to the device using web.esphome. The device boots, but it looks like it crashes immediately. I can see log output in the console, which show the ethernet interface starts successfully. Same for Bluetooth. The green LED on the device is on and the white LED flashes.

I manually added the device to HA (using its ip). HA detects the device has a reset button, but shows it as unavailable.

Another thing on the hardware side: the flash-button is located differently. It’s now near the RX/TX/GND holes…

Are you using blakadder’s web flasher?
GL-S10 Bluetooth Proxy Web Flasher (blakadder.github.io)

Yes, initially. But that leads to a immediate state of failure. Not even console output…

— update —
So compiled blakadders original yaml of a different comuputer, this time using the correct framework-setting (esp-edif). Then copied that firmware to the board using web.esp. Flash is succesful. But after reboot the following appears on the console logs:

[12:04:20]rst:0x10 (RTCWDT_RTC_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
[12:04:20]flash read err, 1000
[12:04:20]ets_main.c 371 
[12:04:20]ets Jun  8 2016 00:22:57
[12:04:20]

I’m not familiar with the yaml/compiling stuff, so don’t know what to suggest, sorry.
I do have the V2.1 version.

Is there anything in the comments at the very bottom of blackadder’s page that might be of help?

Alright, let’s wrap this up…

So the Blakadder way didn’t work for me. Not sure why. It may work for you, but since you are reading this, you are probably in the same boat.

I tried flashing again multiple times today but with no success. After digging into that flash read error (see above), I had an epiphany (turned out I needed multiple today btw). So I opened up web.esphome again and then flash to the “Prepare for first use” image. That worked and was a starting point for me. I then decided to flash a minimal image to the device, just to get it into my ESPHome dashboard and then build it up. That also worked. After several rebuilds, and adding options every time, the device was up and running. I thought I was done and happy. But there wasn’t a whole lot of activity on the device and it wasn’t discovering any Bluetooth devices.

So started Googling around and found the reason why it uses the ESP-EDIF framework instead of the Arduino I was using. ESP-EDIF is much faster (that’s what the website said).

Then I decided to flash an image that was built on the ESP-EDIF framework. But, as said before, that didn’t work either. Turned out I was running into this issue. The actual fix can be found here. But, I run Hassio and had no idea where to find that platformio folder that I needed to delete.

Luckily, I already have Advanced SSH & Web Terminal installed, and if you run the addon in privileged mode, you can use the docker command…

So SSH into HA, and issue

docker ps

to find the name of your ESPHome Docker env.

Then use

docker exec -ti <containername> bash

to get into that container.
The folder you are looking for is in the /data/cache/

You can delete the platformio folder.

Just to be sure, I restarted the ESPHome addon.

Now you can try and build the firmware using the ESP-EDIF framework. This may take a long time, but it will succeed. :slight_smile:

DONE!

Well almost… because I now needed to make sure I could still update my firmware of the other ESP devices I use. But they run the Arduino framework. So I tested that with an easy one; CO-meter. It needs to download all dependencies, and especially installing the Arduino framework will take a long time. But patience is your friend and it successfully finished. So all set, done, and finished!

It just took me a lot of time. It always does :stuck_out_tongue:

To be complete, below is the yaml file I use. I remove the I2C part, and I will not use that anyway. There is a bug in Blakadders yaml with the LED-config. I just removed that but didn’t fix it yet.

substitutions:
  device_name: bluetooth-proxy
  device_description: Bluetooth Proxy

esphome:
  name: "bluetooth-proxy"
  friendly_name: "bluetooth-proxy"
  on_boot:
    then:
      - output.turn_on: power_led

esp32:
  board: esp32dev
  framework:
    type: esp-idf

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "KJ7IEZA0CrWW6djX4QFzg+xWI+455px+yH16nvVuNyk="

ota:
  password: "ee1de38d9f7b0af9653a85b4f5ea2baa"

ethernet:
  type: IP101
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 1
  power_pin: GPIO5

esp32_ble_tracker:
  scan_parameters:
    interval: 1100ms
    window: 1100ms
    active: True

bluetooth_proxy:
  active: true

binary_sensor:
  - platform: gpio
    pin: 33
    name: "Reset Button"

status_led:
  pin:
    number: GPIO32
    inverted: true

output:
  - platform: gpio
    pin: GPIO14
    inverted: true
    id: power_led

Glad you’ve worked out a fix.

Think I’m going to just stick the GL-S10 on eBay as most of what you have described has gone over my head and I don’t recall where I put the CH340 module. :man_facepalming:

Hopefully someone will just start selling a PoE Bluetooth Proxy that’s plug-and-play with HA.

I have an Everything Presence Lite but when I tried the optional Bluetooth Proxy firmware HA started reporting all sorts of error messages, as if it was blocking the Bluetooth on the pi4 in my HA Yellow so I reverted it to the “No Bluetooth” firmware.

EDIT: May give this a try:
EST-PoE-32 - ESP32 PoE Development Kit – Everything Smart Technology

Browsing YouTube and found this: Every Home Assistant Install Should Use This - YouTube

Which introduced me to the ESPHome add-on for HA. I had only previously installed the integration, not this add-on. It’s found the GL-S10. Will give the “Adopt” a try. :crossed_fingers:

Oh dear… seems to be stuck in a loop:

[10:55:50][I][bluetooth_proxy:278]: [0] [D1:3B:7E:1D:E9:F3] Connecting v3 with cache
[10:55:50][D][esp32_ble_tracker:215]: Pausing scan to make connection...
[10:55:50][I][esp32_ble_client:067]: [0] [D1:3B:7E:1D:E9:F3] 0x01 Attempting BLE connection
[10:55:51][D][esp32_ble_client:110]: [0] [D1:3B:7E:1D:E9:F3] ESP_GATTC_CONNECT_EVT
[10:55:51][D][esp32_ble_client:110]: [0] [D1:3B:7E:1D:E9:F3] ESP_GATTC_OPEN_EVT
[10:55:51][I][esp32_ble_client:154]: [0] [D1:3B:7E:1D:E9:F3] Connected
[10:55:51][D][esp32_ble_tracker:266]: Starting scan...
[10:55:51][D][esp32_ble_client:110]: [0] [D1:3B:7E:1D:E9:F3] ESP_GATTC_REG_FOR_NOTIFY_EVT
[10:55:51][D][esp32_ble_client:188]: [0] [D1:3B:7E:1D:E9:F3] cfg_mtu status 0, mtu 247
[10:55:51][D][esp32_ble_client:110]: [0] [D1:3B:7E:1D:E9:F3] ESP_GATTC_WRITE_DESCR_EVT
[10:55:51][D][esp32_ble_client:110]: [0] [D1:3B:7E:1D:E9:F3] ESP_GATTC_WRITE_CHAR_EVT
[10:55:51][D][esp32_ble_client:110]: [0] [D1:3B:7E:1D:E9:F3] ESP_GATTC_NOTIFY_EVT
[10:55:59][I][esp32_ble_client:084]: [0] [D1:3B:7E:1D:E9:F3] Disconnecting.
[10:55:59][D][esp-idf:000][BTU_TASK]: W (129729) BT_HCI: hci cmd send: disconnect: hdl 0x0, rsn:0x13

[10:55:59][D][esp-idf:000][BTU_TASK]: W (129733) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x16

[10:55:59][D][esp-idf:000][BTU_TASK]: W (129734) BT_APPL: gattc_conn_cb: if=4 st=0 id=4 rsn=0x16

[10:55:59][D][esp-idf:000][BTU_TASK]: W (129736) BT_APPL: gattc_conn_cb: if=5 st=0 id=5 rsn=0x16

[10:55:59][D][esp-idf:000][BTU_TASK]: W (129754) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x16

Back on the ESPHome add-on web ui I can click EDIT for the device, which shows a text editor…

Yeah, that’s the config of your GL-S10. You can try and flash it to the device if you want to.

But I don’t see any issues with the log you posted. It connects to a Bluetooth device and then disconnects. Look ok to me?

I am stuck again as I ran into another bug. I’m at work now, so cannot share the details.

But, I may just be done with this device. The EST device you are linking to looks promising, but has no enclosure…

If you know someone with a 3D printer: EST-PoE-32 - ESP32 PoE DevKit Case & Enclosure by Everything Smart Home | Download free STL model | Printables.com

Not sure if you can reset the device. The combination of holding the button while powering on is only when you want to flash using a serial connection.

If you flashed the device with an encryption key (my config has that), you need to enter that key into HA…it should notify you of that

I re-flashed using Blakadder’s web installer and then adopted the device into ESPHome add-on. Seems to have worked this time. :man_shrugging:

Lucky you!

I’m running into this bug every time I compile using the ESP-EDIF framework now.

I’m giving up.

Wish I knew how to help you resolve your issue. Do you have (m)any other ESP32 devices in HA? Might anything be conflicting? Or do you think it’s just a different GL-S10 hardware/firmware version?

I really don’t know. I have about 10 ESPHome devices. I don’t think they can conflict. It could be that some compiler cache is in the way, but that’s just a wild guess. I generally dislike that switching frameworks within ESPHome is such a huge effort. The whole computer gets soo slow while/after doing that.

Yesterday I installed ESPHome on a different computer and compiled the firmware once more. It successfully flashed on the GL-S10, but now the ethernet interface doesn’t work.

I googled for another device, but couldn’t find anything. I like the POE on the GL-S10. So I ordered another one, and hope to have more luck with this second one.

Appreciate your support!

In case it’s of help, to you or someone else finding this thread, this is the CH340 I purchased to flash the GL-S10: CH340 Module Instead Of PL2303 , CH340G RS232 to TTL Module Upgrade USB to Serial Port In Nine Brush Small Plates Golden - AliExpress

Will let you know how I get on with the EST PoE one. Should hopefully arrive later this week.

EST-PoE-32 seems good. None of that awkward flashing experience with a CH340 and pin cables. Doesn’t come with a case though. I’ve ordered the one Lewis shares from Xometry (3D printer) for £13.58 (inc VAT and shipping)

All in, will be £38.58. A fair bit more than the GL-S10. Oops!

1 Like

Finally managed to find the issue…

I configured my network to place the device into a vlan. Esphome can’t deal with this. Now I configured the switch port to which the device is connected to this vlan, that works.

Kind of weird the the is very limited logging when Ethernet fails when using the ESP-EDIF framework…

:+1: Glad you’ve figured it out.