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.12k stars 4.79k forks source link

Error build code in plarformio #2472

Closed beho1der closed 6 years ago

beho1der commented 6 years ago

Today I build(git clone https://github.com/arendst/Sonoff-Tasmota.git ) the firmware and get an error:

lib/ESPAsyncUDP-0.21/src/AsyncUDP.cpp: In member function 'bool AsyncUDP::listenMulticast(ip_addr_t*, uint16_t, uint8_t)': lib/ESPAsyncUDP-0.21/src/AsyncUDP.cpp:254:57: error: 'udp_set_multicast_netif_addr' was not declared in this scope udp_set_multicast_netif_addr(_pcb, multicast_if_addr); ^ lib/ESPAsyncUDP-0.21/src/AsyncUDP.cpp:258:36: error: 'udp_set_multicast_ttl' was not declared in this scope

Leseratte10 commented 6 years ago

Can you try using build 8e0a25f? The next commit adds a bunch of code for the KNX protocol which does not appear in the commit message - was it even intended for this to be added already?

beho1der commented 6 years ago

I get master branch (git clone -b master https://github.com/arendst/Sonoff-Tasmota.git), they build without problem. Development build is broken.

localhost61 commented 6 years ago

@beho1der It's weird, I could build it (yesterday's commit 107379)under Arduino IDE 1.85 and it works fine. Files timestamp was 2018-17-04 08:05:24. Check if you didn't comment out a define that shouldn't in user_config.h, it can give that kind of error

beho1der commented 6 years ago

I test current git (git clone https://github.com/arendst/Sonoff-Tasmota.git). Edit only platformio.ini uncomment

env_default = sonoff

and BUILD, i get error:

Compiling .pioenvs/sonoff/lib530/esp-knx-ip-async-udp-0.4.0.15/esp-knx-ip-send.cpp.o
lib/ESPAsyncUDP-0.21/src/AsyncUDP.cpp: In member function 'bool AsyncUDP::listenMulticast(ip_addr_t*, uint16_t, uint8_t)':
lib/ESPAsyncUDP-0.21/src/AsyncUDP.cpp:254:57: error: 'udp_set_multicast_netif_addr' was not declared in this scope
udp_set_multicast_netif_addr(_pcb, multicast_if_addr);
^
lib/ESPAsyncUDP-0.21/src/AsyncUDP.cpp:258:36: error: 'udp_set_multicast_ttl' was not declared in this scope
udp_set_multicast_ttl(_pcb, ttl);
^
*** [.pioenvs/sonoff/lib076/ESPAsyncUDP-0.21/AsyncUDP.cpp.o] Error 1
localhost61 commented 6 years ago

OK, found it ! -> Remove the library Sonoff-Tasmota-development\lib\ESPAsyncUDP-0.21, it is currently not needed but still compiled I admit that from the archive I only extract the \sonoff directory and only check library changes if I get a build error :-/

[Edith] ... remove also new lib esp-knx-ip-async-udp-0.4.0.15 (if you get other errors) [/Edith]

localhost61 commented 6 years ago

It seems that the makefile dedendencies under Arduino IDE are more efficient that under Platformio. The libraries are not compiled if not called by the source code. I could add both new libs to the project and recompile without issue. @beho1der , does it work for you now?

beho1der commented 6 years ago

I remove folder ESPAsyncUDP-0.21 and esp-knx-ip-async-udp-0.4.0.15 and all build success! Need Fix it

ascillato commented 6 years ago

Hi,

There is no need to fix the development branch.

The issue that you are experiencing is that both libraries now requires version 2.4.0 of the esp8266 board libraries.

Will not compile under 2.3.0 as explained on the libraries readme files: esp-knx-ip readme ESPAsyncUDP readme

You need to update your esp8266 board libraries as explained here

ascillato commented 6 years ago

If you are using Arduino, just update the esp8266 library from Program/Libraries/Manage Libraries and look for esp8266 and click on update

If you are using Platform.io, just change on the file platformio.ini:

[env:sonoff]
;platform = espressif8266@1.5.0  ; v2.3.0
platform = espressif8266@1.6.0  ; v2.4.0
;platform = espressif8266

or under the language you prefer.

beho1der commented 6 years ago

It works on platform = espressif8266@1.6.0 Thanks all for help.

ascillato commented 6 years ago

Great! :+1:

I made the PR #2487 to add to the Sonoff-Tasmota readme this requirement. Thanks.

localhost61 commented 6 years ago

OK, I confirm I was already in 2.40 under Arduino IDE.

beho1der commented 6 years ago

Need platform = espressif8266@1.6.0

ascillato commented 6 years ago

Yes, but just once.

The first time Platform.io see platform = espressif8266@1.6.0 will download the library. Then, using the platform = espressif8266 will make platform.io use the one just downloaded.

Remember that with this type of change, platform.io also needs a REBUILD C/C++

image

arendst commented 6 years ago

I have no time for testing today but am I right that 2.3.0 still works when KNX is disabled?

If not, then we have to change things as I still want 2.3.0 to be available on non-KNX systems.

beho1der commented 6 years ago

On 2.3.0 all Build with KNX

reloxx13 commented 6 years ago

I have no time for testing today but am I right that 2.3.0 still works when KNX is disabled?

nope, KNX commented out in user_config.h and still getting errors while compiling with 2.3.0.

Leseratte10 commented 6 years ago

Probably because here -> https://github.com/arendst/Sonoff-Tasmota/blob/8bc64758504d37486485a014fe69d19bd171e597/sonoff/sonoff_post.h#L36 it doesn't check the KNX config flag.

ascillato commented 6 years ago

Hi, I'm downgrading the esp-knx-ip library to use 2.3.0 so KNX will run on 2.3.0

I will make the PR soon

The fix will be just:

No other change will be needed. And everything under ESP8266 v2.3.0

ascillato commented 6 years ago

PR #2492 to:

Compiled and Tested under ESP8266 Board Library 2.3.0, with and without #define USE_KNX