Can ESP Tx Power be set?

For general Flowcode discussion that does not belong in the other sections.
Post Reply
chipfryer27
Valued Contributor
Posts: 1175
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Can ESP Tx Power be set?

Post 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

stefan.erni
Valued Contributor
Posts: 760
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 150 times
Been thanked: 171 times

Re: Can ESP Tx Power be set?

Post 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

chipfryer27
Valued Contributor
Posts: 1175
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Re: Can ESP Tx Power be set?

Post 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

stefan.erni
Valued Contributor
Posts: 760
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 150 times
Been thanked: 171 times

Re: Can ESP Tx Power be set?

Post 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
Attachments
Demodata_ESP32_v2.fcfx
(112.13 KiB) Downloaded 42 times

chipfryer27
Valued Contributor
Posts: 1175
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Re: Can ESP Tx Power be set?

Post by chipfryer27 »

Hi

Thanks for this, appreciated.

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

Regards

chipfryer27
Valued Contributor
Posts: 1175
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Re: Can ESP Tx Power be set?

Post 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

chipfryer27
Valued Contributor
Posts: 1175
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Re: Can ESP Tx Power be set?

Post 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

Post Reply