hiveeyes / hanimandl

HaniMandl ist ein halbautomatischer Honig-Abfüll-Roboter.
https://hanimandl.readthedocs.io/
GNU General Public License v3.0
38 stars 29 forks source link

Use newer Version of ESPServo library (at least for Heltec Wifi V3 Boards) #61

Open rallef80 opened 1 month ago

rallef80 commented 1 month ago

Hello Everyone! In the platformio.ini which is provided with the project the defined environment uses the board "heltec_wifi_kit_32" together with the library ESP32Servo@^0.9.0

Recently the old Heltec Wifi Boards (V2) are not longer purchasable. So new buildups probably are mostly realized with the newer Heltec Wifi Boards (V3). But with these Boards, the Library ESP32Servo is not working in Verison 0.9.0. Instead at least Version 0.12.1 needs to be used together with Heltec Wifi V3. If not, the Servo is not moving at all.

Therefore i would recommend to update the platformio.ini for the default use of the Heltec Wifi Boards (V3) boards together with ESP32Servo in Version 0.12.1.

In Platformio it is possible to define development environments for various boards. So maybe it is a good idea to define a additional environment for the newer boards and also define a default environment which should be used. This would look like this:

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[platformio]
src_dir = .
default_envs = heltec_wifi_kit_32_v3

[env:heltec]
platform = espressif32
board = heltec_wifi_kit_32
framework = arduino

monitor_speed = 115200

lib_deps =
    HX711@^0.7.4
    U8g2@^2.28.6
    ESP32Servo@^0.9.0

[env:heltec_wifi_kit_32_v3]
platform = espressif32
board = heltec_wifi_kit_32_V3
framework = arduino

monitor_speed = 115200

lib_deps =
    HX711@^0.7.4
    U8g2@^2.28.6
    ESP32Servo @^0.12.1

Another solution could be to use the newer Library ESP32Servo @^0.12.1 for all types of boards and keep going with a simpler platformio.ini. But i could not test at the moment if this version of ESP32Servo works for all types of boards.