EmileSpecialProducts / portable-disk-driveEx

This is the SD-Card example for esp-arduino and Platformio 8266/ESP32/ESP32S2/ESP32S3/ESP32C3
GNU General Public License v3.0
0 stars 0 forks source link

multiple compiler errors #3

Open Elmojomo opened 1 week ago

Elmojomo commented 1 week ago

When compiling using Arduino IDE 2.3.3, the following errors are returned by the compiler: Any assistance appreciated.

In file included from C:\Users\Mike\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\libraries\WebServer\src/WebServer.h:28, from D:\X\Arduino-Microcontroller Stuff\portable-disk-driveEx-main\SDWebserverFx\SDWebserverFx.ino:39: D:\X\Arduino-Microcontroller Stuff\portable-disk-driveEx-main\SDWebserverFx\SDWebserverFx.ino: In function 'void handleFileUpload()': C:\Users\Mike\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\libraries\FS\src/FS.h:30:21: error: invalid conversion from 'const char*' to 'oflag_t' {aka 'int'} [-fpermissive] 30 #define FILE_WRITE "w" ^~~
const char*
D:\X\Arduino-Microcontroller Stuff\portable-disk-driveEx-main\SDWebserverFx\SDWebserverFx.ino:419:51: note: in expansion of macro 'FILE_WRITE' 419 uploadFile = sd.open(upload.filename.c_str(), FILE_WRITE); ^~~~~~ In file included from c:\Users\Mike\Documents\Arduino\libraries\SdFat\src/FsLib/FsFile.h:34, from c:\Users\Mike\Documents\Arduino\libraries\SdFat\src/FsLib/FsLib.h:31, from c:\Users\Mike\Documents\Arduino\libraries\SdFat\src/SdFat.h:33, from D:\X\Arduino-Microcontroller Stuff\portable-disk-driveEx-main\SDWebserverFx\SDWebserverFx.ino:49: c:\Users\Mike\Documents\Arduino\libraries\SdFat\src/FsLib/FsVolume.h:221:41: note: initializing argument 2 of 'FsFile FsVolume::open(const char*, oflag_t)' 221 FsFile open(const char* path, oflag_t oflag = O_RDONLY); ^ D:\X\Arduino-Microcontroller Stuff\portable-disk-driveEx-main\SDWebserverFx\SDWebserverFx.ino: In function 'void handleCreate()': C:\Users\Mike\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\libraries\FS\src/FS.h:30:21: error: invalid conversion from 'const char*' to 'oflag_t' {aka 'int'} [-fpermissive] 30 #define FILE_WRITE "w" ^~~
const char*

D:\X\Arduino-Microcontroller Stuff\portable-disk-driveEx-main\SDWebserverFx\SDWebserverFx.ino:497:49: note: in expansion of macro 'FILE_WRITE' 497 | file_t file = sd.open((char )path.c_str(), FILE_WRITE); | ^~~~~~ c:\Users\Mike\Documents\Arduino\libraries\SdFat\src/FsLib/FsVolume.h:221:41: note: initializing argument 2 of 'FsFile FsVolume::open(const char, oflag_t)' 221 | FsFile open(const char* path, oflag_t oflag = O_RDONLY); | ^ D:\X\Arduino-Microcontroller Stuff\portable-disk-driveEx-main\SDWebserverFx\SDWebserverFx.ino: In function 'void setup()': D:\X\Arduino-Microcontroller Stuff\portable-disk-driveEx-main\SDWebserverFx\SDWebserverFx.ino:878:39: error: 'hallRead' was not declared in this scope 878 | message += " HallSensor: " + String(hallRead()); | ^~~~ D:\X\Arduino-Microcontroller Stuff\portable-disk-driveEx-main\SDWebserverFx\SDWebserverFx.ino: In function 'void Log(String)': D:\X\Arduino-Microcontroller Stuff\portable-disk-driveEx-main\SDWebserverFx\SDWebserverFx.ino:948:53: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator|' 948 | file_t LogFile = sd.open("/Log.txt", FILE_WRITE | O_APPEND); | ^ Multiple libraries were found for "ArduinoOTA.h" Used: C:\Users\Mike\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\libraries\ArduinoOTA Not used: C:\Users\Mike\Documents\Arduino\libraries\ArduinoOTA exit status 1

Compilation error: 'hallRead' was not declared in this scope

EmileSpecialProducts commented 1 week ago

Yes, this is the problem in using Arduino IDE instead of platformIO. Your problem is that you will need to deinstall the SD library, and then install the SdFat from https://github.com/greiman/SdFat That is also why I have the link to the library after the include so that you know what library you need, In platformio this is managed better

include // https://github.com/arduino-libraries/NTPClient

include // WifiManager by tzapu https://github.com/tzapu/WiFiManager

include // ArduinoOTA by Arduino, Juraj https://github.com/JAndrassy/ArduinoOTA

Elmojomo commented 1 week ago

Greetings!

Thank you so much for the amazing project, and the quick reply! I'm helping my niece with a school project, and your code seems to be exactly what we need. Thanks for suggesting it in the ESP32 Reddit. πŸ™‚ I did see the part about using the sdfat library, and I do have it installed, I think. I'm not sure what you mean about "de(in)stalling the SD library". How would I do that, please?

PlatformIO looks very nice, and I tried to use it, but there appeared to be some sort of error on the MS VS Code page. It would not let me even access the site at all last night. I will try again today. If I'm able to use PlatformIO, did I see that it has an option to select the board I'm using, which then "cuts out" all the unused code for the other boards? If I saw that correctly, that's an amazing feature! I was wondering what is happening to all the unused code that gets uploaded.

For example, in our case, we only need to put some files on the SD card, and be able to read them from a browser. That's all. I have no need to upload or do any editing in the browser. I would prefer to edit the code to simplify things, but my skills are...weak. lol I'm just trying to help my niece get this project done, and it's turning out to be much more complicated than we expected. πŸ˜•

I'll try again with PlatformIO, if I can get it to install. I would love to hear how to remove the SD library in the Arduino IDE, if possible.

Thanks again for your help!

Mike Piantanida 252-526-8322


From: EmileSpecialProducts @.> Sent: Tuesday, October 8, 2024 4:10 AM To: EmileSpecialProducts/portable-disk-driveEx @.> Cc: Elmojomo @.>; Author @.> Subject: Re: [EmileSpecialProducts/portable-disk-driveEx] multiple compiler errors (Issue #3)

Yes, this is the problem in using Arduino IDE instead of platformIO. Your problem is that you will need to deinstall the SD library, and then install the SdFat from https://github.com/greiman/SdFat That is also why I have the link to the library after the include so that you know what library you need, In platformio this is managed better

include // https://github.com/arduino-libraries/NTPClient

include // WifiManager by tzapu https://github.com/tzapu/WiFiManager

include // ArduinoOTA by Arduino, Juraj https://github.com/JAndrassy/ArduinoOTA

β€” Reply to this email directly, view it on GitHubhttps://github.com/EmileSpecialProducts/portable-disk-driveEx/issues/3#issuecomment-2399152796, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFHYXWKONHG4JD44OS6DIM3Z2OHQRAVCNFSM6AAAAABPRDYNUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJZGE2TENZZGY. You are receiving this because you authored the thread.Message ID: @.***>

Elmojomo commented 1 week ago

In your FTP WebServer video, at 5:40 (herehttps://youtu.be/mrwjPOust5I?t=342), what are you "selecting"? That's the step where it appears that PlatformIO is doing some sort of auto-clipping of the code or something, but I can't tell what you've selected, and you don't really say in the video. Maybe I'm just misunderstanding the whole process?

I did get PlatformIO installed! πŸ™‚

Mike Piantanida 252-526-8322


From: EmileSpecialProducts @.> Sent: Tuesday, October 8, 2024 4:10 AM To: EmileSpecialProducts/portable-disk-driveEx @.> Cc: Elmojomo @.>; Author @.> Subject: Re: [EmileSpecialProducts/portable-disk-driveEx] multiple compiler errors (Issue #3)

Yes, this is the problem in using Arduino IDE instead of platformIO. Your problem is that you will need to deinstall the SD library, and then install the SdFat from https://github.com/greiman/SdFat That is also why I have the link to the library after the include so that you know what library you need, In platformio this is managed better

include // https://github.com/arduino-libraries/NTPClient

include // WifiManager by tzapu https://github.com/tzapu/WiFiManager

include // ArduinoOTA by Arduino, Juraj https://github.com/JAndrassy/ArduinoOTA

β€” Reply to this email directly, view it on GitHubhttps://github.com/EmileSpecialProducts/portable-disk-driveEx/issues/3#issuecomment-2399152796, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFHYXWKONHG4JD44OS6DIM3Z2OHQRAVCNFSM6AAAAABPRDYNUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJZGE2TENZZGY. You are receiving this because you authored the thread.Message ID: @.***>

Elmojomo commented 1 week ago

I see a possible issue/solution: You note on your GitHub... "For the ESP32 you will need the Arduino Alpha 3 Release v3.0.0." How do I update the EPS32 within the Arduino IDE? I don't see an option, and it's not mentioned on the download pagehttps://github.com/espressif/arduino-esp32/releases/tag/3.0.5, that I can see. Also, is it okay to use the newly released v3.0.5, or do I specifically need to go back and find the v3.0.0 alpha?

Sorry for all the questions. I feel like I'm very close to getting this working, with perhaps a little help... πŸ™‚

Mike Piantanida 252-526-8322


From: EmileSpecialProducts @.> Sent: Tuesday, October 8, 2024 4:10 AM To: EmileSpecialProducts/portable-disk-driveEx @.> Cc: Elmojomo @.>; Author @.> Subject: Re: [EmileSpecialProducts/portable-disk-driveEx] multiple compiler errors (Issue #3)

Yes, this is the problem in using Arduino IDE instead of platformIO. Your problem is that you will need to deinstall the SD library, and then install the SdFat from https://github.com/greiman/SdFat That is also why I have the link to the library after the include so that you know what library you need, In platformio this is managed better

include // https://github.com/arduino-libraries/NTPClient

include // WifiManager by tzapu https://github.com/tzapu/WiFiManager

include // ArduinoOTA by Arduino, Juraj https://github.com/JAndrassy/ArduinoOTA

β€” Reply to this email directly, view it on GitHubhttps://github.com/EmileSpecialProducts/portable-disk-driveEx/issues/3#issuecomment-2399152796, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFHYXWKONHG4JD44OS6DIM3Z2OHQRAVCNFSM6AAAAABPRDYNUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJZGE2TENZZGY. You are receiving this because you authored the thread.Message ID: @.***>

EmileSpecialProducts commented 1 week ago

In the board manager you can find the β€œESP32” from espressif System and there you can change the version 2.0.17 will do as the FATex library will not yet build on the android 3.X versions. If you need the android 3.x version ( C6 /H2) then you can use the older version, But only supports fat and not FatEx ( >32GB ) https://github.com/EmileSpecialProducts/portable-disk-drive

Elmojomo commented 1 week ago

I'm sorry, I don't understand. I'm not using any sort of Android anything. I have an ESP-WROOM-32 dev board, made by NodeMCU. It's just a regular ESP32, to my knowledge. In your video, and on your Github page, you say something about the ESP32 requiring v3.0.0 alpha. I thought maybe this was where the compiler errors were coming from.

You mentioned in a previous email that I need to remove the SD card library, and install sdfat. Can you please explain how to remove the SD library? I already have the sdfat library installed.

I have PlatformIO, but I don't understand how to use it with this code. In your other video, you appear to select some sort of script or shortcut, but you don't say what it is. You can please see my previous emails (I sent several, sorry!) and they will explain my questions in more detail.

Any help is greatly appreciated. Thanks for your time!

Mike Piantanida 252-526-8322


From: EmileSpecialProducts @.> Sent: Tuesday, October 8, 2024 5:08 PM To: EmileSpecialProducts/portable-disk-driveEx @.> Cc: Elmojomo @.>; Author @.> Subject: Re: [EmileSpecialProducts/portable-disk-driveEx] multiple compiler errors (Issue #3)

In the board manager you can find the β€œESP32” from espressif System and there you can change the version 2.0.17 will do as the FATex library will not yet build on the android 3.X versions. If you need the android 3.x version ( C6 /H2) then you can use the older version, But only supports fat and not FatEx ( >32GB ) https://github.com/EmileSpecialProducts/portable-disk-drive

β€” Reply to this email directly, view it on GitHubhttps://github.com/EmileSpecialProducts/portable-disk-driveEx/issues/3#issuecomment-2400824118, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFHYXWMCTFL4QM3FS3VDR4LZ2RCVRAVCNFSM6AAAAABPRDYNUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBQHAZDIMJRHA. You are receiving this because you authored the thread.Message ID: @.***>

Elmojomo commented 1 week ago

Greetings! I'm so sorry to keep bothering you, but I think with just a little help, I can get this working! I received an ESP32-S3 board today. Will this make the programming easier, since it's a supported board in your code? I have PlatformIO installed (and Arduino 2.3.3 IDE as well). If you could take a few minutes to help me get to the next step, I would be very grateful. I'm trying to help my niece finish this school project, and I'm a little bit (very much) lost! πŸ™‚ It appears that I have all the required components, I just need a little assistance putting it all together.

Thanks for your help!

Mike Piantanida 252-526-8322


From: Mike Piantanida IV @.> Sent: Tuesday, October 8, 2024 5:25 PM To: EmileSpecialProducts/portable-disk-driveEx @.> Subject: Re: [EmileSpecialProducts/portable-disk-driveEx] multiple compiler errors (Issue #3)

I'm sorry, I don't understand. I'm not using any sort of Android anything. I have an ESP-WROOM-32 dev board, made by NodeMCU. It's just a regular ESP32, to my knowledge. In your video, and on your Github page, you say something about the ESP32 requiring v3.0.0 alpha. I thought maybe this was where the compiler errors were coming from.

You mentioned in a previous email that I need to remove the SD card library, and install sdfat. Can you please explain how to remove the SD library? I already have the sdfat library installed.

I have PlatformIO, but I don't understand how to use it with this code. In your other video, you appear to select some sort of script or shortcut, but you don't say what it is. You can please see my previous emails (I sent several, sorry!) and they will explain my questions in more detail.

Any help is greatly appreciated. Thanks for your time!

Mike Piantanida 252-526-8322


From: EmileSpecialProducts @.> Sent: Tuesday, October 8, 2024 5:08 PM To: EmileSpecialProducts/portable-disk-driveEx @.> Cc: Elmojomo @.>; Author @.> Subject: Re: [EmileSpecialProducts/portable-disk-driveEx] multiple compiler errors (Issue #3)

In the board manager you can find the β€œESP32” from espressif System and there you can change the version 2.0.17 will do as the FATex library will not yet build on the android 3.X versions. If you need the android 3.x version ( C6 /H2) then you can use the older version, But only supports fat and not FatEx ( >32GB ) https://github.com/EmileSpecialProducts/portable-disk-drive

β€” Reply to this email directly, view it on GitHubhttps://github.com/EmileSpecialProducts/portable-disk-driveEx/issues/3#issuecomment-2400824118, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFHYXWMCTFL4QM3FS3VDR4LZ2RCVRAVCNFSM6AAAAABPRDYNUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBQHAZDIMJRHA. You are receiving this because you authored the thread.Message ID: @.***>