Matrix Portal M4 and PlatformIO libraries

Hi
I’ve been wanting to use PlatformIO for a while now but every time I try with a project, I get tangled up with the libraries and have to go back to the Arduino IDE.

The latest project is with the Matrix Portal M4 using Adafruit IO. This needs the AdafruitIO_WiFi library. The whole project works in Arduino IDE but won’t compile because of a problem with AdafruitIO_WiFi.h.

There are a lot of messages from the compiler digging down into the errors but the main thing is AdafruitIO_AIRLIST.h expecting setLEDs & setPins functions.

I’ve seen something similar in Arduino IDE but that was cured by changing to the specific Adafruit WiFiNINA library I’m using now in PlatformIO.

If you would like more information, I can provide it but easier to give the specific details required rather than everything in one go.

Thanks in advance for any help or suggestions.

Cheers
Max

My platformio.ini:

; 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

; custom common options
[common]
build_flags =
    -D VERSION=1.2.3
    -D DEBUG=1
lib_deps_builtin =
    SPI
    Wire
lib_deps_external = 
    adafruit/Adafruit Protomatter@^1.5.2
    adafruit/Adafruit IO Arduino@4.3.0
    adafruit/Adafruit MQTT Library@2.5.8
    arduino-libraries/ArduinoHttpClient@^0.6.0
    arduino-libraries/WiFiNINA@^1.8.14

[env:adafruit_matrix_portal_m4]
platform = atmelsam
board = adafruit_matrix_portal_m4
framework = arduino

; Library options
lib_deps =
    ${common.lib_deps_builtin}
    ${common.lib_deps_external}


; Serial monitor options
monitor_speed = 115200

Well but Arduino Libraries | Adafruit MatrixPortal M4 | Adafruit Learning System> says to explicitly use the Adafruit version (https://github.com/adafruit/WiFiNINA), not the official Arduino version.

So I’d suggest deleting the entire .pio folder (kills old wrong libraries) and using only this

[env:adafruit_matrix_portal_m4]
platform = atmelsam
board = adafruit_matrix_portal_m4
framework = arduino
lib_deps =
   https://github.com/adafruit/WiFiNINA/archive/refs/heads/master.zip

plus the ScanNetworks.ino sketch: https://github.com/adafruit/WiFiNINA/blob/master/examples/ScanNetworks/ScanNetworks.ino

With only that minimal code and platformio.ini, you should see whether WiFi works or not. Do not make the project more complicated before you checked the basics.