Skip to content
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

Compiling issue on ESP32 with Networking and SDCard using EDP-IDF 4.3 #8

Closed
troth530 opened this issue Nov 3, 2021 · 8 comments
Closed

Comments

@troth530
Copy link

troth530 commented Nov 3, 2021

This only occurs with both Networking and SDCard ON in CmakeLists.txt
The error does not make sense.

-elf\sys-include\sys\fcntl.h:3,
from C:/Users/myName/Desktop/esp-idf/components/lwip/port/esp32/include/lwipopts.h:39,
from C:/Users/myName/Desktop/esp-idf/components/lwip/lwip/src/include/lwip/opt.h:51,
from C:/Users/myName/Desktop/esp-idf/components/lwip/lwip/src/include/lwip/debug.h:41,
from ../main/networking/ftpd.c:52:
../main/networking/ftpd.c: In function 'send_next_directory':
../main/networking/ftpd.c:419:41: error: 'vfs_stat_t' {aka 'struct '} has no member named 'st_mtim'; did you mean 'st_mtime'?
s_time = gmtime(&st.st_mtime);
^~~~~~~~
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

@terjeio
Copy link
Contributor

terjeio commented Nov 3, 2021

Is this with the latest version? Asking since it compiles for me.

@troth530
Copy link
Author

troth530 commented Nov 4, 2021

Using Windows 10. ESP-IDF was downloaded based on the latest, I think it's 4.3.1. Used both offline and online downloaders on 2 different machines. Followed your installation instructions exactly with only adjustments for install.sh and export.sh file names in Windows. No errors during install. Freshly pulled, cloned and updated all grblHAL code.

Feels like a compiler issue because the error says no member st_min, but line 419 in fptd.c is clearly written st.st_time. I tried copy/pasting the text back in thinking it was a bad, hidden character.

@terjeio
Copy link
Contributor

terjeio commented Nov 4, 2021

Feels like a compiler issue because the error says no member st_min, but line 419 in fptd.c is clearly written st.st_time.

Could it be that your version of the framework has a definition of vfs_stat_t that "hides" the one grblHAL provides? Or is it the way you compile that does it? I am compiling using VS Code.

I have not enabled ftp by default for other drivers as the both the fatFs and lwip configurations may need changes for that. Perhaps I should do the same for this driver and make it an option instead? If you do not need ftp enabled you can disable it by commenting out this line.

@troth530
Copy link
Author

troth530 commented Nov 4, 2021

@terjeio
Sorry but I cannot determine the cause at this point until I have done more testing.

I can confirm that setting FTP_ENABLE to 0 n driver.h as you suggested enabled the code to compile.
I use the Powershell with the idf.py build command
It also seems core/driver_opts.h has special setting for all but ESP32 here

I had SDCard and Networking Enabled with Teensy 4.1. I was able to FTP files to the SD card by connecting to the IP address, but I had to use static IPs as DHCP did not seem to work. In order to get SD and Networking to compile I recall I had to find the dependancies (FatFS and lwip) in various places on the internet. Also I had to make many changes to lwip and FatFS and as I was not pulling the code using git, I was using Arduino IDE.

My goal is to use the ESP3D WebUI, but I'm not that far yet and do not know if FTP is required for my workflow.

As always your hard work is appreciated!

@terjeio
Copy link
Contributor

terjeio commented Nov 4, 2021

Sorry but I cannot determine the cause at this point until I have done more testing.

if you have time can you try by renaming vfs_stat_t to something else? The instances are here:

image

It also seems core/driver_opts.h has special setting for all but ESP32 here

I'll incorporate that in driver.h in the next build - it makes maintenance a bit easier.

but I had to use static IPs as DHCP did not seem to work

I have done all my testing with DHCP so that is odd, IIRC I've had one complaint that static IP did not work.

@troth530
Copy link
Author

troth530 commented Nov 6, 2021

@terjeio
I will look into it this weekend and report back.
Again thank you for all your hard work!

@troth530
Copy link
Author

Today I updated to the latest commit
cd ~
cd .\esp\esp-idf\ESP32
git stash
git pull --recurse-submodules
git submodule update --remote

Made changes in CMakeList.txt
Networking, SDcard and SoftAP all 3 set to ON. I believe this will meet my needs, but need to confirm.

@terjeio
Copy link
Contributor

terjeio commented Nov 28, 2021

I have added a workaround for this in the latest version - I have no idea why the compiler flags this as an error with v4.3 of the IDF. It even suggests to rename the field to the name it already has... Silly.

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