04-01-2020, 06:09 AM
Hi Paul
If you can run other projects then it sounds like your display is connected correctly, and the mpd_oled command you are running should be using default values that are correct for your display.
The issue could well be with mpd_oled. I only recently added command line support for SPI, and it has not been widely tested. I am not sure if there is a report of an SPI SSD1306 display working with mpd_oled, although there is a report for the compatible SPI SSD1309 working with the SSD1306 code.
However, there is a specific potential for there being issues with the SPI support. The communications library that mpd_oled uses appears to talk the the RPi hardware directly, rather than using the Linux devices. I updated this library to be compatible with the RPi4 recently and this led to issues with I2C devices that were sharing a bus. It turned out that the original library I was using had been customised to use the Linux /dev/i2c* devices, and when I added this code back in to the updated library this fixed the issue. However, the same is also true of SPI, as the library does not use the /dev/spidev* devices, but the original library was never customised to use these devices and so there is no code I can add back in to use them instead.
If you are running any other SPI devices it may be there is some kind of conflict that is making the mpd_oled initialisation fail. Otherwise, if you are able to add print statements to the mpd_oled code you could try to track down the innermost function that is failing during the initialisation, and it might suggest where the issue lies.
Adrian.
If you can run other projects then it sounds like your display is connected correctly, and the mpd_oled command you are running should be using default values that are correct for your display.
The issue could well be with mpd_oled. I only recently added command line support for SPI, and it has not been widely tested. I am not sure if there is a report of an SPI SSD1306 display working with mpd_oled, although there is a report for the compatible SPI SSD1309 working with the SSD1306 code.
However, there is a specific potential for there being issues with the SPI support. The communications library that mpd_oled uses appears to talk the the RPi hardware directly, rather than using the Linux devices. I updated this library to be compatible with the RPi4 recently and this led to issues with I2C devices that were sharing a bus. It turned out that the original library I was using had been customised to use the Linux /dev/i2c* devices, and when I added this code back in to the updated library this fixed the issue. However, the same is also true of SPI, as the library does not use the /dev/spidev* devices, but the original library was never customised to use these devices and so there is no code I can add back in to use them instead.
If you are running any other SPI devices it may be there is some kind of conflict that is making the mpd_oled initialisation fail. Otherwise, if you are able to add print statements to the mpd_oled code you could try to track down the innermost function that is failing during the initialisation, and it might suggest where the issue lies.
Adrian.