nodemcu / nodemcu-firmware

Lua based interactive firmware for ESP8266, ESP8285 and ESP32
https://nodemcu.readthedocs.io
MIT License
7.68k stars 3.13k forks source link

Wi-Fi module is missing in ESP32C3 #3654

Open bv73 opened 6 months ago

bv73 commented 6 months ago

Expected behavior

Normal working with wifi module

Actual behavior

After idf.py set-target esp32c3 and make I have suspicious small size of firmware and errors for mention of the wifi module.

Test code

Any commands like wifi.start() or wifi.mode(wifi.STATION, true) etc

Hardware

ESP32C3 supermini with external USB-UART adapter, connected to GPIO20 & GPIO21.

Later I found out that the components/modules/CMakeLists.txt file was missing a line ${wifi_modules}

elseif(IDF_TARGET STREQUAL "esp32c3")
  list(APPEND module_srcs
    ${wifi_modules}
  )

So, now wifi module is working. But I have some issues with sta mode while ap mode working well. Please, add the missing line to the source code so that the firmware can be fully used.

serg3295 commented 4 months ago

But I have some issues with sta mode

To connect to AP in STA mode you should reduce TX_power. See https://github.com/espressif/arduino-esp32/issues/6767#issuecomment-1145661485

  wifi.mode(wifi.STATION)
  wifi.sta.config({ ssid = "***", pwd = "***", auto = true }, true)
  wifi.start()
  wifi.sta.settxpower(8)  -- !!!!!!
  wifi.sta.on("got_ip", function(ev, info) print("NodeMCU IP config:", info.ip) end)
  wifi.sta.connect()