WallaceWilliam / framework-esp8266-rtos-sdk-idf-platformio

Apache License 2.0
13 stars 18 forks source link

Error in esp8266-rtos-sdk.py when compile #8

Closed Serjy1710 closed 4 years ago

Serjy1710 commented 4 years ago

I've just install this platform and package as described here, but first "blink" example cannot compile with error:

`Processing nodemcuv2 (platform: custom8266; framework: esp8266-rtos-sdk; board: nodemcuv2)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/custom8266/nodemcuv2.html PLATFORM: custom Espressif 8266 1.0.0 > NodeMCU 1.0 (ESP-12E Module) HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash PACKAGES: toolchain-xtensa-lx106-elf 5.2.0+100, framework-esp8266-rtos-sdk 6cfeb14 File "C:\Users\s.dmitriev.platformio\platforms\custom8266\builder\frameworks\esp8266-rtos-sdk.py", line 237

line = line.replace('"','')

                          ^

TabError: inconsistent use of tabs and spaces in indentation

================================================================================= [FAILED] Took 0.95 seconds ================================================================================= The terminal process terminated with exit code: 1`

platformio.ini: [env:nodemcuv2] platform = custom8266 framework = esp8266-rtos-sdk board = nodemcuv2

The same "blink" is compile and working fine with built-in PlatformIO esp8266-RTOS-sdk package.

WallaceWilliam commented 4 years ago

please see README.md to compile latest rtos release

howroyd commented 4 years ago

Just got the same issue, installed in platformio by putting this repo into the advance installation, in pio platforms gui. Done the cmake files correctly and renames src to main. I think the issue is because I haven't done the install requirements part as I expected this to be done within pio. Am I right in assuming this framework doesn't download the esp8266-rtos-sdk within pio, but requires it to be cloned and installed as if you were then going to compile from the command line? Annoyingly I already have the esp32 build environment installed that way, and can't figure out how to have that play nicely with the esp8266 environment, which uses the same path variable names and .espressif folder. Grr. Thank you for posting this repo publicly though. Will report back if I find a way of getting both esp32 and esp8266 environments to play nice together! Note; I know I can just used the normal esp8266 framework but this is soooo far behind and I need features in v3.x

WallaceWilliam commented 4 years ago

howroyd, hello

Reinstall "custom Espressif 8266" from https://github.com/WallaceWilliam/framework-esp8266-rtos-sdk-idf-platformio

In .platformio\packages\ should appear framework-esp8266-rtos-sdk and toolchain-xtensa-lx106-elf

you must complete [CMAKE for Windows], [NINJA], [MCONF] yourself and add to PATH Please note that idf.py works with python3 in the platformio terminal, I run such a command py -3.6% IDF_PATH% / tools / idf.py build

esp32 and esp8266 environments both use the same variable IDF_PATH therefore, you must change IDF_PATH each time when using esp32 or esp8266 show the error that you get when compiling

WallaceWilliam commented 4 years ago

need add to PATH {path to platformio}.platformio\packages\toolchain-xtensa-lx106-elf\bin;

howroyd commented 4 years ago

That seems to have done the trick, ty very much.

Seems to be going through the build process as I would expect. Build is now throwing an error with lwip, but that looks like an issue on the IDF or sdkconfig side and not an issue with your repo:

In file included from C:/Simon/Esp8266/ESP8266_RTOS_SDK/components/lwip/lwip/src/api/if_api.c:49:0:
C:/Simon/Esp8266/ESP8266_RTOS_SDK/components/lwip/lwip/src/include/lwip/priv/sockets_priv.h:105:0: warning: "LWIP_SETGETSOCKOPT_MAXOPTLEN" redefined
 #define LWIP_SETGETSOCKOPT_MAXOPTLEN LWIP_MAX(16, sizeof(struct ifreq))
 ^
In file included from C:/Simon/Esp8266/ESP8266_RTOS_SDK/components/lwip/lwip/src/include/lwip/priv/sockets_priv.h:45:0,
                 from C:/Simon/Esp8266/ESP8266_RTOS_SDK/components/lwip/lwip/src/api/if_api.c:49:
C:/Simon/Esp8266/ESP8266_RTOS_SDK/components/lwip/lwip/src/include/lwip/sockets.h:115:0: note: this is the location of the previous definition
 #define LWIP_SETGETSOCKOPT_MAXOPTLEN 16
 ^
In file included from C:/Simon/Esp8266/ESP8266_RTOS_SDK/components/lwip/lwip/src/api/if_api.c:49:0:
C:/Simon/Esp8266/ESP8266_RTOS_SDK/components/lwip/lwip/src/include/lwip/priv/sockets_priv.h:109:8: error: redefinition of 'struct lwip_setgetsockopt_data'
 struct lwip_setgetsockopt_data {
        ^
In file included from C:/Simon/Esp8266/ESP8266_RTOS_SDK/components/lwip/lwip/src/include/lwip/priv/sockets_priv.h:45:0,
                 from C:/Simon/Esp8266/ESP8266_RTOS_SDK/components/lwip/lwip/src/api/if_api.c:49:
C:/Simon/Esp8266/ESP8266_RTOS_SDK/components/lwip/lwip/src/include/lwip/sockets.h:119:8: note: originally defined here
 struct lwip_setgetsockopt_data {
        ^
cc1.exe: warning: unrecognized command line option '-Wno-frame-address'
[359/501] Building C object esp-idf/lwip/CMakeFiles/__idf_lwip.dir/lwip/src/api/api_msg.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

Many thanks for your help :)

EDIT: Not sure why but commenting out a struct definition seemed to fix my remaining issue. Built and flashed all OK now. Ref; https://www.esp8266.com/viewtopic.php?p=87308

WallaceWilliam commented 4 years ago

Always happy to help :) I decided to go the other way the original script from https://github.com/espressif/esp-idf has been adapted for esp 8266 must reinstall custom8266

howroyd commented 4 years ago

Cool will give it a go. Also, just seen the new README.md and the note about flash less than 4M. I am on a 2M board and seems to be working just fine

WallaceWilliam commented 4 years ago

I am glad to help