platformio / platform-espressif8266

Espressif 8266: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/espressif8266
Apache License 2.0
320 stars 218 forks source link

Support for latest Espressif ESP8266 frameworks: NONOS-SDK 3.0.4 and RTOS-SDK 3.4 #284

Open freedib opened 1 year ago

freedib commented 1 year ago

This Pull Request implements support for the latest Espressif ESP8266 frameworks

Changes are explained in each commit of the Pull Request

Support for the Espressif NONOS-SDK requires two additional packages

Support for the Espressif RTOS-SDK @ 3.4 is very similar to the latest ESP-IDF platform with ESP8266 in mind. Support for old RTOS-SDK @ 1.5 have been removed. It requires one additional package:

Embed_files support have been included in esp8266-nonos-sdk and Arduino builders. It should replace the one proposed in Pull Request #267 to support the new esp8266-rtos-sdk builder

freedib commented 1 year ago

RTOS-SDK @ 3.4 requires a new toolchain-xtensa @ 8.4.0. I packaged it locally for my Linux system, but I could prepare a version suitable for the Registry

freedib commented 1 year ago

tool-genbin have been renamed to tool-genbin-esp8266. GIT: https://github.com/freedib/tool-genbin-esp8266.git

qnxsgwy commented 1 year ago

Thank you for your contribution, hope to support RTOS-SDK 3.4 as soon as possible, the current version is too old

omarmohamedkh commented 1 year ago

When will it be merged?

YashxD commented 1 year ago

I am sure a lot of folks are eagerly awaiting this PR to be merged. Is there any particular reason it's being held back? Can I contribute in any way?

h1aji commented 1 year ago

@freedib I am getting this error when i try to install

remote: Counting objects: 100% (105/105), done.
remote: Compressing objects: 100% (79/79), done.
remote: Total 105 (delta 54), reused 46 (delta 13), pack-reused 0
Receiving objects: 100% (105/105), 46.42 KiB | 864.00 KiB/s, done.
Resolving deltas: 100% (54/54), done.
Platform Manager: espressif8266@4.2.0+sha.032d938 has been installed!
Tool Manager: Installing platformio/toolchain-xtensa @ ~2.100300.0
Unpacking  [####################################]  100%          
Tool Manager: toolchain-xtensa@2.100300.220621 has been installed!
Tool Manager: Installing platformio/tool-genbin-esp8266 @ ~1.0.0
Error: Could not find the package with 'platformio/tool-genbin-esp8266 @ ~1.0.0' requirements for your system 'linux_x86_64'

Any chance to fix it?

freedib commented 1 year ago

Because this pull request have not been merged, tool-genbin-esp8266 have not been added to platformio registry. From your log, it seems also that "pio run" downloads the current espressif8266 framework (version 4.2.0) and not the one of the pull request (version 4.0.1) You have to modify your platformio.ini file to specify where to get components.

If developing for NONOS SDK: [env] platform = https://github.com/freedib/platform-espressif8266.git framework = esp8266-nonos-sdk platform_packages = framework-esp8266-nonos-sdk @ https://github.com/freedib/framework-esp8266-nonos-sdk@3.0.5 tool-genbin-esp8266 @ https://github.com/freedib/tool-genbin-esp8266@1.0.0

If developing for RTOS SDK on Linux 64: [env] platform = https://github.com/freedib/platform-espressif8266.git framework = esp8266-rtos-sdk platform_packages = framework-esp8266-rtos-sdk @ https://github.com/freedib/framework-esp8266-rtos-sdk.git@3.4 toolchain-xtensa @ https://github.com/freedib/toolchain-xtensa-8.4.0-linux-amd64.git@8.4.0 tool-genbin-esp8266 @ https://github.com/freedib/tool-genbin-esp8266@1.0.0

h1aji commented 1 year ago

@freedib Thanks it all works except mdns from components.

Building in release mode
Linking .pio/build/esp12e/firmware.elf
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: .pio/build/esp12e/src/webserver.o:(.bss.clientIvol+0x0): multiple definition of `clientIvol'; .pio/build/esp12e/src/main.o:(.bss.clientIvol+0x0): first defined here
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: .pio/build/esp12e/src/main.o:(.literal.app_main+0xf4): undefined reference to `mdns_init'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: .pio/build/esp12e/src/main.o: in function `app_main':
/home/hmurad/Documents/PlatformIO/Projects/Le-Radio/src/main.c:745: undefined reference to `mdns_init'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: /home/hmurad/Documents/PlatformIO/Projects/Le-Radio/src/main.c:750: undefined reference to `mdns_hostname_set'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: /home/hmurad/Documents/PlatformIO/Projects/Le-Radio/src/main.c:755: undefined reference to `mdns_instance_name_set'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: /home/hmurad/Documents/PlatformIO/Projects/Le-Radio/src/main.c:760: undefined reference to `mdns_service_add'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: /home/hmurad/Documents/PlatformIO/Projects/Le-Radio/src/main.c:763: undefined reference to `mdns_service_add'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: .pio/build/esp12e/src/interface.o:(.literal.setHostname+0x2c): undefined reference to `mdns_service_remove'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: .pio/build/esp12e/src/interface.o:(.literal.setHostname+0x30): undefined reference to `mdns_hostname_set'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: .pio/build/esp12e/src/interface.o:(.literal.setHostname+0x34): undefined reference to `mdns_instance_name_set'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: .pio/build/esp12e/src/interface.o:(.literal.setHostname+0x38): undefined reference to `mdns_service_add'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: .pio/build/esp12e/src/interface.o: in function `heapSize':
/home/hmurad/Documents/PlatformIO/Projects/Le-Radio/src/interface.c:1155: undefined reference to `mdns_service_remove'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: .pio/build/esp12e/src/interface.o: in function `setHostname':
/home/hmurad/Documents/PlatformIO/Projects/Le-Radio/src/interface.c:1161: undefined reference to `mdns_service_remove'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: /home/hmurad/Documents/PlatformIO/Projects/Le-Radio/src/interface.c:1162: undefined reference to `mdns_hostname_set'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: /home/hmurad/Documents/PlatformIO/Projects/Le-Radio/src/interface.c:1163: undefined reference to `mdns_instance_name_set'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: /home/hmurad/Documents/PlatformIO/Projects/Le-Radio/src/interface.c:1165: undefined reference to `mdns_service_add'
/home/hmurad/.platformio/packages/toolchain-xtensa@src-5e1dba65eabc364c0001e57aa616c039/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: /home/hmurad/Documents/PlatformIO/Projects/Le-Radio/src/interface.c:1166: undefined reference to `mdns_service_add'
collect2: error: ld returned 1 exit status
*** [.pio/build/esp12e/firmware.elf] Error 1

VScode finds mdns.h library fine, but when i run compilation i see this error.

freedib commented 1 year ago

@h1aji Right. I didn't test mDNS :-( mDNS is not enabled by default. You have to execute "pio run -t menuconfig" to enable it in sdkconfig. In menuconfig, it is in "Component Config" / "mDNS" / "Enable mDNS". When mDNS is activated, the side effect is that IPv6 is automatically enabled ("Component Config" / "LWIP" / "Enable IPv6")

Bastian0302 commented 1 year ago

Hallo,

i was searching for a long time and now found this. But i get an error while installing the packages.

TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType: File "C:\Users\Bastian\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 174: env.SConscript("$BUILD_SCRIPT") File "C:\Users\Bastian\.platformio\packages\tool-scons\scons-local-4.5.2\SCons\Script\SConscript.py", line 598: return _SConscript(self.fs, *files, **subst_kw) File "C:\Users\Bastian\.platformio\packages\tool-scons\scons-local-4.5.2\SCons\Script\SConscript.py", line 285: exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals) File "C:\Users\Bastian\.platformio\platforms\espressif8266\builder\main.py", line 250: target_elf = env.BuildProgram() File "C:\Users\Bastian\.platformio\packages\tool-scons\scons-local-4.5.2\SCons\Util\envs.py", line 242: return self.method(*nargs, **kwargs) File "C:\Users\Bastian\.platformio\penv\lib\site-packages\platformio\builder\tools\piobuild.py", line 60: env.ProcessProgramDeps() File "C:\Users\Bastian\.platformio\packages\tool-scons\scons-local-4.5.2\SCons\Util\envs.py", line 242: return self.method(*nargs, **kwargs) File "C:\Users\Bastian\.platformio\penv\lib\site-packages\platformio\builder\tools\piobuild.py", line 120: env.BuildFrameworks(env.get("PIOFRAMEWORK")) File "C:\Users\Bastian\.platformio\packages\tool-scons\scons-local-4.5.2\SCons\Util\envs.py", line 242: return self.method(*nargs, **kwargs) File "C:\Users\Bastian\.platformio\penv\lib\site-packages\platformio\builder\tools\piobuild.py", line 331: SConscript(env.GetFrameworkScript(name), exports="env") File "C:\Users\Bastian\.platformio\packages\tool-scons\scons-local-4.5.2\SCons\Script\SConscript.py", line 662: return method(*args, **kw) File "C:\Users\Bastian\.platformio\packages\tool-scons\scons-local-4.5.2\SCons\Script\SConscript.py", line 598: return _SConscript(self.fs, *files, **subst_kw) File "C:\Users\Bastian\.platformio\packages\tool-scons\scons-local-4.5.2\SCons\Script\SConscript.py", line 285: exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals) File "C:\Users\Bastian\.platformio\platforms\espressif8266\builder\frameworks\esp8266-rtos-sdk.py", line 60: assert os.path.isdir(TOOLCHAIN_DIR) File "C:\Users\Bastian\.platformio\python3\lib\genericpath.py", line 42: st = os.stat(s))

Im working on windows.

Thanks.

h1aji commented 1 year ago

@Bastian0302 what python version are you using?

Bastian0302 commented 1 year ago

I installed 3.10.11 with the check box „add to path“ but still not working.

Update: I uninstalled Paython, deleted .platformio,and isntalled all new. But still same error.

Additional Information: `Tool Manager: Installing git+https://github.com/freedib/toolchain-xtensa-8.4.0-linux-amd64.git @ 8.4.0 Tool Manager: toolchain-xtensa@8.4.0+sha.61d3129 has been installed! Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini_pro.html PLATFORM: Espressif 8266 (4.0.1+sha.4979251) > WeMos D1 mini Pro HARDWARE: ESP8266 80MHz, 80KB RAM, 16MB Flash PACKAGES:

I have no clue where i can start finding the error.

remuslazar commented 11 months ago

@ivankravets it will be really awesome if this PR could get merged! ESP8266 is still an awesome and cheap device to use. 🙏

jeecrypt commented 8 months ago

I would like to return to PlatformIO, but the old version of RTOS SDK does not allow me to do this. I'm really looking forward to the update. I want stability.

milo1000 commented 7 months ago

Apparently this project is dead, year passed and nobody cares to merge most important PR.

cziter15 commented 2 months ago

@ivankravets is there any chance to get this merged? It might be not so trivial as it links two external dependencies (RTOS sdk repo and tool-genbin), but please at least give it a try.

I'm porting https://github.com/cziter15/ksIotFrameworkLib to espidf, but it would be nice to support esp8266 too.

tbb98 commented 2 months ago

@ivankravets @valeros Is it possible to merge this? Even into an another branch, if You can't really test it?