dl9rdz / rdz_ttgo_sonde

259 stars 92 forks source link

Enhancement wish: compatibility with board version 2.0.0 #409

Closed df8oe closed 6 months ago

df8oe commented 6 months ago

as in title: best would be to stay with recent version of board.... Do you already have sorted out what is the problem?

dl9rdz commented 6 months ago

Not sure which board version you are referring to? Some TTGO board (there are many)? Or rather the Arduino IDE?

df8oe commented 6 months ago

Sorry - I was absolutely unclear :/ I mean Arduino IDE / Boards Manager where "ESP32" 2.0.x is not supported - we have to stay to 1.0.6 If I choose 2.0.1 project builds without additional warnings but the binary is running unstable (but does not start up fully, depending on the preject version I want to build I build). This looks for me as a minor issue (missing or wrong definition of RAM / interrupt, stack or so on). The goal of board 2.0.x is that this version allows runtime debugging with Arduino IDE 2.0 - 1.0.6 does not support this...

dl9rdz commented 6 months ago

Reasons for sticking with the old version: The new version will not fit into flash when using PlatformIO (for some strange reasons the PlatformIO builds are somewhat larger -- I tracked it down to the C++ libraries pulling in some wide string stuff I don't need, this is not happening on ArduinoIDE, so if someone has some idea how to fix this get in contact with me :-)) and I want to keep versions consistent between PlatformIO and ArduinoIDE (and I prefer using PlatformIO for development - its incremental builds are way faster than a build in ArduinoIDE)

One problem with Arduino IDE 2.0 is that it does not support the SPIFFS file system upload plugin. So you need some other way how to upload it (flashing the full bin image first, then uploading just the code via ArduinoIDE would usually work, IF there was not the second problem).

The second problem with 2.0.x is that they changed the partition format again. That makes uploading the file system partition harder. What you can do is get the default.csv from 2.0.x, include it in platformio.ini and use platformio for uploading the file system image.

(The reason for not running stable seems to be the lack of the file system. My code should use some reasonable default values and somewhat run without, and this seems to be broken (in my tests right now something triggers the watchdog timer and it resets) and I might have a look at it some day. But in any case, without the file system most of the functionality, including the web interface, will be missing, so the software is not reasonably usable anyway, so you really need the file system!)

If the RX chip is not properly initialized, then you selected the wrong board in Arduino IDE (the autodetect code uses some constants in some cases, and e.g. "ESP32 dev module" has not the right values. e.g. "T-Beam" does.

With that it seems to be running fine (currently testing with esp32 2.0.12, board "T-Beam" on a T-Beam 1.2 board)

df8oe commented 6 months ago

Of course Arduino IDE 1.6 is the preferred base - I know about the problems with SPIFFS. But if we use board version 2.0.x it is future proof - I think the days when some other libs depend on 2.0.x (and not 1.0.6) are not so far... I by myself do not use platformio - it is a M$ product and I do not use any M$ software for 23 years ;) If possible I use no GUI at all but command line of Linux. Finetuning is lightyears more precise on CLI than in any GUI. So switching to Arduino 2.x is not point of discussion - but using ESO32 v2.0.x is...

dl9rdz commented 6 months ago

I disagree with that ;-)

Just to put it right: Visual Studio is a MS product, and there is an IDE extension from PlatformIO for VS – while I am not using that it might be true that most people using PlatformIO indeed use its VS integration. But that does not make PlatformIO a MS product at all. PlatformIO is a fully open source product from PlatformIO Labs.

And PlatformIO Core is its core part without any GUI (indeed that is the part I am usually using myself) – if you prefer the command line over some GUI then this might indeed be the better choice than ArduinoIDE...

df8oe commented 6 months ago

Thanks for pointing me to this! The last time I looked for platformio (about 4 years ago) I only found pages that bundled platformio with VS... I will dig into platformio again!

df8oe commented 6 months ago

Tried it - works. I can confirm that build with platformio is bigger than with Arduino: 1309114 vs. 1165833. I have had same problem in the past with builds for STM32 on Eclipse and via make. There it was during linking. Some not neccessary parts (I think it was debugging symbols) were added automatically by Eclipse...

dl9rdz commented 6 months ago

Spent some more time on it. Getting closer to fix it. Found two issues/differences:

df8oe commented 6 months ago

That is very good news :) !!! Congrats! Debug level config flag should be overrideable via paramater in platformio.ini. And what is the best source for "Async Webserver" is something to look and test. Platformio now runs for me on Arch Linux, too. It compiles much faster because of it uses all COU cores parallel...

df8oe commented 6 months ago

Congrats! Your investigations were a "main goal"! Now building via platformio is smaller than with Arduino IDE. And thank you again for pointing me to platformio.