Skip to content
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

Compiling with Station configuration results in compiler error #3

Closed
benvonhandorf opened this issue Jul 7, 2020 · 1 comment
Closed

Comments

@benvonhandorf
Copy link
Contributor

I used make menuconfig to reconfigure the project to connect to my home wifi rather than operating as an AP. With this configuration the compilation fails.

blackmagic-espidf/main/platform.c:471:3: error: implicit declaration of function 'wifi_init_softap' [-Werror=implicit-function-declaration]
   wifi_init_softap();

I believe there is a mismatch between the Wifi options configured by menuconfig and what is expected in platform.c.
e.g. configuring for station mode results in the following in sdkconfig:

# CONFIG_ESP_WIFI_IS_SOFTAP is not set
CONFIG_ESP_WIFI_IS_STATION=y
# CONFIG_ESP_WIFI_MODE_AP is not set

Configuring for AP mode results in:

CONFIG_ESP_WIFI_IS_SOFTAP=y
# CONFIG_ESP_WIFI_IS_STATION is not set
CONFIG_ESP_WIFI_MODE_AP=y

Looking in platform.c, it is looking for CONFIG_ESP_WIFI_MODE_AP and CONFIG_ESP_WIFI_MODE_STA starting at line 382. In AP mode, the correct function gets included by virtue of the MODE_AP configuration setting, rather than the IS_SOFTAP setting.

At line 468, however, an #if / #else is used:

#if CONFIG_ESP_WIFI_MODE_STA
  wifi_init_sta();
#else
  wifi_init_softap();
#endif

which results in this always calling wifi_init_softap since there is no code that defines CONFIG_ESP_WIFI_MODE_STA in any configuration that I can find.

Changing the section at 468 to:

#if CONFIG_ESP_WIFI_IS_STATION
  wifi_init_sta();
#else
  wifi_init_softap();
#endif

allows you to compile in station mode successfully although I'm unable to connect due to a MAC address problem that I will submit a different issue for.

@benvonhandorf
Copy link
Contributor Author

Submitted PR #5

xobs added a commit to xobs/blackmagic-espidf that referenced this issue Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant