hiveeyes / arduino

Arduino-compatible MCU firmware code for sensor-, telemetry-, and gateway-appliances.
https://hiveeyes.org/docs/arduino/
GNU General Public License v3.0
49 stars 31 forks source link

Dissolve Makefile-based build tooling. Move on to PlatformIO. Thanks for all the fish! #58

Closed amotl closed 1 year ago

amotl commented 1 year ago

About

With GH-57, we are modernizing our first-generation multi-hop ISM packet radio firmwares, effectively dissolving the previous Makefile-based build tooling using dependency management based on Git submodules, and move on to use PlatformIO exclusively.

Acknowledgements

We want to send big shoutouts to all the authors of the excellent build tooling which supported the programs in this repository for such a long time, sharing the same spirit that none of us wants to actually use the Arduino IDE, focusing on AVR/Espressif/SAMD/Arduino HAL toolchain setup automation, and reproducible builds instead. Thank you so much! -- with special thanks to the PlatformIO creators and contributors.

/cc @einsiedlerkrebs, @amperka, @nkrkv, @mjoldfield, @sudar, @tuna-f1sh, @peplin, @rpavlik, @matthijskooijman, @ladislas, @plerup, @hoijui, @ivankravets, @valeros

ivankravets commented 1 year ago

Thanks for using PlatformIO! 🙏

We see you use outdated EPS32 dev-platform. Do you have any issues with the latest 6.x version https://github.com/platformio/platform-espressif32/releases ?

amotl commented 1 year ago

Dear Ivan,

thanks for your swift response, and your suggestion to use more recent packages.

I've been conservative in bringing in the PlatformIO configuration, and nailed the SDKs roughly to versions they had at the time the corresponding programs have been conceived. Now, upgrading the ESP32 platform SDK works well, see GH-68.

However, upgrading ESP8266 with GH-67 failed at ^1. It is probably our fault, because we are using other outdated libraries, or such.

After looking into the details, it turns out joaolopesf/SerialDebug might trip the build, as we receive similar error messages like outlined in https://github.com/JoaoLopesF/SerialDebug/issues/20 when updating to espressif8266@^3.

SerialDebug.cpp:2384:46: error: reference to 'byte' is ambiguous
SerialDebug.cpp:2384:46: error: 'byte' has not been declared
SerialDebug.cpp:2486:61: error: reference to 'byte' is ambiguous
SerialDebug.cpp:5608:21: error: expected primary-expression before '(' token

Regarding this SerialDebug library, I can find those comments in the changelog of the node-wifi-mqtt.ino program we are trying to build here.

 2017-04-07 Silence debug output by using SerialDebugger to reduce battery drain even more.
 2021-05-02 Modernize code by using the SerialDebug library by Joao Lopes and
            add build environment based on PlatformIO.

Is it sane? Do we need it for the purposes outlined there, to reduce battery drain even more, or do you think it can be safely removed? Maybe there are better techniques "to turn off logging" in a similar manner. On the other hand, it may have been utter nonsense ;]. Please advise, if you have the patience for our naivity.

With kind regards, Andreas.

P.S.: Those commands should get anyone interested to the right spot quickly.

git clone https://github.com/hiveeyes/arduino hiveeyes-arduino --branch amo/update-esp8266-sdk
cd hiveeyes-arduino/backdoor/node-wifi-mqtt
make
amotl commented 1 year ago

The next spot are the firmwares based on Homie, where this happens when updating to espressif8266@^3 or higher:

Homie/Boot/BootConfig.cpp:282:20: error: call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)
  282 |   _httpClient.begin(url);
      |   ~~~~~~~~~~~~~~~~~^~~~~
*** [.pio/build/esp07/lib5c7/Homie/Homie/Boot/BootConfig.cpp.o] Error 1

-- https://github.com/hiveeyes/arduino/actions/runs/5113969818/jobs/9193750333?pr=67#step:9:267

They are still using marvinroger/Homie@^2, while marvinroger/Homie@^3 is already available. Updating the programs in this repository to use the most recent version of Homie may help on this matter. /cc @Gulaschcowboy, @marvinroger

P.S.: Those commands should get anyone interested to the right spot quickly.

git clone https://github.com/hiveeyes/arduino hiveeyes-arduino --branch amo/update-esp8266-sdk
cd hiveeyes-arduino/homie/node-homie-basic
make
amotl commented 1 year ago

Hi again. 4b457972e7 and 6d72ad6f6ac were needed to stay on espressif8266@^2 on both of the occasions reported above. Other than this, all other updates, effectively not nailing platform SDK versions any longer, succeeded on CI, and have been merged. Thanks again.

amotl commented 1 year ago

With GH-69, I tried to update the platform SDK for AVR, and it also failed. However, after investing a bit here, I can surely say 22c6da6efa makes me happy, by being able to dissolve another StandardCplusplus library fork we needed to use the other day, because mike-matera/ArduinoSTL did not work for us back then. Now, it does -- this is excellent. 💯

amotl commented 1 year ago

Hi. I've created GH-71 and GH-72 to follow up on this. Closing this now, in order not to send too many notifications to all people tagged here. Thanks, and keep up the spirit.