sbcshop / PiSquare

PiSquare is an RP2040 and ESP-12E-based board that allows you to use multiple Raspberry Pi HATs without stacking them on top of one other. PiSquare uses Socket programming to wirelessly communicate multiple Raspberry Pi HATs ("n" numbers of HATs).
MIT License
25 stars 5 forks source link

PiHut Status HAT - PiSquare no longer connects #3

Closed GeekyTim closed 2 years ago

GeekyTim commented 2 years ago

I've just plugged my first hat on top of the PiSquare having got a Pi and PS communicating. However, when I run the same PiSquare software example (pisquare_client.py) it no longer connects:

I2C(1, freq=200000, scl=7, sda=6) Traceback (most recent call last): File "", line 20, in IndexError: list index out of range

(the line is print("I2C Address : " + hex(i2c.scan()[0]).upper()) # Display device address)

I've not yet worked out why this is happening, but works perfectly when no HAT is attached.

Any thoughts?

sbcshop1 commented 2 years ago

@GeekyTim This issue occurs because your PiHut status HAT pins match the onboard OLED display pins, which is why the display works normally after removing the hat. If you wish to run this HAT, please do not utilize the onboard OLED display pins; instead, remark below lines and lines relating to OLED.-

i2c = I2C(1,freq=200000,sda=Pin(6),scl=Pin(7)) print(i2c) print("I2C Address : "+hex(i2c.scan()[0]).upper()) # Display device address print("I2C Configuration: "+str(i2c))

oled = SSD1306_I2C(WIDTH, HEIGHT, i2c) # Init oled display oled.fill(0) oled.text("Client",30,0) oled.show()

GeekyTim commented 2 years ago

Ah! Lots to learn.