0

PiOLED 128x32 Mini OLED Help
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PiOLED 128x32 Mini OLED Help

by cajeck on Thu Jun 17, 2021 1:50 pm

I'm completely new to using GPIO, so I'm sure I've done something wrong. My PiOLED isn't displaying anything.

I've followed this guide to set up my PiOLED: https://learn.adafruit.com/adafruit-pio ... y-pi/usage

Circuitpython installation seemed to go okay. Blinkatest.py returned OK across the board, so I know I2c is working.

Here's the thing... I'm using a pibow coupe with a pimoroni shimfan. Those are on the same pins that the PiOLED is supposed to go on. I bought pin extenders and tried putting the display over the fan. The fan is technically on, but not running since it's configured to only spin when my pi reaches a certain temperature.

I shutdown my pi and installed the display. Turned it back on.

When I tried to run the stats.py code, I got:

Code: Select all | TOGGLE FULL SIZE
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 154, in __probe_for_device
    self.i2c.writeto(self.device_address, b"")
  File "/usr/local/lib/python3.7/dist-packages/busio.py", line 158, in writeto
    return self._i2c.writeto(address, buffer, stop=stop)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 49, in writeto
    self._i2c_bus.write_bytes(address, buffer[start:end])
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/smbus.py", line 308, in write_bytes
    self._device.write(buf)
OSError: [Errno 121] Remote I/O error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 160, in __probe_for_device
    self.i2c.readfrom_into(self.device_address, result)
  File "/usr/local/lib/python3.7/dist-packages/busio.py", line 148, in readfrom_into
    return self._i2c.readfrom_into(address, buffer, stop=stop)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 56, in readfrom_into
    readin = self._i2c_bus.read_bytes(address, end - start)
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/smbus.py", line 179, in read_bytes
    return self._device.read(number)
OSError: [Errno 121] Remote I/O error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "stats.py", line 24, in <module>
    disp = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_ssd1306.py", line 220, in __init__
    self.i2c_device = i2c_device.I2CDevice(i2c, addr)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 50, in __init__
    self.__probe_for_device()
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 163, in __probe_for_device
    raise ValueError("No I2C device at address: 0x%x" % self.device_address)
ValueError: No I2C device at address: 0x3c



Is this because of my pimoroni fanshim? Do I need to switch to the heatsink instead to free the GPIO pins?

Would it be safe to remove the fanshim and replace it with the display just to test in the meantime? (to make sure the display works for sure?)

I can post a picture of the setup I have. My display appears to be in tact and I've been very careful with it, even going so far as to ground myself and wash my hands every time I handle it. It sits in a static shield bag when I'm not using it. (I don't know if this matters, I'm just trying to be safe.)

cajeck
 
Posts: 7
Joined: Thu Jun 17, 2021 1:28 pm

Re: PiOLED 128x32 Mini OLED Help

by mikeysklar on Thu Jun 17, 2021 6:16 pm

You will need to take the fanshim out of. the picture for testing purposes and it is safe to remove as long as the Pi is powered off.

It would be helpful to see the i2cdetect -y 1 output just to confirm that the PiOLED appears correctly from the OS view as the script appears to bailing out while probing for the display.

Go ahead and post a photo of your setup once the fanshim is removed (800x600 resolution works best).

mikeysklar
 
Posts: 5030
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiOLED 128x32 Mini OLED Help

by cajeck on Thu Jun 17, 2021 9:35 pm

I shut down my pi and removed the fanshim, putting the OLED in its place. I ran the command you asked. Here's the result:

Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --


38707e81-da21-4749-824b-5facb279ad2f.png
38707e81-da21-4749-824b-5facb279ad2f.png (920.93 KiB) Viewed 211 times


I've attached a picture of my setup with the fanshim removed and the PiOLED installed. I took this picture before I ran stats.py. The display lit up.

Everything seems to be working now! The text clips at the end of the memory line, but I may be able to edit the file so that it all fits on the display. It's a shame I can't have both fan and display installed at the same time. As this is just a 2gb model, my pi doesn't tend to get too hot, but I'd rather have the fan on while I wait for a heat sink.

I've gone ahead and purchased Pimoroni's 40x30mm heat sink as it was designed to fit my case. https://shop.pimoroni.com/products/rasp ... 4-heatsink

Thank you for your help!

cajeck
 
Posts: 7
Joined: Thu Jun 17, 2021 1:28 pm

Re: PiOLED 128x32 Mini OLED Help

by mikeysklar on Fri Jun 18, 2021 10:18 am

Now that you have the display working you could experiment more with getting FanShim going. The initial removal of FanShim was just to test the OLED in isolation to get it running.

Personally I run my Pi4's with no fan and heat syncs without issue, but I can understand wanting to have both the OLED and Fan working together.

mikeysklar
 
Posts: 5030
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiOLED 128x32 Mini OLED Help

by cajeck on Fri Jun 18, 2021 10:30 am

Oh! So the display and the fan could possibly work together? I'd be interested to test to see!

I suppose next I should try and run the
Code: Select all | TOGGLE FULL SIZE
i2cdetect -y 1
command with both the display and fanshim installed, right?

cajeck
 
Posts: 7
Joined: Thu Jun 17, 2021 1:28 pm

Re: PiOLED 128x32 Mini OLED Help

by mikeysklar on Fri Jun 18, 2021 10:51 am

You got it. See if PiOLED address shows up with the FanShim. I'm guessing there is just not enough vertical pin real estate to squeeze these two together not an actual power or GPIO conflict. You could experiment with extra tall stacking headers.

https://www.adafruit.com/product/1979

mikeysklar
 
Posts: 5030
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiOLED 128x32 Mini OLED Help

by cajeck on Sat Jun 19, 2021 4:03 pm

So good news!

I had some pin extenders so I popped one on, then placed my fan and display on top. It worked! Display lights up great. Fan even works perfectly.

Thank you!

cajeck
 
Posts: 7
Joined: Thu Jun 17, 2021 1:28 pm

Re: PiOLED 128x32 Mini OLED Help

by mikeysklar on Mon Jun 21, 2021 4:43 pm

Nicely done. Good job.

mikeysklar
 
Posts: 5030
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.