stefanbode / Sonoff-Tasmota

Provide ESP8266 based itead Sonoff with Web, MQTT and OTA firmware using Arduino IDE, enhanced with I2C options
GNU General Public License v3.0
127 stars 41 forks source link

Sonoff Basic compiling error #169

Closed titomontes closed 5 years ago

titomontes commented 5 years ago

Hello Stefan

I´m trying to compile your fork to flash it onto a Sonoff dual R2, but I´m getting only errors; It seemed (like 20 attempts ago) that the problem would be low memory, so I tried the sonoff basic option, but I get this:

Compiling .pio\build\sonoff-basic\src\sonoff.ino.cpp.o Linking .pio\build\sonoff-basic\firmware.elf c:/users/tito/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\sonoff-basic\firmware.elf section .text' will not fit in regioniram1_0_seg' collect2.exe: error: ld returned 1 exit status *** [.pio\build\sonoff-basic\firmware.elf] Error 1 [ERROR] Took 17.14 seconds Environment sonoff-basic [FAILED]

Is there an already compiled flashable .bin file? (with core 2.3?)

Thanks again for your work!

ascillato commented 5 years ago

@titomontes

Your issue is that you have Platformio v4 and requires to add build_dir = .pioenvs under [platformio] inside the platformio.ini file as:

[platformio]
src_dir = sonoff
build_dir = .pioenvs

This is already updated in main Tasmota

meingraham commented 5 years ago

@stefanbode @titomontes

Have you tried using Gitpod for compilation? It ought to work in a very similar manner to what is described in the Tasmota wiki Gitpod article other than pointing to your code branch.

Mike

stefanbode commented 5 years ago

Hi gents, thanks for bringing up the incompatibility with Platformio V4. Will update sources now

titomontes commented 5 years ago

Hello again

I´m sorry to say that, compiling in core 2.3 still fails:

Linking .pioenvs\sonoff\firmware.elf .pioenvs\sonoff\libFrameworkArduino.a(core_esp8266_main.cpp.o):(.text._ZL12loop_wrapperv+0x4): undefined reference to setup' .pioenvs\sonoff\libFrameworkArduino.a(core_esp8266_main.cpp.o):(.text._ZL12loop_wrapperv+0x8): undefined reference toloop' .pioenvs\sonoff\libFrameworkArduino.a(core_esp8266_main.cpp.o): In function loop_wrapper()': core_esp8266_main.cpp:(.text._ZL12loop_wrapperv+0x21): undefined reference tosetup' core_esp8266_main.cpp:(.text._ZL12loop_wrapperv+0x2d): undefined reference to `loop' collect2.exe: error: ld returned 1 exit status

*** [.pioenvs\sonoff\firmware.elf] Error 1 [ERROR] Took 32.14 seconds Environment sonoff [FAILED]

Core 2.5.2 works well though, although there are stability issues...

titomontes commented 5 years ago

@stefanbode @titomontes

Have you tried using Gitpod for compilation? It ought to work in a very similar manner to what is described in the Tasmota wiki Gitpod article other than pointing to your code branch.

Mike

@meingraham Thanks a lot for pointing it out. I will surely use it in the future

titomontes commented 5 years ago

@ascillato @stefanbode, did you have a look at this?

stefanbode commented 5 years ago

Yes fine. I think you can use it without any modification. I do not see any changes I need to do. Anyhow: I do not agree to change the my_user_config.... you can all do this in the override file. Just follow the exampled and undef define the variable to override existing values.