Skip to content

Manual recompile not necessary? #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gsicilia82 opened this issue May 2, 2023 · 7 comments
Closed

Manual recompile not necessary? #6

gsicilia82 opened this issue May 2, 2023 · 7 comments

Comments

@gsicilia82
Copy link

Hi, after failing few times by manually recompile Arduino-SDK with enabled LWIP-NAT, I have asked ChatGPT.

It told me to use this platformio.ini:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
lib_deps = 
    esp32wifi
build_flags = 
    -DLWIP_FEATURES=1
    -DLWIP_IPV4_NAT=1

ChatGPTs C++ code was bullshit, but replacing it with your example file: IT WORKS!
Using these build flags, your example script works out of the box. I don't really understand, why it works without issues by using standard arduino sdk.

Do you know why?

@gsicilia82
Copy link
Author

Hmm, ok it works also without any build flags....
Maybe, LWIP NAT is uncluded in standard arduino SDK?

@paclema
Copy link
Owner

paclema commented May 2, 2023

Hi @gsicilia82, thank you for your comments! At the time that I made this example, the lwip nat layer was not totally available by default yet into the esp-idf compiled core that arduino-esp32 is based on.

If it works for you, it might be then included now then :)

I will check that out further and I will let you know, but I am happy that you made it works out of the box.

@paclema
Copy link
Owner

paclema commented May 30, 2023

Hi @gsicilia82 I have been testing this repo example using your platofmio.ini but for me the ip_napt_enable() function is not available using the standard arduino-esp32 framework.

Could you share what are the exact program that you had run that works for you, please?

@gsicilia82
Copy link
Author

To be sure that my arduino framework still coresponds to original distribution, how can I "reset" my data and start by null?

Attached, you will find my platformio.ini.
Maybe, the tasmota distribution has napt/lwip already included? I always use tasmota distro cause of esp32 solo1 framework.

[platformio]
default_envs = esp32debug
build_cache_dir = /home/giuseppe/.buildcache
extra_configs = platformio_override.ini

[env]
lib_compat_mode = strict

[common]
lib_deps = 
build_flags = 
	-D DEBUG

[env:esp32]
platform = https://github.com/tasmota/platform-espressif32/releases/download/v.2.0.5/platform-espressif32-v.2.0.5.zip
platform_packages = 
framework = arduino
board = esp32dev
check_tool = cppcheck
lib_deps = ${common.lib_deps}
monitor_speed = 115200
upload_speed = 1500000
lib_ldf_mode = deep
monitor_filters = 
	esp32_exception_decoder
	time
build_unflags = 
build_flags = ${common.build_flags}


[env:esp32debug]
platform = https://github.com/tasmota/platform-espressif32/releases/download/v.2.0.5/platform-espressif32-v.2.0.5.zip
platform_packages = 
framework = arduino
board = esp32dev
check_tool = cppcheck
lib_deps = ${common.lib_deps}
monitor_speed = 115200
monitor_port = /dev/ttyUSB1
debug_tool = esp-prog
debug_init_break = tbreak setup
upload_port = /dev/ttyUSB1
lib_ldf_mode = deep
monitor_filters = 
	esp32_exception_decoder
	time
build_unflags = 
build_type = debug
build_flags = ${common.build_flags}
#upload_protocol = esp-prog
#debug_port = /dev/ttyUSB0

@paclema
Copy link
Owner

paclema commented May 30, 2023

Thanks for your answer @gsicilia82! I am afraid that this is the case. Tasmota platform has its own arduino-esp32 version where they have compiled esp-idf adding the NAPT features by default (not enabled in the espressif official arduino-esp32 framework) in the same way that I explain in the readme of this repo. So in your case you are not using the official arduino-esp32 framework distributed from espressif but the Tasmota version, which already include LWIP-NAPT capabilities.

You can also check more details about this on this issue: espressif/arduino-esp32#6421

Using platformio, the arduino-esp32 framework will be downloaded under the folder .platormio/packages/framework-arduinoespressif32 inside your user home folder. You can remove manually that folder if you want to make platformio download it again the next time that you compile your program.

@gsicilia82
Copy link
Author

Thanks for your effort to clarify this topic. In this case, I am pretty sure that your test with original framework and not working lwip napt coresponds to real/original behaviour.
With solo1 project, I started to use tasmota distribution and I continued this way cause of stable results. I never thought about other side effects.

@paclema
Copy link
Owner

paclema commented May 30, 2023

Thank you for your feedback too! I guess we must wait until this feature is included in espressif´s framework with this PR: espressif/esp32-arduino-lib-builder#69, but in your case, it makes sense to use tasmota´s ;)

I close this issue since I guess this has been clarified.

@paclema paclema closed this as completed May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants