esp-rs / esp-idf-svc

Type-Safe Rust Wrappers for various ESP-IDF services (WiFi, Network, Httpd, Logging, etc.)
https://docs.esp-rs.org/esp-idf-svc/
Apache License 2.0
333 stars 183 forks source link

Is there a function similiar to esp_wifi_set_max_tx_power? #360

Closed weiying-chen closed 9 months ago

weiying-chen commented 9 months ago

I have a similar problem as this one. Does esp-idf-svc have a similar function as esp-wifi's esp_wifi_set_max_tx_power?

ivmarkov commented 9 months ago

@weiying-chen the matrix chat is a better place to ask these questions. You have opened 3 issues (this one, plus #359 + https://github.com/esp-rs/embedded-svc/issues/73 for a single problem that you are having). Which might still be a hardware problem.

With that said, esp_wifi_set_max_tx_power should be available as unsafe function in esp-idf-sys (or esp_idf_svc::sys, which is the same; you should be able to call it on the raw Wifi "handle", i.e. wifi.driver().handle().

weiying-chen commented 9 months ago

@ivmarkov Got it. I'll try the matrix chat next time. Thanks for all the help!

ivmarkov commented 9 months ago

I still strongly suggest to try powering your board with a more powerful supply as a first step.

weiying-chen commented 9 months ago

@ivmarkov Yes, I'll follow your advice. I'll buy a USB hub with its own power supply. Then connect my mini PC and ESP32-C3 to it. Note: I need my mini PC and ESP32-C3 to be connected so I can debug with ESPMonitor.

ivmarkov commented 9 months ago

You can just use a USB power supply from a phone and connect it to the board. You won't get logs this way of course, but you can try pinging the IP of the board from your PC and see if the ping succeeds and stays stable. This way the power supply hypothesis can be confirmed / denied.

weiying-chen commented 9 months ago

@ivmarkov Ah, that's a good idea. But how do I get the IP of the board? In the ESPMonitor log, I didn't see any IP. I think the ESP32-C3's Wi-Fi connection is stopping before the IP can show up?

ivmarkov commented 9 months ago

Look at the DHCP leases of your router, in its WEB-UI.

weiying-chen commented 9 months ago

@ivmarkov Okay, I'll try that. Thanks a lot for the help.