-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wemos C3 Mini should pre-set tx_power to 8.5 #9235
Comments
It appears from reading the documentation, though I am not sure of this, that |
@dhalbert The current default is 20.0, set by the "default wifi settings" from idf as far as I can tell. And besides, the tiny ceramic antenna did connect through closed doors to an AP 3 rooms away. It's honestly fine. Also, as I already mentioned, for those who need the range, it's a settable value. They can crank it all the way. It may be worth testing more values and antenna types though. |
So, I took some time to perform some tests using the station example from the ESP-IDF. I discovered that my QTPY C3 would effectively connect up through power values of 18dBm (72 in the ESP API) but would never connect using the highest (and default) power of 20dBm (80 in ESP API). Lower values would connect fairly well, but 18 seemed to connect within 1 or 2 tries every time. When I was digging into the ESP WIFI API, I discovered that you have to call this after wifi has started or it will error. I then returned to the Circuit Python code (and reviewed the PR from @bill88t, which gave me good insight into where wifi start up was being called. Thanks Bill!). I then ran a few experiments within a cp build. I discovered that placing the code in Web Workflow comes up now without any boot.py modifications. I plan to test this against some other wifi code (i.e. AP, web server, etc.) to see if all that works too. Here's a snippet showing my change...
|
I feel like what's happening is that we're overpowering the antennas. It may be too high values have bad signal reception too. |
It would be possible to detect error code 2 and recursively reduce power and retry. |
Nice insight. A few hours too late for me: I just replaced shortly before your post the onboard ceramic antenna on my QTPY C3 with a (very!) cheap external antenna and had a good and stable connection at once. Before it didn't even find all available networks when trying a scan. |
I wonder what the reason for the problem with the chip antennas is. I did some websearching and did not find any clear discussion. Maybe:
|
The chip antenna itself cannot be the problem. I have some Waveshare ESP32-S3 boards with an "C3"-ceramic antenna very similar to the one in the image above and they are working just fine. But the boards have a large ground-plane for the antenna (I guess 3-4 times the area of the antenna). |
I communicated with @ladyada about this. She is inclined to think it is mismatch and therefore reflected power, given that there is little room on some boards for an adequate layout. |
I also had another find. What I don't understand now is why the 3D antennas connect to that one network with the reduced power. |
The SuperTiny schematic, such as it is, is here: https://www.aliexpress.us/item/3256806297878595.html?gatewayAdapt=glo2usa4itemAdapt. Chip antennas are fed at one end and aren't meants to be grounded at the other end. But they need to be near a ground plane, at a particular orientation and distance: https://www.globalspec.com/learnmore/semiconductors/communication_ic/chip_antenna. Sometimes there isn't room for this or the designers are sloppy. |
Ah? So in the schematic it isn't showing it as grounded?
I would wanna just wanna say it's just a defective sample, but it's certainly not the only one. And wait, the WeMos C3 Mini does keep (from the image of it I can see on the web) 6.3mm from ground.. I give up trying to understand. |
I was wrong. My horrible memory was remembering the WeMos ESP32 Lite (pcb ant). On the supertiny the antenna itself is shorted. It's not shorted to ground. |
CircuitPython version
main
Code/REPL
Behavior
As reported by multiple users, with the power-on default tx_power, the board does not successfully connect to wifi (#6540 #9058 (comment) and probably others) but does work if boot.py executes
wifi.radio.tx_power=8.5
.Description
No response
Additional information
The board init routine should set tx_power=8.5 by default, without needing lines in boot.py.
The text was updated successfully, but these errors were encountered: