Page 1 of 1

Can ESP Tx Power be set?

Posted: Tue Sep 13, 2022 10:41 am
by chipfryer27
Hi

Is it possible to change the Tx power of an ESP32 (wroom) using some C-code? I see some examples of setting BT power but nothing for WiFi. From the AT commands I can see how it could be done but just wondering if there was a simpler way to do it from within a chart, possibly after being intialised. This is the first time I've actually done something with one and still very much getting to grips with it.

Regards

Re: Can ESP Tx Power be set?

Posted: Tue Sep 13, 2022 11:23 am
by stefan.erni
Hi Lain


Yes set the BT tx power.

https://flowcode.co.uk/forums/viewtopic ... 6&start=10


I made some test and
Default powersetting is:
ESP_PWR_LVL_N0 = 4, !< Corresponding to 0dbm
ESP_PWR_LVL_P3 = 5, !< Corresponding to +3dbm

I have now set to the minimum
ESP_PWR_LVL_N12 = 0, !< Corresponding to -12dbm
ESP_PWR_LVL_N9 = 1, !< Corresponding to -9dbm
CODE: SELECT ALL

esp_bredr_tx_power_set(ESP_PWR_LVL_N12,ESP_PWR_LVL_N9);


regards

Stefan

Re: Can ESP Tx Power be set?

Posted: Tue Sep 13, 2022 12:43 pm
by chipfryer27
Hi Stefan

Thanks for the reply.

I did look at that and mistakenly thought it was sending via USB to the ESP, not from it. I should invest in glasses :)

So if I include your two C-blocks with appropriate numbers (P6/P9) that would set it to the maximum?

Regards

Re: Can ESP Tx Power be set?

Posted: Tue Sep 13, 2022 1:18 pm
by stefan.erni
Hi Lain

Yes with this two commands you can set the maximal power for Bluetooth sending.
Note I used exactly for the other direction, Bluetooth set to minimum power.
It's in the program demodata includet.
There is also an idea for the BT interrupt in ESP32, to make the inerrupt routine very short and also for the USB Interrupt.


regards

Stefan

Re: Can ESP Tx Power be set?

Posted: Tue Sep 13, 2022 2:07 pm
by chipfryer27
Hi

Thanks for this, appreciated.

I'll give it a go later and let you know how I get on.

Regards

Re: Can ESP Tx Power be set?

Posted: Tue Sep 13, 2022 8:00 pm
by chipfryer27
Hi

I discovered it is a dodgy board.

Set it to be an AP then "looked" for a near impossible to find signal. It could be the PCB antenna track or the chip itself, but unless it's a few feet from anything it's as good as invisible.

Thanks again for your replies.

Regards

Re: Can ESP Tx Power be set?

Posted: Thu Sep 22, 2022 3:12 pm
by chipfryer27
Hi

I obtained another board (same one, same source). Still pretty much useless though. Any further than a few metres from the router and it won't register on the WiFi network. If not direct LoS then around two metres (wooden floor or single sheet of Gyproc).

What sort of ranges are others getting? Is this normal for one of these units?

Regards