Matrix Portal M4 and PlatformIO libraries

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.


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

; custom common options
build_flags =
    -D VERSION=1.2.3
    -D DEBUG=1
lib_deps_builtin =
lib_deps_external = 
    adafruit/Adafruit Protomatter@^1.5.2
    adafruit/Adafruit IO Arduino@4.3.0
    adafruit/Adafruit MQTT Library@2.5.8

platform = atmelsam
board = adafruit_matrix_portal_m4
framework = arduino

; Library options
lib_deps =

; Serial monitor options
monitor_speed = 115200

Well but Arduino Libraries | Adafruit MatrixPortal M4 | Adafruit Learning System> says to explicitly use the Adafruit version (, not the official Arduino version.

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

platform = atmelsam
board = adafruit_matrix_portal_m4
framework = arduino
lib_deps =

plus the ScanNetworks.ino sketch:

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.