Enable external wifi antenna on XIAO_ESP32C6

Is there anyway to activate the external antenna on the XIAO ESP32C6 in ESPHome?

I know i have to set GPIO03 to low and GPIO14 to high, but can’t get it to work.

I have tried to make some output and run them on boot, but don’t work.

output:

  • platform: gpio
    id: “GPIO14”
    pin: GPIO14
  • platform: gpio
    id: “GPIO03”
    pin: GPIO03

and

on_boot:
priority: 1000
then:
- output.turn_off: GPIO03
- output.turn_on: GPIO14

Also tried switch, but also don’t work.

Then i found someone that wort you should do this, but i get a error when trying it, so not sure what to do.
on_boot:
priority: 1000
then:
- lambda: |-
pinMode(02, OUTPUT);
digitalWrite(02, HIGH);

And can’t find it anywhere on google how to do it, so is there anyone here that know?

Can be tricky with esphome.
Try with that 100ms delay between outputs.

C6 is still on experimental state here.

How do i add delay?
Can find the right command for that.

      - output.turn_on:: output03
      - delay: 100ms
      - output.turn_off: output14

Don’t give id like “GPIO14”, it’s too confusing (if it even work).