SSD1306 on ESP32C6 + Swift Embedded + Matter

After getting the swift matter smart-light example working (lighting up the LED on my ESP32C6 via HomeKit - woo hoo!), wanted to get an LCD (ssd1306) connected to my board to also display text sent from my swift embedded code. Browsing through ESP, Matter, IDF, hacking on Bridging headers and Cmake files, etc. modeling what's done for the LED in the smart-light example, I've had little success unfortunately.

Any pointers or help to put me in the right direction to get my display working would be much appreciated. Thanks in advance!

1 Like

I'm usually working with nRF MCUs but a quick search lead me to this repo: GitHub - nopnop2002/esp-idf-ssd1306: SSD1306/SH1106 Driver for esp-idf

My way of working is usually to get the (hardware) setup working with the easiest tools I can find (often Arduino IDE).
Then move to the SDK I would like to use (nRF Connect SDK in my case, ESP-IDF here), native, in C.
Then when that's working, encapsulate that in Swift constructs.
And finally implement the project logic in Swift.

Could you also share some more specific information on the problem you're having, a specific error or question ?

Hope that already helps a bit.

4 Likes

Hello,
can you please share your setup and versions of IDF, CMake etc. ?
Id really appreciate that!
Thank you !

Appreciate the reply! I am able to get my SSD1306 to work in Arduino IDE without issue.

My plan was to (somehow) find/integrate/create an esp-idf variant (thanks for the pointer to the esp-idf repo, btw) for use in a swift embedded project via CMake + BridgingHeader and - as you suggest - swift logic for the card similar to what is done in this swift embedded example (that I already have working for my onboard ESP32C6 LED) : swift-matter-examples/smart-light at main · apple/swift-matter-examples · GitHub. I was hoping for an example for the SSD1306 card but have been unsuccessful finding something that pulls all of the pieces together similar to the embedded example for the LED.

My current setup:

software
cmake version 3.31.2
ESP-IDF v5.2.1
Apple Swift version 6.0-dev (LLVM c7c87ee42989d4b, Swift 0aa0687fe0f4047)
Target: x86_64-apple-macosx15.0
ESP-Matter SDK v1.3

hardware
ESP32-C6
SSD1306 (0.91", 128x32)

Hope this helps to clarify!

(please see additional details in other reply)

Which version of ESP-Matter are you using?
Thanks for sharing:)

v1.3 : GitHub - espressif/esp-matter at release/v1.3