arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.06k stars 4.78k forks source link

V6.1.1 Compile error undefined reference to `WPS_is_unavailable_in_this_configuration__Please_check_FAQ_or_board_generator_tool' #3427

Closed anthonykeane closed 6 years ago

anthonykeane commented 6 years ago

Make sure these boxes are checked [x] before submitting your issue - Thank you!

(Please, remember to close the issue when the problem has been addressed)

This is a BUILD error from the Arduino IDE:

Arduino: 1.8.3 (Mac OS X), TD: 1.37, Board: "Generic ESP8266 Module, 80 MHz, Flash, ck, 26 MHz, 40MHz, DOUT, 1M (no SPIFFS), 2, v1.4 Higher Bandwidth, Disabled, None, Only Sketch, 115200"

Build options changed, rebuilding all sketch/sonoff.ino.cpp.o:(.text._Z18WifiWpsConfigBeginv+0x4): undefined reference to WPS_is_unavailable_in_this_configuration__Please_check_FAQ_or_board_generator_tool' sketch/sonoff.ino.cpp.o: In functionWifiWpsConfigBegin()': Arduino/Sonoff-Tasmota-6.1.1/sonoff/support.ino:947: undefined reference to WPS_is_unavailable_in_this_configuration__Please_check_FAQ_or_board_generator_tool' Arduino/Sonoff-Tasmota-6.1.1/sonoff/support.ino:947: undefined reference toWPS_is_unavailable_in_this_configurationPlease_check_FAQ_or_board_generator_tool' Arduino/Sonoff-Tasmota-6.1.1/sonoff/support.ino:947: undefined reference to WPS_is_unavailable_in_this_configuration__Please_check_FAQ_or_board_generator_tool' Arduino/Sonoff-Tasmota-6.1.1/sonoff/support.ino:947: undefined reference toWPS_is_unavailable_in_this_configurationPlease_check_FAQ_or_board_generator_tool' collect2: error: ld returned 1 exit status exit status 1 Error compiling for board Generic ESP8266 Module.

Previous versions worked:

Frogmore42 commented 6 years ago

Building Tasmota with Arduino is hard. There are many things that have to be done exactly right to get a good result. If you miss even one thing, even just partially, the error you get will likely not be helpful in resolving the error.

I use PlatformIO with VSCode. It is better, but it too has issues with some of the code sometimes, but it can usually compile it.

But, I have to ask, why do you feel you need to compile it? There are now precompiled binaries that provide the latest released code.

Unless you are modifying the code to add support for something new, you don't need to compile the code. The default code comes with good defaults and you can easily configure it for your network.

anthonykeane commented 6 years ago

@Frogmore42 Thanks for the reply.

Reasons: I am flashing 15 new Sonoff basics. By compiling myself I can add the config

This means these work even if the units config gets corrupt (easier to recover without having to remove from the wall)

So flash once and change the unit name and it is good to go.

using the prebuild I need to do a lot of post flash stuff. If I flush the unit completely it won't connect to my wifi or my mqtt as the firmware doesn't have my wifi creds.

Hope this explains: Can you assist? With this error as it was listed as a bug in wifimanager lib but as Tasmota doesn't use that lib I am at a loss as to where to look.

Frogmore42 commented 6 years ago

As I said, I don't use Arduino, but you probably are missing a library. I would start over with a fresh install of Arduino and the Tasmota code base. That will probably fix it.

grantalewis commented 6 years ago

I'm experiencing this same issue.

Arduino: 1.8.5 (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, Flash, ck, 26 MHz, 40MHz, DIO, 1M (64K SPIFFS), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"

anthonykeane commented 6 years ago

SOLVED KINDA:

I moved to a Ubuntu box from a MAC ( 2 MAC's actually) and the issue went away. Identical setups on the Linux and Mac.

Mac fails - Ubuntu works

grantalewis commented 6 years ago

I'm using a Win10 PC. Unfortunately no easy access to a Linux box.

grantalewis commented 6 years ago

29 days ago this was posted: https://github.com/tzapu/WiFiManager/issues/650

Until this is fixed, you can enable WPS in the core:

./tools/boards.txt.py --allowWPS --allgen

Totally in the dark as to how to do that.

Found and tried this, too. No luck. https://forum.arduino.cc/index.php?topic=561944.0

anthonykeane commented 6 years ago

@grantalewis but WiFiManager lib does not seem to be used my Tasmota

I will keep trying to find an answer, let me know if you find one.

grantalewis commented 6 years ago

Will do. Thanks.

grantalewis commented 6 years ago

For reference, that section of code in the support.ino file is as follows:

  wps_result = status;
  if (WPS_CB_ST_SUCCESS == wps_result) {
    wifi_wps_disable();
  } else {
    snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_WIFI D_WPS_FAILED_WITH_STATUS " %d"), wps_result);
    AddLog(LOG_LEVEL_DEBUG);
    wifi_config_counter = 2;

...which probably concerns this section in the user_config.h file:

// -- Wifi ----------------------------------------
#define WIFI_IP_ADDRESS        "0.0.0.0"         // [IpAddress1] Set to 0.0.0.0 for using DHCP or IP address
#define WIFI_GATEWAY           "192.168.2.254"   // [IpAddress2] If not using DHCP set Gateway IP address
#define WIFI_SUBNETMASK        "255.255.255.0"   // [IpAddress3] If not using DHCP set Network mask
#define WIFI_DNS               "192.168.2.27"    // [IpAddress4] If not using DHCP set DNS IP address (might be equal to WIFI_GATEWAY)

#define STA_SSID1              ""                // [Ssid1] Wifi SSID
#define STA_PASS1              ""                // [Password1] Wifi password
#define STA_SSID2              ""                // [Ssid2] Optional alternate AP Wifi SSID
#define STA_PASS2              ""                // [Password2] Optional alternate AP Wifi password
#define WIFI_CONFIG_TOOL       WIFI_WPSCONFIG    // [WifiConfig] Default tool if wifi fails to connect
                                                 //   (WIFI_RESTART, WIFI_SMARTCONFIG, WIFI_MANAGER, WIFI_WPSCONFIG, WIFI_RETRY, WIFI_WAIT)

(Apologies if I'm posting the obvious. This is all new to me.)

grantalewis commented 6 years ago

Fresh install of Ubuntu on an HP laptop, fresh install of all Arduino software and libraries (etc.). Error still exists.

Arduino: 1.8.5 (Linux), Board: "Generic ESP8266 Module, 80 MHz, Flash, ck, 26 MHz, 40MHz, DIO, 1M (64K SPIFFS), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"

/tmp/arduino_build_82417/sketch/sonoff.ino.cpp.o:(.text._Z18WifiWpsConfigBeginv+0x4): undefined reference to `WPS_is_unavailable_in_this_configuration__Please_check_FAQ_or_board_generator_tool'
/tmp/arduino_build_82417/sketch/sonoff.ino.cpp.o: In function `WifiWpsConfigBegin()':
/home/grant/Documents/Sonoff-Tasmota-6.1.1/sonoff/support.ino:947: undefined reference to `WPS_is_unavailable_in_this_configuration__Please_check_FAQ_or_board_generator_tool'
/home/grant/Documents/Sonoff-Tasmota-6.1.1/sonoff/support.ino:947: undefined reference to `WPS_is_unavailable_in_this_configuration__Please_check_FAQ_or_board_generator_tool'
/home/grant/Documents/Sonoff-Tasmota-6.1.1/sonoff/support.ino:947: undefined reference to `WPS_is_unavailable_in_this_configuration__Please_check_FAQ_or_board_generator_tool'
/home/grant/Documents/Sonoff-Tasmota-6.1.1/sonoff/support.ino:947: undefined reference to `WPS_is_unavailable_in_this_configuration__Please_check_FAQ_or_board_generator_tool'
collect2: error: ld returned 1 exit status
...
exit status 1
Error compiling for board Generic ESP8266 Module.
andyrichter commented 6 years ago

maybe you can change revert the esp8266 driver version with boards manager to version 2.4.0

Frogmore42 commented 6 years ago

This is the reason that I like PlatformIO. While there is a bit of a learning curve. It and VSCode are actually really nice to use. But, I am a trained professional πŸ˜€.

Arduino works great when your needs are not too far from Blinky. But, when you start to need many libraries and files, the Arduino environment is extremely limiting.

It's been a long while since I last used Arduino, so maybe it has changed.

grantalewis commented 6 years ago

Thanks for the reply. Still getting an error, but at least the error has changed. So... progress?

Generating function prototypes...
"/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/tools/sdk/include" "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/tools/sdk/lwip2/include" "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/tools/sdk/libc/xtensa-lx106-elf/include" "-I/tmp/arduino_build_41466/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11  -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536   -DARDUINO=10805 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_GENERIC"  -DESP8266 "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/cores/esp8266" "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/variants/generic" "-I/home/grant/Documents/arduino-1.8.5/libraries/esp-knx-ip-0.5.1" "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/libraries/EEPROM" "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/libraries/ESP8266WiFi/src" "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/libraries/ESP8266WebServer/src" "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/libraries/Ticker" "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/libraries/ESP8266HTTPClient/src" "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/libraries/ESP8266httpUpdate/src" "-I/home/grant/Documents/arduino-1.8.5/portable/sketchbook/libraries/ArduinoJson/src" "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/libraries/DNSServer/src" "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/libraries/ESP8266mDNS" "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/libraries/Wire" "-I/home/grant/Documents/arduino-1.8.5/portable/sketchbook/libraries/PubSubClient/src" "-I/home/grant/Documents/arduino-1.8.5/libraries/TasmotaSerial-2.0.0/src" "-I/home/grant/Documents/arduino-1.8.5/libraries/IRremoteESP8266-2.2.1.02/src" "-I/home/grant/Documents/arduino-1.8.5/libraries/C2Programmer-1.0.0/src" "-I/home/grant/Documents/arduino-1.8.5/libraries/NeoPixelBus-2.2.9/src" "-I/home/grant/Documents/arduino-1.8.5/portable/packages/esp8266/hardware/esp8266/2.4.0/libraries/SPI" "-I/home/grant/Documents/arduino-1.8.5/libraries/Adafruit_SGP30-1.0.0.13" "/tmp/arduino_build_41466/sketch/sonoff.ino.cpp" -o "/tmp/arduino_build_41466/preproc/ctags_target_for_gcc_minus_e.cpp"
sonoff:44: error: #error Please use stable lwIP v1.4
   #error Please use stable lwIP v1.4
Frogmore42 commented 6 years ago

Don't use core 2.4.0. For many people it has caused serious issues. 2.4.1 was supposed to fix them, but didn't really. 2.4.2 is supposed to fix them, but so far there is not any real confirmation. I use 2.3.0 and have had very good luck with it. I plan on switching to 2.4.2 as soon as it is available for PlatformIO.

grantalewis commented 6 years ago

OK, got it to compile with 2.4.0 after I changed lwIP Variant to v1.4 Prebuilt. But based on what Frogmore42 says, I'll go back and re-try with 2.3.0.

Thanks, gents, for the help.

Frogmore42 commented 6 years ago

For 2.3.0 you need to follow the instructions for the loader file, or you won't be able to have the correct memory layout.

grantalewis commented 6 years ago

I’m not sure where to find that. Do you have a URL?

Frogmore42 commented 6 years ago

https://github.com/arendst/Sonoff-Tasmota/wiki/Arduino-IDE

Look at the copy files section: ESP8266 Board version before 2.4.0

grantalewis commented 6 years ago

Thank you VERY MUCH. In addition to the above instructions, I also found this discussion helpful. I was able to successfully compile 2.3.0. Now I'm ready to try my hand at the flashing process.

OperatorB commented 6 years ago

Had the same error message with esp8266 core 2.4.2 then I downgraded it to 2.4.1. The error has gone. It compiles. Thank you guys! (Linux)

consolacion commented 6 years ago

Can confirm OperatorB. Had the same error message with esp8266 core 2.4.2 then I downgraded it to 2.4.1. The error has gone. It compiles. (Windows10)

digiblur commented 6 years ago

@consolacion - don't use 2.4.0 or 2.4.1, use 2.3.0. Frogmore42 knows what he is talking about.

I also recommend, Platform IO, it's pretty nice, it just works how Theo intended it to be compiled.

consolacion commented 6 years ago

@digiblur Thanks. Maybe I am wrong but I would think if it compiles it compiles. Don' t understand why a compilation in 2.3.0 would be 'better'. But I could be wrong. Indeed I hear PlatformIO is better, but I think I'll just use the binary :-)

digiblur commented 6 years ago

There are many issues with that core version. Trust us, don't use it.

arendst commented 6 years ago

@consolacion have a look here https://github.com/arendst/Sonoff-Tasmota/wiki/Theo's-Tasmota-Tips#20180523---relation-tasmota-and-esp8266arduino-core-version regarding core versions and why you probably need to use 2.3.0....

Frogmore42 commented 6 years ago

Just because something compiles doesn't mean it will actually does what anyone intended or wants. If that were the case, software development would be really easy πŸ˜€. The fact that it compiles means the compiler understands what was asked of it. Let's say that the developer wanted to multiply two numbers x and y. The following will compile:

Answer = x + y;

That, of course, is the wrong answer except for a very few cases of x and y. So, while the fact that it compiles is necessary, it is not enough.

Theo provided the link to the page that lists some of the issues with 2.4.0 and 2.4.1. Some people have had luck with them, but I would stick with 2.3.0, at least until 2.4.2 (or later) has been proven to be working better.

consolacion commented 6 years ago

Will do. Dank je

On Sun, Aug 12, 2018, 17:10 Theo Arends notifications@github.com wrote:

@consolacion https://github.com/consolacion have a look here https://github.com/arendst/Sonoff-Tasmota/wiki/Theo's-Tasmota-Tips#20180523---relation-tasmota-and-esp8266arduino-core-version regarding core versions and why you probably need to use 2.3.0....

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arendst/Sonoff-Tasmota/issues/3427#issuecomment-412349228, or mute the thread https://github.com/notifications/unsubscribe-auth/AIN0DTeGlLFGm_mecSGI-aPFVrETPdBIks5uQEVIgaJpZM4VzGcW .

consolacion commented 6 years ago

Ah yes you are right. I took a look at Theo's link. I guess I ll stick to the binaries. I am just happy I got it compiled at all

On Sun, Aug 12, 2018, 17:28 Frogmore42 notifications@github.com wrote:

Just because something compiles doesn't mean it will actually does what anyone intended or wants. If that were the case, software development would be really easy πŸ˜€. The fact that it compiles means the compiler understands what was asked of it. Let's say that the developer wanted to multiply two numbers x and y. The following will compile:

Answer = x + y;

That, of course, is the wrong answer except for a very few cases of x and y. So, while the fact that it compiles is necessary, it is not enough.

Theo provided the link to the page that lists some of the issues with 2.4.0 and 2.4.1. Some people have had luck with them, but I would stick with 2.3.0, at least until 2.4.2 (or later) has been proven to be working better.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arendst/Sonoff-Tasmota/issues/3427#issuecomment-412350324, or mute the thread https://github.com/notifications/unsubscribe-auth/AIN0DWtjwEEAaDVYgNoM_3dJFd1UfIuRks5uQEmQgaJpZM4VzGcW .

digiblur commented 6 years ago

It takes less than 10 seconds to switch your board manager over to 2.30 but then make sure you copy in the linker if needed. 99% there.

jwrw commented 6 years ago

Hi - I hit this problem doing a build in IDE 1.8.5 against ESP board version 2.4.2.

The reason is in the ESP8266 library docs here https://arduino-esp8266.readthedocs.io/en/latest/faq/readme.html

Which says... Why can’t I use WPS ? WPS is disabled by default, this offers an extra 4KB in ram/heap. To enable WPS (and lose 4KB of useable ram), use this boards generator option: ./tools/boards.txt.py --allowWPS --allgen

If you want to do that, then you will need to clone the library yourself from GitHub (as the files pulled in by the IDE board manager don't have the necessary 'package' folder.

This really needs fixing in in Sonoff-Tasmota so that the WPS stuff can be safely disabled for security.

grantalewis commented 6 years ago

I can't believe the (senseless) agony I've been through over the last two weeks. I'm happy to give more explicit instructions, but the two biggest things I've learned:

  1. DON'T buy a knockoff adapter with a fake FTDI chip like this one. Spend $6 more and get one with a genuine FTDI chip like this one. It even comes with header wires. Guaranteed that $6 "saved" will buy you a world of hurt.
  2. This guy has the goods. Watch his video, follow his instructions. Unless you're incredibly lucky with the minefield of compiling your own firmware, it's just not worth the time and effort to use the Arduino software. Using ESPEasy, a pre-compiled Sonoff.bin file, and Termite make the process so much simpler.

Again, happy to answer questions about the above processes.

digiblur commented 6 years ago

I use that cheap FTDI and have flashed a ton of devices with no issues. Guess I got lucky.

I would recommend the PlatformIO to build things over ArduinoIDE any day.

grantalewis commented 6 years ago

@digiblur Go buy a lottery ticket! And while you're out, pick me up a horseshoe and a few four-leaf clovers because I need some of your mojo.

digiblur commented 6 years ago

Never good at the lottery. But if mine does burn out one day I am going with the Ch340g model adapter I see people recommend all the time.

arendst commented 6 years ago

@anthonykeane about the original issue:

v6.1.1 does not compile with core version 2.4.2 as you noticed. This is due to removed default functionality in core version 2.4.2 regarding WPS support.

The issue has been solved in development version 6.1.1b

Bottomline: all current released version will fail compile with core 2.4.2 regarding WPS.

As a workaround insert the following line to file sonoff.h before line 112:

#define NO_EXTRA_4K_HEAP                    // Allocate 4k heap for WPS in ESP8166/Arduino core v2.4.2 (was always allocated in previous versions)
Frogmore42 commented 6 years ago

@grantalewis you are the one who got lucky. The real FTDI is rated to NOT provide enough current to program an esp8266. As evidenced by your experience it sometimes works. I always use a separate low voltage power supply for powering a Sonoff.

grantalewis commented 6 years ago

Really? In the last 24 hours I've flashed 5 Sonoff Basics and one S31, no problems at all.

arendst commented 6 years ago

Gents, this is an issue regarding WPS mis-compile and not a FTDI facebook page. Pls stop FTDI discussions in this issue.

ascillato2 commented 6 years ago

Closing issue as has been fixed.

DetlefR commented 6 years ago

Hello,

only for information. I had the same problem. Yesterday it works. Today "WPS_is_unavailable_in_this_configuration". What is happens. I have made some test with ESP32 and had a reference to "WebServer-ESP32-1.0" in library path. After remove. Everything was fine.

grantalewis commented 6 years ago

Not sure if this is related, but yesterday I flashed a new Sonoff Basic using the same process I mentioned above. Using Sonoff-Tasmota v6.2.1 I received the error "Connect failed as AP cannot be reached." I then tried v6.1.1 and didn't encounter any problems.

ghost commented 5 years ago

This is the reason that I like PlatformIO. While there is a bit of a learning curve. It and VSCode are actually really nice to use. But, I am a trained professional πŸ˜€.

Arduino works great when your needs are not too far from Blinky. But, when you start to need many libraries and files, the Arduino environment is extremely limiting.

It's been a long while since I last used Arduino, so maybe it has changed.

I'm using PIO on Win10 and I've just started to see this error. I'm building v5.14.0 which has built before, many time. The big change on my system right now is the installation of EDP-IDF, new toolchains for ESP32 and 8266, etc.

This makes me assume this is an issue with the "build system" rather than an issue in the code.