Sh1106 SPI in Breakout Garden - can't get it working

I’ve installed the software as described:

sudo pip install git+git://github.com/rm-hull/luma.oled.git#egg=luma.oled

but can’t get the bounce demo to work - I’ve tried the sh1106 in both SPI slots with the same result (–spi-device = 0 and 1)

pi@raspberrypi2:~/luma.examples/examples $ python bounce.py --display sh1106 --height 128 --rotate 2 --interface spi --gpio-data-command 9 --spi-device 0
Version: luma.oled 3.6.0 (luma.core 1.17.1)
Display: sh1106
Interface: spi
Dimensions: 128 x 128

/usr/local/lib/python3.7/dist-packages/luma/core/interface/serial.py:198: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
self._gpio.setup(pin, self._gpio.OUT)
Traceback (most recent call last):
File “bounce.py”, line 80, in
device = get_device()
File “/home/pi/luma.examples/examples/demo_opts.py”, line 63, in get_device
device = cmdline.create_device(args)
File “/usr/local/lib/python3.7/dist-packages/luma/core/cmdline.py”, line 218, in create_device
device = Device(serial_interface=interface(), **vars(args))
File “/usr/local/lib/python3.7/dist-packages/luma/core/cmdline.py”, line 157, in spi
gpio=self.gpio or GPIO)
File “/usr/local/lib/python3.7/dist-packages/luma/core/interface/serial.py”, line 306, in init
self._spi.cshigh = cs_high
SystemError: error return without exception set

The breakout garden seems fine as I have a bme680 plugged in which is working OK. Allthough this doesn’t prove SPI bus is ok.

Also checked that spi is not commented out in /boot/config.txt

Any suggestions are much appreciated

Pete

Got it working, but I don’t understand why!

I had to add the argument --spi-cd-high False

I will try the rest of the examples to confirm that the others are working

All the examples that I have tried worked ok with --spi-cd-high False

Just some FYI stuff on the Breakout Garden
The Back SPI slot is cs=0 and the Front is cs=1
And you can just use cs=1, instead of all that BG_SPI_CS_FRONT stuff.
Also the Back SPI slot uses GPIO 18 for backlight and the Front uses GPIO 19 for Backlight. I have the Mini SPI i2c, it uses the Front values.

Is CD the DC pin?

I don’t know, the error message mentioned cd-high so I tried playing with the true/false settings. So it worked but I don’t know why. Hope someone else can tell me. Also if this is needed by everyone then the instructions need updating.

Just realised that spell check has changed cs to cd in my replies. So I needed --spi-cs-high False, I’m guessing cs is chip select.

Yes cs is chip select. Use the wrong one and the display won’t do anything.